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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.370",
3
+ "version": "0.0.372",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -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 bg-brand-600/10",
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
- * Show prefix in the raw value number.
181
+ * Prefix to display before input value.
183
182
  */
184
- rawValuePrefix: {
185
- type: Boolean,
186
- default: getDefault(defaultConfig, UInputMoney).rawValuePrefix,
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
- rawValuePrefix: props.rawValuePrefix,
253
- prefix: props.minus ? SYMBOL_MINUS : "",
243
+ prefix: props.prefix,
254
244
  }));
255
245
 
256
246
  const localValue = computed({
@@ -8,9 +8,8 @@ export default /*tw*/ {
8
8
  decimalSeparator: ",",
9
9
  thousandsSeparator: " ",
10
10
  labelAlign: "topInside",
11
+ prefix: "",
11
12
  positiveOnly: false,
12
- rawValuePrefix: false,
13
- minus: false,
14
13
  readonly: false,
15
14
  disabled: false,
16
15
  },
@@ -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 Minus = DefaultTemplate.bind({});
102
- Minus.args = { minus: true };
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, rawValuePrefix, prefix } = options;
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 rawValuePrefix ? rawValueWithPrefix : rawValueWithPrefix.replace(prefix, "");
17
+ return rawValueWithPrefix.replace(prefix, "");
18
18
  }
19
19
 
20
20
  static getFormattedValue(value, options) {
@@ -3,5 +3,3 @@
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
5
  export const UMoney = "UMoney";
6
- export const SYMBOL_MINUS = "–";
7
- export const SYMBOL_PLUS = "+";
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
- vuelessConfig = (await import(`${process.cwd()}/vueless.config.js`)).default;
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.370",
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": "rawValuePrefix",
4975
- "description": "Show prefix in the raw value number.",
4974
+ "name": "prefix",
4975
+ "description": "Prefix to display before input value.",
4976
4976
  "value": {
4977
4977
  "kind": "expression",
4978
- "type": "boolean"
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": "false"
4980
+ "default": ""
4990
4981
  },
4991
4982
  {
4992
4983
  "name": "readonly",