@activecollab/components 2.0.116 → 2.0.118

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 (45) hide show
  1. package/dist/cjs/components/EditableHours/EditableHours.js +1 -1
  2. package/dist/cjs/components/EditableHours/EditableHours.js.map +1 -1
  3. package/dist/cjs/components/ProgressRing/Styles.js +2 -2
  4. package/dist/cjs/components/ProgressRing/Styles.js.map +1 -1
  5. package/dist/cjs/components/SelectTrigger/SelectTrigger.js +11 -1
  6. package/dist/cjs/components/SelectTrigger/SelectTrigger.js.map +1 -1
  7. package/dist/cjs/components/SelectTrigger/Styles.js +6 -3
  8. package/dist/cjs/components/SelectTrigger/Styles.js.map +1 -1
  9. package/dist/cjs/hooks/useInputHours.js +3 -3
  10. package/dist/cjs/hooks/useInputHours.js.map +1 -1
  11. package/dist/cjs/utils/index.js +7 -0
  12. package/dist/cjs/utils/index.js.map +1 -1
  13. package/dist/cjs/utils/timeUtils.js +87 -33
  14. package/dist/cjs/utils/timeUtils.js.map +1 -1
  15. package/dist/cjs/utils/timeUtils.test.js +1 -1
  16. package/dist/cjs/utils/timeUtils.test.js.map +1 -1
  17. package/dist/esm/components/EditableHours/EditableHours.js +2 -2
  18. package/dist/esm/components/EditableHours/EditableHours.js.map +1 -1
  19. package/dist/esm/components/ProgressRing/Styles.js +2 -2
  20. package/dist/esm/components/ProgressRing/Styles.js.map +1 -1
  21. package/dist/esm/components/SelectTrigger/SelectTrigger.d.ts +2 -3
  22. package/dist/esm/components/SelectTrigger/SelectTrigger.d.ts.map +1 -1
  23. package/dist/esm/components/SelectTrigger/SelectTrigger.js +12 -2
  24. package/dist/esm/components/SelectTrigger/SelectTrigger.js.map +1 -1
  25. package/dist/esm/components/SelectTrigger/Styles.d.ts +2 -3
  26. package/dist/esm/components/SelectTrigger/Styles.d.ts.map +1 -1
  27. package/dist/esm/components/SelectTrigger/Styles.js +8 -3
  28. package/dist/esm/components/SelectTrigger/Styles.js.map +1 -1
  29. package/dist/esm/hooks/useInputHours.js +4 -4
  30. package/dist/esm/hooks/useInputHours.js.map +1 -1
  31. package/dist/esm/utils/index.d.ts +1 -1
  32. package/dist/esm/utils/index.d.ts.map +1 -1
  33. package/dist/esm/utils/index.js +1 -1
  34. package/dist/esm/utils/index.js.map +1 -1
  35. package/dist/esm/utils/timeUtils.d.ts +34 -0
  36. package/dist/esm/utils/timeUtils.d.ts.map +1 -1
  37. package/dist/esm/utils/timeUtils.js +83 -30
  38. package/dist/esm/utils/timeUtils.js.map +1 -1
  39. package/dist/esm/utils/timeUtils.test.js +2 -2
  40. package/dist/esm/utils/timeUtils.test.js.map +1 -1
  41. package/dist/index.js +110 -42
  42. package/dist/index.js.map +1 -1
  43. package/dist/index.min.js +1 -1
  44. package/dist/index.min.js.map +1 -1
  45. package/package.json +1 -1
