@qrvey/utils 1.5.0-0 → 1.5.0-11

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 (347) hide show
  1. package/README.md +1 -1
  2. package/dist/charts/adapters/endpointData.d.ts +90 -0
  3. package/dist/charts/adapters/endpointData.js +513 -0
  4. package/dist/charts/adapters/endpointDataGet.d.ts +14 -0
  5. package/dist/charts/adapters/endpointDataGet.js +427 -0
  6. package/dist/charts/adapters/endpointDataValidators.d.ts +4 -0
  7. package/dist/charts/adapters/endpointDataValidators.js +54 -0
  8. package/dist/charts/adapters/index.d.ts +3 -0
  9. package/dist/charts/adapters/index.js +3 -0
  10. package/dist/charts/index.d.ts +1 -0
  11. package/dist/charts/index.js +1 -0
  12. package/dist/cjs/charts/adapters/endpointData.d.ts +90 -0
  13. package/dist/cjs/charts/adapters/endpointData.js +519 -0
  14. package/dist/cjs/charts/adapters/endpointDataGet.d.ts +14 -0
  15. package/dist/cjs/charts/adapters/endpointDataGet.js +443 -0
  16. package/dist/cjs/charts/adapters/endpointDataValidators.d.ts +4 -0
  17. package/dist/cjs/charts/adapters/endpointDataValidators.js +61 -0
  18. package/dist/cjs/charts/adapters/index.d.ts +3 -0
  19. package/dist/cjs/{dates/range → charts/adapters}/index.js +3 -1
  20. package/dist/cjs/charts/index.d.ts +1 -0
  21. package/dist/cjs/charts/index.js +1 -0
  22. package/dist/cjs/column_format/constants/DURATION_PARTS_LIST.d.ts +1 -0
  23. package/dist/cjs/column_format/constants/DURATION_PARTS_LIST.js +12 -0
  24. package/dist/cjs/column_format/constants/index.d.ts +1 -0
  25. package/dist/cjs/column_format/constants/index.js +1 -0
  26. package/dist/cjs/column_format/helpers/defineTableChartFormat.js +19 -10
  27. package/dist/cjs/column_format/helpers/defineXYChartFormat.js +11 -13
  28. package/dist/cjs/columns/constants/COLUMN.js +1 -1
  29. package/dist/cjs/columns/constants/COLUMN_PROPERTY.js +2 -2
  30. package/dist/cjs/columns/helpers/getDatasetColumn.d.ts +9 -1
  31. package/dist/cjs/columns/helpers/getDatasetColumn.js +31 -4
  32. package/dist/cjs/columns/helpers/getDatasetColumnByDatasets.d.ts +6 -5
  33. package/dist/cjs/columns/helpers/getDatasetColumnByDatasets.js +22 -8
  34. package/dist/cjs/columns/helpers/getModelColumn.d.ts +4 -4
  35. package/dist/cjs/columns/helpers/getModelColumn.js +9 -19
  36. package/dist/cjs/columns/helpers/isComplexColumn.d.ts +5 -0
  37. package/dist/cjs/columns/helpers/isComplexColumn.js +5 -0
  38. package/dist/cjs/columns/helpers/isDateColumn.d.ts +5 -0
  39. package/dist/cjs/columns/helpers/isDateColumn.js +8 -1
  40. package/dist/cjs/columns/helpers/isNumericalColumn.d.ts +5 -0
  41. package/dist/cjs/columns/helpers/isNumericalColumn.js +7 -1
  42. package/dist/cjs/constants/Charts.Const.d.ts +1 -0
  43. package/dist/cjs/constants/Charts.Const.js +1 -0
  44. package/dist/cjs/dates/adapters/dateToHms.d.ts +1 -1
  45. package/dist/cjs/dates/adapters/dateToHms.js +6 -8
  46. package/dist/cjs/dates/adapters/dateToMdyDate.js +6 -9
  47. package/dist/cjs/dates/adapters/dateToMonthYear.js +6 -4
  48. package/dist/cjs/dates/adapters/dateToQuarterYear.d.ts +2 -2
  49. package/dist/cjs/dates/adapters/dateToQuarterYear.js +8 -6
  50. package/dist/cjs/dates/adapters/dateToWeekYear.js +5 -3
  51. package/dist/cjs/dates/adapters/dateToYear.d.ts +1 -1
  52. package/dist/cjs/dates/adapters/dateToYear.js +6 -4
  53. package/dist/cjs/dates/adapters/weekYearToDate.js +1 -6
  54. package/dist/cjs/dates/constants/DATETIME_COLUMN_FORMAT.js +1 -0
  55. package/dist/cjs/dates/constants/DATE_DISTINCT_PROPERTY.js +1 -1
  56. package/dist/cjs/dates/constants/DATE_FORMAT.js +7 -7
  57. package/dist/cjs/dates/constants/DATE_FORMATS.d.ts +1 -0
  58. package/dist/cjs/dates/constants/DATE_FORMATS.js +22 -0
  59. package/dist/cjs/dates/constants/DATE_GROUPING_ALL_PROPERTIES.d.ts +1 -0
  60. package/dist/cjs/dates/constants/DATE_GROUPING_ALL_PROPERTIES.js +9 -0
  61. package/dist/cjs/dates/constants/DATE_REGULAR_EXPRESSIONS.d.ts +1 -0
  62. package/dist/cjs/dates/constants/DATE_REGULAR_EXPRESSIONS.js +23 -0
  63. package/dist/cjs/dates/constants/DATE_REGULAR_EXPRESSION_ARRAY_BY_FORMAT.d.ts +3 -0
  64. package/dist/cjs/dates/constants/DATE_REGULAR_EXPRESSION_ARRAY_BY_FORMAT.js +40 -0
  65. package/dist/cjs/dates/constants/index.d.ts +4 -0
  66. package/dist/cjs/dates/constants/index.js +4 -0
  67. package/dist/cjs/dates/helpers/{includeDateTokens.d.ts → areIncludedDateTokens.d.ts} +1 -1
  68. package/dist/cjs/dates/helpers/{includeDateTokens.js → areIncludedDateTokens.js} +5 -4
  69. package/dist/cjs/dates/helpers/getDateFormatRegularExpressionInArray.d.ts +2 -2
  70. package/dist/cjs/dates/helpers/getDateFormatRegularExpressionInArray.js +9 -42
  71. package/dist/{dates/range → cjs/dates/helpers}/getDateRange.d.ts +3 -3
  72. package/dist/cjs/dates/{range → helpers}/getDateRange.js +73 -69
  73. package/dist/cjs/dates/helpers/getFormattedDateByFormat.d.ts +1 -0
  74. package/dist/cjs/dates/helpers/getFormattedDateByFormat.js +17 -17
  75. package/dist/cjs/dates/helpers/getSeparatorByDateFormat.d.ts +1 -1
  76. package/dist/cjs/dates/helpers/getSeparatorByDateFormat.js +1 -1
  77. package/dist/cjs/dates/helpers/getWeek.d.ts +6 -4
  78. package/dist/cjs/dates/helpers/getWeek.js +6 -3
  79. package/dist/cjs/dates/helpers/index.d.ts +4 -1
  80. package/dist/cjs/dates/helpers/index.js +4 -1
  81. package/dist/cjs/dates/helpers/isValidPotentialDate.d.ts +6 -0
  82. package/dist/cjs/dates/helpers/isValidPotentialDate.js +18 -0
  83. package/dist/cjs/dates/index.d.ts +0 -1
  84. package/dist/cjs/dates/index.js +0 -1
  85. package/dist/cjs/dates/relative/constants/RELATIVE_UNIT_INFO_LIST.js +5 -5
  86. package/dist/cjs/filters/adapters/FDToFlatUI.js +4 -4
  87. package/dist/cjs/filters/adapters/FDToUI.js +3 -3
  88. package/dist/cjs/filters/adapters/UIToFD.js +3 -3
  89. package/dist/cjs/filters/adapters/UIToFlatUI.js +3 -3
  90. package/dist/cjs/filters/adapters/UIToOldLogic.js +6 -6
  91. package/dist/cjs/filters/adapters/adaptFilterData.js +7 -7
  92. package/dist/cjs/filters/adapters/flatUIToFD.js +24 -24
  93. package/dist/cjs/filters/adapters/flatUIToOldLogic.js +42 -49
  94. package/dist/cjs/filters/adapters/flatUIToUI.js +29 -29
  95. package/dist/cjs/filters/adapters/index.d.ts +0 -1
  96. package/dist/cjs/filters/adapters/index.js +0 -1
  97. package/dist/cjs/filters/adapters/logicToFlatUI.js +6 -8
  98. package/dist/cjs/filters/helpers/OLD_getAggFilters.js +5 -4
  99. package/dist/cjs/filters/helpers/backend/buildExpression.js +1 -1
  100. package/dist/cjs/filters/helpers/backend/buildFilters.js +6 -16
  101. package/dist/cjs/filters/helpers/backend/getBackendValidator.js +1 -1
  102. package/dist/cjs/filters/helpers/backend/getBackendValues.js +1 -3
  103. package/dist/cjs/filters/helpers/backend/getLogicByDatasets.js +2 -2
  104. package/dist/cjs/filters/helpers/backend/getLogicByDatasetsColumns.js +2 -2
  105. package/dist/cjs/filters/helpers/backend/getLogicByScopes.js +2 -2
  106. package/dist/cjs/filters/helpers/backend/getLogicByScopesHierarchy.js +0 -2
  107. package/dist/cjs/filters/helpers/common/excludeFiltersByAggregateColumn.js +3 -3
  108. package/dist/cjs/filters/helpers/common/excludeFiltersByParams.js +10 -11
  109. package/dist/cjs/filters/helpers/common/excludeFiltersByScopes.js +3 -3
  110. package/dist/cjs/filters/helpers/common/getFilterLabel.js +1 -1
  111. package/dist/cjs/filters/helpers/common/getFiltersByAggregateColumn.js +3 -3
  112. package/dist/cjs/filters/helpers/common/getFiltersByParams.js +15 -17
  113. package/dist/cjs/filters/helpers/common/getFiltersByScopes.js +3 -3
  114. package/dist/cjs/filters/helpers/common/getFiltersByScopesIds.js +4 -4
  115. package/dist/cjs/filters/helpers/common/getFiltersByVisibility.js +4 -4
  116. package/dist/cjs/filters/helpers/common/mergeFilters.js +23 -19
  117. package/dist/cjs/filters/helpers/common/mergeValues.js +2 -2
  118. package/dist/cjs/filters/helpers/common/resolveScopeConditions.js +1 -1
  119. package/dist/cjs/filters/helpers/getAggFiltersFromFilterData.js +2 -2
  120. package/dist/cjs/filters/helpers/getTokensFromFilters.js +9 -4
  121. package/dist/cjs/filters/helpers/ui/excludeUIFiltersByAggregate.js +2 -2
  122. package/dist/cjs/filters/helpers/ui/excludeUIFlatFiltersByScopes.js +2 -2
  123. package/dist/cjs/filters/helpers/ui/getUIFlatFilterByParams.js +3 -3
  124. package/dist/cjs/filters/helpers/ui/getUIFlatFiltersByParams.js +2 -2
  125. package/dist/cjs/filters/helpers/ui/getUIFlatFiltersByScopes.js +2 -2
  126. package/dist/cjs/filters/helpers/ui/getUIValues.js +9 -11
  127. package/dist/cjs/filters/helpers/ui/transformFilterValues.js +1 -3
  128. package/dist/cjs/filters/services/Filters.api.d.ts +4 -4
  129. package/dist/cjs/filters/services/Filters.api.js +7 -7
  130. package/dist/cjs/filters/services/UChartApi.d.ts +11 -11
  131. package/dist/cjs/filters/services/UChartApi.js +176 -185
  132. package/dist/cjs/filters/services/UChartPaginationApi.d.ts +13 -13
  133. package/dist/cjs/filters/services/UChartPaginationApi.js +198 -212
  134. package/dist/cjs/format/definition.d.ts +4 -1
  135. package/dist/cjs/format/definition.js +10 -1
  136. package/dist/cjs/format/duration/addDurationFormat.d.ts +1 -1
  137. package/dist/cjs/format/duration/addDurationFormat.js +2 -2
  138. package/dist/cjs/format/duration/durationFormatter.d.ts +1 -1
  139. package/dist/cjs/format/duration/durationFormatter.js +7 -10
  140. package/dist/cjs/format/format.js +42 -34
  141. package/dist/cjs/format/localization.js +19 -4
  142. package/dist/cjs/general/mix/importScripts.js +8 -14
  143. package/dist/cjs/general/mix/randomId.js +11 -10
  144. package/dist/cjs/general/object/get.js +4 -4
  145. package/dist/cjs/general/object/getAttribute.js +1 -1
  146. package/dist/cjs/general/object/mapValues.js +2 -2
  147. package/dist/cjs/general/object/mergeDeep.js +6 -4
  148. package/dist/cjs/general/object/serialize.js +3 -3
  149. package/dist/cjs/general/string/padLeadingZeros.js +2 -2
  150. package/dist/cjs/globalization/helpers/getI18nDateGroupLabel.js +13 -10
  151. package/dist/cjs/globalization/helpers/getReverseI18nGroupLabel.js +12 -9
  152. package/dist/cjs/globalization/interfaces/II18nResource.d.ts +2 -0
  153. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilder.d.ts +2 -0
  154. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderAxisStyle.d.ts +9 -0
  155. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderDurationParts.d.ts +10 -0
  156. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderDurationParts.js +2 -0
  157. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderFormatValues.d.ts +1 -0
  158. package/dist/cjs/globalization/interfaces/chart_builder/index.d.ts +1 -0
  159. package/dist/cjs/globalization/interfaces/chart_builder/index.js +1 -0
  160. package/dist/cjs/globalization/interfaces/common/II18nCommon.d.ts +4 -0
  161. package/dist/cjs/globalization/interfaces/filters/II18nTokenBox.d.ts +1 -0
  162. package/dist/cjs/globalization/interfaces/panel/II18nPanelMenu.d.ts +1 -0
  163. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +1 -0
  164. package/dist/cjs/globalization/interfaces/tabular_view/II18nTabularView.d.ts +4 -0
  165. package/dist/cjs/globalization/interfaces/tabular_view/II18nTabularView.js +2 -0
  166. package/dist/cjs/globalization/labels/I18N_DEFAULT.js +2 -0
  167. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER.js +10 -0
  168. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +13 -4
  169. package/dist/cjs/globalization/labels/common/I18N_COMMON.js +6 -0
  170. package/dist/cjs/globalization/labels/panel/I18N_PANEL.js +1 -0
  171. package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.js +1 -0
  172. package/dist/cjs/globalization/labels/tabular_view/I18N_TABULAR_VIEW.d.ts +2 -0
  173. package/dist/cjs/globalization/labels/tabular_view/I18N_TABULAR_VIEW.js +7 -0
  174. package/dist/cjs/interfaces/format/IFormatOutputFormat.Interface.d.ts +1 -0
  175. package/dist/cjs/qrvey/helpers/getLookupAnswers.js +4 -6
  176. package/dist/cjs/qrvey/helpers/getValueWithSuffixes.js +1 -1
  177. package/dist/cjs/services/adapters/index.d.ts +2 -1
  178. package/dist/cjs/services/adapters/index.js +2 -1
  179. package/dist/cjs/services/api/getAllDatasets.api.js +6 -8
  180. package/dist/cjs/services/helpers/Request.js +5 -4
  181. package/dist/column_format/constants/DURATION_PARTS_LIST.d.ts +1 -0
  182. package/dist/column_format/constants/DURATION_PARTS_LIST.js +9 -0
  183. package/dist/column_format/constants/index.d.ts +1 -0
  184. package/dist/column_format/constants/index.js +1 -0
  185. package/dist/column_format/helpers/defineTableChartFormat.js +19 -10
  186. package/dist/column_format/helpers/defineXYChartFormat.js +11 -13
  187. package/dist/columns/constants/COLUMN.js +1 -1
  188. package/dist/columns/constants/COLUMN_PROPERTY.js +2 -2
  189. package/dist/columns/helpers/getDatasetColumn.d.ts +9 -1
  190. package/dist/columns/helpers/getDatasetColumn.js +31 -4
  191. package/dist/columns/helpers/getDatasetColumnByDatasets.d.ts +6 -5
  192. package/dist/columns/helpers/getDatasetColumnByDatasets.js +22 -8
  193. package/dist/columns/helpers/getModelColumn.d.ts +4 -4
  194. package/dist/columns/helpers/getModelColumn.js +9 -19
  195. package/dist/columns/helpers/isComplexColumn.d.ts +5 -0
  196. package/dist/columns/helpers/isComplexColumn.js +5 -0
  197. package/dist/columns/helpers/isDateColumn.d.ts +5 -0
  198. package/dist/columns/helpers/isDateColumn.js +8 -1
  199. package/dist/columns/helpers/isNumericalColumn.d.ts +5 -0
  200. package/dist/columns/helpers/isNumericalColumn.js +7 -1
  201. package/dist/constants/Charts.Const.d.ts +1 -0
  202. package/dist/constants/Charts.Const.js +1 -0
  203. package/dist/dates/adapters/dateToHms.d.ts +1 -1
  204. package/dist/dates/adapters/dateToHms.js +6 -8
  205. package/dist/dates/adapters/dateToMdyDate.js +6 -9
  206. package/dist/dates/adapters/dateToMonthYear.js +6 -4
  207. package/dist/dates/adapters/dateToQuarterYear.d.ts +2 -2
  208. package/dist/dates/adapters/dateToQuarterYear.js +8 -6
  209. package/dist/dates/adapters/dateToWeekYear.js +5 -3
  210. package/dist/dates/adapters/dateToYear.d.ts +1 -1
  211. package/dist/dates/adapters/dateToYear.js +6 -4
  212. package/dist/dates/adapters/weekYearToDate.js +1 -6
  213. package/dist/dates/constants/DATETIME_COLUMN_FORMAT.js +1 -0
  214. package/dist/dates/constants/DATE_DISTINCT_PROPERTY.js +1 -1
  215. package/dist/dates/constants/DATE_FORMAT.js +7 -7
  216. package/dist/dates/constants/DATE_FORMATS.d.ts +1 -0
  217. package/dist/dates/constants/DATE_FORMATS.js +19 -0
  218. package/dist/dates/constants/DATE_GROUPING_ALL_PROPERTIES.d.ts +1 -0
  219. package/dist/dates/constants/DATE_GROUPING_ALL_PROPERTIES.js +6 -0
  220. package/dist/dates/constants/DATE_REGULAR_EXPRESSIONS.d.ts +1 -0
  221. package/dist/dates/constants/DATE_REGULAR_EXPRESSIONS.js +20 -0
  222. package/dist/dates/constants/DATE_REGULAR_EXPRESSION_ARRAY_BY_FORMAT.d.ts +3 -0
  223. package/dist/dates/constants/DATE_REGULAR_EXPRESSION_ARRAY_BY_FORMAT.js +37 -0
  224. package/dist/dates/constants/index.d.ts +4 -0
  225. package/dist/dates/constants/index.js +4 -0
  226. package/dist/dates/helpers/{includeDateTokens.d.ts → areIncludedDateTokens.d.ts} +1 -1
  227. package/dist/dates/helpers/{includeDateTokens.js → areIncludedDateTokens.js} +3 -2
  228. package/dist/dates/helpers/getDateFormatRegularExpressionInArray.d.ts +2 -2
  229. package/dist/dates/helpers/getDateFormatRegularExpressionInArray.js +9 -42
  230. package/dist/{cjs/dates/range → dates/helpers}/getDateRange.d.ts +3 -3
  231. package/dist/dates/{range → helpers}/getDateRange.js +73 -69
  232. package/dist/dates/helpers/getFormattedDateByFormat.d.ts +1 -0
  233. package/dist/dates/helpers/getFormattedDateByFormat.js +17 -17
  234. package/dist/dates/helpers/getSeparatorByDateFormat.d.ts +1 -1
  235. package/dist/dates/helpers/getSeparatorByDateFormat.js +1 -1
  236. package/dist/dates/helpers/getWeek.d.ts +6 -4
  237. package/dist/dates/helpers/getWeek.js +6 -3
  238. package/dist/dates/helpers/index.d.ts +4 -1
  239. package/dist/dates/helpers/index.js +4 -1
  240. package/dist/dates/helpers/isValidPotentialDate.d.ts +6 -0
  241. package/dist/dates/helpers/isValidPotentialDate.js +14 -0
  242. package/dist/dates/index.d.ts +0 -1
  243. package/dist/dates/index.js +0 -1
  244. package/dist/dates/relative/constants/RELATIVE_UNIT_INFO_LIST.js +5 -5
  245. package/dist/filters/adapters/FDToFlatUI.js +4 -4
  246. package/dist/filters/adapters/FDToUI.js +3 -3
  247. package/dist/filters/adapters/UIToFD.js +3 -3
  248. package/dist/filters/adapters/UIToFlatUI.js +3 -3
  249. package/dist/filters/adapters/UIToOldLogic.js +6 -6
  250. package/dist/filters/adapters/adaptFilterData.js +7 -7
  251. package/dist/filters/adapters/flatUIToFD.js +24 -24
  252. package/dist/filters/adapters/flatUIToOldLogic.js +42 -49
  253. package/dist/filters/adapters/flatUIToUI.js +29 -29
  254. package/dist/filters/adapters/index.d.ts +0 -1
  255. package/dist/filters/adapters/index.js +0 -1
  256. package/dist/filters/adapters/logicToFlatUI.js +6 -8
  257. package/dist/filters/helpers/OLD_getAggFilters.js +5 -4
  258. package/dist/filters/helpers/backend/buildExpression.js +1 -1
  259. package/dist/filters/helpers/backend/buildFilters.js +6 -16
  260. package/dist/filters/helpers/backend/getBackendValidator.js +1 -1
  261. package/dist/filters/helpers/backend/getBackendValues.js +1 -3
  262. package/dist/filters/helpers/backend/getLogicByDatasets.js +2 -2
  263. package/dist/filters/helpers/backend/getLogicByDatasetsColumns.js +2 -2
  264. package/dist/filters/helpers/backend/getLogicByScopes.js +2 -2
  265. package/dist/filters/helpers/backend/getLogicByScopesHierarchy.js +0 -2
  266. package/dist/filters/helpers/common/excludeFiltersByAggregateColumn.js +3 -3
  267. package/dist/filters/helpers/common/excludeFiltersByParams.js +10 -11
  268. package/dist/filters/helpers/common/excludeFiltersByScopes.js +3 -3
  269. package/dist/filters/helpers/common/getFilterLabel.js +1 -1
  270. package/dist/filters/helpers/common/getFiltersByAggregateColumn.js +3 -3
  271. package/dist/filters/helpers/common/getFiltersByParams.js +15 -17
  272. package/dist/filters/helpers/common/getFiltersByScopes.js +3 -3
  273. package/dist/filters/helpers/common/getFiltersByScopesIds.js +4 -4
  274. package/dist/filters/helpers/common/getFiltersByVisibility.js +4 -4
  275. package/dist/filters/helpers/common/mergeFilters.js +23 -19
  276. package/dist/filters/helpers/common/mergeValues.js +2 -2
  277. package/dist/filters/helpers/common/resolveScopeConditions.js +1 -1
  278. package/dist/filters/helpers/getAggFiltersFromFilterData.js +2 -2
  279. package/dist/filters/helpers/getTokensFromFilters.js +9 -4
  280. package/dist/filters/helpers/ui/excludeUIFiltersByAggregate.js +2 -2
  281. package/dist/filters/helpers/ui/excludeUIFlatFiltersByScopes.js +2 -2
  282. package/dist/filters/helpers/ui/getUIFlatFilterByParams.js +3 -3
  283. package/dist/filters/helpers/ui/getUIFlatFiltersByParams.js +2 -2
  284. package/dist/filters/helpers/ui/getUIFlatFiltersByScopes.js +2 -2
  285. package/dist/filters/helpers/ui/getUIValues.js +9 -11
  286. package/dist/filters/helpers/ui/transformFilterValues.js +1 -3
  287. package/dist/filters/services/Filters.api.d.ts +4 -4
  288. package/dist/filters/services/Filters.api.js +7 -7
  289. package/dist/filters/services/UChartApi.d.ts +11 -11
  290. package/dist/filters/services/UChartApi.js +176 -185
  291. package/dist/filters/services/UChartPaginationApi.d.ts +13 -13
  292. package/dist/filters/services/UChartPaginationApi.js +198 -212
  293. package/dist/format/definition.d.ts +4 -1
  294. package/dist/format/definition.js +9 -0
  295. package/dist/format/duration/addDurationFormat.d.ts +1 -1
  296. package/dist/format/duration/addDurationFormat.js +2 -2
  297. package/dist/format/duration/durationFormatter.d.ts +1 -1
  298. package/dist/format/duration/durationFormatter.js +7 -10
  299. package/dist/format/format.js +42 -34
  300. package/dist/format/localization.js +19 -4
  301. package/dist/general/mix/importScripts.js +8 -14
  302. package/dist/general/mix/randomId.js +11 -10
  303. package/dist/general/object/get.js +4 -4
  304. package/dist/general/object/getAttribute.js +1 -1
  305. package/dist/general/object/mapValues.js +2 -2
  306. package/dist/general/object/mergeDeep.js +6 -4
  307. package/dist/general/object/serialize.js +3 -3
  308. package/dist/general/string/padLeadingZeros.js +2 -2
  309. package/dist/globalization/helpers/getI18nDateGroupLabel.js +13 -10
  310. package/dist/globalization/helpers/getReverseI18nGroupLabel.js +12 -9
  311. package/dist/globalization/interfaces/II18nResource.d.ts +2 -0
  312. package/dist/globalization/interfaces/chart_builder/II18nChartBuilder.d.ts +2 -0
  313. package/dist/globalization/interfaces/chart_builder/II18nChartBuilderAxisStyle.d.ts +9 -0
  314. package/dist/globalization/interfaces/chart_builder/II18nChartBuilderDurationParts.d.ts +10 -0
  315. package/dist/globalization/interfaces/chart_builder/II18nChartBuilderDurationParts.js +1 -0
  316. package/dist/globalization/interfaces/chart_builder/II18nChartBuilderFormatValues.d.ts +1 -0
  317. package/dist/globalization/interfaces/chart_builder/index.d.ts +1 -0
  318. package/dist/globalization/interfaces/chart_builder/index.js +1 -0
  319. package/dist/globalization/interfaces/common/II18nCommon.d.ts +4 -0
  320. package/dist/globalization/interfaces/filters/II18nTokenBox.d.ts +1 -0
  321. package/dist/globalization/interfaces/panel/II18nPanelMenu.d.ts +1 -0
  322. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +1 -0
  323. package/dist/globalization/interfaces/tabular_view/II18nTabularView.d.ts +4 -0
  324. package/dist/globalization/interfaces/tabular_view/II18nTabularView.js +1 -0
  325. package/dist/globalization/labels/I18N_DEFAULT.js +2 -0
  326. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER.js +10 -0
  327. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +13 -4
  328. package/dist/globalization/labels/common/I18N_COMMON.js +6 -0
  329. package/dist/globalization/labels/panel/I18N_PANEL.js +1 -0
  330. package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.js +1 -0
  331. package/dist/globalization/labels/tabular_view/I18N_TABULAR_VIEW.d.ts +2 -0
  332. package/dist/globalization/labels/tabular_view/I18N_TABULAR_VIEW.js +4 -0
  333. package/dist/interfaces/format/IFormatOutputFormat.Interface.d.ts +1 -0
  334. package/dist/qrvey/helpers/getLookupAnswers.js +4 -6
  335. package/dist/qrvey/helpers/getValueWithSuffixes.js +1 -1
  336. package/dist/services/adapters/index.d.ts +2 -1
  337. package/dist/services/adapters/index.js +2 -1
  338. package/dist/services/api/getAllDatasets.api.js +6 -8
  339. package/dist/services/helpers/Request.js +5 -4
  340. package/package.json +5 -5
  341. package/dist/cjs/dates/range/index.d.ts +0 -1
  342. package/dist/cjs/filters/adapters/transformFilters.d.ts +0 -60
  343. package/dist/cjs/filters/adapters/transformFilters.js +0 -427
  344. package/dist/dates/range/index.d.ts +0 -1
  345. package/dist/dates/range/index.js +0 -1
  346. package/dist/filters/adapters/transformFilters.d.ts +0 -60
  347. package/dist/filters/adapters/transformFilters.js +0 -423
