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 +1 -1
- package/ui.button/UButton.vue +18 -1
- package/ui.form-input-money/utilFormat.js +5 -10
- package/web-types.json +1 -1
package/package.json
CHANGED
package/ui.button/UButton.vue
CHANGED
|
@@ -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
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
const formattedValue = intlNumber
|
|
69
|
+
.format(rawValue)
|
|
70
|
+
.replaceAll(this.comma, thousandsSeparator)
|
|
71
|
+
.replaceAll(this.rawDecimalMark, decimalSeparator);
|
|
72
72
|
|
|
73
|
-
|
|
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
|
}
|