vueless 0.0.370 → 0.0.372
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-toggle-item/config.js +2 -2
- package/ui.form-input-money/UInputMoney.vue +5 -15
- package/ui.form-input-money/config.js +1 -2
- package/ui.form-input-money/storybook/stories.js +2 -5
- package/ui.form-input-money/utilFormat.js +2 -2
- package/ui.text-money/constants.js +0 -2
- package/utils/utilUI.js +2 -1
- package/web-types.json +5 -14
package/package.json
CHANGED
|
@@ -27,12 +27,12 @@ export default /*tw*/ {
|
|
|
27
27
|
{
|
|
28
28
|
selected: true,
|
|
29
29
|
variant: "primary",
|
|
30
|
-
class: "!text-white bg-brand-600 border-brand-600
|
|
30
|
+
class: "!text-white bg-brand-600 border-brand-600",
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
selected: true,
|
|
34
34
|
variant: "secondary",
|
|
35
|
-
class: "text-brand-600 border-brand-600
|
|
35
|
+
class: "text-brand-600 border-brand-600 bg-brand-600/10",
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
selected: true,
|
|
@@ -47,7 +47,6 @@ import { computed, ref, watch, onMounted, nextTick, useId } from "vue";
|
|
|
47
47
|
import { getDefault } from "../utils/utilUI.js";
|
|
48
48
|
|
|
49
49
|
import UInput from "../ui.form-input/UInput.vue";
|
|
50
|
-
import { SYMBOL_MINUS } from "../ui.text-money/constants.js";
|
|
51
50
|
|
|
52
51
|
import defaultConfig from "./config.js";
|
|
53
52
|
import useAttrs from "./useAttrs.js";
|
|
@@ -179,19 +178,11 @@ const props = defineProps({
|
|
|
179
178
|
},
|
|
180
179
|
|
|
181
180
|
/**
|
|
182
|
-
*
|
|
181
|
+
* Prefix to display before input value.
|
|
183
182
|
*/
|
|
184
|
-
|
|
185
|
-
type:
|
|
186
|
-
default: getDefault(defaultConfig, UInputMoney).
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Show minus sign.
|
|
191
|
-
*/
|
|
192
|
-
minus: {
|
|
193
|
-
type: Boolean,
|
|
194
|
-
default: getDefault(defaultConfig, UInputMoney).minus,
|
|
183
|
+
prefix: {
|
|
184
|
+
type: String,
|
|
185
|
+
default: getDefault(defaultConfig, UInputMoney).prefix,
|
|
195
186
|
},
|
|
196
187
|
|
|
197
188
|
/**
|
|
@@ -249,8 +240,7 @@ const { formattedValue, rawValue, setValue } = useFormatCurrency(`#${elementId}`
|
|
|
249
240
|
decimalSeparator: props.decimalSeparator,
|
|
250
241
|
thousandsSeparator: props.thousandsSeparator,
|
|
251
242
|
positiveOnly: props.positiveOnly,
|
|
252
|
-
|
|
253
|
-
prefix: props.minus ? SYMBOL_MINUS : "",
|
|
243
|
+
prefix: props.prefix,
|
|
254
244
|
}));
|
|
255
245
|
|
|
256
246
|
const localValue = computed({
|
|
@@ -92,14 +92,11 @@ DecimalSeparator.args = { decimalSeparator: "." };
|
|
|
92
92
|
export const ThousandsSeparator = DefaultTemplate.bind({});
|
|
93
93
|
ThousandsSeparator.args = { thousandsSeparator: "-" };
|
|
94
94
|
|
|
95
|
-
export const RawValuePrefix = DefaultTemplate.bind({});
|
|
96
|
-
RawValuePrefix.args = { rawValuePrefix: true };
|
|
97
|
-
|
|
98
95
|
export const PositiveOnly = DefaultTemplate.bind({});
|
|
99
96
|
PositiveOnly.args = { positiveOnly: true };
|
|
100
97
|
|
|
101
|
-
export const
|
|
102
|
-
|
|
98
|
+
export const Prefix = DefaultTemplate.bind({});
|
|
99
|
+
Prefix.args = { prefix: "+" };
|
|
103
100
|
|
|
104
101
|
export const ReadOnly = DefaultTemplate.bind({});
|
|
105
102
|
ReadOnly.args = { readOnly: true };
|
|
@@ -4,7 +4,7 @@ export default class FormatService {
|
|
|
4
4
|
static comma = ",";
|
|
5
5
|
|
|
6
6
|
static getRawValue(value, options) {
|
|
7
|
-
const { thousandsSeparator, decimalSeparator,
|
|
7
|
+
const { thousandsSeparator, decimalSeparator, prefix } = options;
|
|
8
8
|
|
|
9
9
|
value = String(value).endsWith(decimalSeparator)
|
|
10
10
|
? String(value).replace(decimalSeparator, "")
|
|
@@ -14,7 +14,7 @@ export default class FormatService {
|
|
|
14
14
|
.replaceAll(thousandsSeparator, "")
|
|
15
15
|
.replace(decimalSeparator, ".");
|
|
16
16
|
|
|
17
|
-
return
|
|
17
|
+
return rawValueWithPrefix.replace(prefix, "");
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
static getFormattedValue(value, options) {
|
package/utils/utilUI.js
CHANGED
|
@@ -20,7 +20,8 @@ if (isSSR) {
|
|
|
20
20
|
/* Load Vueless config from the project root in IIFE (no top-level await). */
|
|
21
21
|
(async () => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
// eslint-disable-next-line prettier/prettier
|
|
24
|
+
vuelessConfig = (await import(/* @vite-ignore */ `${process.cwd()}/vueless.config.js`)).default;
|
|
24
25
|
} catch (error) {
|
|
25
26
|
vuelessConfig = {};
|
|
26
27
|
}
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.372",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -4971,22 +4971,13 @@
|
|
|
4971
4971
|
"default": "false"
|
|
4972
4972
|
},
|
|
4973
4973
|
{
|
|
4974
|
-
"name": "
|
|
4975
|
-
"description": "
|
|
4974
|
+
"name": "prefix",
|
|
4975
|
+
"description": "Prefix to display before input value.",
|
|
4976
4976
|
"value": {
|
|
4977
4977
|
"kind": "expression",
|
|
4978
|
-
"type": "
|
|
4979
|
-
},
|
|
4980
|
-
"default": "false"
|
|
4981
|
-
},
|
|
4982
|
-
{
|
|
4983
|
-
"name": "minus",
|
|
4984
|
-
"description": "Show minus sign.",
|
|
4985
|
-
"value": {
|
|
4986
|
-
"kind": "expression",
|
|
4987
|
-
"type": "boolean"
|
|
4978
|
+
"type": "string"
|
|
4988
4979
|
},
|
|
4989
|
-
"default": "
|
|
4980
|
+
"default": ""
|
|
4990
4981
|
},
|
|
4991
4982
|
{
|
|
4992
4983
|
"name": "readonly",
|