@qrvey/utils 1.9.0 → 1.10.0-1

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 (285) hide show
  1. package/dist/charts/adapters/endpointData.js +0 -3
  2. package/dist/charts/interfaces/IAggregateAbbreviation.d.ts +1 -1
  3. package/dist/charts/interfaces/IAggregateLabel.d.ts +1 -1
  4. package/dist/charts/interfaces/IAggregateType.d.ts +1 -1
  5. package/dist/charts/interfaces/IRequestAdapterMetric.d.ts +12 -12
  6. package/dist/cjs/charts/adapters/endpointData.js +0 -3
  7. package/dist/cjs/charts/interfaces/IAggregateAbbreviation.d.ts +1 -1
  8. package/dist/cjs/charts/interfaces/IAggregateLabel.d.ts +1 -1
  9. package/dist/cjs/charts/interfaces/IAggregateType.d.ts +1 -1
  10. package/dist/cjs/charts/interfaces/IRequestAdapterMetric.d.ts +12 -12
  11. package/dist/cjs/column_format/interfaces/IChartGroupType.d.ts +1 -1
  12. package/dist/cjs/column_format/interfaces/IChartShelfType.d.ts +1 -1
  13. package/dist/cjs/column_format/interfaces/IChartTableType.d.ts +1 -1
  14. package/dist/cjs/column_format/interfaces/IColumnFormatReturnType.d.ts +1 -1
  15. package/dist/cjs/column_format/interfaces/IFormatStringType.d.ts +1 -1
  16. package/dist/cjs/columns/interfaces/IColumnImageUploadOption.d.ts +1 -1
  17. package/dist/cjs/columns/interfaces/IColumnPropertyType.d.ts +1 -1
  18. package/dist/cjs/columns/interfaces/IColumnType.d.ts +1 -1
  19. package/dist/cjs/columns/interfaces/IComplexColumnPropertyType.d.ts +1 -1
  20. package/dist/cjs/columns/interfaces/IComplexColumnType.d.ts +1 -1
  21. package/dist/cjs/columns/interfaces/ICompoundColumnPropertyType.d.ts +1 -1
  22. package/dist/cjs/columns/interfaces/ICompoundColumnType.d.ts +1 -1
  23. package/dist/cjs/columns/interfaces/IDateColumnPropertyType.d.ts +1 -1
  24. package/dist/cjs/columns/interfaces/INumericalColumnType.d.ts +1 -1
  25. package/dist/cjs/dates/adapters/ISOToNumericOffset.d.ts +6 -0
  26. package/dist/cjs/dates/adapters/ISOToNumericOffset.js +21 -0
  27. package/dist/cjs/dates/adapters/index.d.ts +2 -0
  28. package/dist/cjs/dates/adapters/index.js +2 -0
  29. package/dist/cjs/dates/adapters/numericOffsetToISO.d.ts +6 -0
  30. package/dist/cjs/dates/adapters/numericOffsetToISO.js +29 -0
  31. package/dist/cjs/dates/constants/ISO_8601_REGEX.d.ts +1 -0
  32. package/dist/cjs/dates/constants/ISO_8601_REGEX.js +4 -0
  33. package/dist/cjs/dates/constants/TIMEZONE_TYPE.d.ts +5 -0
  34. package/dist/cjs/dates/constants/TIMEZONE_TYPE.js +9 -0
  35. package/dist/cjs/dates/constants/index.d.ts +1 -0
  36. package/dist/cjs/dates/constants/index.js +1 -0
  37. package/dist/cjs/dates/helpers/getDateByTimezone.d.ts +8 -0
  38. package/dist/cjs/dates/helpers/getDateByTimezone.js +41 -0
  39. package/dist/cjs/dates/helpers/getDateByTimezoneOffset.d.ts +7 -0
  40. package/dist/cjs/dates/helpers/getDateByTimezoneOffset.js +22 -0
  41. package/dist/cjs/dates/helpers/getTimezoneObject.d.ts +10 -0
  42. package/dist/cjs/dates/helpers/getTimezoneObject.js +21 -0
  43. package/dist/cjs/dates/helpers/getTimezoneOffsetByType.d.ts +13 -0
  44. package/dist/cjs/dates/helpers/getTimezoneOffsetByType.js +27 -0
  45. package/dist/cjs/dates/helpers/index.d.ts +4 -1
  46. package/dist/cjs/dates/helpers/index.js +4 -1
  47. package/dist/cjs/dates/helpers/isValidISOOffset.d.ts +7 -0
  48. package/dist/cjs/dates/helpers/isValidISOOffset.js +17 -0
  49. package/dist/cjs/dates/interfaces/IBTimezone.d.ts +7 -0
  50. package/dist/cjs/dates/interfaces/IBTimezone.js +2 -0
  51. package/dist/cjs/dates/interfaces/IBTimezoneType.d.ts +2 -0
  52. package/dist/cjs/dates/interfaces/IBTimezoneType.js +2 -0
  53. package/dist/cjs/dates/interfaces/IDTimezone.d.ts +6 -0
  54. package/dist/cjs/dates/interfaces/IDTimezone.js +2 -0
  55. package/dist/cjs/dates/interfaces/IDTimezoneOffset.d.ts +1 -0
  56. package/dist/cjs/dates/interfaces/IDTimezoneOffset.js +2 -0
  57. package/dist/cjs/dates/interfaces/IDTimezoneType.d.ts +2 -0
  58. package/dist/cjs/dates/interfaces/IDTimezoneType.js +2 -0
  59. package/dist/cjs/dates/interfaces/IDateFormat.d.ts +1 -1
  60. package/dist/cjs/dates/interfaces/IDateGroupingProperty.d.ts +1 -1
  61. package/dist/cjs/dates/interfaces/IGetDateByTimezoneSettings.d.ts +6 -0
  62. package/dist/cjs/dates/interfaces/IGetDateByTimezoneSettings.js +2 -0
  63. package/dist/cjs/dates/interfaces/index.d.ts +6 -0
  64. package/dist/cjs/dates/interfaces/index.js +6 -0
  65. package/dist/cjs/dates/relative/helpers/parseDate.d.ts +2 -2
  66. package/dist/cjs/dates/relative/interfaces/IRelativeUnit.d.ts +1 -1
  67. package/dist/cjs/dates/relative/interfaces/RelativeCursor.d.ts +1 -1
  68. package/dist/cjs/dates/relative/interfaces/RelativeInput.d.ts +1 -1
  69. package/dist/cjs/dates/relative/interfaces/ui/IRelativeSectionMode.d.ts +1 -1
  70. package/dist/cjs/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -1
  71. package/dist/cjs/filters/helpers/common/excludeFiltersByParams.js +5 -5
  72. package/dist/cjs/filters/helpers/common/getFiltersByTimezone.d.ts +10 -0
  73. package/dist/cjs/filters/helpers/common/getFiltersByTimezone.js +26 -0
  74. package/dist/cjs/filters/helpers/common/index.d.ts +1 -0
  75. package/dist/cjs/filters/helpers/common/index.js +1 -0
  76. package/dist/cjs/filters/interfaces/IFDateProperty.d.ts +1 -1
  77. package/dist/cjs/filters/interfaces/IFDateSection.d.ts +1 -1
  78. package/dist/cjs/filters/interfaces/IFOperator.d.ts +1 -1
  79. package/dist/cjs/filters/interfaces/IFProperty.d.ts +1 -1
  80. package/dist/cjs/filters/interfaces/IFScope.d.ts +1 -1
  81. package/dist/cjs/filters/interfaces/IFSection.d.ts +1 -1
  82. package/dist/cjs/filters/interfaces/IFStructureType.d.ts +1 -1
  83. package/dist/cjs/filters/interfaces/IFValidator.d.ts +1 -1
  84. package/dist/cjs/filters/interfaces/IFValue.d.ts +1 -1
  85. package/dist/cjs/filters/interfaces/OLD_IFilterExpression.d.ts +2 -2
  86. package/dist/cjs/filters/interfaces/backend/IFBExpressionRelativeDate.d.ts +1 -1
  87. package/dist/cjs/filters/interfaces/backend/IFBExpressionValue.d.ts +1 -1
  88. package/dist/cjs/filters/interfaces/backend/IFBackendExpressionValue.d.ts +1 -1
  89. package/dist/cjs/filters/interfaces/backend/IFBackendValidator.d.ts +1 -1
  90. package/dist/cjs/filters/interfaces/common/IFSColumn.d.ts +1 -1
  91. package/dist/cjs/filters/interfaces/common/IFSGetDataValues.d.ts +1 -1
  92. package/dist/cjs/filters/interfaces/common/IFSValueRelativeDate.d.ts +1 -1
  93. package/dist/cjs/filters/interfaces/common/IFilterConfig.d.ts +1 -1
  94. package/dist/cjs/filters/interfaces/panel/IFPAction.d.ts +1 -1
  95. package/dist/cjs/filters/interfaces/settings/IFSettingsPanelView.d.ts +1 -1
  96. package/dist/cjs/filters/interfaces/settings/IFSettingsScopes.d.ts +1 -1
  97. package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
  98. package/dist/cjs/format/duration/durationFormatter.js +2 -1
  99. package/dist/cjs/format/format.d.ts +1 -1
  100. package/dist/cjs/format/format.js +10 -4
  101. package/dist/cjs/formulas/interfaces/IFormulaType.d.ts +1 -1
  102. package/dist/cjs/general/array/addPropertyToArrayOfObjects.d.ts +1 -1
  103. package/dist/cjs/general/index.d.ts +1 -0
  104. package/dist/cjs/general/index.js +1 -0
  105. package/dist/cjs/general/mix/importScripts.d.ts +2 -2
  106. package/dist/cjs/general/numeric/getSign.d.ts +6 -0
  107. package/dist/cjs/general/numeric/getSign.js +12 -0
  108. package/dist/cjs/general/numeric/index.d.ts +1 -0
  109. package/dist/cjs/general/numeric/index.js +17 -0
  110. package/dist/cjs/general/object/applyTimezoneDeep.d.ts +8 -0
  111. package/dist/cjs/general/object/applyTimezoneDeep.js +48 -0
  112. package/dist/cjs/general/object/index.d.ts +1 -0
  113. package/dist/cjs/general/object/index.js +1 -0
  114. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_FORMAT_OPTIONS.d.ts +1 -1
  115. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.d.ts +1 -1
  116. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL_OPTIONS.d.ts +1 -1
  117. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.d.ts +1 -1
  118. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_OPERATORS.d.ts +1 -1
  119. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.d.ts +1 -1
  120. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_THRESHOLD.d.ts +1 -1
  121. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_TIME_PERIOD.d.ts +1 -1
  122. package/dist/cjs/interfaces/Chart.Interface.d.ts +1 -1
  123. package/dist/cjs/interfaces/IChartBuilder.Interface.d.ts +1 -1
  124. package/dist/cjs/interfaces/Qrvey.Interface.d.ts +2 -2
  125. package/dist/cjs/interfaces/format/IFormatConfig.Interface.d.ts +1 -0
  126. package/dist/cjs/interfaces/general/IWidgetConfig.d.ts +2 -1
  127. package/dist/cjs/qrvey/helpers/transformValue.js +34 -6
  128. package/dist/cjs/qrvey/interfaces/IAppStatus.d.ts +1 -1
  129. package/dist/cjs/qrvey/interfaces/IAppType.d.ts +1 -1
  130. package/dist/cjs/qrvey/interfaces/IBDataset.d.ts +2 -0
  131. package/dist/cjs/qrvey/interfaces/IBModel.d.ts +5 -0
  132. package/dist/cjs/qrvey/interfaces/ICalculation.d.ts +1 -1
  133. package/dist/cjs/qrvey/interfaces/ICalculationType.d.ts +1 -1
  134. package/dist/cjs/qrvey/interfaces/IDataset.d.ts +3 -1
  135. package/dist/cjs/qrvey/interfaces/IModel.d.ts +3 -1
  136. package/dist/cjs/qrvey/interfaces/ITransformValueSettings.d.ts +6 -0
  137. package/dist/cjs/services/adapters/BDatasetsToUIDatasets.adapter.js +2 -0
  138. package/dist/cjs/services/adapters/BModelToUIModel.adapter.js +2 -0
  139. package/dist/cjs/services/adapters/BTimezoneToUITimezone.d.ts +8 -0
  140. package/dist/cjs/services/adapters/BTimezoneToUITimezone.js +18 -0
  141. package/dist/cjs/services/helpers/Request.d.ts +1 -1
  142. package/dist/cjs/services/helpers/Request.js +11 -5
  143. package/dist/cjs/typescript/DeepPartial.d.ts +1 -1
  144. package/dist/cjs/typescript/DeepRequired.d.ts +1 -1
  145. package/dist/cjs/typescript/ValueOf.d.ts +1 -1
  146. package/dist/column_format/interfaces/IChartGroupType.d.ts +1 -1
  147. package/dist/column_format/interfaces/IChartShelfType.d.ts +1 -1
  148. package/dist/column_format/interfaces/IChartTableType.d.ts +1 -1
  149. package/dist/column_format/interfaces/IColumnFormatReturnType.d.ts +1 -1
  150. package/dist/column_format/interfaces/IFormatStringType.d.ts +1 -1
  151. package/dist/columns/interfaces/IColumnImageUploadOption.d.ts +1 -1
  152. package/dist/columns/interfaces/IColumnPropertyType.d.ts +1 -1
  153. package/dist/columns/interfaces/IColumnType.d.ts +1 -1
  154. package/dist/columns/interfaces/IComplexColumnPropertyType.d.ts +1 -1
  155. package/dist/columns/interfaces/IComplexColumnType.d.ts +1 -1
  156. package/dist/columns/interfaces/ICompoundColumnPropertyType.d.ts +1 -1
  157. package/dist/columns/interfaces/ICompoundColumnType.d.ts +1 -1
  158. package/dist/columns/interfaces/IDateColumnPropertyType.d.ts +1 -1
  159. package/dist/columns/interfaces/INumericalColumnType.d.ts +1 -1
  160. package/dist/dates/adapters/ISOToNumericOffset.d.ts +6 -0
  161. package/dist/dates/adapters/ISOToNumericOffset.js +17 -0
  162. package/dist/dates/adapters/index.d.ts +2 -0
  163. package/dist/dates/adapters/index.js +2 -0
  164. package/dist/dates/adapters/numericOffsetToISO.d.ts +6 -0
  165. package/dist/dates/adapters/numericOffsetToISO.js +25 -0
  166. package/dist/dates/constants/ISO_8601_REGEX.d.ts +1 -0
  167. package/dist/dates/constants/ISO_8601_REGEX.js +1 -0
  168. package/dist/dates/constants/TIMEZONE_TYPE.d.ts +5 -0
  169. package/dist/dates/constants/TIMEZONE_TYPE.js +6 -0
  170. package/dist/dates/constants/index.d.ts +1 -0
  171. package/dist/dates/constants/index.js +1 -0
  172. package/dist/dates/helpers/getDateByTimezone.d.ts +8 -0
  173. package/dist/dates/helpers/getDateByTimezone.js +37 -0
  174. package/dist/dates/helpers/getDateByTimezoneOffset.d.ts +7 -0
  175. package/dist/dates/helpers/getDateByTimezoneOffset.js +18 -0
  176. package/dist/dates/helpers/getTimezoneObject.d.ts +10 -0
  177. package/dist/dates/helpers/getTimezoneObject.js +17 -0
  178. package/dist/dates/helpers/getTimezoneOffsetByType.d.ts +13 -0
  179. package/dist/dates/helpers/getTimezoneOffsetByType.js +23 -0
  180. package/dist/dates/helpers/index.d.ts +4 -1
  181. package/dist/dates/helpers/index.js +4 -1
  182. package/dist/dates/helpers/isValidISOOffset.d.ts +7 -0
  183. package/dist/dates/helpers/isValidISOOffset.js +13 -0
  184. package/dist/dates/interfaces/IBTimezone.d.ts +7 -0
  185. package/dist/dates/interfaces/IBTimezone.js +1 -0
  186. package/dist/dates/interfaces/IBTimezoneType.d.ts +2 -0
  187. package/dist/dates/interfaces/IBTimezoneType.js +1 -0
  188. package/dist/dates/interfaces/IDTimezone.d.ts +6 -0
  189. package/dist/dates/interfaces/IDTimezone.js +1 -0
  190. package/dist/dates/interfaces/IDTimezoneOffset.d.ts +1 -0
  191. package/dist/dates/interfaces/IDTimezoneOffset.js +1 -0
  192. package/dist/dates/interfaces/IDTimezoneType.d.ts +2 -0
  193. package/dist/dates/interfaces/IDTimezoneType.js +1 -0
  194. package/dist/dates/interfaces/IDateFormat.d.ts +1 -1
  195. package/dist/dates/interfaces/IDateGroupingProperty.d.ts +1 -1
  196. package/dist/dates/interfaces/IGetDateByTimezoneSettings.d.ts +6 -0
  197. package/dist/dates/interfaces/IGetDateByTimezoneSettings.js +1 -0
  198. package/dist/dates/interfaces/index.d.ts +6 -0
  199. package/dist/dates/interfaces/index.js +6 -0
  200. package/dist/dates/relative/helpers/parseDate.d.ts +2 -2
  201. package/dist/dates/relative/interfaces/IRelativeUnit.d.ts +1 -1
  202. package/dist/dates/relative/interfaces/RelativeCursor.d.ts +1 -1
  203. package/dist/dates/relative/interfaces/RelativeInput.d.ts +1 -1
  204. package/dist/dates/relative/interfaces/ui/IRelativeSectionMode.d.ts +1 -1
  205. package/dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -1
  206. package/dist/filters/helpers/common/excludeFiltersByParams.js +5 -5
  207. package/dist/filters/helpers/common/getFiltersByTimezone.d.ts +10 -0
  208. package/dist/filters/helpers/common/getFiltersByTimezone.js +22 -0
  209. package/dist/filters/helpers/common/index.d.ts +1 -0
  210. package/dist/filters/helpers/common/index.js +1 -0
  211. package/dist/filters/interfaces/IFDateProperty.d.ts +1 -1
  212. package/dist/filters/interfaces/IFDateSection.d.ts +1 -1
  213. package/dist/filters/interfaces/IFOperator.d.ts +1 -1
  214. package/dist/filters/interfaces/IFProperty.d.ts +1 -1
  215. package/dist/filters/interfaces/IFScope.d.ts +1 -1
  216. package/dist/filters/interfaces/IFSection.d.ts +1 -1
  217. package/dist/filters/interfaces/IFStructureType.d.ts +1 -1
  218. package/dist/filters/interfaces/IFValidator.d.ts +1 -1
  219. package/dist/filters/interfaces/IFValue.d.ts +1 -1
  220. package/dist/filters/interfaces/OLD_IFilterExpression.d.ts +2 -2
  221. package/dist/filters/interfaces/backend/IFBExpressionRelativeDate.d.ts +1 -1
  222. package/dist/filters/interfaces/backend/IFBExpressionValue.d.ts +1 -1
  223. package/dist/filters/interfaces/backend/IFBackendExpressionValue.d.ts +1 -1
  224. package/dist/filters/interfaces/backend/IFBackendValidator.d.ts +1 -1
  225. package/dist/filters/interfaces/common/IFSColumn.d.ts +1 -1
  226. package/dist/filters/interfaces/common/IFSGetDataValues.d.ts +1 -1
  227. package/dist/filters/interfaces/common/IFSValueRelativeDate.d.ts +1 -1
  228. package/dist/filters/interfaces/common/IFilterConfig.d.ts +1 -1
  229. package/dist/filters/interfaces/panel/IFPAction.d.ts +1 -1
  230. package/dist/filters/interfaces/settings/IFSettingsPanelView.d.ts +1 -1
  231. package/dist/filters/interfaces/settings/IFSettingsScopes.d.ts +1 -1
  232. package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
  233. package/dist/format/duration/durationFormatter.js +2 -1
  234. package/dist/format/format.d.ts +1 -1
  235. package/dist/format/format.js +10 -4
  236. package/dist/formulas/interfaces/IFormulaType.d.ts +1 -1
  237. package/dist/general/array/addPropertyToArrayOfObjects.d.ts +1 -1
  238. package/dist/general/index.d.ts +1 -0
  239. package/dist/general/index.js +1 -0
  240. package/dist/general/mix/importScripts.d.ts +2 -2
  241. package/dist/general/numeric/getSign.d.ts +6 -0
  242. package/dist/general/numeric/getSign.js +8 -0
  243. package/dist/general/numeric/index.d.ts +1 -0
  244. package/dist/general/numeric/index.js +1 -0
  245. package/dist/general/object/applyTimezoneDeep.d.ts +8 -0
  246. package/dist/general/object/applyTimezoneDeep.js +44 -0
  247. package/dist/general/object/index.d.ts +1 -0
  248. package/dist/general/object/index.js +1 -0
  249. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_FORMAT_OPTIONS.d.ts +1 -1
  250. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.d.ts +1 -1
  251. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL_OPTIONS.d.ts +1 -1
  252. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.d.ts +1 -1
  253. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_OPERATORS.d.ts +1 -1
  254. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.d.ts +1 -1
  255. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_THRESHOLD.d.ts +1 -1
  256. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_TIME_PERIOD.d.ts +1 -1
  257. package/dist/interfaces/Chart.Interface.d.ts +1 -1
  258. package/dist/interfaces/IChartBuilder.Interface.d.ts +1 -1
  259. package/dist/interfaces/Qrvey.Interface.d.ts +2 -2
  260. package/dist/interfaces/format/IFormatConfig.Interface.d.ts +1 -0
  261. package/dist/interfaces/general/IWidgetConfig.d.ts +2 -1
  262. package/dist/qrvey/helpers/transformValue.js +34 -6
  263. package/dist/qrvey/interfaces/IAppStatus.d.ts +1 -1
  264. package/dist/qrvey/interfaces/IAppType.d.ts +1 -1
  265. package/dist/qrvey/interfaces/IBDataset.d.ts +2 -0
  266. package/dist/qrvey/interfaces/IBModel.d.ts +5 -0
  267. package/dist/qrvey/interfaces/ICalculation.d.ts +1 -1
  268. package/dist/qrvey/interfaces/ICalculationType.d.ts +1 -1
  269. package/dist/qrvey/interfaces/IDataset.d.ts +3 -1
  270. package/dist/qrvey/interfaces/IModel.d.ts +3 -1
  271. package/dist/qrvey/interfaces/ITransformValueSettings.d.ts +6 -0
  272. package/dist/services/adapters/BDatasetsToUIDatasets.adapter.js +2 -0
  273. package/dist/services/adapters/BModelToUIModel.adapter.js +2 -0
  274. package/dist/services/adapters/BTimezoneToUITimezone.d.ts +8 -0
  275. package/dist/services/adapters/BTimezoneToUITimezone.js +14 -0
  276. package/dist/services/helpers/Request.d.ts +1 -1
  277. package/dist/services/helpers/Request.js +11 -5
  278. package/dist/typescript/DeepPartial.d.ts +1 -1
  279. package/dist/typescript/DeepRequired.d.ts +1 -1
  280. package/dist/typescript/ValueOf.d.ts +1 -1
  281. package/package.json +20 -19
  282. package/dist/cjs/dates/helpers/adjustTimezone.d.ts +0 -6
  283. package/dist/cjs/dates/helpers/adjustTimezone.js +0 -19
  284. package/dist/dates/helpers/adjustTimezone.d.ts +0 -6
  285. package/dist/dates/helpers/adjustTimezone.js +0 -15
