vueless 0.0.468 → 0.0.470

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.468",
3
+ "version": "0.0.470",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -5,6 +5,7 @@
5
5
  ref="buttonRef"
6
6
  :disabled="disabled"
7
7
  v-bind="buttonAttrs"
8
+ :style="buttonStyle"
8
9
  :tabindex="!loading ? tabindex : -1"
9
10
  :data-test="dataTest"
10
11
  >
@@ -80,7 +81,7 @@
80
81
  </template>
81
82
 
82
83
  <script setup>
83
- import { computed, ref, watchEffect, useId } from "vue";
84
+ import { computed, ref, watchEffect, useId, watch } from "vue";
84
85
 
85
86
  import { getDefault } from "../utils/utilUI.js";
86
87
  import ULoader from "../ui.loader/ULoader.vue";
@@ -255,6 +256,8 @@ const { buttonAttrs, loaderAttrs, leftIconAttrs, rightIconAttrs, centerIconAttrs
255
256
  useAttrs(props);
256
257
 
257
258
  const buttonRef = ref(null);
259
+ const buttonStyle = ref(null);
260
+ const buttonWidth = ref(0);
258
261
 
259
262
  const loaderSize = computed(() => {
260
263
  const sizes = {
@@ -286,6 +289,20 @@ const iconColor = computed(() => {
286
289
  return props.variant === "primary" ? "white" : props.color;
287
290
  });
288
291
 
292
+ watch(
293
+ () => props.loading,
294
+ (newValue) => {
295
+ if (newValue && buttonRef.value) {
296
+ buttonWidth.value = buttonRef.value.offsetWidth;
297
+ }
298
+
299
+ buttonStyle.value = {
300
+ width: newValue ? `${buttonWidth.value}px` : "auto",
301
+ };
302
+ },
303
+ { immediate: true },
304
+ );
305
+
289
306
  watchEffect(() => {
290
307
  props.loading && buttonRef.value.blur();
291
308
  });
@@ -65,16 +65,11 @@ export default class FormatService {
65
65
  rawValuePrefix: false,
66
66
  });
67
67
 
68
- const formattedValue = intlNumber.formatToParts(parseFloat(rawValue) || 0).map((part) => {
69
- if (part.type === "group") part.value = thousandsSeparator;
70
- if (part.type === "decimal") part.value = decimalSeparator;
71
- if (part.type === "fraction") part.value = part.value.padEnd(maxFractionDigits, "0");
68
+ const formattedValue = intlNumber
69
+ .format(rawValue)
70
+ .replaceAll(this.comma, thousandsSeparator)
71
+ .replaceAll(this.rawDecimalMark, decimalSeparator);
72
72
 
73
- return part;
74
- });
75
-
76
- formattedValue.unshift({ value: prefix, type: "minusSign" });
77
-
78
- return formattedValue.map((part) => part.value).join("");
73
+ return prefix + formattedValue;
79
74
  }
80
75
  }
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.468",
4
+ "version": "0.0.470",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",