@tmagic/form 1.1.0-beta.9 → 1.1.0
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,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.1.0
|
|
2
|
+
"version": "1.1.0",
|
|
3
3
|
"name": "@tmagic/form",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"dist/*",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"url": "https://github.com/Tencent/tmagic-editor.git"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@element-plus/icons-vue": "^2.0.
|
|
38
|
-
"@tmagic/utils": "1.1.0
|
|
37
|
+
"@element-plus/icons-vue": "^2.0.9",
|
|
38
|
+
"@tmagic/utils": "1.1.0",
|
|
39
39
|
"element-plus": "^2.2.6",
|
|
40
40
|
"lodash-es": "^4.17.21",
|
|
41
41
|
"sortablejs": "^1.14.0",
|
package/src/fields/Text.vue
CHANGED
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
<script lang="ts">
|
|
27
27
|
import { computed, defineComponent, inject, PropType } from 'vue';
|
|
28
28
|
|
|
29
|
+
import { isNumber } from '@tmagic/utils';
|
|
30
|
+
|
|
29
31
|
import { FormState, TextConfig } from '../schema';
|
|
30
32
|
import fieldProps from '../utils/fieldProps';
|
|
31
33
|
import { useAddField } from '../utils/useAddField';
|
|
@@ -86,7 +88,7 @@ export default defineComponent({
|
|
|
86
88
|
const value = props.model[modelName.value];
|
|
87
89
|
let num;
|
|
88
90
|
let unit;
|
|
89
|
-
if (
|
|
91
|
+
if (isNumber(value)) {
|
|
90
92
|
num = +value;
|
|
91
93
|
} else {
|
|
92
94
|
value.replace(/^([0-9.]+)([a-z%]+)$/, ($0: string, $1: string, $2: string) => {
|
|
@@ -100,7 +102,7 @@ export default defineComponent({
|
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
const ctrl = navigator.platform.match('Mac') ? $event.metaKey : $event.ctrlKey;
|
|
103
|
-
const
|
|
105
|
+
const shift = $event.shiftKey;
|
|
104
106
|
const alt = $event.altKey;
|
|
105
107
|
|
|
106
108
|
if (arrowUp) {
|
|
@@ -108,7 +110,7 @@ export default defineComponent({
|
|
|
108
110
|
num += 100;
|
|
109
111
|
} else if (alt) {
|
|
110
112
|
num = (num * 10000 + 1000) / 10000;
|
|
111
|
-
} else if (
|
|
113
|
+
} else if (shift) {
|
|
112
114
|
num = num + 10;
|
|
113
115
|
} else {
|
|
114
116
|
num += 1;
|
|
@@ -118,7 +120,7 @@ export default defineComponent({
|
|
|
118
120
|
num -= 100;
|
|
119
121
|
} else if (alt) {
|
|
120
122
|
num = (num * 10000 - 1000) / 10000;
|
|
121
|
-
} else if (
|
|
123
|
+
} else if (shift) {
|
|
122
124
|
num -= 10;
|
|
123
125
|
} else {
|
|
124
126
|
num -= 1;
|