@@ -1,2 +1,2 @@
1
1
  import { FILTER_PANEL_ACTION } from "../../constants/panel/FILTER_PANEL_ACTION";
2
- export declare type IFPAction = FILTER_PANEL_ACTION;
2
+ export type IFPAction = FILTER_PANEL_ACTION;
@@ -1,2 +1,2 @@
1
1
  import { FILTER_PANEL_VIEW } from "../../constants/panel/FILTER_PANEL_VIEW";
2
- export declare type IFPSettingsPanelView = FILTER_PANEL_VIEW;
2
+ export type IFPSettingsPanelView = FILTER_PANEL_VIEW;
@@ -3,6 +3,6 @@ import { IFSettingsScope } from "./IFSettingsScope";
3
3
  /**
4
4
  * Structure for a single scope settings
5
5
  */
6
- export declare type IFSettingsScopes = {
6
+ export type IFSettingsScopes = {
7
7
  [key in IFScope]?: IFSettingsScope;
8
8
  };
@@ -1,7 +1,13 @@
1
+ import { IDTimezone } from "../../../dates/interfaces/IDTimezone";
1
2
  import { II18nConfig } from "../../../globalization/interfaces/II18nConfig";
2
3
  import { II18nServiceTranslate } from "../../../globalization/interfaces/II18nServiceTranslate";
3
4
  export interface IFUTransformFilterValuesSettings {
5
+ timezone?: IDTimezone;
4
6
  translate: II18nServiceTranslate;
5
7
  i18n: II18nConfig;
6
8
  suffixTranslateLabel?: string;
9
+ noLocale?: boolean;
10
+ noTranslate?: boolean;
11
+ noSuffix?: boolean;
12
+ noTimezone?: boolean;
7
13
  }
@@ -101,7 +101,8 @@ export class DurationFormatter {
101
101
  */
102
102
  parseFormatTemplate(template) {
103
103
  this.template = isEmpty(template) ? "" : template;
104
- return (this.template.match(PARTS_REGEX) || [])
104
+ const templateParts = this.template.match(PARTS_REGEX) || [];
105
+ return templateParts
105
106
  .reduce((store, part) => {
106
107
  const config = DURATION_PARTS[part[0]];
107
108
  if (config)
@@ -1,5 +1,5 @@
1
1
  import { IFormatConfig } from "../interfaces/format/IFormatConfig.Interface";
2
- export declare function formatDate(dateString: any, format: any): any;
2
+ export declare function formatDate(dateString: any, format: any, offset: any): any;
3
3
  export declare function formatAbbreviated(num: any, decimals: any): any;
4
4
  /**
5
5
  * Set convert Bytes into MB
@@ -3,6 +3,7 @@ import dayjs from "dayjs";
3
3
  import { DATEGROUP_FORMATTING_UNSUPPORT, appliesFormatting, hasfileSizeProperty, isTextColumn, DEFAULT_DATE, } from "./definition";
4
4
  import isoWeek from "dayjs/plugin/isoWeek";
5
5
  import advancedFormat from "dayjs/plugin/advancedFormat";
6
+ import utc from "dayjs/plugin/utc";
6
7
  import { isEmpty } from "../general/mix/isEmpty";
7
8
  import { _get } from "../general/object/get";
8
9
  import { COLUMN } from "../columns/constants/COLUMN";
@@ -13,6 +14,7 @@ import { DURATION_PARTS_LIST } from "../column_format/constants/DURATION_PARTS_L
13
14
  import { cloneDeep } from "../general/object/cloneDeep";
14
15
  dayjs.extend(isoWeek); // Add support for iso week format https://github.com/iamkun/dayjs/issues/1328
15
16
  dayjs.extend(advancedFormat); // Add support to advanced formats https://day.js.org/docs/en/plugin/advanced-format
17
+ dayjs.extend(utc);
16
18
  /**
17
19
  * Apply to the given date format to a date value
18
20
  * @param bytes type number
@@ -21,7 +23,7 @@ function isValidDateString(dateString = "") {
21
23
  return (/^\d{2}\/\d{2}\/\d{4}/.test(dateString) || // MM/DD/YYY OR DD/MM/YYYY
22
24
  /^\d{4}-\d{2}-\d{2}/.test(dateString)); // YYYY-MM-DD
23
25
  }
24
- export function formatDate(dateString, format) {
26
+ export function formatDate(dateString, format, offset) {
25
27
  let _format = cloneDeep(format);
26
28
  if (isObject(format))
27
29
  _format = _format.format || "";
@@ -29,8 +31,12 @@ export function formatDate(dateString, format) {
29
31
  return dateString;
30
32
  if (!isValidDateString(dateString))
31
33
  return dateString;
32
- const dateValue = dateString === null || dateString === void 0 ? void 0 : dateString.replace(/Z$/i, "");
33
- return dayjs(dateValue.split(".")[0]).format(_format
34
+ const dateStringCleaned = dateString === null || dateString === void 0 ? void 0 : dateString.replace(/Z$/i, "");
35
+ const firstPartOfDateString = dayjs(dateStringCleaned.split(".")[0]);
36
+ const newDateValue = !isEmpty(offset)
37
+ ? firstPartOfDateString.utcOffset(offset)
38
+ : firstPartOfDateString;
39
+ return newDateValue.format(_format
34
40
  .replace("HH24:", "HH:")
35
41
  .replace("MI:SS", "mm:ss")
36
42
  .replace("MM:SS", "mm:ss"));
@@ -135,7 +141,7 @@ export const addFormat = (value, outputFormat = "None", config) => {
135
141
  : formatDate(value, (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === "Default" &&
136
142
  ((_c = outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.originalFormat) === null || _c === void 0 ? void 0 : _c.format)
137
143
  ? (_d = outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.originalFormat) === null || _d === void 0 ? void 0 : _d.format
138
- : outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format);
144
+ : outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format, config === null || config === void 0 ? void 0 : config.offset);
139
145
  case "NUMERIC": {
140
146
  const parse = parseFloat(value);
141
147
  const withLocale = (outputFormat !== "None" && (config === null || config === void 0 ? void 0 : config.lang)) ||
@@ -1,2 +1,2 @@
1
1
  import { FORMULA } from "../constants/FORMULA";
2
- export declare type IFormulaType = FORMULA;
2
+ export type IFormulaType = FORMULA;
@@ -14,7 +14,7 @@
14
14
  * @returns the new array created.
15
15
  */
16
16
  export declare function addPropertyToArrayOfObjects(obj: AddPropertyToArrayOfObjectsParams): any[];
17
- declare type AddPropertyToArrayOfObjectsParams = {
17
+ type AddPropertyToArrayOfObjectsParams = {
18
18
  array: any[];
19
19
  property: string;
20
20
  value: any;
@@ -1,5 +1,6 @@
1
1
  export * from "./array/index";
2
2
  export * from "./function/index";
3
3
  export * from "./mix/index";
4
+ export * from "./numeric/index";
4
5
  export * from "./object/index";
5
6
  export * from "./string/index";
@@ -1,5 +1,6 @@
1
1
  export * from "./array/index";
2
2
  export * from "./function/index";
3
3
  export * from "./mix/index";
4
+ export * from "./numeric/index";
4
5
  export * from "./object/index";
5
6
  export * from "./string/index";
@@ -49,5 +49,5 @@ export interface IScriptItem {
49
49
  noModule?: boolean;
50
50
  type?: string;
51
51
  }
52
- export declare type TScriptItem = string | IScriptItem;
53
- export declare type TScriptType = "text/javascript" | "module" | string;
52
+ export type TScriptItem = string | IScriptItem;
53
+ export type TScriptType = "text/javascript" | "module" | string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Gets the numeric sign of a given number
3
+ * @param {number} num the number
4
+ * @returns {string} an string with the sign
5
+ */
6
+ export declare function getSign(num: number): string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Gets the numeric sign of a given number
3
+ * @param {number} num the number
4
+ * @returns {string} an string with the sign
5
+ */
6
+ export function getSign(num) {
7
+ return Math.sign(num) > -1 ? "+" : "-";
8
+ }
@@ -0,0 +1 @@
1
+ export * from "./getSign";
@@ -0,0 +1 @@
1
+ export * from "./getSign";
@@ -0,0 +1,8 @@
1
+ import { IDTimezone } from "../../dates/interfaces/IDTimezone";
2
+ /**
3
+ * Transforms the date+times propertiesof the given object by the Timezone object
4
+ * @param {any} obj the object
5
+ * @param {IDTimezone} timezone the timezone object
6
+ * @returns {IFSData | IFUData} the new filter data with the transformed datetime values
7
+ */
8
+ export declare function applyTimezoneDeep(obj: any, timezone: IDTimezone): any;
@@ -0,0 +1,44 @@
1
+ import { DATE_FORMAT } from "../../dates/constants/DATE_FORMAT";
2
+ import { DATE_GROUPING_TIME_PROPERTY } from "../../dates/constants/DATE_GROUPING_TIME_PROPERTY";
3
+ import { getDateByTimezone } from "../../dates/helpers/getDateByTimezone";
4
+ import { validateDate } from "../../dates/helpers/validateDate";
5
+ import { isEmpty } from "../mix/isEmpty";
6
+ import { isObject } from "./isObject";
7
+ /**
8
+ * Transforms the date+times propertiesof the given object by the Timezone object
9
+ * @param {any} obj the object
10
+ * @param {IDTimezone} timezone the timezone object
11
+ * @returns {IFSData | IFUData} the new filter data with the transformed datetime values
12
+ */
13
+ export function applyTimezoneDeep(obj, timezone) {
14
+ if (isEmpty(obj))
15
+ return obj;
16
+ let result;
17
+ if (isObject(obj)) {
18
+ result = {};
19
+ }
20
+ else if (Array.isArray(obj)) {
21
+ result = [];
22
+ }
23
+ try {
24
+ for (const i in obj) {
25
+ if (isObject(obj[i]) || Array.isArray(obj[i])) {
26
+ result[i] = applyTimezoneDeep(obj[i], timezone);
27
+ }
28
+ else if (obj[i] instanceof Date ||
29
+ validateDate(obj[i], DATE_FORMAT.HOUR)) {
30
+ result[i] = getDateByTimezone(obj[i], {
31
+ property: DATE_GROUPING_TIME_PROPERTY.HOUR,
32
+ timezone,
33
+ });
34
+ }
35
+ else {
36
+ result[i] = obj[i];
37
+ }
38
+ }
39
+ return result;
40
+ }
41
+ catch (_a) {
42
+ return obj;
43
+ }
44
+ }
@@ -1,3 +1,4 @@
1
+ export * from "./applyTimezoneDeep";
1
2
  export * from "./cloneDeep";
2
3
  export * from "./get";
3
4
  export * from "./getAttribute";
@@ -1,3 +1,4 @@
1
+ export * from "./applyTimezoneDeep";
1
2
  export * from "./cloneDeep";
2
3
  export * from "./get";
3
4
  export * from "./getAttribute";
@@ -1,4 +1,4 @@
1
1
  import { II18nChartBuilder } from "../../interfaces/chart_builder/II18nChartBuilder";
2
- declare type FormatOptions = "small_multiples" | "conditional_formatting";
2
+ type FormatOptions = "small_multiples" | "conditional_formatting";
3
3
  export declare const I18N_CHART_BUILDER_FORMAT_OPTIONS: Pick<II18nChartBuilder, FormatOptions>;
4
4
  export {};
@@ -1,4 +1,4 @@
1
1
  import { II18nChartBuilder } from "../../interfaces/chart_builder/II18nChartBuilder";
2
- declare type General = "nav_panel" | "save_dialog" | "save_incomplete_dialog" | "leave_dialog" | "custom_format_dialog" | "data_panel" | "dimensions" | "shelf_menu" | "scale_types" | "trend_chart" | "chart_info" | "dnd_zone" | "chart_labels" | "action_panel" | "messages_general" | "messages_default" | "messages_crosstab" | "messages_table_chart" | "messages_missing_default" | "messages_ms" | "messages_pie" | "messages_min_max" | "messages_metric" | "messages_heatmap" | "messages_geo" | "messages_geo_bubble" | "messages_box_whiskers" | "messages_combined";
2
+ type General = "nav_panel" | "save_dialog" | "save_incomplete_dialog" | "leave_dialog" | "custom_format_dialog" | "data_panel" | "dimensions" | "shelf_menu" | "scale_types" | "trend_chart" | "chart_info" | "dnd_zone" | "chart_labels" | "action_panel" | "messages_general" | "messages_default" | "messages_crosstab" | "messages_table_chart" | "messages_missing_default" | "messages_ms" | "messages_pie" | "messages_min_max" | "messages_metric" | "messages_heatmap" | "messages_geo" | "messages_geo_bubble" | "messages_box_whiskers" | "messages_combined";
3
3
  export declare const I18N_CHART_BUILDER_GENERAL: Pick<II18nChartBuilder, General>;
4
4
  export {};
@@ -1,4 +1,4 @@
1
1
  import { II18nChartBuilder } from "../../interfaces/chart_builder/II18nChartBuilder";
2
- declare type GeneralOptions = "aggregated_formula" | "general_options" | "totals" | "legends" | "menu_actions" | "sorting" | "table_calculations" | "tooltip_settings";
2
+ type GeneralOptions = "aggregated_formula" | "general_options" | "totals" | "legends" | "menu_actions" | "sorting" | "table_calculations" | "tooltip_settings";
3
3
  export declare const I18N_CHART_BUILDER_GENERAL_OPTIONS: Pick<II18nChartBuilder, GeneralOptions>;
4
4
  export {};
@@ -1,4 +1,4 @@
1
1
  import { II18nChartBuilder } from "../../interfaces/chart_builder/II18nChartBuilder";
2
- declare type LayerOptions = "trends_line" | "references_line";
2
+ type LayerOptions = "trends_line" | "references_line";
3
3
  export declare const I18N_CHART_BUILDER_LAYER_OPTIONS: Pick<II18nChartBuilder, LayerOptions>;
4
4
  export {};
@@ -1,4 +1,4 @@
1
1
  import { II18nChartBuilder } from "../../interfaces/chart_builder/II18nChartBuilder";
2
- declare type Operators = "operators";
2
+ type Operators = "operators";
3
3
  export declare const I18N_CHART_BUILDER_OPERATORS: Pick<II18nChartBuilder, Operators>;
4
4
  export {};
@@ -1,4 +1,4 @@
1
1
  import { II18nChartBuilder } from "../../interfaces/chart_builder/II18nChartBuilder";
2
- declare type StyleOptions = "style_options" | "color_settings" | "color_by_values" | "chart_orientation" | "axis_style" | "bar_types" | "line_style_options" | "symbol_style_options" | "chart_mode" | "category_labels" | "font_options" | "circle_size" | "gauge_style" | "target_config" | "table_header" | "table_body" | "resize_rows" | "custom_scale" | "gaps_options" | "base_map" | "map_region" | "table_style_options";
2
+ type StyleOptions = "style_options" | "color_settings" | "color_by_values" | "chart_orientation" | "axis_style" | "bar_types" | "line_style_options" | "symbol_style_options" | "chart_mode" | "category_labels" | "font_options" | "circle_size" | "gauge_style" | "target_config" | "table_header" | "table_body" | "resize_rows" | "custom_scale" | "gaps_options" | "base_map" | "map_region" | "table_style_options";
3
3
  export declare const I18N_CHART_BUILDER_STYLE_OPTIONS: Pick<II18nChartBuilder, StyleOptions>;
4
4
  export {};
@@ -1,4 +1,4 @@
1
1
  import { II18nChartBuilder } from "../../interfaces/chart_builder/II18nChartBuilder";
2
- declare type Threshold = "threshold";
2
+ type Threshold = "threshold";
3
3
  export declare const I18N_CHART_BUILDER_THRESHOLD: Pick<II18nChartBuilder, Threshold>;
4
4
  export {};
@@ -1,4 +1,4 @@
1
1
  import { II18nChartBuilder } from "../../interfaces/chart_builder/II18nChartBuilder";
2
- declare type TimePeriod = "time_period" | "time_period_custom_range";
2
+ type TimePeriod = "time_period" | "time_period_custom_range";
3
3
  export declare const I18N_CHART_BUILDER_TIME_PERIOD: Pick<II18nChartBuilder, TimePeriod>;
4
4
  export {};
@@ -1,2 +1,2 @@
1
1
  import { CHART_TYPE } from "../constants/Charts.Const";
2
- export declare type ChartType = CHART_TYPE;
2
+ export type ChartType = CHART_TYPE;
@@ -26,7 +26,7 @@ export declare enum TIME_PERIOD {
26
26
  ALL_HISTORY = "ALL_HISTORY",
27
27
  CUSTOM_RANGE = "CUSTOM_RANGE"
28
28
  }
29
- export declare type TimePeriod = TIME_PERIOD;
29
+ export type TimePeriod = TIME_PERIOD;
30
30
  export declare enum TP_CUSTOM_RANGE {
31
31
  BEFORE = "BEFORE",
32
32
  AFTER = "AFTER",
@@ -7,5 +7,5 @@ export interface IColumnCalculation {
7
7
  type: string;
8
8
  value: IColumnCalculationLabel;
9
9
  }
10
- export declare type IColumnCalculationLabel = CALCULATION_LABEL;
11
- export declare type IColumnCalculationAbbreviation = CALCULATION_ABBREVIATION;
10
+ export type IColumnCalculationLabel = CALCULATION_LABEL;
11
+ export type IColumnCalculationAbbreviation = CALCULATION_ABBREVIATION;
@@ -1,5 +1,6 @@
1
1
  export interface IFormatConfig {
2
2
  lang?: string;
3
+ offset?: number;
3
4
  options?: object;
4
5
  isMultiplied?: boolean;
5
6
  }
@@ -1,3 +1,4 @@
1
+ import { IDTimezone } from "../../dates/interfaces/IDTimezone";
1
2
  import { II18nConfig } from "../../globalization/interfaces/II18nConfig";
2
3
  export interface IWidgetConfig {
3
4
  appid?: string;
@@ -5,6 +6,6 @@ export interface IWidgetConfig {
5
6
  domain: string;
6
7
  i18n?: II18nConfig;
7
8
  qv_token?: string;
8
- timezoneControl?: string;
9
+ timezone?: IDTimezone;
9
10
  userid?: string;
10
11
  }
@@ -7,6 +7,7 @@ import { addFormat } from "../../format/format";
7
7
  import { isEmpty } from "../../general/mix/isEmpty";
8
8
  import { getI18nDateGroupLabel } from "../../globalization/helpers/getI18nDateGroupLabel";
9
9
  import { getValueWithSuffixes } from "./getValueWithSuffixes";
10
+ import { getDateByTimezone } from "../../dates/helpers/getDateByTimezone";
10
11
  /**
11
12
  * Transforms a value depending of localization/globalization and extras settings.
12
13
  * @param value A value to transform
@@ -16,12 +17,39 @@ import { getValueWithSuffixes } from "./getValueWithSuffixes";
16
17
  export function transformValue(value, settings) {
17
18
  if (isEmpty(value))
18
19
  return value;
19
- const valueWithI18n = getI18nDateGroupLabel(value, settings.property, settings.translate);
20
- const valueWithLocalization = addFormat(valueWithI18n, getOutputFormat(settings), getFormatConfig(settings));
21
- return getValueWithSuffixes(valueWithLocalization, {
22
- suffixTranslateLabel: settings.suffixTranslateLabel,
23
- translate: settings.translate,
24
- });
20
+ const defaultSettings = getDefaultSettings(settings);
21
+ let timezonedValue = value;
22
+ if (!defaultSettings.noTimezone) {
23
+ timezonedValue = getDateByTimezone(value, {
24
+ property: defaultSettings.property,
25
+ timezone: defaultSettings.timezone,
26
+ });
27
+ }
28
+ let valueWithI18n = timezonedValue;
29
+ if (!defaultSettings.noTranslate) {
30
+ valueWithI18n = getI18nDateGroupLabel(timezonedValue, defaultSettings.property, defaultSettings.translate);
31
+ }
32
+ let valueWithLocalization = valueWithI18n;
33
+ if (!defaultSettings.noLocale) {
34
+ valueWithLocalization = addFormat(valueWithI18n, getOutputFormat(settings), getFormatConfig(settings));
35
+ }
36
+ let valueWithSuffix = valueWithI18n;
37
+ if (!defaultSettings.noSuffix) {
38
+ valueWithSuffix = getValueWithSuffixes(valueWithLocalization, {
39
+ suffixTranslateLabel: defaultSettings.suffixTranslateLabel,
40
+ translate: defaultSettings.translate,
41
+ });
42
+ }
43
+ return valueWithSuffix;
44
+ }
45
+ /**
46
+ * Gets the default settings properties
47
+ * @param {ITransformValueSettings} settings the given settings
48
+ * @returns {ITransformValueSettings} the settings with default properties
49
+ */
50
+ function getDefaultSettings(settings) {
51
+ var _a, _b, _c, _d;
52
+ return Object.assign(Object.assign({}, settings), { noLocale: (_a = settings === null || settings === void 0 ? void 0 : settings.noLocale) !== null && _a !== void 0 ? _a : false, noSuffix: (_b = settings === null || settings === void 0 ? void 0 : settings.noSuffix) !== null && _b !== void 0 ? _b : false, noTimezone: (_c = settings === null || settings === void 0 ? void 0 : settings.noTimezone) !== null && _c !== void 0 ? _c : false, noTranslate: (_d = settings === null || settings === void 0 ? void 0 : settings.noTranslate) !== null && _d !== void 0 ? _d : false });
25
53
  }
26
54
  /**
27
55
  * Gets the outputformat settings
@@ -1,2 +1,2 @@
1
1
  import { APP_STATUS } from "../constants/APP_STATUS";
2
- export declare type IAppStatus = APP_STATUS;
2
+ export type IAppStatus = APP_STATUS;
@@ -1,2 +1,2 @@
1
1
  import { APP_TYPE } from "../constants/APP_TYPE";
2
- export declare type IAppType = APP_TYPE;
2
+ export type IAppType = APP_TYPE;
@@ -1,4 +1,5 @@
1
1
  import { IBColumn } from "../../columns/interfaces/IBColumn";
2
+ import { IBTimezone } from "../../dates/interfaces/IBTimezone";
2
3
  /**
3
4
  * Structure for Dataset in the frontend side of Qrvey App
4
5
  */
@@ -7,4 +8,5 @@ export interface IBDataset {
7
8
  name?: string;
8
9
  options?: IBColumn[];
9
10
  qrveyid: string;
11
+ timezone?: IBTimezone;
10
12
  }
@@ -2,11 +2,15 @@ import { IAppStatus } from "./IAppStatus";
2
2
  import { IBModelBranchesMap } from "./IBModelBranchesMap";
3
3
  import { IBModelData } from "./IBModelData";
4
4
  import { IAppType } from "./IAppType";
5
+ import { IBTimezone } from "../../dates/interfaces/IBTimezone";
5
6
  export interface IBModel {
6
7
  appType: IAppType;
7
8
  appid: string;
8
9
  branchesMap?: IBModelBranchesMap[];
9
10
  createDate: string;
11
+ /**
12
+ * @deprecated Data Link feature is not longer supported
13
+ */
10
14
  datalinkInfo?: any[];
11
15
  geoGroups?: any[];
12
16
  modifyDate: string;
@@ -16,5 +20,6 @@ export interface IBModel {
16
20
  questionOrder: string[];
17
21
  questions: IBModelData;
18
22
  status: IAppStatus;
23
+ timezone: IBTimezone;
19
24
  userid: string;
20
25
  }
@@ -1,2 +1,2 @@
1
1
  import { CALCULATION } from "../constants/CALCULATION";
2
- export declare type ICalculation = CALCULATION;
2
+ export type ICalculation = CALCULATION;
@@ -1,2 +1,2 @@
1
1
  import { CALCULATION } from "../constants/CALCULATION";
2
- export declare type IColumnCalculationType = typeof CALCULATION[keyof typeof CALCULATION];
2
+ export type IColumnCalculationType = (typeof CALCULATION)[keyof typeof CALCULATION];
@@ -1,9 +1,11 @@
1
1
  import { IColumn } from "../../columns/interfaces/IColumn";
2
+ import { IDTimezone } from "../../dates/interfaces/IDTimezone";
2
3
  import { IBDataset } from "./IBDataset";
3
4
  /**
4
5
  * Structure for Dataset in the frontend side of Qrvey App
5
6
  */
6
- export interface IDataset extends Omit<IBDataset, "name" | "options"> {
7
+ export interface IDataset extends Omit<IBDataset, "name" | "options" | "timezone"> {
7
8
  label?: string;
8
9
  options?: IColumn[];
10
+ timezone?: IDTimezone;
9
11
  }
@@ -1,10 +1,12 @@
1
1
  import { IColumn } from "../../columns/interfaces/IColumn";
2
+ import { IDTimezone } from "../../dates/interfaces/IDTimezone";
2
3
  import { IBModel } from "./IBModel";
3
4
  import { IModelBranchesMap } from "./IModelBranchesMap";
4
- export interface IModel extends Omit<IBModel, "questions" | "branchesMap" | "name" | "numResponses" | "questionOrder"> {
5
+ export interface IModel extends Omit<IBModel, "questions" | "branchesMap" | "name" | "numResponses" | "questionOrder" | "timezone"> {
5
6
  columns: IColumn[];
6
7
  columnOrder: string[];
7
8
  branchesMap: IModelBranchesMap[];
8
9
  label: string;
10
+ timezone: IDTimezone;
9
11
  totalRecords: number;
10
12
  }
@@ -1,11 +1,17 @@
1
1
  import { IColumn } from "../../columns/interfaces/IColumn";
2
2
  import { IColumnPropertyType } from "../../columns/interfaces/IColumnPropertyType";
3
+ import { IDTimezone } from "../../dates/interfaces/IDTimezone";
3
4
  import { II18nConfig } from "../../globalization/interfaces/II18nConfig";
4
5
  import { II18nServiceTranslate } from "../../globalization/interfaces/II18nServiceTranslate";
5
6
  export interface ITransformValueSettings {
6
7
  column: IColumn;
7
8
  property: IColumnPropertyType;
9
+ timezone?: IDTimezone;
8
10
  translate: II18nServiceTranslate;
9
11
  i18n: II18nConfig;
10
12
  suffixTranslateLabel?: string;
13
+ noLocale?: boolean;
14
+ noTranslate?: boolean;
15
+ noSuffix?: boolean;
16
+ noTimezone?: boolean;
11
17
  }
@@ -1,9 +1,11 @@
1
1
  import { getAttribute } from "../../general/object/getAttribute";
2
2
  import { BColumnsToUIColumns } from "./BColumnsToUIColumns.adapter";
3
+ import { BTimezoneToUITimezone } from "./BTimezoneToUITimezone";
3
4
  export function BDatasetsToUIDatasets(datasets = []) {
4
5
  return datasets.map((dataset) => ({
5
6
  qrveyid: getAttribute(dataset, "qrvey_id"),
6
7
  label: dataset.name,
7
8
  options: BColumnsToUIColumns(dataset.options, dataset),
9
+ timezone: BTimezoneToUITimezone(dataset.timezone),
8
10
  }));
9
11
  }
@@ -1,6 +1,7 @@
1
1
  import { isEmpty } from "../../general/mix/isEmpty";
2
2
  import { BBranchesMapToUIBranchesMap } from "./BBranchesMapToUIBranchesMap.adapter";
3
3
  import { BColumnsToUIColumns } from "./BColumnsToUIColumns.adapter";
4
+ import { BTimezoneToUITimezone } from "./BTimezoneToUITimezone";
4
5
  export function BModelToUIModel(model) {
5
6
  if (isEmpty(model))
6
7
  return;
@@ -20,6 +21,7 @@ export function BModelToUIModel(model) {
20
21
  totalRecords: model.numResponses,
21
22
  qrveyid: model.qrveyid,
22
23
  status: model.status,
24
+ timezone: BTimezoneToUITimezone(model.timezone),
23
25
  userid: model.userid,
24
26
  };
25
27
  }
@@ -0,0 +1,8 @@
1
+ import { IDTimezone } from "../../dates/interfaces/IDTimezone";
2
+ import { IBTimezone } from "../../dates/interfaces/IBTimezone";
3
+ /**
4
+ * Transforms the backenc timezone structure to UI timezone structure
5
+ * @param {IBTimezone} timezone the backend timezone object
6
+ * @returns {IDTimezone} the UI timezone object
7
+ */
8
+ export declare function BTimezoneToUITimezone(timezone: IBTimezone): IDTimezone;
@@ -0,0 +1,14 @@
1
+ import { TIMEZONE_TYPE } from "../../dates/constants/TIMEZONE_TYPE";
2
+ import { getTimezoneOffsetByType } from "../../dates/helpers/getTimezoneOffsetByType";
3
+ /**
4
+ * Transforms the backenc timezone structure to UI timezone structure
5
+ * @param {IBTimezone} timezone the backend timezone object
6
+ * @returns {IDTimezone} the UI timezone object
7
+ */
8
+ export function BTimezoneToUITimezone(timezone) {
9
+ const type = (timezone === null || timezone === void 0 ? void 0 : timezone.type) || TIMEZONE_TYPE.DEFAULT;
10
+ return {
11
+ type,
12
+ offset: getTimezoneOffsetByType(Object.assign(Object.assign({}, timezone), { type })),
13
+ };
14
+ }
@@ -2,7 +2,7 @@ export default class Request {
2
2
  static checkStatus(response: any): Promise<any>;
3
3
  static hasQvToken(config: any): boolean;
4
4
  static getQvToken(config: any): any;
5
- static getTimezoneControl(config: any): any;
5
+ static getTimezoneOffset(config: any): string;
6
6
  static hasApiKey(config: any): boolean;
7
7
  static getApiKey(config: any): any;
8
8
  static makeUrl(config: any, url: any, params?: any): string;
@@ -7,6 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ import { numericOffsetToISO } from "../../dates/adapters/numericOffsetToISO";
11
+ import { isEmpty } from "../../general/mix/isEmpty";
10
12
  import { getAttribute } from "../../general/object/getAttribute";
11
13
  import { serialize } from "../../general/object/serialize";
12
14
  import { parseUrl } from "../../general/string/parseUrl";
@@ -24,8 +26,12 @@ export default class Request {
24
26
  static getQvToken(config) {
25
27
  return getAttribute(config, "qv_token");
26
28
  }
27
- static getTimezoneControl(config) {
28
- return getAttribute(config, "timezone_control");
29
+ static getTimezoneOffset(config) {
30
+ var _a;
31
+ const timezoneOffset = (_a = config.timezone) === null || _a === void 0 ? void 0 : _a.offset;
32
+ if (!isEmpty(timezoneOffset)) {
33
+ return numericOffsetToISO(timezoneOffset);
34
+ }
29
35
  }
30
36
  static hasApiKey(config) {
31
37
  return !!this.getApiKey(config);
@@ -68,9 +74,9 @@ export default class Request {
68
74
  cfg.credentials = "include";
69
75
  }
70
76
  }
71
- const timezoneControl = this.getTimezoneControl(reqData.config);
72
- if (timezoneControl) {
73
- cfg.headers["q-timezone-control"] = `offset=${timezoneControl};use-client-offset-only`;
77
+ const timezoneOffset = this.getTimezoneOffset(reqData.config);
78
+ if (timezoneOffset) {
79
+ cfg.headers["q-timezone-control"] = `offset=${timezoneOffset}`;
74
80
  }
75
81
  // AbortSignal (https://developers.google.com/web/updates/2017/09/abortable-fetch)
76
82
  if (reqData.config && reqData.config.signal) {
@@ -1,3 +1,3 @@
1
- export declare type DeepPartial<T> = T extends Function ? T : T extends object ? {
1
+ export type DeepPartial<T> = T extends Function ? T : T extends object ? {
2
2
  [P in keyof T]?: DeepPartial<T[P]>;
3
3
  } : T;
@@ -1,3 +1,3 @@
1
- export declare type DeepRequired<T> = {
1
+ export type DeepRequired<T> = {
2
2
  [P in keyof T]: T[P] extends object ? DeepRequired<T[P]> : T[P];
3
3
  };
@@ -1 +1 @@
1
- export declare type ValueOf<T> = T[keyof T];
1
+ export type ValueOf<T> = T[keyof T];