@qrvey/utils 1.11.0-1 → 1.11.0-1-features-0

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 (259) hide show
  1. package/dist/cjs/columns/helpers/index.d.ts +1 -0
  2. package/dist/cjs/columns/helpers/index.js +1 -0
  3. package/dist/cjs/columns/helpers/isDurationColumn.d.ts +7 -0
  4. package/dist/cjs/columns/helpers/isDurationColumn.js +18 -0
  5. package/dist/cjs/columns/interfaces/IColumnPropertyType.d.ts +2 -1
  6. package/dist/cjs/dates/helpers/getTimezoneObject.js +1 -1
  7. package/dist/cjs/filters/adapters/FDToFlatUI.js +2 -1
  8. package/dist/cjs/filters/adapters/UIToOldLogic.js +1 -0
  9. package/dist/cjs/filters/adapters/logicToFlatUI.js +4 -4
  10. package/dist/cjs/filters/constants/settings/FILTER_SETTINGS_DEFAULT.js +2 -0
  11. package/dist/cjs/filters/helpers/backend/getBackendValues.js +3 -1
  12. package/dist/cjs/filters/helpers/common/adaptTimeUnitValuesFromFilters.d.ts +11 -0
  13. package/dist/cjs/filters/helpers/common/adaptTimeUnitValuesFromFilters.js +29 -0
  14. package/dist/cjs/filters/helpers/common/index.d.ts +1 -0
  15. package/dist/cjs/filters/helpers/common/index.js +1 -0
  16. package/dist/cjs/filters/helpers/common/resolveDatasetConditions.js +5 -0
  17. package/dist/cjs/filters/helpers/common/resolveFilterConditions.js +5 -0
  18. package/dist/cjs/filters/helpers/common/resolveScopeConditions.js +5 -0
  19. package/dist/cjs/filters/interfaces/OLD_IFilterDetail.d.ts +4 -0
  20. package/dist/cjs/filters/interfaces/builder/IFilterBuilderSettings.d.ts +5 -0
  21. package/dist/cjs/filters/interfaces/common/IFSParamsToGetFilter.d.ts +2 -0
  22. package/dist/cjs/filters/interfaces/common/IFSParamsToGetFilterDisplayeds.d.ts +9 -0
  23. package/dist/cjs/filters/interfaces/common/IFSParamsToGetFilterDisplayeds.js +2 -0
  24. package/dist/cjs/filters/interfaces/common/index.d.ts +1 -0
  25. package/dist/cjs/filters/interfaces/common/index.js +1 -0
  26. package/dist/cjs/filters/interfaces/settings/IFSettingsFilterBuilder.d.ts +1 -0
  27. package/dist/cjs/filters/interfaces/settings/IFSettingsFilterPanel.d.ts +1 -0
  28. package/dist/cjs/format/definition.d.ts +1 -0
  29. package/dist/cjs/format/definition.js +2 -1
  30. package/dist/cjs/format/duration/convertTimeUnit.d.ts +15 -0
  31. package/dist/cjs/format/duration/convertTimeUnit.js +34 -0
  32. package/dist/cjs/format/duration/index.d.ts +1 -0
  33. package/dist/cjs/format/duration/index.js +1 -0
  34. package/dist/cjs/globalization/interfaces/common/I18nTimeUnitProperties.d.ts +10 -0
  35. package/dist/cjs/globalization/interfaces/common/I18nTimeUnitProperties.js +2 -0
  36. package/dist/cjs/globalization/interfaces/common/II18nCommon.d.ts +2 -0
  37. package/dist/cjs/globalization/interfaces/common/index.d.ts +1 -0
  38. package/dist/cjs/globalization/interfaces/common/index.js +1 -0
  39. package/dist/cjs/globalization/interfaces/tabular_view/II18nTabularView.d.ts +1 -0
  40. package/dist/cjs/globalization/labels/common/I18N_COMMON.js +2 -0
  41. package/dist/cjs/globalization/labels/common/I18N_TIME_UNITS.d.ts +2 -0
  42. package/dist/cjs/globalization/labels/common/I18N_TIME_UNITS.js +14 -0
  43. package/dist/cjs/globalization/labels/tabular_view/I18N_TABULAR_VIEW.js +1 -0
  44. package/dist/cjs/index.d.ts +1 -0
  45. package/dist/cjs/index.js +1 -0
  46. package/dist/cjs/qrvey/helpers/getPropertyLabel.d.ts +7 -0
  47. package/dist/cjs/qrvey/helpers/getPropertyLabel.js +14 -3
  48. package/dist/cjs/time/adapters/adaptTimeUnitNumbers.d.ts +9 -0
  49. package/dist/cjs/time/adapters/adaptTimeUnitNumbers.js +204 -0
  50. package/dist/cjs/time/adapters/daysToHours.d.ts +6 -0
  51. package/dist/cjs/time/adapters/daysToHours.js +22 -0
  52. package/dist/cjs/time/adapters/daysToMinutes.d.ts +6 -0
  53. package/dist/cjs/time/adapters/daysToMinutes.js +22 -0
  54. package/dist/cjs/time/adapters/daysToMonths.d.ts +6 -0
  55. package/dist/cjs/time/adapters/daysToMonths.js +22 -0
  56. package/dist/cjs/time/adapters/daysToSeconds.d.ts +6 -0
  57. package/dist/cjs/time/adapters/daysToSeconds.js +22 -0
  58. package/dist/cjs/time/adapters/daysToYears.d.ts +6 -0
  59. package/dist/cjs/time/adapters/daysToYears.js +22 -0
  60. package/dist/cjs/time/adapters/hoursToDays.d.ts +6 -0
  61. package/dist/cjs/time/adapters/hoursToDays.js +22 -0
  62. package/dist/cjs/time/adapters/hoursToMinutes.d.ts +6 -0
  63. package/dist/cjs/time/adapters/hoursToMinutes.js +22 -0
  64. package/dist/cjs/time/adapters/hoursToMonths.d.ts +6 -0
  65. package/dist/cjs/time/adapters/hoursToMonths.js +22 -0
  66. package/dist/cjs/time/adapters/hoursToSeconds.d.ts +6 -0
  67. package/dist/cjs/time/adapters/hoursToSeconds.js +22 -0
  68. package/dist/cjs/time/adapters/hoursToYears.d.ts +6 -0
  69. package/dist/cjs/time/adapters/hoursToYears.js +22 -0
  70. package/dist/cjs/time/adapters/index.d.ts +31 -0
  71. package/dist/cjs/time/adapters/index.js +47 -0
  72. package/dist/cjs/time/adapters/minutesToDays.d.ts +6 -0
  73. package/dist/cjs/time/adapters/minutesToDays.js +22 -0
  74. package/dist/cjs/time/adapters/minutesToHours.d.ts +6 -0
  75. package/dist/cjs/time/adapters/minutesToHours.js +22 -0
  76. package/dist/cjs/time/adapters/minutesToMonths.d.ts +6 -0
  77. package/dist/cjs/time/adapters/minutesToMonths.js +22 -0
  78. package/dist/cjs/time/adapters/minutesToSeconds.d.ts +6 -0
  79. package/dist/cjs/time/adapters/minutesToSeconds.js +22 -0
  80. package/dist/cjs/time/adapters/minutesToYears.d.ts +6 -0
  81. package/dist/cjs/time/adapters/minutesToYears.js +22 -0
  82. package/dist/cjs/time/adapters/monthsToDays.d.ts +6 -0
  83. package/dist/cjs/time/adapters/monthsToDays.js +22 -0
  84. package/dist/cjs/time/adapters/monthsToHours.d.ts +6 -0
  85. package/dist/cjs/time/adapters/monthsToHours.js +22 -0
  86. package/dist/cjs/time/adapters/monthsToMinutes.d.ts +6 -0
  87. package/dist/cjs/time/adapters/monthsToMinutes.js +22 -0
  88. package/dist/cjs/time/adapters/monthsToSeconds.d.ts +6 -0
  89. package/dist/cjs/time/adapters/monthsToSeconds.js +22 -0
  90. package/dist/cjs/time/adapters/monthsToYears.d.ts +6 -0
  91. package/dist/cjs/time/adapters/monthsToYears.js +22 -0
  92. package/dist/cjs/time/adapters/secondsToDays.d.ts +6 -0
  93. package/dist/cjs/time/adapters/secondsToDays.js +22 -0
  94. package/dist/cjs/time/adapters/secondsToHours.d.ts +6 -0
  95. package/dist/cjs/time/adapters/secondsToHours.js +22 -0
  96. package/dist/cjs/time/adapters/secondsToMinutes.d.ts +6 -0
  97. package/dist/cjs/time/adapters/secondsToMinutes.js +22 -0
  98. package/dist/cjs/time/adapters/secondsToMonths.d.ts +6 -0
  99. package/dist/cjs/time/adapters/secondsToMonths.js +22 -0
  100. package/dist/cjs/time/adapters/secondsToYears.d.ts +6 -0
  101. package/dist/cjs/time/adapters/secondsToYears.js +22 -0
  102. package/dist/cjs/time/adapters/yearsToDays.d.ts +6 -0
  103. package/dist/cjs/time/adapters/yearsToDays.js +22 -0
  104. package/dist/cjs/time/adapters/yearsToHours.d.ts +6 -0
  105. package/dist/cjs/time/adapters/yearsToHours.js +22 -0
  106. package/dist/cjs/time/adapters/yearsToMinutes.d.ts +6 -0
  107. package/dist/cjs/time/adapters/yearsToMinutes.js +22 -0
  108. package/dist/cjs/time/adapters/yearsToMonths.d.ts +6 -0
  109. package/dist/cjs/time/adapters/yearsToMonths.js +22 -0
  110. package/dist/cjs/time/adapters/yearsToSeconds.d.ts +6 -0
  111. package/dist/cjs/time/adapters/yearsToSeconds.js +22 -0
  112. package/dist/cjs/time/constants/TIME_UNIT_INFO.d.ts +5 -0
  113. package/dist/cjs/time/constants/TIME_UNIT_INFO.js +55 -0
  114. package/dist/cjs/time/constants/TIME_UNIT_INFO_LIST.d.ts +2 -0
  115. package/dist/cjs/time/constants/TIME_UNIT_INFO_LIST.js +13 -0
  116. package/dist/cjs/time/constants/TIME_UNIT_PROPERTY.d.ts +8 -0
  117. package/dist/cjs/time/constants/TIME_UNIT_PROPERTY.js +12 -0
  118. package/dist/cjs/time/constants/TIME_UNIT_PROPERTY_LABEL.d.ts +8 -0
  119. package/dist/cjs/time/constants/TIME_UNIT_PROPERTY_LABEL.js +12 -0
  120. package/dist/cjs/time/constants/index.d.ts +4 -0
  121. package/dist/cjs/time/constants/index.js +20 -0
  122. package/dist/cjs/time/index.d.ts +3 -0
  123. package/dist/cjs/time/index.js +19 -0
  124. package/dist/cjs/time/interfaces/ITimeUnitProperty.d.ts +2 -0
  125. package/dist/cjs/time/interfaces/ITimeUnitProperty.js +2 -0
  126. package/dist/cjs/time/interfaces/ITimeUnitPropertyInfo.d.ts +5 -0
  127. package/dist/cjs/time/interfaces/ITimeUnitPropertyInfo.js +2 -0
  128. package/dist/cjs/time/interfaces/index.d.ts +2 -0
  129. package/dist/cjs/time/interfaces/index.js +18 -0
  130. package/dist/columns/helpers/index.d.ts +1 -0
  131. package/dist/columns/helpers/index.js +1 -0
  132. package/dist/columns/helpers/isDurationColumn.d.ts +7 -0
  133. package/dist/columns/helpers/isDurationColumn.js +14 -0
  134. package/dist/columns/interfaces/IColumnPropertyType.d.ts +2 -1
  135. package/dist/dates/helpers/getTimezoneObject.js +1 -1
  136. package/dist/filters/adapters/FDToFlatUI.js +2 -1
  137. package/dist/filters/adapters/UIToOldLogic.js +1 -0
  138. package/dist/filters/adapters/logicToFlatUI.js +4 -4
  139. package/dist/filters/constants/settings/FILTER_SETTINGS_DEFAULT.js +2 -0
  140. package/dist/filters/helpers/backend/getBackendValues.js +3 -1
  141. package/dist/filters/helpers/common/adaptTimeUnitValuesFromFilters.d.ts +11 -0
  142. package/dist/filters/helpers/common/adaptTimeUnitValuesFromFilters.js +25 -0
  143. package/dist/filters/helpers/common/index.d.ts +1 -0
  144. package/dist/filters/helpers/common/index.js +1 -0
  145. package/dist/filters/helpers/common/resolveDatasetConditions.js +5 -0
  146. package/dist/filters/helpers/common/resolveFilterConditions.js +5 -0
  147. package/dist/filters/helpers/common/resolveScopeConditions.js +5 -0
  148. package/dist/filters/interfaces/OLD_IFilterDetail.d.ts +4 -0
  149. package/dist/filters/interfaces/builder/IFilterBuilderSettings.d.ts +5 -0
  150. package/dist/filters/interfaces/common/IFSParamsToGetFilter.d.ts +2 -0
  151. package/dist/filters/interfaces/common/IFSParamsToGetFilterDisplayeds.d.ts +9 -0
  152. package/dist/filters/interfaces/common/IFSParamsToGetFilterDisplayeds.js +1 -0
  153. package/dist/filters/interfaces/common/index.d.ts +1 -0
  154. package/dist/filters/interfaces/common/index.js +1 -0
  155. package/dist/filters/interfaces/settings/IFSettingsFilterBuilder.d.ts +1 -0
  156. package/dist/filters/interfaces/settings/IFSettingsFilterPanel.d.ts +1 -0
  157. package/dist/format/definition.d.ts +1 -0
  158. package/dist/format/definition.js +1 -0
  159. package/dist/format/duration/convertTimeUnit.d.ts +15 -0
  160. package/dist/format/duration/convertTimeUnit.js +27 -0
  161. package/dist/format/duration/index.d.ts +1 -0
  162. package/dist/format/duration/index.js +1 -0
  163. package/dist/globalization/interfaces/common/I18nTimeUnitProperties.d.ts +10 -0
  164. package/dist/globalization/interfaces/common/I18nTimeUnitProperties.js +1 -0
  165. package/dist/globalization/interfaces/common/II18nCommon.d.ts +2 -0
  166. package/dist/globalization/interfaces/common/index.d.ts +1 -0
  167. package/dist/globalization/interfaces/common/index.js +1 -0
  168. package/dist/globalization/interfaces/tabular_view/II18nTabularView.d.ts +1 -0
  169. package/dist/globalization/labels/common/I18N_COMMON.js +2 -0
  170. package/dist/globalization/labels/common/I18N_TIME_UNITS.d.ts +2 -0
  171. package/dist/globalization/labels/common/I18N_TIME_UNITS.js +11 -0
  172. package/dist/globalization/labels/tabular_view/I18N_TABULAR_VIEW.js +1 -0
  173. package/dist/index.d.ts +1 -0
  174. package/dist/index.js +1 -0
  175. package/dist/qrvey/helpers/getPropertyLabel.d.ts +7 -0
  176. package/dist/qrvey/helpers/getPropertyLabel.js +14 -3
  177. package/dist/time/adapters/adaptTimeUnitNumbers.d.ts +9 -0
  178. package/dist/time/adapters/adaptTimeUnitNumbers.js +200 -0
  179. package/dist/time/adapters/daysToHours.d.ts +6 -0
  180. package/dist/time/adapters/daysToHours.js +15 -0
  181. package/dist/time/adapters/daysToMinutes.d.ts +6 -0
  182. package/dist/time/adapters/daysToMinutes.js +15 -0
  183. package/dist/time/adapters/daysToMonths.d.ts +6 -0
  184. package/dist/time/adapters/daysToMonths.js +15 -0
  185. package/dist/time/adapters/daysToSeconds.d.ts +6 -0
  186. package/dist/time/adapters/daysToSeconds.js +15 -0
  187. package/dist/time/adapters/daysToYears.d.ts +6 -0
  188. package/dist/time/adapters/daysToYears.js +15 -0
  189. package/dist/time/adapters/hoursToDays.d.ts +6 -0
  190. package/dist/time/adapters/hoursToDays.js +15 -0
  191. package/dist/time/adapters/hoursToMinutes.d.ts +6 -0
  192. package/dist/time/adapters/hoursToMinutes.js +15 -0
  193. package/dist/time/adapters/hoursToMonths.d.ts +6 -0
  194. package/dist/time/adapters/hoursToMonths.js +15 -0
  195. package/dist/time/adapters/hoursToSeconds.d.ts +6 -0
  196. package/dist/time/adapters/hoursToSeconds.js +15 -0
  197. package/dist/time/adapters/hoursToYears.d.ts +6 -0
  198. package/dist/time/adapters/hoursToYears.js +15 -0
  199. package/dist/time/adapters/index.d.ts +31 -0
  200. package/dist/time/adapters/index.js +31 -0
  201. package/dist/time/adapters/minutesToDays.d.ts +6 -0
  202. package/dist/time/adapters/minutesToDays.js +15 -0
  203. package/dist/time/adapters/minutesToHours.d.ts +6 -0
  204. package/dist/time/adapters/minutesToHours.js +15 -0
  205. package/dist/time/adapters/minutesToMonths.d.ts +6 -0
  206. package/dist/time/adapters/minutesToMonths.js +15 -0
  207. package/dist/time/adapters/minutesToSeconds.d.ts +6 -0
  208. package/dist/time/adapters/minutesToSeconds.js +15 -0
  209. package/dist/time/adapters/minutesToYears.d.ts +6 -0
  210. package/dist/time/adapters/minutesToYears.js +15 -0
  211. package/dist/time/adapters/monthsToDays.d.ts +6 -0
  212. package/dist/time/adapters/monthsToDays.js +15 -0
  213. package/dist/time/adapters/monthsToHours.d.ts +6 -0
  214. package/dist/time/adapters/monthsToHours.js +15 -0
  215. package/dist/time/adapters/monthsToMinutes.d.ts +6 -0
  216. package/dist/time/adapters/monthsToMinutes.js +15 -0
  217. package/dist/time/adapters/monthsToSeconds.d.ts +6 -0
  218. package/dist/time/adapters/monthsToSeconds.js +15 -0
  219. package/dist/time/adapters/monthsToYears.d.ts +6 -0
  220. package/dist/time/adapters/monthsToYears.js +15 -0
  221. package/dist/time/adapters/secondsToDays.d.ts +6 -0
  222. package/dist/time/adapters/secondsToDays.js +15 -0
  223. package/dist/time/adapters/secondsToHours.d.ts +6 -0
  224. package/dist/time/adapters/secondsToHours.js +15 -0
  225. package/dist/time/adapters/secondsToMinutes.d.ts +6 -0
  226. package/dist/time/adapters/secondsToMinutes.js +15 -0
  227. package/dist/time/adapters/secondsToMonths.d.ts +6 -0
  228. package/dist/time/adapters/secondsToMonths.js +15 -0
  229. package/dist/time/adapters/secondsToYears.d.ts +6 -0
  230. package/dist/time/adapters/secondsToYears.js +15 -0
  231. package/dist/time/adapters/yearsToDays.d.ts +6 -0
  232. package/dist/time/adapters/yearsToDays.js +15 -0
  233. package/dist/time/adapters/yearsToHours.d.ts +6 -0
  234. package/dist/time/adapters/yearsToHours.js +15 -0
  235. package/dist/time/adapters/yearsToMinutes.d.ts +6 -0
  236. package/dist/time/adapters/yearsToMinutes.js +15 -0
  237. package/dist/time/adapters/yearsToMonths.d.ts +6 -0
  238. package/dist/time/adapters/yearsToMonths.js +15 -0
  239. package/dist/time/adapters/yearsToSeconds.d.ts +6 -0
  240. package/dist/time/adapters/yearsToSeconds.js +15 -0
  241. package/dist/time/constants/TIME_UNIT_INFO.d.ts +5 -0
  242. package/dist/time/constants/TIME_UNIT_INFO.js +52 -0
  243. package/dist/time/constants/TIME_UNIT_INFO_LIST.d.ts +2 -0
  244. package/dist/time/constants/TIME_UNIT_INFO_LIST.js +10 -0
  245. package/dist/time/constants/TIME_UNIT_PROPERTY.d.ts +8 -0
  246. package/dist/time/constants/TIME_UNIT_PROPERTY.js +9 -0
  247. package/dist/time/constants/TIME_UNIT_PROPERTY_LABEL.d.ts +8 -0
  248. package/dist/time/constants/TIME_UNIT_PROPERTY_LABEL.js +9 -0
  249. package/dist/time/constants/index.d.ts +4 -0
  250. package/dist/time/constants/index.js +4 -0
  251. package/dist/time/index.d.ts +3 -0
  252. package/dist/time/index.js +3 -0
  253. package/dist/time/interfaces/ITimeUnitProperty.d.ts +2 -0
  254. package/dist/time/interfaces/ITimeUnitProperty.js +1 -0
  255. package/dist/time/interfaces/ITimeUnitPropertyInfo.d.ts +5 -0
  256. package/dist/time/interfaces/ITimeUnitPropertyInfo.js +1 -0
  257. package/dist/time/interfaces/index.d.ts +2 -0
  258. package/dist/time/interfaces/index.js +2 -0
  259. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ import { I18nTimeUnitProperties } from "../../interfaces/common/I18nTimeUnitProperties";
