@dative-gpi/foundation-shared-components 1.0.30 → 1.0.32
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.
|
@@ -251,13 +251,22 @@
|
|
|
251
251
|
<slot
|
|
252
252
|
name="clear"
|
|
253
253
|
>
|
|
254
|
-
<
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
254
|
+
<FSRow
|
|
255
|
+
gap="16px"
|
|
256
|
+
:wrap="false"
|
|
257
|
+
>
|
|
258
|
+
<slot
|
|
259
|
+
v-if="!$props.multiple"
|
|
260
|
+
name="autocomplete-suffix"
|
|
261
|
+
/>
|
|
262
|
+
<FSButton
|
|
263
|
+
v-if="$props.clearable && $props.editable && !!$props.modelValue"
|
|
264
|
+
icon="mdi-close"
|
|
265
|
+
variant="icon"
|
|
266
|
+
:color="ColorEnum.Dark"
|
|
267
|
+
@click="$emit('update:modelValue', null)"
|
|
268
|
+
/>
|
|
269
|
+
</FSRow>
|
|
261
270
|
</slot>
|
|
262
271
|
</template>
|
|
263
272
|
<template
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FSRow
|
|
2
|
+
<FSRow
|
|
3
|
+
class="fs-magic-config-field"
|
|
4
|
+
>
|
|
3
5
|
<component
|
|
4
6
|
class="fs-magic-config-field-value"
|
|
5
7
|
:is="get($props.type)"
|
|
@@ -107,7 +109,7 @@ export default defineComponent({
|
|
|
107
109
|
});
|
|
108
110
|
|
|
109
111
|
const valueToInput = computed((): any => {
|
|
110
|
-
if (props.modelValue
|
|
112
|
+
if (!props.modelValue) {
|
|
111
113
|
return null;
|
|
112
114
|
}
|
|
113
115
|
|
|
@@ -129,8 +131,7 @@ export default defineComponent({
|
|
|
129
131
|
});
|
|
130
132
|
|
|
131
133
|
const inputToValue = (value: any) => {
|
|
132
|
-
|
|
133
|
-
if (value == null) {
|
|
134
|
+
if (!value) {
|
|
134
135
|
emit("update:modelValue", null);
|
|
135
136
|
}
|
|
136
137
|
|
|
@@ -43,13 +43,15 @@ export default defineComponent({
|
|
|
43
43
|
emits: ["update:modelValue"],
|
|
44
44
|
setup(_, { emit }) {
|
|
45
45
|
const onUpdate = (value: string) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
emit("update:modelValue", parseFloat(match[0].replace(",", ".").replace(" ", "")));
|
|
46
|
+
if (value === "-") {
|
|
47
|
+
return;
|
|
49
48
|
}
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
const match = /[-]?([0-9 ]*[,.]?)?[0-9]*/.exec(value);
|
|
50
|
+
if (match != null && !isNaN(parseFloat(match[0].replace(",", ".").replace(" ", "")))) {
|
|
51
|
+
emit("update:modelValue", parseFloat(match[0].replace(",", ".").replace(" ", "")));
|
|
52
|
+
return;
|
|
52
53
|
}
|
|
54
|
+
emit("update:modelValue", 0);
|
|
53
55
|
};
|
|
54
56
|
|
|
55
57
|
return {
|
package/models/rules.ts
CHANGED
|
@@ -31,7 +31,7 @@ export const TagRules = {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const NumberRules = {
|
|
34
|
-
required: (message: string | undefined = undefined) => (value: string) => (
|
|
34
|
+
required: (message: string | undefined = undefined) => (value: string) => (value != null && !isNaN(parseFloat(value))) || (message ?? $tr("ui.rules.required", "Required")),
|
|
35
35
|
min: (min: number, message: string | undefined = undefined) => (value: string) => (!!value && !isNaN(parseFloat(value)) && parseFloat(value) >= min) || (message ?? $tr("ui.rules.number-min", "Must be at least {0}", min.toString())),
|
|
36
36
|
max: (max: number, message: string | undefined = undefined) => (value: string) => (!!value && !isNaN(parseFloat(value)) && parseFloat(value) <= max) || (message ?? $tr("ui.rules.number-max", "Must be at most {0}", max.toString())),
|
|
37
37
|
integer: (message: string | undefined = undefined) => (value: string) => (!!value && !isNaN(parseFloat(value)) && Number.isInteger(parseFloat(value))) || (message ?? $tr("ui.rules.number-integer", "Must be an integer"))
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-shared-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.32",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-shared-domain": "1.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "1.0.32",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.32"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@dative-gpi/bones-ui": "^0.0.75",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"sass": "1.71.1",
|
|
36
36
|
"sass-loader": "13.3.2"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "475c12a7d4e324276c8524486c566dedf0b139ed"
|
|
39
39
|
}
|