vueless 0.0.447 → 0.0.449

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.447",
3
+ "version": "0.0.449",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -198,13 +198,13 @@ const props = defineProps({
198
198
  const emit = defineEmits([
199
199
  /**
200
200
  * Triggers when checkbox is toggled.
201
- * @property {Boolean} newModelValue
201
+ * @property {Boolean} modelValue
202
202
  */
203
203
  "update:modelValue",
204
204
 
205
205
  /**
206
206
  * Triggers when checkbox is toggled.
207
- * @property {Boolean} newModelValue
207
+ * @property {Boolean} modelValue
208
208
  */
209
209
  "input",
210
210
  ]);
@@ -24,8 +24,8 @@
24
24
  >
25
25
  <!--
26
26
  @slot Use it to add icon before the text.
27
- @binding {string} iconName
28
- @binding {string} iconSize
27
+ @binding {string} icon-name
28
+ @binding {string} icon-size
29
29
  -->
30
30
  <slot name="left-icon" :icon-name="leftIcon" :icon-size="iconSize">
31
31
  <UIcon
@@ -19,7 +19,7 @@
19
19
  <span
20
20
  v-if="!integer"
21
21
  v-bind="pennyAttrs"
22
- v-text="preparedMoney.delimiter + preparedMoney.penny"
22
+ v-text="preparedMoney.decimalSeparator + preparedMoney.penny"
23
23
  />
24
24
 
25
25
  <span
@@ -118,11 +118,11 @@ const props = defineProps({
118
118
  },
119
119
 
120
120
  /**
121
- * Set the delimiter between integer and float (penny) parts.
121
+ * A symbol used to separate the integer part from the fractional part of a number.
122
122
  */
123
- delimiter: {
123
+ decimalSeparator: {
124
124
  type: String,
125
- default: getDefault(defaultConfig, UMoney).delimiter,
125
+ default: getDefault(defaultConfig, UMoney).decimalSeparator,
126
126
  },
127
127
 
128
128
  /**
@@ -200,6 +200,6 @@ const mathSign = computed(() => {
200
200
  });
201
201
 
202
202
  const preparedMoney = computed(() => {
203
- return separatedMoney(Math.abs(props.sum), props.decimalScale, props.delimiter);
203
+ return separatedMoney(Math.abs(props.sum), props.decimalScale, props.decimalSeparator);
204
204
  });
205
205
  </script>
@@ -54,7 +54,7 @@ export default /*tw*/ {
54
54
  align: "left",
55
55
  symbolAlign: "right",
56
56
  decimalScale: 2,
57
- delimiter: ",",
57
+ decimalSeparator: ",",
58
58
  planned: false,
59
59
  integer: false,
60
60
  symbolDivided: true,
@@ -8,17 +8,22 @@ export const ADD_SPACE_IN_MONEY_REG_EX = /(\d)(?=(\d{3})+(\D|$))/g;
8
8
  export const SINGLE_ZERO = "0";
9
9
  export const DOUBLE_ZERO = "00";
10
10
 
11
- export function separatedMoney(money, decimalPlaces = 2, delimiter = ",") {
11
+ export function separatedMoney(money, decimalPlaces = 2, decimalSeparator = ",") {
12
12
  const roundedMoney = money ? money.toFixed(decimalPlaces) : 0;
13
13
 
14
14
  let [integer, penny] = String(roundedMoney).split(".");
15
15
 
16
16
  integer = integer.replace(ADD_SPACE_IN_MONEY_REG_EX, "$1 ");
17
17
 
18
- if (roundedMoney === 0) {
18
+ if (!roundedMoney) {
19
19
  integer = SINGLE_ZERO;
20
20
  penny = DOUBLE_ZERO;
21
21
  }
22
22
 
23
- return { integer, penny, delimiter };
23
+ if (decimalPlaces === 0) {
24
+ decimalSeparator = "";
25
+ penny = "";
26
+ }
27
+
28
+ return { integer, penny, decimalSeparator };
24
29
  }
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.447",
4
+ "version": "0.0.449",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -1592,7 +1592,7 @@
1592
1592
  "type": [
1593
1593
  "Boolean"
1594
1594
  ],
1595
- "name": "newModelValue"
1595
+ "name": "modelValue"
1596
1596
  }
1597
1597
  ]
1598
1598
  },
@@ -1604,7 +1604,7 @@
1604
1604
  "type": [
1605
1605
  "Boolean"
1606
1606
  ],
1607
- "name": "newModelValue"
1607
+ "name": "modelValue"
1608
1608
  }
1609
1609
  ]
1610
1610
  }
@@ -4690,9 +4690,11 @@
4690
4690
  "description": "Use it to add icon before the text.",
4691
4691
  "bindings": [
4692
4692
  {
4693
+ "type": "string",
4693
4694
  "name": "icon-name"
4694
4695
  },
4695
4696
  {
4697
+ "type": "string",
4696
4698
  "name": "icon-size"
4697
4699
  }
4698
4700
  ]
@@ -6631,8 +6633,8 @@
6631
6633
  "default": "2"
6632
6634
  },
6633
6635
  {
6634
- "name": "delimiter",
6635
- "description": "Set the delimiter between integer and float (penny) parts.",
6636
+ "name": "decimalSeparator",
6637
+ "description": "A symbol used to separate the integer part from the fractional part of a number.",
6636
6638
  "value": {
6637
6639
  "kind": "expression",
6638
6640
  "type": "string"