intelliwaketssveltekitv25 0.1.111 → 0.1.112

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.
@@ -1,5 +1,18 @@
1
1
  <script lang="ts">
2
+ /**
3
+ * @component NumberFormat
4
+ * @description Provides a span with formatted number version of the value based on the paramemters provided
5
+ * @param {number | string | null} value - The value to be displayed
6
+ * @param {boolean} currency - If the value should be displayed as $1,234.56
7
+ * @param {boolean} percent - If the value should be displayed as 12.3%
8
+ * @param {boolean} dash - If blanks should show as dashes instead
9
+ * @param {boolean} blank - If zero should show as blank instead of 0
10
+ * @param {number} decimals - Number of decimal places to show
11
+ * @param {string} className - CSS class name to apply to span
12
+ * @param {string} classNameAddOnNegative - Additional CSS class name to apply when value is negative
13
+ */
2
14
  import {
15
+ CleanNumber,
3
16
  ToCurrency,
4
17
  ToCurrencyBlank,
5
18
  ToCurrencyDash,
@@ -32,11 +45,10 @@
32
45
  } = $props()
33
46
  </script>
34
47
 
35
-
36
48
  <span
37
49
  data-color="danger"
38
50
  class={
39
- (className ?? '') + ' ' + ((value ?? 0) < 0 ? classNameAddOnNegative ?? 'text-red-600' : '')
51
+ (className ?? '') + ' ' + (CleanNumber(value, 4) < 0 ? classNameAddOnNegative ?? 'text-red-600' : '')
40
52
  }>
41
53
  {percent
42
54
  ? blank
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelliwaketssveltekitv25",
3
- "version": "0.1.111",
3
+ "version": "0.1.112",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",