2
+ export declare const I18N_TIME_UNITS: I18nTimeUnitProperties;
@@ -0,0 +1,11 @@
1
+ import { TIME_UNIT_PROPERTY_LABEL } from "../../../time/constants/TIME_UNIT_PROPERTY_LABEL";
2
+ export const I18N_TIME_UNITS = {
3
+ day: TIME_UNIT_PROPERTY_LABEL.DAY,
4
+ hour: TIME_UNIT_PROPERTY_LABEL.HOUR,
5
+ minute: TIME_UNIT_PROPERTY_LABEL.MINUTE,
6
+ month: TIME_UNIT_PROPERTY_LABEL.MONTH,
7
+ second: TIME_UNIT_PROPERTY_LABEL.SECOND,
8
+ year: TIME_UNIT_PROPERTY_LABEL.YEAR,
9
+ title: "Time Unit",
10
+ placeholder: "Select Time Unit",
11
+ };
@@ -14,6 +14,7 @@ export const I18N_TABULAR_VIEW = {
14
14
  edit_modal_edit_option: "Update",
15
15
  edit_modal_cancel_option: "Cancel",
16
16
  filter_access_point: "Filter",
17
+ no_columns_selected_message: "No columns selected",
17
18
  no_records_found_message: "No Records Found",
18
19
  select_columns_all_option: "All",
19
20
  select_columns_date_option: "Date",
package/dist/index.d.ts CHANGED
@@ -12,5 +12,6 @@ export * from "./qrvey/index";
12
12
  export * from "./stencil/index";
13
13
  export * from "./services/index";
14
14
  export * from "./typescript/index";
15
+ export * from "./time/index";
15
16
  export * from "./tokens/index";
16
17
  export * from "./column_format/index";
package/dist/index.js CHANGED
@@ -12,5 +12,6 @@ export * from "./qrvey/index";
12
12
  export * from "./stencil/index";
13
13
  export * from "./services/index";
14
14
  export * from "./typescript/index";
15
+ export * from "./time/index";
15
16
  export * from "./tokens/index";
16
17
  export * from "./column_format/index";
@@ -1,4 +1,11 @@
1
1
  import { IColumnPropertyType } from "../../columns/interfaces/IColumnPropertyType";
2
2
  import { IColumn } from "../../columns/interfaces/IColumn";
3
3
  import { II18nServiceTranslate } from "../../globalization/interfaces/II18nServiceTranslate";
4
+ /**
5
+ * Gets the label of a property by the column
6
+ * @param {IColumn} column the column object
7
+ * @param {IColumnPropertyType} property the column property
8
+ * @param translate function to apply the i18n translation
9
+ * @returns the label
10
+ */
4
11
  export declare function getPropertyLabel(column: IColumn, property: IColumnPropertyType, translate?: II18nServiceTranslate): string;
@@ -2,11 +2,22 @@ import { COLUMN_PROPERTY_INFO } from "../../columns/constants/COLUMN_PROPERTY_IN
2
2
  import { isDateColumn } from "../../columns/helpers/isDateColumn";
3
3
  import { COLUMN } from "../../columns/constants/COLUMN";
4
4
  import { isEmpty } from "../../general/mix/isEmpty";
5
+ import { isDurationColumn } from "../../columns/helpers/isDurationColumn";
6
+ import { TIME_UNIT_INFO_LIST } from "../../time/constants/TIME_UNIT_INFO_LIST";
7
+ /**
8
+ * Gets the label of a property by the column
9
+ * @param {IColumn} column the column object
10
+ * @param {IColumnPropertyType} property the column property
11
+ * @param translate function to apply the i18n translation
12
+ * @returns the label
13
+ */
5
14
  export function getPropertyLabel(column, property, translate) {
6
15
  let propertyLabel;
7
- const propertyValues = COLUMN_PROPERTY_INFO[isDateColumn(column) ? COLUMN.DATE : column.type];
8
- if (!isEmpty(propertyValues)) {
9
- const propertyObject = propertyValues.find((pValue) => pValue.value === property);
16
+ let columnProperties = COLUMN_PROPERTY_INFO[isDateColumn(column) ? COLUMN.DATE : column.type];
17
+ if (isEmpty(columnProperties) && isDurationColumn(column))
18
+ columnProperties = TIME_UNIT_INFO_LIST;
19
+ if (!isEmpty(columnProperties)) {
20
+ const propertyObject = columnProperties.find((pValue) => pValue.value === property);
10
21
  if (!isEmpty(propertyObject))
11
22
  propertyLabel = !isEmpty(translate)
12
23
  ? translate(propertyObject.i18nLabelPath)
@@ -0,0 +1,9 @@
1
+ import { ITimeUnitProperty } from "../interfaces/ITimeUnitProperty";
2
+ /**
3
+ * Converts a number from a time unit to another
4
+ * @param {ITimeUnitProperty} from a time unit
5
+ * @param {ITimeUnitProperty} to a time unit
6
+ * @param {number} number the number to convert
7
+ * @returns the converted number
8
+ */
9
+ export declare function adaptTimeUnitNumbers(from: ITimeUnitProperty, to: ITimeUnitProperty, number: number): number;
@@ -0,0 +1,200 @@
1
+ import { isEmpty } from "../../general/mix/isEmpty";
2
+ import { isNaNV2 } from "../../general/mix/isNaNV2";
3
+ import { TIME_UNIT_PROPERTY } from "../constants/TIME_UNIT_PROPERTY";
4
+ import { daysToHours } from "./daysToHours";
5
+ import { daysToMinutes } from "./daysToMinutes";
6
+ import { daysToMonths } from "./daysToMonths";
7
+ import { daysToSeconds } from "./daysToSeconds";
8
+ import { daysToYears } from "./daysToYears";
9
+ import { hoursToDays } from "./hoursToDays";
10
+ import { hoursToMinutes } from "./hoursToMinutes";
11
+ import { hoursToMonths } from "./hoursToMonths";
12
+ import { hoursToSeconds } from "./hoursToSeconds";
13
+ import { hoursToYears } from "./hoursToYears";
14
+ import { minutesToDays } from "./minutesToDays";
15
+ import { minutesToHours } from "./minutesToHours";
16
+ import { minutesToMonths } from "./minutesToMonths";
17
+ import { minutesToSeconds } from "./minutesToSeconds";
18
+ import { minutesToYears } from "./minutesToYears";
19
+ import { monthsToDays } from "./monthsToDays";
20
+ import { monthsToHours } from "./monthsToHours";
21
+ import { monthsToMinutes } from "./monthsToMinutes";
22
+ import { monthsToSeconds } from "./monthsToSeconds";
23
+ import { monthsToYears } from "./monthsToYears";
24
+ import { secondsToDays } from "./secondsToDays";
25
+ import { secondsToHours } from "./secondsToHours";
26
+ import { secondsToMinutes } from "./secondsToMinutes";
27
+ import { secondsToMonths } from "./secondsToMonths";
28
+ import { secondsToYears } from "./secondsToYears";
29
+ import { yearsToDays } from "./yearsToDays";
30
+ import { yearsToHours } from "./yearsToHours";
31
+ import { yearsToMinutes } from "./yearsToMinutes";
32
+ import { yearsToMonths } from "./yearsToMonths";
33
+ import { yearsToSeconds } from "./yearsToSeconds";
34
+ /**
35
+ * Converts a number from a time unit to another
36
+ * @param {ITimeUnitProperty} from a time unit
37
+ * @param {ITimeUnitProperty} to a time unit
38
+ * @param {number} number the number to convert
39
+ * @returns the converted number
40
+ */
41
+ export function adaptTimeUnitNumbers(from, to, number) {
42
+ if (validateArgumentts(from, to, number))
43
+ return 0;
44
+ switch (from) {
45
+ case TIME_UNIT_PROPERTY.DAY:
46
+ return dayConversion(to, number);
47
+ case TIME_UNIT_PROPERTY.HOUR:
48
+ return hourConversion(to, number);
49
+ case TIME_UNIT_PROPERTY.MINUTE:
50
+ return minuteConversion(to, number);
51
+ case TIME_UNIT_PROPERTY.MONTH:
52
+ return monthConversion(to, number);
53
+ case TIME_UNIT_PROPERTY.YEAR:
54
+ return yearConversion(to, number);
55
+ default:
56
+ return secondConversion(to, number);
57
+ }
58
+ }
59
+ /**
60
+ * Converts day number to another time unit
61
+ * @param {ITimeUnitProperty} to a time unit
62
+ * @param {number} number the number to convert
63
+ * @returns the converted number
64
+ */
65
+ function dayConversion(to, number) {
66
+ switch (to) {
67
+ case TIME_UNIT_PROPERTY.HOUR:
68
+ return daysToHours(number);
69
+ case TIME_UNIT_PROPERTY.MINUTE:
70
+ return daysToMinutes(number);
71
+ case TIME_UNIT_PROPERTY.MONTH:
72
+ return daysToMonths(number);
73
+ case TIME_UNIT_PROPERTY.SECOND:
74
+ return daysToSeconds(number);
75
+ case TIME_UNIT_PROPERTY.YEAR:
76
+ return daysToYears(number);
77
+ default:
78
+ return number || 0;
79
+ }
80
+ }
81
+ /**
82
+ * Converts hour number to another time unit
83
+ * @param {ITimeUnitProperty} to a time unit
84
+ * @param {number} number the number to convert
85
+ * @returns the converted number
86
+ */
87
+ function hourConversion(to, number) {
88
+ switch (to) {
89
+ case TIME_UNIT_PROPERTY.DAY:
90
+ return hoursToDays(number);
91
+ case TIME_UNIT_PROPERTY.MINUTE:
92
+ return hoursToMinutes(number);
93
+ case TIME_UNIT_PROPERTY.MONTH:
94
+ return hoursToMonths(number);
95
+ case TIME_UNIT_PROPERTY.SECOND:
96
+ return hoursToSeconds(number);
97
+ case TIME_UNIT_PROPERTY.YEAR:
98
+ return hoursToYears(number);
99
+ default:
100
+ return number || 0;
101
+ }
102
+ }
103
+ /**
104
+ * Converts month number to another time unit
105
+ * @param {ITimeUnitProperty} to a time unit
106
+ * @param {number} number the number to convert
107
+ * @returns the converted number
108
+ */
109
+ function monthConversion(to, number) {
110
+ switch (to) {
111
+ case TIME_UNIT_PROPERTY.DAY:
112
+ return monthsToDays(number);
113
+ case TIME_UNIT_PROPERTY.HOUR:
114
+ return monthsToHours(number);
115
+ case TIME_UNIT_PROPERTY.MINUTE:
116
+ return monthsToMinutes(number);
117
+ case TIME_UNIT_PROPERTY.SECOND:
118
+ return monthsToSeconds(number);
119
+ case TIME_UNIT_PROPERTY.YEAR:
120
+ return monthsToYears(number);
121
+ default:
122
+ return number || 0;
123
+ }
124
+ }
125
+ /**
126
+ * Converts minute number to another time unit
127
+ * @param {ITimeUnitProperty} to a time unit
128
+ * @param {number} number the number to convert
129
+ * @returns the converted number
130
+ */
131
+ function minuteConversion(to, number) {
132
+ switch (to) {
133
+ case TIME_UNIT_PROPERTY.DAY:
134
+ return minutesToDays(number);
135
+ case TIME_UNIT_PROPERTY.HOUR:
136
+ return minutesToHours(number);
137
+ case TIME_UNIT_PROPERTY.MONTH:
138
+ return minutesToMonths(number);
139
+ case TIME_UNIT_PROPERTY.SECOND:
140
+ return minutesToSeconds(number);
141
+ case TIME_UNIT_PROPERTY.YEAR:
142
+ return minutesToYears(number);
143
+ default:
144
+ return number || 0;
145
+ }
146
+ }
147
+ /**
148
+ * Converts year number to another time unit
149
+ * @param {ITimeUnitProperty} to a time unit
150
+ * @param {number} number the number to convert
151
+ * @returns the converted number
152
+ */
153
+ function yearConversion(to, number) {
154
+ switch (to) {
155
+ case TIME_UNIT_PROPERTY.DAY:
156
+ return yearsToDays(number);
157
+ case TIME_UNIT_PROPERTY.HOUR:
158
+ return yearsToHours(number);
159
+ case TIME_UNIT_PROPERTY.MINUTE:
160
+ return yearsToMinutes(number);
161
+ case TIME_UNIT_PROPERTY.MONTH:
162
+ return yearsToMonths(number);
163
+ case TIME_UNIT_PROPERTY.SECOND:
164
+ return yearsToSeconds(number);
165
+ default:
166
+ return number || 0;
167
+ }
168
+ }
169
+ /**
170
+ * Converts second number to another time unit
171
+ * @param {ITimeUnitProperty} to a time unit
172
+ * @param {number} number the number to convert
173
+ * @returns the converted number
174
+ */
175
+ function secondConversion(to, number) {
176
+ switch (to) {
177
+ case TIME_UNIT_PROPERTY.DAY:
178
+ return secondsToDays(number);
179
+ case TIME_UNIT_PROPERTY.HOUR:
180
+ return secondsToHours(number);
181
+ case TIME_UNIT_PROPERTY.MINUTE:
182
+ return secondsToMinutes(number);
183
+ case TIME_UNIT_PROPERTY.MONTH:
184
+ return secondsToMonths(number);
185
+ case TIME_UNIT_PROPERTY.YEAR:
186
+ return secondsToYears(number);
187
+ default:
188
+ return number || 0;
189
+ }
190
+ }
191
+ /**
192
+ * Validates the given arguments
193
+ * @param {ITimeUnitProperty} from a time unit
194
+ * @param {ITimeUnitProperty} to a time unit
195
+ * @param {number} number the number to convert
196
+ * @returns the converted number
197
+ */
198
+ function validateArgumentts(from, to, number) {
199
+ return (isEmpty(from) || isEmpty(to)) && isNaNV2(number);
200
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Converts the number in days to hours
3
+ * @param num the number in days
4
+ * @returns the number in hours
5
+ */
6
+ export declare function daysToHours(num: number): number;
@@ -0,0 +1,15 @@
1
+ import dayjs from "dayjs";
2
+ import duration from "dayjs/plugin/duration";
3
+ import { isEmpty } from "../../general/mix/isEmpty";
4
+ import { isNaNV2 } from "../../general/mix/isNaNV2";
5
+ /**
6
+ * Converts the number in days to hours
7
+ * @param num the number in days
8
+ * @returns the number in hours
9
+ */
10
+ export function daysToHours(num) {
11
+ dayjs.extend(duration);
12
+ if (isEmpty(num) || isNaNV2(num))
13
+ return 0;
14
+ return dayjs.duration({ days: num }).asHours();
15
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Converts the number in days to minutes
3
+ * @param num the number in days
4
+ * @returns the number in minutes
5
+ */
6
+ export declare function daysToMinutes(num: number): number;
@@ -0,0 +1,15 @@
1
+ import dayjs from "dayjs";
2
+ import duration from "dayjs/plugin/duration";
3
+ import { isEmpty } from "../../general/mix/isEmpty";
4
+ import { isNaNV2 } from "../../general/mix/isNaNV2";
5
+ /**
6
+ * Converts the number in days to minutes
7
+ * @param num the number in days
8
+ * @returns the number in minutes
9
+ */
10
+ export function daysToMinutes(num) {
11
+ dayjs.extend(duration);
12
+ if (isEmpty(num) || isNaNV2(num))
13
+ return 0;
14
+ return dayjs.duration({ days: num }).asMinutes();
15
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Converts the number in days to months
3
+ * @param num the number in days
4
+ * @returns the number in months
5
+ */
6
+ export declare function daysToMonths(num: number): number;
@@ -0,0 +1,15 @@
1
+ import dayjs from "dayjs";
2
+ import duration from "dayjs/plugin/duration";
3
+ import { isEmpty } from "../../general/mix/isEmpty";
4
+ import { isNaNV2 } from "../../general/mix/isNaNV2";
5
+ /**
6
+ * Converts the number in days to months
7
+ * @param num the number in days
8
+ * @returns the number in months
9
+ */
10
+ export function daysToMonths(num) {
11
+ dayjs.extend(duration);
12
+ if (isEmpty(num) || isNaNV2(num))
13
+ return 0;
14
+ return dayjs.duration({ days: num }).asMonths();
15
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Converts the number in days to seconds
3
+ * @param num the number in days
4
+ * @returns the number in seconds
5
+ */
6
+ export declare function daysToSeconds(num: number): number;
@@ -0,0 +1,15 @@
1
+ import dayjs from "dayjs";
2
+ import duration from "dayjs/plugin/duration";
3
+ import { isEmpty } from "../../general/mix/isEmpty";
4
+ import { isNaNV2 } from "../../general/mix/isNaNV2";
5
+ /**
6
+ * Converts the number in days to seconds
7
+ * @param num the number in days
8
+ * @returns the number in seconds
9
+ */
10
+ export function daysToSeconds(num) {
11
+ dayjs.extend(duration);
12
+ if (isEmpty(num) || isNaNV2(num))
13
+ return 0;
14
+ return dayjs.duration({ days: num }).asSeconds();
15
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Converts the number in days to years
3
+ * @param num the number in days
4
+ * @returns the number in years
5
+ */
6
+ export declare function daysToYears(num: number): number;
@@ -0,0 +1,15 @@
1
+ import dayjs from "dayjs";
2
+ import duration from "dayjs/plugin/duration";
3
+ import { isEmpty } from "../../general/mix/isEmpty";
4
+ import { isNaNV2 } from "../../general/mix/isNaNV2";
5
+ /**
6
+ * Converts the number in days to years
7
+ * @param num the number in days
8
+ * @returns the number in years
9
+ */
10
+ export function daysToYears(num) {
11
+ dayjs.extend(duration);
12
+ if (isEmpty(num) || isNaNV2(num))
13
+ return 0;
14
+ return dayjs.duration({ days: num }).asYears();
15
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Converts the number in hours to days
3
+ * @param num the number in hours
4
+ * @returns the number in days
5
+ */
6
+ export declare function hoursToDays(num: number): number;
@@ -0,0 +1,15 @@
1
+ import dayjs from "dayjs";
2
+ import duration from "dayjs/plugin/duration";
3
+ import { isEmpty } from "../../general/mix/isEmpty";
4
+ import { isNaNV2 } from "../../general/mix/isNaNV2";
5
+ /**
6
+ * Converts the number in hours to days
7
+ * @param num the number in hours
8
+ * @returns the number in days
9
+ */
10
+ export function hoursToDays(num) {
11
+ dayjs.extend(duration);
12
+ if (isEmpty(num) || isNaNV2(num))
13
+ return 0;
14
+ return dayjs.duration({ hours: num }).asDays();
15
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Converts the number in hours to minutes
3
+ * @param num the number in hours
4
+ * @returns the number in minutes
5
+ */
6
+ export declare function hoursToMinutes(num: number): number;
@@ -0,0 +1,15 @@
1
+ import dayjs from "dayjs";
2
+ import duration from "dayjs/plugin/duration";
3
+ import { isEmpty } from "../../general/mix/isEmpty";
4
+ import { isNaNV2 } from "../../general/mix/isNaNV2";
5
+ /**
6
+ * Converts the number in hours to minutes
7
+ * @param num the number in hours
8
+ * @returns the number in minutes
9
+ */
10
+ export function hoursToMinutes(num) {
11
+ dayjs.extend(duration);
12
+ if (isEmpty(num) || isNaNV2(num))
13
+ return 0;
14
+ return dayjs.duration({ hours: num }).asMinutes();
15
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Converts the number in hours to months
3
+ * @param num the number in hours
4
+ * @returns the number in months
5
+ */
6
+ export declare function hoursToMonths(num: number): number;
@@ -0,0 +1,15 @@
1
+ import dayjs from "dayjs";
2
+ import duration from "dayjs/plugin/duration";
3
+ import { isEmpty } from "../../general/mix/isEmpty";
4
+ import { isNaNV2 } from "../../general/mix/isNaNV2";
5
+ /**
6
+ * Converts the number in hours to months
7
+ * @param num the number in hours
8
+ * @returns the number in months
9
+ */
10
+ export function hoursToMonths(num) {
11
+ dayjs.extend(duration);
12
+ if (isEmpty(num) || isNaNV2(num))
13
+ return 0;
14
+ return dayjs.duration({ hours: num }).asMonths();
15
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Converts the number in hours to seconds
3
+ * @param num the number in hours
4
+ * @returns the number in seconds
5
+ */
6
+ export declare function hoursToSeconds(num: number): number;
@@ -0,0 +1,15 @@
1
+ import dayjs from "dayjs";
2
+ import duration from "dayjs/plugin/duration";
3
+ import { isEmpty } from "../../general/mix/isEmpty";
4
+ import { isNaNV2 } from "../../general/mix/isNaNV2";
5
+ /**
6
+ * Converts the number in hours to seconds
7
+ * @param num the number in hours
8
+ * @returns the number in seconds
9
+ */
10
+ export function hoursToSeconds(num) {
11
+ dayjs.extend(duration);
12
+ if (isEmpty(num) || isNaNV2(num))
13
+ return 0;
14
+ return dayjs.duration({ hours: num }).asSeconds();
15
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Converts the number in hours to years
3
+ * @param num the number in hours
4
+ * @returns the number in years
5
+ */
6
+ export declare function hoursToYears(num: number): number;
@@ -0,0 +1,15 @@
1
+ import dayjs from "dayjs";
2
+ import duration from "dayjs/plugin/duration";
3
+ import { isEmpty } from "../../general/mix/isEmpty";
4
+ import { isNaNV2 } from "../../general/mix/isNaNV2";
5
+ /**
6
+ * Converts the number in hours to years
7
+ * @param num the number in hours
8
+ * @returns the number in years
9
+ */
10
+ export function hoursToYears(num) {
11
+ dayjs.extend(duration);
12
+ if (isEmpty(num) || isNaNV2(num))
13
+ return 0;
14
+ return dayjs.duration({ hours: num }).asYears();
15
+ }
@@ -0,0 +1,31 @@
1
+ export * from "./adaptTimeUnitNumbers";
2
+ export * from "./daysToHours";
3
+ export * from "./daysToMinutes";
4
+ export * from "./daysToMonths";
5
+ export * from "./daysToSeconds";
6
+ export * from "./daysToYears";
7
+ export * from "./hoursToDays";
8
+ export * from "./hoursToMinutes";
9
+ export * from "./hoursToMonths";
10
+ export * from "./hoursToSeconds";
11
+ export * from "./hoursToYears";
12
+ export * from "./minutesToDays";
13
+ export * from "./minutesToHours";
14
+ export * from "./minutesToMonths";
15
+ export * from "./minutesToSeconds";
16
+ export * from "./minutesToYears";
17
+ export * from "./monthsToDays";
18
+ export * from "./monthsToHours";
19
+ export * from "./monthsToMinutes";
20
+ export * from "./monthsToSeconds";
21
+ export * from "./monthsToYears";
22
+ export * from "./secondsToDays";
23
+ export * from "./secondsToHours";
24
+ export * from "./secondsToMinutes";
25
+ export * from "./secondsToMonths";
26
+ export * from "./secondsToYears";
27
+ export * from "./yearsToDays";
28
+ export * from "./yearsToHours";
29
+ export * from "./yearsToMinutes";
30
+ export * from "./yearsToMonths";
31
+ export * from "./yearsToSeconds";
@@ -0,0 +1,31 @@
1
+ export * from "./adaptTimeUnitNumbers";
2
+ export * from "./daysToHours";
3
+ export * from "./daysToMinutes";
4
+ export * from "./daysToMonths";
5
+ export * from "./daysToSeconds";
6
+ export * from "./daysToYears";
7
+ export * from "./hoursToDays";
8
+ export * from "./hoursToMinutes";
9
+ export * from "./hoursToMonths";
10
+ export * from "./hoursToSeconds";
11
+ export * from "./hoursToYears";
12
+ export * from "./minutesToDays";
13
+ export * from "./minutesToHours";
14
+ export * from "./minutesToMonths";
15
+ export * from "./minutesToSeconds";
16
+ export * from "./minutesToYears";
17
+ export * from "./monthsToDays";
18
+ export * from "./monthsToHours";
19
+ export * from "./monthsToMinutes";
20
+ export * from "./monthsToSeconds";
21
+ export * from "./monthsToYears";
22
+ export * from "./secondsToDays";
23
+ export * from "./secondsToHours";
24
+ export * from "./secondsToMinutes";
25
+ export * from "./secondsToMonths";
26
+ export * from "./secondsToYears";
27
+ export * from "./yearsToDays";
28
+ export * from "./yearsToHours";
29
+ export * from "./yearsToMinutes";
30
+ export * from "./yearsToMonths";
31
+ export * from "./yearsToSeconds";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Converts the number in minutes to days
3
+ * @param num the number in minutes
4
+ * @returns the number in days
5
+ */
6
+ export declare function minutesToDays(num: number): number;
@@ -0,0 +1,15 @@
1
+ import dayjs from "dayjs";
2
+ import duration from "dayjs/plugin/duration";
3
+ import { isEmpty } from "../../general/mix/isEmpty";
4
+ import { isNaNV2 } from "../../general/mix/isNaNV2";
5
+ /**
6
+ * Converts the number in minutes to days
7
+ * @param num the number in minutes
8
+ * @returns the number in days
9
+ */
10
+ export function minutesToDays(num) {
11
+ dayjs.extend(duration);
12
+ if (isEmpty(num) || isNaNV2(num))
13
+ return 0;
14
+ return dayjs.duration({ minutes: num }).asDays();
15
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Converts the number in minutes to hours
3
+ * @param num the number in minutes
4
+ * @returns the number in hours
5
+ */
6
+ export declare function minutesToHours(num: number): number;
@@ -0,0 +1,15 @@
1
+ import dayjs from "dayjs";
2
+ import duration from "dayjs/plugin/duration";
3
+ import { isEmpty } from "../../general/mix/isEmpty";
4
+ import { isNaNV2 } from "../../general/mix/isNaNV2";
5
+ /**
6
+ * Converts the number in minutes to hours
7
+ * @param num the number in minutes
8
+ * @returns the number in hours
9
+ */
10
+ export function minutesToHours(num) {
11
+ dayjs.extend(duration);
12
+ if (isEmpty(num) || isNaNV2(num))
13
+ return 0;
14
+ return dayjs.duration({ minutes: num }).asHours();
15
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Converts the number in minutes to months
3
+ * @param num the number in minutes
4
+ * @returns the number in months
5
+ */
6
+ export declare function minutesToMonths(num: number): number;