@@ -1,38 +1,91 @@
1
- // export const decimalToHours = (decimal: string) => {
2
- // // we round it on two decimals first, to eliminate quirks, eg, 5.99999999 will return 5:59 instead of 6:00
3
- // decimal = parseFloat(decimal).toFixed(2);
4
- // decimal = decimal + "";
5
- // let hours;
6
- // let minutes_decimal;
7
- //
8
- // if (decimal.indexOf(".") < 0) {
9
- // hours = parseInt(decimal);
10
- // minutes_decimal = 0;
11
- // } else {
12
- // hours = parseInt(decimal.substring(0, decimal.indexOf(".")));
13
- // minutes_decimal = decimal.substring(decimal.indexOf(".") + 1);
14
- // minutes_decimal = minutes_decimal.substring(0, 2);
15
- // if (minutes_decimal.length === 1) {
16
- // minutes_decimal += "0";
17
- // } // if
18
- // minutes_decimal = parseInt(minutes_decimal);
19
- // } // if
20
- //
21
- // const minutes = Math.round((minutes_decimal / 100) * 60);
22
- //
23
- // if (hours < 10) {
24
- // hours = `0${hours}`;
25
- // }
26
- // return {
27
- // hours: hours,
28
- // minutes: minutes,
29
- // };
30
- // };
1
+ /**
2
+ * @function formatHours
3
+ * @description
4
+ * Formats a decimal number representing hours into a formatted string (HH:MM).
5
+ * The input can be a number, string, or undefined. The function handles various formats
6
+ * and can optionally add a leading zero to the hours component.
7
+ *
8
+ * @param {number | string | undefined} num - The input representing the hours, which can be in decimal format, a time string, or undefined.
9
+ * @param {boolean} [withLeadingZeroHours=false] - Whether to add a leading zero to the hours part of the output.
10
+ *
11
+ * @returns {string} - A formatted time string in HH:MM format.
12
+ *
13
+ * @example
14
+ * formatHours(1.5) // "1:30"
15
+ * formatHours("3.5", true) // "03:30"
16
+ */
17
+ export const formatHours = function (num, withLeadingZeroHours) {
18
+ if (withLeadingZeroHours === void 0) {
19
+ withLeadingZeroHours = false;
20
+ }
21
+ if (!num) {
22
+ return "";
23
+ }
24
+ if (typeof num === "string" && !num) {
25
+ return withLeadingZeroHours ? "00:00" : "0:00";
26
+ }
27
+ if (typeof num === "string" && num.indexOf(":") >= 0) {
28
+ //eslint-disable-next-line
29
+ let [_hours, _minutes] = num.split(":");
30
+ if (_minutes && _minutes.length === 1 && Number(_minutes) < 10) {
31
+ _minutes = Number(_minutes) + "0";
32
+ }
33
+ if (_hours && _minutes) {
34
+ if (withLeadingZeroHours) {
35
+ return withLeadingZero(_hours) + ":" + _minutes;
36
+ }
37
+ return _hours + ":" + _minutes;
38
+ } else if (!_hours && _minutes) {
39
+ return withLeadingZeroHours ? "00:" + _minutes : "0:" + _minutes;
40
+ } else if (!_minutes && _hours) {
41
+ return withLeadingZeroHours ? withLeadingZero(_hours) + ":00" : _hours + ":00";
42
+ } else {
43
+ return withLeadingZeroHours ? "00:00" : "0:00";
44
+ }
45
+ }
46
+ if (typeof num === "string" && num.indexOf(",") >= 0) {
47
+ num = num.replace(",", ".");
48
+ }
49
+ const input = typeof num === "string" ? parseFloat(num) : num;
50
+ if (!isDecimal(input)) {
51
+ if (withLeadingZeroHours) {
52
+ return withLeadingZero(input) + ":00";
53
+ }
54
+ return input + ":00";
55
+ }
56
+ const decimal = input.toFixed(2);
57
+ const time = decimal.toString().split(".");
58
+ let hours = time[0];
59
+ if (withLeadingZeroHours) {
60
+ hours = withLeadingZero(hours);
61
+ }
62
+ const minutes = time[1];
63
+ const minutes_formatted = Math.round(parseInt(minutes, 10) / 100 * 60);
64
+ return hours + ":" + withLeadingZero(minutes_formatted);
65
+ };
31
66
 