@@ -26,6 +26,16 @@ exports.I18N_CHART_BUILDER = Object.assign(Object.assign(Object.assign(Object.as
26
26
  custom: "Custom Format",
27
27
  date_format: "Date Format",
28
28
  value_format: "Value Format",
29
+ duration: "Duration",
30
+ }, duration_parts: {
31
+ full_duration: "D[d] HH[h] mm[m] ss[s]",
32
+ hour_minute_seconds: "HH:mm:ss",
33
+ hour_minutes: "HH:mm",
34
+ hours: "HH",
35
+ minutes: "mm",
36
+ seconds: "ss (Seconds)",
37
+ milliseconds: "SSS (Milliseconds)",
38
+ custom: "Custom format",
29
39
  }, chart_names: {
30
40
  bar: "Bar",
31
41
  line: "Line",
@@ -78,7 +78,7 @@ exports.I18N_CHART_BUILDER_STYLE_OPTIONS = {
78
78
  axis_position_right: "Right",
79
79
  custom_axis_label: "Axis Label",
80
80
  custom_label: "Label",
81
- custom_label_placeholder: "Custom label",
81
+ custom_label_placeholder: "Type custom label",
82
82
  format_title: "Format",
83
83
  max_range: "Max Range",
84
84
  max_range_placeholder: "Auto",
@@ -93,11 +93,20 @@ exports.I18N_CHART_BUILDER_STYLE_OPTIONS = {
93
93
  steps_placeholder: "Auto",
94
94
  type_label: "Type",
95
95
  values_axis_check: "Axis Values",
96
- values_check: "Values",
96
+ values_check: "Value Labels",
97
97
  values_rotation: "Values Rotation",
98
98
  values_rotation_diagonal: "Diagonal",
99
99
  values_rotation_horizontal: "Horizontal",
100
100
  values_rotation_vertical: "Vertical",
101
+ value_font_type: "Typeface",
102
+ value_font_weight: "Weight",
103
+ value_font_size: "Size",
104
+ value_font_color: "Font Color",
105
+ label_check: "Axis Title",
106
+ label_font_type: "Typeface",
107
+ label_font_weight: "Weight",
108
+ label_font_size: "Size",
109
+ label_font_color: "Font Color",
101
110
  },
102
111
  bar_types: {
103
112
  title: "Type",
@@ -218,8 +227,8 @@ exports.I18N_CHART_BUILDER_STYLE_OPTIONS = {
218
227
  border_outer: "Outer Borders",
219
228
  expandable_color: "Header Color",
220
229
  expandable_font_color: "Header Font Color",
221
- crosstab_color: "Header Color",
222
- crosstab_font_color: "Header Font Color",
230
+ crosstab_color: "BG Color",
231
+ crosstab_font_color: "Font Color",
223
232
  },
224
233
  table_body: {
225
234
  title: "Body",
@@ -9,6 +9,7 @@ const I18N_COLUMN_PROPERTY_LABEL_1 = require("./I18N_COLUMN_PROPERTY_LABEL");
9
9
  const I18N_DATE_GROUPING_1 = require("./I18N_DATE_GROUPING");
10
10
  const I18N_DAY_NAMES_1 = require("./I18N_DAY_NAMES");
11
11
  exports.I18N_COMMON = {
12
+ aggregates: "Aggregates",
12
13
  aggregate_labels: I18N_AGGREGATE_LABEL_1.I18N_AGGREGATE_LABEL,
13
14
  calendar: calendar_1.I18N_CALENDAR,
14
15
  column_types: I18N_COLUMN_LABEL_1.I18N_COLUMN_LABEL,
@@ -23,6 +24,11 @@ exports.I18N_COMMON = {
23
24
  no_data_found: "No Data Found",
24
25
  properties: I18N_COLUMN_PROPERTY_LABEL_1.I18N_COLUMN_PROPERTY_LABEL,
25
26
  search: "Search",
27
+ sort: "Sort",
28
+ token_box: {
29
+ search: "Search",
30
+ language_tokens: "Language Tokens",
31
+ },
26
32
  units: {
27
33
  day: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.DAY.label,
28
34
  month: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.MONTH.label,
@@ -44,6 +44,7 @@ exports.I18N_PANEL = {
44
44
  pdf: "PDF",
45
45
  csv: "CSV",
46
46
  csv_summary: "CSV-Summary",
47
+ excel: "Excel",
47
48
  },
48
49
  menu_options: {
49
50
  see_data: "See Data",
@@ -34,6 +34,7 @@ exports.I18N_STYLE_THEMES = {
34
34
  edit_theme: "Edit Theme",
35
35
  generate_new: "Generate New",
36
36
  header_font_color: "Header Font Color",
37
+ header_main_color: "Header BG Color",
37
38
  id: "ID",
38
39
  legends: "Legends",
39
40
  main_color: "Main Color",
@@ -0,0 +1,2 @@
1
+ import { II18nTabularView } from "../../interfaces/tabular_view/II18nTabularView";
2
+ export declare const I18N_TABULAR_VIEW: II18nTabularView;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.I18N_TABULAR_VIEW = void 0;
4
+ exports.I18N_TABULAR_VIEW = {
5
+ all: "Todas",
6
+ select_columns: "Select Columns",
7
+ };
@@ -4,4 +4,5 @@ export interface IFormatOutputFormat extends IFormatDefaultFormat {
4
4
  currency?: IFormatCurrency;
5
5
  backup_currency?: IFormatCurrency;
6
6
  originalFormat?: IFormatOutputFormat;
7
+ template?: string;
7
8
  }
@@ -9,11 +9,9 @@ function getLookupAnswers(column, property, display) {
9
9
  (valueItem === null || valueItem === void 0 ? void 0 : valueItem.answer) ||
10
10
  []).map((_value) => (Object.assign(Object.assign({}, _value), { answerid: valueItem.answerid })));
11
11
  }
12
- else {
13
- const answerItem = column.answers[display];
14
- return answerItem
15
- ? answerItem.answer.map((_answer) => (Object.assign(Object.assign({}, _answer), { answerid: answerItem.answerid })))
16
- : [];
17
- }
12
+ const answerItem = column.answers[display];
13
+ return answerItem
14
+ ? answerItem.answer.map((_answer) => (Object.assign(Object.assign({}, _answer), { answerid: answerItem.answerid })))
15
+ : [];
18
16
  }
19
17
  exports.getLookupAnswers = getLookupAnswers;
@@ -23,6 +23,6 @@ function getValueWithSuffixes(value, settings) {
23
23
  ? settings.suffixes.plural
24
24
  : settings.suffixes.singular;
25
25
  }
26
- return value + (!(0, isEmpty_1.isEmpty)(suffix) ? " " + suffix : "");
26
+ return value + (!(0, isEmpty_1.isEmpty)(suffix) ? ` ${suffix}` : "");
27
27
  }
28
28
  exports.getValueWithSuffixes = getValueWithSuffixes;
@@ -1,3 +1,4 @@
1
1
  export * from "./BBranchesMapToUIBranchesMap.adapter";
2
- export * from "./BDatasetsToUIDatasets.adapter";
3
2
  export * from "./BColumnsToUIColumns.adapter";
3
+ export * from "./BDatasetsToUIDatasets.adapter";
4
+ export * from "./BModelToUIModel.adapter";
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./BBranchesMapToUIBranchesMap.adapter"), exports);
18
- __exportStar(require("./BDatasetsToUIDatasets.adapter"), exports);
19
18
  __exportStar(require("./BColumnsToUIColumns.adapter"), exports);
19
+ __exportStar(require("./BDatasetsToUIDatasets.adapter"), exports);
20
+ __exportStar(require("./BModelToUIModel.adapter"), exports);
@@ -22,13 +22,11 @@ function getAllDatasets(config, qrveyids) {
22
22
  else if (Array.isArray(qrveyids) && !(0, isEmpty_1.isEmpty)(qrveyids)) {
23
23
  return (0, getDatasetsByIds_api_1.getDatasetsByIds)(config, qrveyids);
24
24
  }
25
- else {
26
- return (0, getAllQrveys_api_1.getAllQrveys)(Object.assign({}, config), { status: ["RUNNING", "FINISHED", "PAUSED"], loadAll: true })
27
- .then((qrveys) => {
28
- const datasets = qrveys.Items.filter((item) => !["NPS", "CHECKLIST"].includes(item.appType.toUpperCase()));
29
- return (0, getDatasetsByIds_api_1.getDatasetsByIds)(config, (0, getArrayByProperty_1.getArrayByProperty)(datasets, "qrveyid"));
30
- })
31
- .catch((_e) => []);
32
- }
25
+ return (0, getAllQrveys_api_1.getAllQrveys)(Object.assign({}, config), { status: ["RUNNING", "FINISHED", "PAUSED"], loadAll: true })
26
+ .then((qrveys) => {
27
+ const datasets = qrveys.Items.filter((item) => !["NPS", "CHECKLIST"].includes(item.appType.toUpperCase()));
28
+ return (0, getDatasetsByIds_api_1.getDatasetsByIds)(config, (0, getArrayByProperty_1.getArrayByProperty)(datasets, "qrveyid"));
29
+ })
30
+ .catch((_e) => []);
33
31
  }
34
32
  exports.getAllDatasets = getAllDatasets;
@@ -36,7 +36,8 @@ class Request {
36
36
  return (0, getAttribute_1.getAttribute)(config, "api_key");
37
37
  }
38
38
  static makeUrl(config, url, params) {
39
- url += typeof params === "object" ? (0, serialize_1.serialize)(params) : "";
39
+ let _url = url;
40
+ _url += typeof params === "object" ? (0, serialize_1.serialize)(params) : "";
40
41
  if (config.endpoint) {
41
42
  const endpoint = config.endpoint;
42
43
  const version = `v${endpoint.version || 4}`;
@@ -45,9 +46,9 @@ class Request {
45
46
  ? "/user/:user_id"
46
47
  : "";
47
48
  const base = `/${api}/${version}${user}`;
48
- url = (config.domain || "") + base + endpoint.uri + url;
49
+ _url = (config.domain || "") + base + endpoint.uri + _url;
49
50
  }
50
- return this.parseUrl(url, config);
51
+ return this.parseUrl(_url, config);
51
52
  }
52
53
  static requestConfig(reqData) {
53
54
  const cfg = {
@@ -58,7 +59,7 @@ class Request {
58
59
  };
59
60
  const qvToken = this.getQvToken(reqData.config);
60
61
  if (qvToken) {
61
- cfg.headers["Authorization"] = "Bearer " + qvToken;
62
+ cfg.headers.Authorization = `Bearer ${qvToken}`;
62
63
  }
63
64
  else {
64
65
  const apiKey = this.getApiKey(reqData.config);
@@ -0,0 +1 @@
1
+ export declare const DURATION_PARTS_LIST: string[];
@@ -0,0 +1,9 @@
1
+ export const DURATION_PARTS_LIST = [
2
+ "D[d] HH[h] mm[m] ss[s]",
3
+ "HH:mm:ss",
4
+ "HH:mm",
5
+ "HH",
6
+ "mm",
7
+ "ss",
8
+ "SSS",
9
+ ];
@@ -4,3 +4,4 @@ export * from "./DATEGROUP_WITHOUT_FORMAT";
4
4
  export * from "./SHELF_TYPE";
5
5
  export * from "./STRING_FORMAT";
6
6
  export * from "./TABLE_TYPE";
7
+ export * from "./DURATION_PARTS_LIST";
@@ -4,3 +4,4 @@ export * from "./DATEGROUP_WITHOUT_FORMAT";
4
4
  export * from "./SHELF_TYPE";
5
5
  export * from "./STRING_FORMAT";
6
6
  export * from "./TABLE_TYPE";
7
+ export * from "./DURATION_PARTS_LIST";
@@ -5,6 +5,7 @@ import { CHART_GROUPS } from "../constants/CHART_GROUP";
5
5
  import { STRING_FORMAT } from "../constants/STRING_FORMAT";
6
6
  import { TABLE_TYPE } from "../constants/TABLE_TYPE";
7
7
  import { columnTypeByChart } from "./columnTypeByChart";
8
+ import { STANDARD_NUMERIC_FORMATS, } from "../../format/definition";
8
9
  import { CALCULATION_LABEL } from "../../qrvey/constants/CALCULATION_LABEL";
9
10
  import { DATEGROUP_UNSUPPORT_FORMAT } from "../constants/DATEGROUP_UNSUPPORT_FORMAT";
10
11
  /**
@@ -15,7 +16,7 @@ import { DATEGROUP_UNSUPPORT_FORMAT } from "../constants/DATEGROUP_UNSUPPORT_FOR
15
16
  export const defineTableChartFormat = (column, settings) => {
16
17
  const { aggregate, defaultFormat, outputFormat, selectedFormat, calculation, dateGroup, } = column;
17
18
  const { tableType, shelfType } = settings;
18
- //Defaults
19
+ // Defaults
19
20
  const defaultText = "Default";
20
21
  const defaultNumeric = { type: "NUMERIC", format: "Decimal" /* LOCALE_FORMATS.DECIMAL */ };
21
22
  const defaultPercentage = {
@@ -57,17 +58,25 @@ export const defineTableChartFormat = (column, settings) => {
57
58
  case COLUMN.NUMERIC:
58
59
  case COLUMN.RATING:
59
60
  case COLUMN.SLIDEBAR: {
60
- if (selectedFormat)
61
+ if (selectedFormat && selectedFormat.format !== "Default") {
61
62
  return selectedFormat;
62
- if ((calculation === null || calculation === void 0 ? void 0 : calculation.value) === CALCULATION_LABEL.PDIFF)
63
- return defaultPercentage;
64
- if (hasDefaultFormat) {
65
- if ((aggregate === null || aggregate === void 0 ? void 0 : aggregate.label) === AGGREGATE.COUNT ||
66
- (aggregate === null || aggregate === void 0 ? void 0 : aggregate.label) === AGGREGATE.DISTINCTCOUNT)
67
- return defaultNumeric;
68
- return defaultFormat || defaultNumeric;
69
63
  }
70
- return;
64
+ let output;
65
+ if ((calculation === null || calculation === void 0 ? void 0 : calculation.value) === CALCULATION_LABEL.PDIFF) {
66
+ output = defaultPercentage;
67
+ }
68
+ else if (isGroupedTable &&
69
+ ((aggregate === null || aggregate === void 0 ? void 0 : aggregate.label) === AGGREGATE.COUNT ||
70
+ (aggregate === null || aggregate === void 0 ? void 0 : aggregate.label) === AGGREGATE.DISTINCTCOUNT)) {
71
+ output = defaultNumeric;
72
+ }
73
+ else {
74
+ output = defaultFormat || defaultNumeric;
75
+ }
76
+ if (!STANDARD_NUMERIC_FORMATS.includes(output === null || output === void 0 ? void 0 : output.format)) {
77
+ output = Object.assign(Object.assign({}, output), { template: output.format, format: "Duration" });
78
+ }
79
+ return output;
71
80
  }
72
81
  }
73
82
  };
@@ -1,5 +1,6 @@
1
1
  import { AGGREGATE } from "../../charts/constants/AGGREGATE";
2
2
  import { COLUMN } from "../../columns/constants/COLUMN";
3
+ import { STANDARD_NUMERIC_FORMATS, } from "../../format/definition";
3
4
  import { isEmpty } from "../../general/mix/isEmpty";
4
5
  import { CALCULATION_LABEL } from "../../qrvey/constants/CALCULATION_LABEL";
5
6
  import { CHART_GROUPS } from "../constants/CHART_GROUP";
@@ -53,9 +54,7 @@ export const defineXYChartFormat = (column, settings) => {
53
54
  else if (hasDefaultFormat) {
54
55
  return Object.assign(Object.assign({}, columnDefaultFormat), { format: defaultText, originalFormat: Object.assign({}, outputFormat) });
55
56
  }
56
- else {
57
- return selectedFormat;
58
- }
57
+ return selectedFormat;
59
58
  }
60
59
  case COLUMN.NUMERIC:
61
60
  case COLUMN.RATING:
@@ -71,19 +70,18 @@ export const defineXYChartFormat = (column, settings) => {
71
70
  (columnCurrentFormat === null || columnCurrentFormat === void 0 ? void 0 : columnCurrentFormat.type) !== COLUMN.NUMERIC) ||
72
71
  withoutFormat)
73
72
  return defaultAbb;
74
- else
75
- return columnCurrentFormat;
73
+ return columnCurrentFormat;
76
74
  }
77
- else {
78
- if (withoutFormat === true) {
79
- return columnDefaultFormat;
80
- }
81
- else if (hasDefaultFormat) {
82
- return Object.assign({}, outputFormat);
75
+ if (withoutFormat === true) {
76
+ return columnDefaultFormat;
77
+ }
78
+ else if (hasDefaultFormat) {
79
+ if (!STANDARD_NUMERIC_FORMATS.includes(outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format)) {
80
+ return Object.assign(Object.assign({}, outputFormat), { template: outputFormat.format, format: "Duration" });
83
81
  }
84
- else
85
- return selectedFormat;
82
+ return Object.assign({}, outputFormat);
86
83
  }
84
+ return selectedFormat;
87
85
  }
88
86
  }
89
87
  };
@@ -30,7 +30,7 @@ export var COLUMN;
30
30
  COLUMN["NUMERICP"] = "NUMERIC-P";
31
31
  COLUMN["NUMERICG"] = "NUMERIC-G";
32
32
  COLUMN["RATING"] = "RATING";
33
- //...COMPLEX_COLUMN,
33
+ // ...COMPLEX_COLUMN,
34
34
  COLUMN["TEXTFIELD"] = "TEXTFIELD";
35
35
  COLUMN["LONGTEXT"] = "LONGTEXT";
36
36
  COLUMN["IMAGEUPLOAD"] = "IMAGEUPLOAD";
@@ -10,7 +10,7 @@ export var COLUMN_PROPERTY;
10
10
  COLUMN_PROPERTY["MONTH"] = "month";
11
11
  COLUMN_PROPERTY["WEEK"] = "week";
12
12
  COLUMN_PROPERTY["DAY"] = "day";
13
- //...DATE_GROUPING_TIME_PROPERTY,
13
+ // ...DATE_GROUPING_TIME_PROPERTY,
14
14
  COLUMN_PROPERTY["HOUR"] = "hour";
15
15
  COLUMN_PROPERTY["MINUTE"] = "minute";
16
16
  COLUMN_PROPERTY["SECOND"] = "second";
@@ -19,7 +19,7 @@ export var COLUMN_PROPERTY;
19
19
  COLUMN_PROPERTY["YEAR_MONTH"] = "month_only";
20
20
  // YEAR_DAY = 'p-y-day',
21
21
  COLUMN_PROPERTY["MONTH_DAY"] = "day_only";
22
- //WEEK_DAY = 'p-w-day'
22
+ // WEEK_DAY = 'p-w-day'
23
23
  // ...DATE_DISTINCT_TIME_PROPERTY,
24
24
  COLUMN_PROPERTY["DAY_HOUR"] = "hour_only";
25
25
  COLUMN_PROPERTY["HOUR_MINUTE"] = "minute_only";
@@ -1,3 +1,11 @@
1
1
  import { IDataset } from "../../qrvey/interfaces/IDataset";
2
2
  import { IColumn } from "../interfaces/IColumn";
3
- export declare function getDatasetColumn(column: Partial<IColumn>, dataset: IDataset): IColumn;
3
+ /**
4
+ * Gets the column from the dataset object
5
+ * Recieves a partial column object and returns a full column object from the Dataset
6
+ * @param {IColumn} column a partial column info
7
+ * @param {IDataset} dataset the dataset info to look for the column
8
+ * @param {boolean} getIndex flag to get the index of the column array or the complete column info
9
+ * @returns the dataset column index or the dataset column object
10
+ */
11
+ export declare function getDatasetColumn(column: Partial<IColumn>, dataset: IDataset, getIndex?: boolean): IColumn | number;
@@ -1,10 +1,37 @@
1
+ import { isObject } from "../../general";
1
2
  import { isEmpty } from "../../general/mix/isEmpty";
2
- export function getDatasetColumn(column, dataset) {
3
- if (isEmpty(column) || isEmpty(dataset))
4
- return;
3
+ /**
4
+ * Gets the column from the dataset object
5
+ * Recieves a partial column object and returns a full column object from the Dataset
6
+ * @param {IColumn} column a partial column info
7
+ * @param {IDataset} dataset the dataset info to look for the column
8
+ * @param {boolean} getIndex flag to get the index of the column array or the complete column info
9
+ * @returns the dataset column index or the dataset column object
10
+ */
11
+ export function getDatasetColumn(column, dataset, getIndex = false) {
12
+ if (!isValidArguments(column, dataset))
13
+ return getIndex ? -1 : undefined;
5
14
  const columns = getDatasetColumns(dataset);
6
- return columns.find((c) => c.id === column.id && c.qrveyid === column.qrveyid);
15
+ const validation = (c) => c.id === column.id && c.qrveyid === column.qrveyid;
16
+ return getIndex ? columns.findIndex(validation) : columns.find(validation);
7
17
  }
18
+ /**
19
+ * Validates the arguments
20
+ * @param {IColumn} column a partial column info
21
+ * @param {IDataset} dataset the dataset info
22
+ * @returns true: the arguments are valid.
23
+ */
24
+ function isValidArguments(column, dataset) {
25
+ return (!isEmpty(column) &&
26
+ isObject(column) &&
27
+ !isEmpty(dataset) &&
28
+ isObject(dataset));
29
+ }
30
+ /**
31
+ * Gets the column array
32
+ * @param {IDataset} dataset the dataset info
33
+ * @returns the column array
34
+ */
8
35
  function getDatasetColumns(dataset) {
9
36
  return (dataset === null || dataset === void 0 ? void 0 : dataset.options) || [];
10
37
  }
@@ -1,10 +1,11 @@
1
1
  import { IDataset } from "../../qrvey/interfaces/IDataset";
2
2
  import { IColumn } from "../interfaces/IColumn";
3
3
  /**
4
- * Gets a column from a dataset.
5
- * Recieves a partial column object and received a full column object from the Dataset
6
- * @param column a partial column object
7
- * @param datasets the datasets to look for the colun
4
+ * Gets a column from a datasets collection.
5
+ * Recieves a partial column object and returns a full column object from the Dataset
6
+ * @param {IColumn} column a partial column object
7
+ * @param {IDataset} datasets the datasets collection to look for the column
8
+ * @param {boolean} getIndex flag to get the index of the column array or the complete column info
8
9
  * @returns the Column object
9
10
  */
10
- export declare function getDatasetColumnByDatasets(column: Partial<IColumn>, datasets: IDataset[]): IColumn;
11
+ export declare function getDatasetColumnByDatasets(column: Partial<IColumn>, datasets: IDataset[], getIndex?: boolean): IColumn | number;
@@ -1,15 +1,29 @@
1
1
  import { isEmpty } from "../../general/mix/isEmpty";
2
+ import { isObject } from "../../general/object/isObject";
2
3
  import { getDatasetColumn } from "./getDatasetColumn";
3
4
  /**
4
- * Gets a column from a dataset.
5
- * Recieves a partial column object and received a full column object from the Dataset
6
- * @param column a partial column object
7
- * @param datasets the datasets to look for the colun
5
+ * Gets a column from a datasets collection.
6
+ * Recieves a partial column object and returns a full column object from the Dataset
7
+ * @param {IColumn} column a partial column object
8
+ * @param {IDataset} datasets the datasets collection to look for the column
9
+ * @param {boolean} getIndex flag to get the index of the column array or the complete column info
8
10
  * @returns the Column object
9
11
  */
10
- export function getDatasetColumnByDatasets(column, datasets) {
11
- if (isEmpty(column) || isEmpty(datasets))
12
- return;
12
+ export function getDatasetColumnByDatasets(column, datasets, getIndex = false) {
13
+ if (!isValidArguments(column, datasets))
14
+ return getIndex ? -1 : undefined;
13
15
  const dataset = datasets.find((_dataset) => _dataset.qrveyid === column.qrveyid);
14
- return getDatasetColumn(column, dataset);
16
+ return getDatasetColumn(column, dataset, getIndex);
17
+ }
18
+ /**
19
+ * Validates the arguments
20
+ * @param {IColumn} column a partial column info
21
+ * @param {IDataset} dataset the datasets collection
22
+ * @returns true: the arguments are valid.
23
+ */
24
+ function isValidArguments(column, datasets) {
25
+ return (!isEmpty(column) &&
26
+ isObject(column) &&
27
+ !isEmpty(datasets) &&
28
+ Array.isArray(datasets));
15
29
  }
@@ -1,9 +1,9 @@
1
1
  import { IModel } from "../../qrvey/interfaces/IModel";
2
2
  import { IColumn } from "../interfaces/IColumn";
3
3
  /**
4
- * Get a model question by column id.
5
- * @param column The column with info
6
- * @param model The model object
7
- * @returns the model question
4
+ * Get a model column by a partial column info.
5
+ * @param {IColumn} column The partial column info
6
+ * @param {IModel} model The model object
7
+ * @returns the model column
8
8
  */
9
9
  export declare function getModelColumn(column: Partial<IColumn>, model: IModel): IColumn;
@@ -1,25 +1,15 @@
1
1
  import { isEmpty } from "../../general/mix/isEmpty";
2
- import { _get } from "../../general/object/get";
3
2
  /**
4
- * Get a model question by column id.
5
- * @param column The column with info
6
- * @param model The model object
7
- * @returns the model question
3
+ * Get a model column by a partial column info.
4
+ * @param {IColumn} column The partial column info
5
+ * @param {IModel} model The model object
6
+ * @returns the model column
8
7
  */
9
8
  export function getModelColumn(column, model) {
10
- if (isEmpty(column) || isEmpty(model))
9
+ if (isEmpty(column) ||
10
+ isEmpty(model) ||
11
+ isEmpty(model.columns) ||
12
+ !Array.isArray(model.columns))
11
13
  return;
12
- const questions = getQuestionData(model);
13
- if (isEmpty(questions))
14
- return;
15
- return questions.find((q) => q.id === column.id);
16
- }
17
- /**
18
- * [TODO: Change the question.data access path. IModel structure is different]
19
- * Get the question data array from model object
20
- * @param model The model object
21
- * @returns the question data array from model object
22
- */
23
- function getQuestionData(model) {
24
- return _get(model, "questions.data", []);
14
+ return model.columns.find((q) => q.id === column.id);
25
15
  }
@@ -1,2 +1,7 @@
1
1
  import { IColumn } from "../interfaces/IColumn";
2
+ /**
3
+ * Validates if the given column is a complex type
4
+ * @param {IColumn} column the column info
5
+ * @returns true: the column is a complex type
6
+ */
2
7
  export declare const isComplexColumn: (column: IColumn) => boolean;
@@ -1,6 +1,11 @@
1
1
  import { isObject } from "../../general/object/isObject";
2
2
  import { isEmpty } from "../../general/mix/isEmpty";
3
3
  import { COMPLEX_COLUMNS } from "../constants/COMPLEX_COLUMNS";
4
+ /**
5
+ * Validates if the given column is a complex type
6
+ * @param {IColumn} column the column info
7
+ * @returns true: the column is a complex type
8
+ */
4
9
  export const isComplexColumn = (column) => !isEmpty(column) &&
5
10
  isObject(column) &&
6
11
  COMPLEX_COLUMNS.includes(column.type);
@@ -1,2 +1,7 @@
1
1
  import { IColumn } from "../interfaces/IColumn";
2
+ /**
3
+ * Validates if the given column is a date type
4
+ * @param {IColumn} column the column info
5
+ * @returns true: the column is a date type
6
+ */
2
7
  export declare const isDateColumn: (column: IColumn) => boolean;
@@ -1,5 +1,12 @@
1
1
  import { isObject } from "../../general/object/isObject";
2
2
  import { isEmpty } from "../../general/mix/isEmpty";
3
+ import { COLUMN } from "../constants/COLUMN";
4
+ import { FORMULA } from "../../formulas/constants/FORMULA";
5
+ /**
6
+ * Validates if the given column is a date type
7
+ * @param {IColumn} column the column info
8
+ * @returns true: the column is a date type
9
+ */
3
10
  export const isDateColumn = (column) => !isEmpty(column) &&
4
11
  isObject(column) &&
5
- (column.type === "DATE" || column.formulaType === "date");
12
+ (column.type === COLUMN.DATE || column.formulaType === FORMULA.DATE);
@@ -1,2 +1,7 @@
1
1
  import { IColumn } from "../interfaces/IColumn";
2
+ /**
3
+ * Validates if the given column is numerical type
4
+ * @param {IColumn} column the column info
5
+ * @returns true: the column is numerical type
6
+ */
2
7
  export declare const isNumericalColumn: (column: IColumn) => boolean;
@@ -1,7 +1,13 @@
1
+ import { FORMULA } from "../../formulas/constants/FORMULA";
1
2
  import { isEmpty } from "../../general/mix/isEmpty";
2
3
  import { isObject } from "../../general/object/isObject";
3
4
  import { NUMERICAL_COLUMNS } from "../constants/NUMERICAL_COLUMNS";
5
+ /**
6
+ * Validates if the given column is numerical type
7
+ * @param {IColumn} column the column info
8
+ * @returns true: the column is numerical type
9
+ */
4
10
  export const isNumericalColumn = (column) => !isEmpty(column) &&
5
11
  isObject(column) &&
6
12
  (NUMERICAL_COLUMNS.includes(column.type) ||
7
- column.formulaType === "number");
13
+ column.formulaType === FORMULA.NUMBER);
@@ -1,5 +1,6 @@
1
1
  export declare enum CHART_TYPE {
2
2
  BAR_CHART = "BAR_CHART",
3
+ FUNNEL_CHART = "FUNNEL_CHART",
3
4
  BAR_CHART_MS = "BAR_CHART_MS",
4
5
  EXPANDABLE_TABLE_CHART = "EXPANDABLE_TABLE_CHART",
5
6
  SYMBOL_CHART = "SYMBOL_CHART",
@@ -1,6 +1,7 @@
1
1
  export var CHART_TYPE;
2
2
  (function (CHART_TYPE) {
3
3
  CHART_TYPE["BAR_CHART"] = "BAR_CHART";
4
+ CHART_TYPE["FUNNEL_CHART"] = "FUNNEL_CHART";
4
5
  CHART_TYPE["BAR_CHART_MS"] = "BAR_CHART_MS";
5
6
  CHART_TYPE["EXPANDABLE_TABLE_CHART"] = "EXPANDABLE_TABLE_CHART";
6
7
  CHART_TYPE["SYMBOL_CHART"] = "SYMBOL_CHART";
@@ -3,4 +3,4 @@
3
3
  * @param date String, object or millisencond number of the date
4
4
  * @returns string of [HH:mm:ss] date format
5
5
  */
6
- export declare function dateToHms(date: string | Date | number): any;
6
+ export declare function dateToHms(date: string | Date | number): string;