vueless 0.0.665 → 0.0.667
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
|
@@ -46,7 +46,9 @@ const toggleIconConfig = computed(() => {
|
|
|
46
46
|
const nestedRow = props.row?.row;
|
|
47
47
|
let isShown = false;
|
|
48
48
|
|
|
49
|
-
if (
|
|
49
|
+
if (props.row.nestedData) {
|
|
50
|
+
isShown = Boolean(props.row.nestedData.isShown);
|
|
51
|
+
} else if (Array.isArray(nestedRow)) {
|
|
50
52
|
isShown = nestedRow.some((row) => row.isShown);
|
|
51
53
|
} else {
|
|
52
54
|
isShown = Boolean(nestedRow?.isShown);
|
|
@@ -76,10 +78,16 @@ const isNestedRowEmpty = computed(() => {
|
|
|
76
78
|
return !Object.keys(mapRowColumns(props.row.row, props.columns)).length;
|
|
77
79
|
});
|
|
78
80
|
|
|
81
|
+
const isNestedDataEmpty = computed(() => {
|
|
82
|
+
if (!props.row.nestedData) return true;
|
|
83
|
+
|
|
84
|
+
return !props.row.nestedData.rows || !props.row.nestedData.rows.length;
|
|
85
|
+
});
|
|
86
|
+
|
|
79
87
|
const isShownToggleIcon = computed(() => {
|
|
80
88
|
return (
|
|
81
89
|
(props.row.row && !isNestedRowEmpty.value) ||
|
|
82
|
-
(props.row.nestedData && hasSlotContent(slots["nested-content"]))
|
|
90
|
+
(props.row.nestedData && !isNestedDataEmpty.value && hasSlotContent(slots["nested-content"]))
|
|
83
91
|
);
|
|
84
92
|
});
|
|
85
93
|
|
package/ui.text-money/UMoney.vue
CHANGED
|
@@ -7,7 +7,7 @@ import { hasSlotContent } from "../utils/helper.ts";
|
|
|
7
7
|
|
|
8
8
|
import { COMPONENT_NAME } from "./constants.ts";
|
|
9
9
|
import defaultConfig from "./config.ts";
|
|
10
|
-
import { separatedMoney, MONEY_SIGN_TYPE } from "./utilMoney.ts";
|
|
10
|
+
import { separatedMoney, MONEY_SIGN_TYPE, MATH_SIGN } from "./utilMoney.ts";
|
|
11
11
|
|
|
12
12
|
import type { Props, Config } from "./types.ts";
|
|
13
13
|
|
|
@@ -31,8 +31,10 @@ const currencySpace = computed(() => {
|
|
|
31
31
|
const mathSign = computed(() => {
|
|
32
32
|
let type = "";
|
|
33
33
|
|
|
34
|
-
if (props.sign === MONEY_SIGN_TYPE.
|
|
35
|
-
if (props.sign === MONEY_SIGN_TYPE.
|
|
34
|
+
if (props.sign === MONEY_SIGN_TYPE.unsigned) type = "";
|
|
35
|
+
if (props.sign === MONEY_SIGN_TYPE.positive) type = MATH_SIGN.PLUS;
|
|
36
|
+
if (props.sign === MONEY_SIGN_TYPE.negative) type = MATH_SIGN.MINUS;
|
|
37
|
+
if (props.sign === MONEY_SIGN_TYPE.auto && props.value < 0) type = MATH_SIGN.MINUS;
|
|
36
38
|
|
|
37
39
|
return type;
|
|
38
40
|
});
|
package/ui.text-money/config.ts
CHANGED
|
@@ -28,7 +28,7 @@ export default {
|
|
|
28
28
|
args: {
|
|
29
29
|
value: 10,
|
|
30
30
|
symbol: "$",
|
|
31
|
-
sign: "
|
|
31
|
+
sign: "auto",
|
|
32
32
|
},
|
|
33
33
|
argTypes: {
|
|
34
34
|
...getArgTypes(UMoney.__name),
|
|
@@ -95,7 +95,7 @@ Colors.args = {
|
|
|
95
95
|
enum: "color",
|
|
96
96
|
value: 0,
|
|
97
97
|
symbol: "$",
|
|
98
|
-
sign: "
|
|
98
|
+
sign: "auto",
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
export const Sizes = EnumVariantTemplate.bind({});
|
package/ui.text-money/types.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export const MONEY_SIGN_TYPE = {
|
|
2
|
-
|
|
2
|
+
auto: "auto",
|
|
3
3
|
positive: "positive",
|
|
4
4
|
negative: "negative",
|
|
5
|
+
unsigned: "unsigned",
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const MATH_SIGN = {
|
|
9
|
+
PLUS: "+",
|
|
10
|
+
MINUS: "-",
|
|
5
11
|
};
|
|
6
12
|
|
|
7
13
|
export const ADD_SPACE_IN_MONEY_REG_EX = /(\d)(?=(\d{3})+(\D|$))/g;
|