67
+ /**
68
+ * @function decimalToHours
69
+ * @deprecated
70
+ * @description
71
+ * Converts a decimal number representing hours into a formatted string (HH:MM).
72
+ * The input can be a number, string, or undefined. The function handles various formats
73
+ * and can optionally add a leading zero to the hours component.
74
+ *
75
+ * @param {number | string | undefined} num - The input representing the hours, which can be in decimal format, a time string, or undefined.
76
+ * @param {boolean} [withLeadingZeroHours=false] - Whether to add a leading zero to the hours part of the output.
77
+ *
78
+ * @returns {string} - A formatted time string in HH:MM format.
79
+ *
80
+ * @example
81
+ * decimalToHours(1.5) // "1:30"
82
+ * decimalToHours("3.5", true) // "03:30"
83
+ */
32
84
  export const decimalToHours = function (num, withLeadingZeroHours) {
33
85
  if (withLeadingZeroHours === void 0) {
34
86
  withLeadingZeroHours = false;
35
87
  }
88
+ console.warn("Deprecated. Please use formatHours from @activecollab/components.");
36
89
  if (!num) {
37
90
  return "";
38
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"timeUtils.js","names":["decimalToHours","num","withLeadingZeroHours","indexOf","_hours","_minutes","split","length","Number","withLeadingZero","replace","input","parseFloat","isDecimal","decimal","toFixed","time","toString","hours","minutes","minutes_formatted","Math","round","parseInt","size","s","isInteger"],"sources":["../../../src/utils/timeUtils.ts"],"sourcesContent":["// export const decimalToHours = (decimal: string) => {\n// // we round it on two decimals first, to eliminate quirks, eg, 5.99999999 will return 5:59 instead of 6:00\n// decimal = parseFloat(decimal).toFixed(2);\n// decimal = decimal + \"\";\n// let hours;\n// let minutes_decimal;\n//\n// if (decimal.indexOf(\".\") < 0) {\n// hours = parseInt(decimal);\n// minutes_decimal = 0;\n// } else {\n// hours = parseInt(decimal.substring(0, decimal.indexOf(\".\")));\n// minutes_decimal = decimal.substring(decimal.indexOf(\".\") + 1);\n// minutes_decimal = minutes_decimal.substring(0, 2);\n// if (minutes_decimal.length === 1) {\n// minutes_decimal += \"0\";\n// } // if\n// minutes_decimal = parseInt(minutes_decimal);\n// } // if\n//\n// const minutes = Math.round((minutes_decimal / 100) * 60);\n//\n// if (hours < 10) {\n// hours = `0${hours}`;\n// }\n// return {\n// hours: hours,\n// minutes: minutes,\n// };\n// };\n\nexport const decimalToHours = (\n num: number | string | undefined,\n withLeadingZeroHours = false\n): string => {\n if (!num) {\n return \"\";\n }\n if (typeof num === \"string\" && !num) {\n return withLeadingZeroHours ? `00:00` : \"0:00\";\n }\n if (typeof num === \"string\" && num.indexOf(\":\") >= 0) {\n //eslint-disable-next-line\n let [_hours, _minutes] = num.split(\":\");\n if (_minutes && _minutes.length === 1 && Number(_minutes) < 10) {\n _minutes = `${Number(_minutes)}0`;\n }\n if (_hours && _minutes) {\n if (withLeadingZeroHours) {\n return `${withLeadingZero(_hours)}:${_minutes}`;\n }\n return `${_hours}:${_minutes}`;\n } else if (!_hours && _minutes) {\n return withLeadingZeroHours ? `00:${_minutes}` : `0:${_minutes}`;\n } else if (!_minutes && _hours) {\n return withLeadingZeroHours\n ? `${withLeadingZero(_hours)}:00`\n : `${_hours}:00`;\n } else {\n return withLeadingZeroHours ? `00:00` : \"0:00\";\n }\n }\n if (typeof num === \"string\" && num.indexOf(\",\") >= 0) {\n num = num.replace(\",\", \".\");\n }\n const input = typeof num === \"string\" ? parseFloat(num) : num;\n\n if (!isDecimal(input)) {\n if (withLeadingZeroHours) {\n return `${withLeadingZero(input)}:00`;\n }\n return `${input}:00`;\n }\n\n const decimal = input.toFixed(2);\n const time = decimal.toString().split(\".\");\n let hours: string = time[0];\n if (withLeadingZeroHours) {\n hours = withLeadingZero(hours);\n }\n const minutes: string = time[1];\n const minutes_formatted = Math.round((parseInt(minutes, 10) / 100) * 60);\n\n return `${hours}:${withLeadingZero(minutes_formatted)}`;\n};\n\nexport const withLeadingZero = (num: string | number, size = 2) => {\n let s = `${num}`;\n while (s.length < size) s = `0` + s;\n return s;\n};\n\nexport const isDecimal = (num: number): boolean => {\n return !Number.isInteger(num);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,cAAc,GAAG,SAAAA,CAC5BC,GAAgC,EAChCC,oBAAoB,EACT;EAAA,IADXA,oBAAoB;IAApBA,oBAAoB,GAAG,KAAK;EAAA;EAE5B,IAAI,CAACD,GAAG,EAAE;IACR,OAAO,EAAE;EACX;EACA,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAI,CAACA,GAAG,EAAE;IACnC,OAAOC,oBAAoB,aAAa,MAAM;EAChD;EACA,IAAI,OAAOD,GAAG,KAAK,QAAQ,IAAIA,GAAG,CAACE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;IACpD;IACA,IAAI,CAACC,MAAM,EAAEC,QAAQ,CAAC,GAAGJ,GAAG,CAACK,KAAK,CAAC,GAAG,CAAC;IACvC,IAAID,QAAQ,IAAIA,QAAQ,CAACE,MAAM,KAAK,CAAC,IAAIC,MAAM,CAACH,QAAQ,CAAC,GAAG,EAAE,EAAE;MAC9DA,QAAQ,GAAMG,MAAM,CAACH,QAAQ,CAAC,MAAG;IACnC;IACA,IAAID,MAAM,IAAIC,QAAQ,EAAE;MACtB,IAAIH,oBAAoB,EAAE;QACxB,OAAUO,eAAe,CAACL,MAAM,CAAC,SAAIC,QAAQ;MAC/C;MACA,OAAUD,MAAM,SAAIC,QAAQ;IAC9B,CAAC,MAAM,IAAI,CAACD,MAAM,IAAIC,QAAQ,EAAE;MAC9B,OAAOH,oBAAoB,WAASG,QAAQ,UAAUA,QAAU;IAClE,CAAC,MAAM,IAAI,CAACA,QAAQ,IAAID,MAAM,EAAE;MAC9B,OAAOF,oBAAoB,GACpBO,eAAe,CAACL,MAA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C,CAAC,GAAG,MAAMA,CAAC;EACnC,OAAOA,CAAC;AACV,CAAC;AAED,OAAO,MAAMZ,SAAS,GAAIZ,GAAW,IAAc;EACjD,OAAO,CAACO,MAAM,CAACkB,SAAS,CAACzB,GAAG,CAAC;AAC/B,CAAC"}
1
+ {"version":3,"file":"timeUtils.js","names":["formatHours","num","withLeadingZeroHours","indexOf","_hours","_minutes","split","length","Number","withLeadingZero","replace","input","parseFloat","isDecimal","decimal","toFixed","time","toString","hours","minutes","minutes_formatted","Math","round","parseInt","decimalToHours","console","warn","size","s","isInteger"],"sources":["../../../src/utils/timeUtils.ts"],"sourcesContent":["/**\n * @function formatHours\n * @description\n * Formats a decimal number representing hours into a formatted string (HH:MM).\n * The input can be a number, string, or undefined. The function handles various formats\n * and can optionally add a leading zero to the hours component.\n *\n * @param {number | string | undefined} num - The input representing the hours, which can be in decimal format, a time string, or undefined.\n * @param {boolean} [withLeadingZeroHours=false] - Whether to add a leading zero to the hours part of the output.\n *\n * @returns {string} - A formatted time string in HH:MM format.\n *\n * @example\n * formatHours(1.5) // \"1:30\"\n * formatHours(\"3.5\", true) // \"03:30\"\n */\nexport const formatHours = (\n num: number | string | undefined,\n withLeadingZeroHours = false\n): string => {\n if (!num) {\n return \"\";\n }\n if (typeof num === \"string\" && !num) {\n return withLeadingZeroHours ? `00:00` : \"0:00\";\n }\n if (typeof num === \"string\" && num.indexOf(\":\") >= 0) {\n //eslint-disable-next-line\n let [_hours, _minutes] = num.split(\":\");\n if (_minutes && _minutes.length === 1 && Number(_minutes) < 10) {\n _minutes = `${Number(_minutes)}0`;\n }\n if (_hours && _minutes) {\n if (withLeadingZeroHours) {\n return `${withLeadingZero(_hours)}:${_minutes}`;\n }\n return `${_hours}:${_minutes}`;\n } else if (!_hours && _minutes) {\n return withLeadingZeroHours ? `00:${_minutes}` : `0:${_minutes}`;\n } else if (!_minutes && _hours) {\n return withLeadingZeroHours\n ? `${withLeadingZero(_hours)}:00`\n : `${_hours}:00`;\n } else {\n return withLeadingZeroHours ? `00:00` : \"0:00\";\n }\n }\n if (typeof num === \"string\" && num.indexOf(\",\") >= 0) {\n num = num.replace(\",\", \".\");\n }\n const input = typeof num === \"string\" ? parseFloat(num) : num;\n\n if (!isDecimal(input)) {\n if (withLeadingZeroHours) {\n return `${withLeadingZero(input)}:00`;\n }\n return `${input}:00`;\n }\n\n const decimal = input.toFixed(2);\n const time = decimal.toString().split(\".\");\n let hours: string = time[0];\n if (withLeadingZeroHours) {\n hours = withLeadingZero(hours);\n }\n const minutes: string = time[1];\n const minutes_formatted = Math.round((parseInt(minutes, 10) / 100) * 60);\n\n return `${hours}:${withLeadingZero(minutes_formatted)}`;\n};\n\n/**\n * @function decimalToHours\n * @deprecated\n * @description\n * Converts a decimal number representing hours into a formatted string (HH:MM).\n * The input can be a number, string, or undefined. The function handles various formats\n * and can optionally add a leading zero to the hours component.\n *\n * @param {number | string | undefined} num - The input representing the hours, which can be in decimal format, a time string, or undefined.\n * @param {boolean} [withLeadingZeroHours=false] - Whether to add a leading zero to the hours part of the output.\n *\n * @returns {string} - A formatted time string in HH:MM format.\n *\n * @example\n * decimalToHours(1.5) // \"1:30\"\n * decimalToHours(\"3.5\", true) // \"03:30\"\n */\nexport const decimalToHours = (\n num: number | string | undefined,\n withLeadingZeroHours = false\n): string => {\n console.warn(\n \"Deprecated. Please use formatHours from @activecollab/components.\"\n );\n if (!num) {\n return \"\";\n }\n if (typeof num === \"string\" && !num) {\n return withLeadingZeroHours ? `00:00` : \"0:00\";\n }\n if (typeof num === \"string\" && num.indexOf(\":\") >= 0) {\n //eslint-disable-next-line\n let [_hours, _minutes] = num.split(\":\");\n if (_minutes && _minutes.length === 1 && Number(_minutes) < 10) {\n _minutes = `${Number(_minutes)}0`;\n }\n if (_hours && _minutes) {\n if (withLeadingZeroHours) {\n return `${withLeadingZero(_hours)}:${_minutes}`;\n }\n return `${_hours}:${_minutes}`;\n } else if (!_hours && _minutes) {\n return withLeadingZeroHours ? `00:${_minutes}` : `0:${_minutes}`;\n } else if (!_minutes && _hours) {\n return withLeadingZeroHours\n ? `${withLeadingZero(_hours)}:00`\n : `${_hours}:00`;\n } else {\n return withLeadingZeroHours ? `00:00` : \"0:00\";\n }\n }\n if (typeof num === \"string\" && num.indexOf(\",\") >= 0) {\n num = num.replace(\",\", \".\");\n }\n const input = typeof num === \"string\" ? parseFloat(num) : num;\n\n if (!isDecimal(input)) {\n if (withLeadingZeroHours) {\n return `${withLeadingZero(input)}:00`;\n }\n return `${input}:00`;\n }\n\n const decimal = input.toFixed(2);\n const time = decimal.toString().split(\".\");\n let hours: string = time[0];\n if (withLeadingZeroHours) {\n hours = withLeadingZero(hours);\n }\n const minutes: string = time[1];\n const minutes_formatted = Math.round((parseInt(minutes, 10) / 100) * 60);\n\n return `${hours}:${withLeadingZero(minutes_formatted)}`;\n};\n\nexport const withLeadingZero = (num: string | number, size = 2) => {\n let s = `${num}`;\n while (s.length < size) s = `0` + s;\n return s;\n};\n\nexport const isDecimal = (num: number): boolean => {\n return !Number.isInteger(num);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,WAAW,GAAG,SAAAA,CACzBC,GAAgC,EAChCC,oBAAoB,EACT;EAAA,IADXA,oBAAoB;IAApBA,oBAAoB,GAAG,KAAK;EAAA;EAE5B,IAAI,CAACD,GAAG,EAAE;IACR,OAAO,EAAE;EACX;EACA,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAI,CAACA,GAAG,EAAE;IACnC,OAAOC,oBAAoB,aAAa,MAAM;EAChD;EACA,IAAI,OAAOD,GAAG,KAAK,QAAQ,IAAIA,GAAG,CAACE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;IACpD;IACA,IAAI,CAACC,MAAM,EAAEC,QAAQ,CAAC,GAAGJ,GAAG,CAACK,KAAK,CAAC,GAAG,CAAC;IACvC,IAAID,QAAQ,IA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OAAO,MAAMX,eAAe,GAAG,SAAAA,CAACR,GAAoB,EAAE0B,IAAI,EAAS;EAAA,IAAbA,IAAI;IAAJA,IAAI,GAAG,CAAC;EAAA;EAC5D,IAAIC,CAAC,QAAM3B,GAAK;EAChB,OAAO2B,CAAC,CAACrB,MAAM,GAAGoB,IAAI,EAAEC,CAAC,GAAG,MAAMA,CAAC;EACnC,OAAOA,CAAC;AACV,CAAC;AAED,OAAO,MAAMf,SAAS,GAAIZ,GAAW,IAAc;EACjD,OAAO,CAACO,MAAM,CAACqB,SAAS,CAAC5B,GAAG,CAAC;AAC/B,CAAC"}
@@ -1,10 +1,10 @@
1
- import { decimalToHours } from "./timeUtils";
1
+ import { formatHours } from "./timeUtils";
2
2
  describe("timeUtis.ts", () => {
3
3
  it.each([["1:30", "1:30"], ["1:30", "01:30", true], ["1.5", "1:30"], ["1.05", "1:03"], ["5,5", "5:30"], ["5.5", "5:30"], ["5:30", "5:30"], [",5", "0:30"], [".5", "0:30"], ["", ""], [":", "0:00"], ["1:", "1:00"], ["1:", "01:00", true], [":05", "00:05", true], [",05", "00:03", true], [0.5, "00:30", true], [1.5, "01:30", true], [1.5, "1:30", false], ["0:3", "0:30", false], ["555:35", "555:35", false], ["555", "555:00", false], [555.5, "555:30", false]])("should formatTime", function (value, expected, leadingZero) {
4
4
  if (leadingZero === void 0) {
5
5
  leadingZero = false;
6
6
  }
7
- expect(decimalToHours(value, leadingZero)).toEqual(expected);
7
+ expect(formatHours(value, leadingZero)).toEqual(expected);
8
8
  });
9
9
  });
10
10
  //# sourceMappingURL=timeUtils.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"timeUtils.test.js","names":["decimalToHours","describe","it","each","value","expected","leadingZero","expect","toEqual"],"sources":["../../../src/utils/timeUtils.test.ts"],"sourcesContent":["import { decimalToHours } from \"./timeUtils\";\n\ndescribe(\"timeUtis.ts\", () => {\n it.each([\n [\"1:30\", \"1:30\"],\n [\"1:30\", \"01:30\", true],\n [\"1.5\", \"1:30\"],\n [\"1.05\", \"1:03\"],\n [\"5,5\", \"5:30\"],\n [\"5.5\", \"5:30\"],\n [\"5:30\", \"5:30\"],\n [\",5\", \"0:30\"],\n [\".5\", \"0:30\"],\n [\"\", \"\"],\n [\":\", \"0:00\"],\n [\"1:\", \"1:00\"],\n [\"1:\", \"01:00\", true],\n [\":05\", \"00:05\", true],\n [\",05\", \"00:03\", true],\n [0.5, \"00:30\", true],\n [1.5, \"01:30\", true],\n [1.5, \"1:30\", false],\n [\"0:3\", \"0:30\", false],\n [\"555:35\", \"555:35\", false],\n [\"555\", \"555:00\", false],\n [555.5, \"555:30\", false],\n ])(\"should formatTime\", (value, expected, leadingZero = false) => {\n expect(decimalToHours(value, leadingZero)).toEqual(expected);\n });\n});\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,aAAa;AAE5CC,QAAQ,CAAC,aAAa,EAAE,MAAM;EAC5BC,EAAE,CAACC,IAAI,CAAC,CACN,CAAC,MAAM,EAAE,MAAM,CAAC,EAChB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EACvB,CAAC,KAAK,EAAE,MAAM,CAAC,EACf,CAAC,MAAM,EAAE,MAAM,CAAC,EAChB,CAAC,KAAK,EAAE,MAAM,CAAC,EACf,CAAC,KAAK,EAAE,MAAM,CAAC,EACf,CAAC,MAAM,EAAE,MAAM,CAAC,EAChB,CAAC,IAAI,EAAE,MAAM,CAAC,EACd,CAAC,IAAI,EAAE,MAAM,CAAC,EACd,CAAC,EAAE,EAAE,EAAE,CAAC,EACR,CAAC,GAAG,EAAE,MAAM,CAAC,EACb,CAAC,IAAI,EAAE,MAAM,CAAC,EACd,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EACrB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EACtB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EACtB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,EACpB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,EACpB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EACpB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EACtB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,EAC3B,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,EACxB,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CACzB,CAAC,CAAC,mBAAmB,EAAE,UAACC,KAAK,EAAEC,QAAQ,EAAEC,WAAW,EAAa;IAAA,IAAxBA,WAAW;MAAXA,WAAW,GAAG,KAAK;IAAA;IAC3DC,MAAM,CAACP,cAAc,CAACI,KAAK,EAAEE,WAAW,CAAC,CAAC,CAACE,OAAO,CAACH,QAAQ,CAAC;EAC9D,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"timeUtils.test.js","names":["formatHours","describe","it","each","value","expected","leadingZero","expect","toEqual"],"sources":["../../../src/utils/timeUtils.test.ts"],"sourcesContent":["import { formatHours } from \"./timeUtils\";\n\ndescribe(\"timeUtis.ts\", () => {\n it.each([\n [\"1:30\", \"1:30\"],\n [\"1:30\", \"01:30\", true],\n [\"1.5\", \"1:30\"],\n [\"1.05\", \"1:03\"],\n [\"5,5\", \"5:30\"],\n [\"5.5\", \"5:30\"],\n [\"5:30\", \"5:30\"],\n [\",5\", \"0:30\"],\n [\".5\", \"0:30\"],\n [\"\", \"\"],\n [\":\", \"0:00\"],\n [\"1:\", \"1:00\"],\n [\"1:\", \"01:00\", true],\n [\":05\", \"00:05\", true],\n [\",05\", \"00:03\", true],\n [0.5, \"00:30\", true],\n [1.5, \"01:30\", true],\n [1.5, \"1:30\", false],\n [\"0:3\", \"0:30\", false],\n [\"555:35\", \"555:35\", false],\n [\"555\", \"555:00\", false],\n [555.5, \"555:30\", false],\n ])(\"should formatTime\", (value, expected, leadingZero = false) => {\n expect(formatHours(value, leadingZero)).toEqual(expected);\n });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C,CAACE,OAAO,CAACH,QAAQ,CAAC;EAC3D,CAAC,CAAC;AACJ,CAAC,CAAC"}
package/dist/index.js CHANGED
@@ -767,38 +767,23 @@
767
767
  };
768
768
  var useResizeObserver$1 = useResizeObserver;
769
769
 
770
- // export const decimalToHours = (decimal: string) => {
771
- // // we round it on two decimals first, to eliminate quirks, eg, 5.99999999 will return 5:59 instead of 6:00
772
- // decimal = parseFloat(decimal).toFixed(2);
773
- // decimal = decimal + "";
774
- // let hours;
775
- // let minutes_decimal;
776
- //
777
- // if (decimal.indexOf(".") < 0) {
778
- // hours = parseInt(decimal);
779
- // minutes_decimal = 0;
780
- // } else {
781
- // hours = parseInt(decimal.substring(0, decimal.indexOf(".")));
782
- // minutes_decimal = decimal.substring(decimal.indexOf(".") + 1);
783
- // minutes_decimal = minutes_decimal.substring(0, 2);
784
- // if (minutes_decimal.length === 1) {
785
- // minutes_decimal += "0";
786
- // } // if
787
- // minutes_decimal = parseInt(minutes_decimal);
788
- // } // if
789
- //
790
- // const minutes = Math.round((minutes_decimal / 100) * 60);
791
- //
792
- // if (hours < 10) {
793
- // hours = `0${hours}`;
794
- // }
795
- // return {
796
- // hours: hours,
797
- // minutes: minutes,
798
- // };
799
- // };
800
-
801
- var decimalToHours = function decimalToHours(num) {
770
+ /**
771
+ * @function formatHours
772
+ * @description
773
+ * Formats a decimal number representing hours into a formatted string (HH:MM).
774
+ * The input can be a number, string, or undefined. The function handles various formats
775
+ * and can optionally add a leading zero to the hours component.
776
+ *
777
+ * @param {number | string | undefined} num - The input representing the hours, which can be in decimal format, a time string, or undefined.
778
+ * @param {boolean} [withLeadingZeroHours=false] - Whether to add a leading zero to the hours part of the output.
779
+ *
780
+ * @returns {string} - A formatted time string in HH:MM format.
781
+ *
782
+ * @example
783
+ * formatHours(1.5) // "1:30"
784
+ * formatHours("3.5", true) // "03:30"
785
+ */
786
+ var formatHours = function formatHours(num) {
802
787
  var withLeadingZeroHours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
803
788
  if (!num) {
804
789
  return "";
@@ -848,6 +833,75 @@
848
833
  var minutes_formatted = Math.round(parseInt(minutes, 10) / 100 * 60);
849
834
  return "".concat(hours, ":").concat(withLeadingZero(minutes_formatted));
850
835
  };
836
+
837
+ /**
838
+ * @function decimalToHours
839
+ * @deprecated
840
+ * @description
841
+ * Converts a decimal number representing hours into a formatted string (HH:MM).
842
+ * The input can be a number, string, or undefined. The function handles various formats
843
+ * and can optionally add a leading zero to the hours component.
844
+ *
845
+ * @param {number | string | undefined} num - The input representing the hours, which can be in decimal format, a time string, or undefined.
846
+ * @param {boolean} [withLeadingZeroHours=false] - Whether to add a leading zero to the hours part of the output.
847
+ *
848
+ * @returns {string} - A formatted time string in HH:MM format.
849
+ *
850
+ * @example
851
+ * decimalToHours(1.5) // "1:30"
852
+ * decimalToHours("3.5", true) // "03:30"
853
+ */
854
+ var decimalToHours = function decimalToHours(num) {
855
+ var withLeadingZeroHours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
856
+ console.warn("Deprecated. Please use formatHours from @activecollab/components.");
857
+ if (!num) {
858
+ return "";
859
+ }
860
+ if (typeof num === "string" && !num) {
861
+ return withLeadingZeroHours ? "00:00" : "0:00";
862
+ }
863
+ if (typeof num === "string" && num.indexOf(":") >= 0) {
864
+ //eslint-disable-next-line
865
+ var _num$split3 = num.split(":"),
866
+ _num$split4 = _slicedToArray(_num$split3, 2),
867
+ _hours = _num$split4[0],
868
+ _minutes = _num$split4[1];
869
+ if (_minutes && _minutes.length === 1 && Number(_minutes) < 10) {
870
+ _minutes = "".concat(Number(_minutes), "0");
871
+ }
872
+ if (_hours && _minutes) {
873
+ if (withLeadingZeroHours) {
874
+ return "".concat(withLeadingZero(_hours), ":").concat(_minutes);
875
+ }
876
+ return "".concat(_hours, ":").concat(_minutes);
877
+ } else if (!_hours && _minutes) {
878
+ return withLeadingZeroHours ? "00:".concat(_minutes) : "0:".concat(_minutes);
879
+ } else if (!_minutes && _hours) {
880
+ return withLeadingZeroHours ? "".concat(withLeadingZero(_hours), ":00") : "".concat(_hours, ":00");
881
+ } else {
882
+ return withLeadingZeroHours ? "00:00" : "0:00";
883
+ }
884
+ }
885
+ if (typeof num === "string" && num.indexOf(",") >= 0) {
886
+ num = num.replace(",", ".");
887
+ }
888
+ var input = typeof num === "string" ? parseFloat(num) : num;
889
+ if (!isDecimal(input)) {
890
+ if (withLeadingZeroHours) {
891
+ return "".concat(withLeadingZero(input), ":00");
892
+ }
893
+ return "".concat(input, ":00");
894
+ }
895
+ var decimal = input.toFixed(2);
896
+ var time = decimal.toString().split(".");
897
+ var hours = time[0];
898
+ if (withLeadingZeroHours) {
899
+ hours = withLeadingZero(hours);
900
+ }
901
+ var minutes = time[1];
902
+ var minutes_formatted = Math.round(parseInt(minutes, 10) / 100 * 60);
903
+ return "".concat(hours, ":").concat(withLeadingZero(minutes_formatted));
904
+ };
851
905
  var withLeadingZero = function withLeadingZero(num) {
852
906
  var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
853
907
  var s = "".concat(num);
@@ -13561,13 +13615,13 @@
13561
13615
  onChange = _ref.onChange,
13562
13616
  onClick = _ref.onClick;
13563
13617
  var _useState = React.useState(function () {
13564
- return decimalToHours(value, withLeadingZero);
13618
+ return formatHours(value, withLeadingZero);
13565
13619
  }),
13566
13620
  _useState2 = _slicedToArray(_useState, 2),
13567
13621
  currentValue = _useState2[0],
13568
13622
  setCurrentValue = _useState2[1];
13569
13623
  var _useState3 = React.useState(function () {
13570
- return decimalToHours(value, withLeadingZero);
13624
+ return formatHours(value, withLeadingZero);
13571
13625
  }),
13572
13626
  _useState4 = _slicedToArray(_useState3, 2),
13573
13627
  prevValue = _useState4[0],
@@ -13578,7 +13632,7 @@
13578
13632
  setCurrentValue(prevValue);
13579
13633
  } else {
13580
13634
  if (e.target.value.trim().length > 0 && prevValue !== e.target.value) {
13581
- var _value = decimalToHours(e.target.value, withLeadingZero);
13635
+ var _value = formatHours(e.target.value, withLeadingZero);
13582
13636
  setPrevValue(_value);
13583
13637
  setCurrentValue(_value);
13584
13638
  typeof onSave === "function" && onSave(e);
@@ -16549,7 +16603,7 @@
16549
16603
  var StyledSelectTrigger = styled__default["default"](Trigger).withConfig({
16550
16604
  displayName: "Styles__StyledSelectTrigger",
16551
16605
  componentId: "sc-9799p2-0"
16552
- })(["display:flex;align-items:center;justify-content:space-between;padding:0 4px 0 8px;width:300px;transition:border-color 0.3s ease;background-color:transparent;border:none;", " ", " ", " ", " ", " ", " ", ";"], function (_ref) {
16606
+ })(["display:flex;align-items:center;justify-content:space-between;padding:0 4px 0 8px;width:300px;transition:border-color 0.3s ease;background-color:transparent;border:none;", " ", " ", " ", " ", " ", " ", ";", ";"], function (_ref) {
16553
16607
  var $mode = _ref.$mode;
16554
16608
  return $mode === "outlined" && styled.css(["border:1px solid var(--color-theme-500);background-color:var(--input-background-color);"]);
16555
16609
  }, function (_ref2) {
@@ -16577,13 +16631,16 @@
16577
16631
  }, function (_ref7) {
16578
16632
  var $size = _ref7.$size;
16579
16633
  return $size === "big" && styled.css(["height:40px;border-radius:var(--ac-br-8);"]);
16634
+ }, function (_ref8) {
16635
+ var $size = _ref8.$size;
16636
+ return $size === "biggest" && styled.css(["height:48px;border-radius:var(--ac-br-8);"]);
16580
16637
  });
16581
16638
  StyledSelectTrigger.displayName = "StyledSelectTrigger";
16582
16639
  var StyledCaretIcon = styled__default["default"](CollapseExpandSingleIcon$1).withConfig({
16583
16640
  displayName: "Styles__StyledCaretIcon",
16584
16641
  componentId: "sc-9799p2-1"
16585
- })(["margin-left:8px;flex-shrink:0;transition:transform 200ms ease;", ""], function (_ref8) {
16586
- var $open = _ref8.$open;
16642
+ })(["margin-left:8px;flex-shrink:0;transition:transform 200ms ease;", ""], function (_ref9) {
16643
+ var $open = _ref9.$open;
16587
16644
  return !$open && styled.css(["transform:rotate(180deg);"]);
16588
16645
  });
16589
16646
  StyledCaretIcon.displayName = "StyledCaretIcon";
@@ -16604,6 +16661,15 @@
16604
16661
  _ref$mode = _ref.mode,
16605
16662
  mode = _ref$mode === void 0 ? "outlined" : _ref$mode,
16606
16663
  rest = _objectWithoutProperties(_ref, _excluded$n);
16664
+ var variant = React.useMemo(function () {
16665
+ if (size === "big") {
16666
+ return "Body 1";
16667
+ }
16668
+ if (size === "biggest") {
16669
+ return "Header 2";
16670
+ }
16671
+ return "Body 2";
16672
+ }, [size]);
16607
16673
  return /*#__PURE__*/React__default["default"].createElement(StyledSelectTrigger, _extends({
16608
16674
  ref: ref,
16609
16675
  role: "button",
@@ -16616,7 +16682,8 @@
16616
16682
  as: "div",
16617
16683
  overflow: "truncate",
16618
16684
  whitespace: "no-wrap",
16619
- variant: size === "small" || size === "regular" ? "Body 2" : "Body 1",
16685
+ variant: variant,
16686
+ weight: size === "biggest" ? "bold" : "regular",
16620
16687
  color: mode === "flat" && invalid ? "alert" : undefined
16621
16688
  }, typographyProps), children), endAdornment ? endAdornment : /*#__PURE__*/React__default["default"].createElement(StyledCaretIcon, {
16622
16689
  $open: open
@@ -17404,7 +17471,7 @@
17404
17471
  var StyledBackgroundCircle = styled__default["default"].circle.withConfig({
17405
17472
  displayName: "Styles__StyledBackgroundCircle",
17406
17473
  componentId: "sc-o6dcyu-3"
17407
- })(["fill:transparent;transition:stroke-dashoffset 0.5s linear;", " ", ""], function (props) {
17474
+ })(["fill:transparent;transition:stroke-dashoffset 0.5s linear,stroke 300ms ease-out;", " ", ""], function (props) {
17408
17475
  return props.$color ? styled.css(["stroke:", ";"], props.$color) : styled.css(["stroke:var(--color-theme-transparent-300);"]);
17409
17476
  }, function (props) {
17410
17477
  return props.$strokeDashOffset && styled.css(["stroke-dashoffset:", ";"], props.$strokeDashOffset);
@@ -17413,7 +17480,7 @@
17413
17480
  var StyledForegroundCircle = styled__default["default"].circle.withConfig({
17414
17481
  displayName: "Styles__StyledForegroundCircle",
17415
17482
  componentId: "sc-o6dcyu-4"
17416
- })(["fill:transparent;transition:stroke-dashoffset 0.5s linear;", " ", " ", ""], function (props) {
17483
+ })(["fill:transparent;transition:stroke-dashoffset 0.5s linear,stroke 300ms ease-out;", " ", " ", ""], function (props) {
17417
17484
  return props.$roundStroke && styled.css(["stroke-linecap:round;"]);
17418
17485
  }, function (props) {
17419
17486
  return props.$color ? styled.css(["stroke:", ";"], props.$color) : styled.css(["stroke:var(--color-secondary);"]);
@@ -18073,7 +18140,7 @@
18073
18140
  React.useEffect(function () {
18074
18141
  var _value;
18075
18142
  if (defaultValue !== undefined) {
18076
- _value = decimalToHours(defaultValue, withLeadingZero);
18143
+ _value = formatHours(defaultValue, withLeadingZero);
18077
18144
  }
18078
18145
  setCurrentValue(function (prevState) {
18079
18146
  if (prevState !== _value) {
@@ -19963,6 +20030,7 @@
19963
20030
  exports.colors = colors$1;
19964
20031
  exports.decimalToHours = decimalToHours;
19965
20032
  exports.formatCurrency = formatCurrency;
20033
+ exports.formatHours = formatHours;
19966
20034
  exports.formatNumber = formatNumber;
19967
20035
  exports.getNumberFromString = getNumberFromString;
19968
20036
  exports.isOptionGroup = isOptionGroup;