@antify/ui 4.1.35 → 4.1.36
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/dist/components/calendar/AntDatePicker.vue +0 -1
- package/dist/components/inputs/AntNumberInput.vue +18 -1
- package/dist/components/inputs/Elements/AntBaseInput.vue +2 -17
- package/dist/components/inputs/__stories/AntNumberInput.stories.js +14 -1
- package/dist/components/inputs/__stories/AntNumberInput.stories.mjs +17 -1
- package/package.json +1 -1
|
@@ -197,7 +197,6 @@ onMounted(() => {
|
|
|
197
197
|
v-for="(day, index) in weekDays"
|
|
198
198
|
:key="`${day}-${index}`"
|
|
199
199
|
class="text-center flex items-center justify-center rounded-md"
|
|
200
|
-
:style="showWeekNumbers && index === 0 ? weekNumberStyles : {}"
|
|
201
200
|
>
|
|
202
201
|
<AntSkeleton
|
|
203
202
|
:visible="skeleton"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import {
|
|
3
|
-
computed, onMounted,
|
|
3
|
+
computed, onMounted, ref, useId,
|
|
4
4
|
} from 'vue';
|
|
5
5
|
import AntButton from '../AntButton.vue';
|
|
6
6
|
import AntField from '../forms/AntField.vue';
|
|
@@ -59,6 +59,7 @@ const props = withDefaults(defineProps<{
|
|
|
59
59
|
indicators?: boolean;
|
|
60
60
|
inputRef?: HTMLInputElement | null;
|
|
61
61
|
selectAllOnFocus?: boolean;
|
|
62
|
+
autocomplete?: 'on' | 'off' | string;
|
|
62
63
|
}>(), {
|
|
63
64
|
state: InputState.base,
|
|
64
65
|
disabled: false,
|
|
@@ -71,6 +72,7 @@ const props = withDefaults(defineProps<{
|
|
|
71
72
|
indicators: false,
|
|
72
73
|
inputRef: null,
|
|
73
74
|
selectAllOnFocus: false,
|
|
75
|
+
autocomplete: 'off',
|
|
74
76
|
});
|
|
75
77
|
const emit = defineEmits([
|
|
76
78
|
'update:modelValue',
|
|
@@ -203,6 +205,7 @@ function onButtonBlur(e: FocusEvent) {
|
|
|
203
205
|
if (props.max !== undefined && finalValue > props.max) {
|
|
204
206
|
finalValue = props.max;
|
|
205
207
|
}
|
|
208
|
+
|
|
206
209
|
if (props.min !== undefined && finalValue < props.min) {
|
|
207
210
|
finalValue = props.min;
|
|
208
211
|
}
|
|
@@ -226,6 +229,19 @@ function onKeyDown(e: KeyboardEvent) {
|
|
|
226
229
|
return;
|
|
227
230
|
}
|
|
228
231
|
|
|
232
|
+
if (e.key === 'ArrowUp') {
|
|
233
|
+
e.preventDefault();
|
|
234
|
+
add();
|
|
235
|
+
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (e.key === 'ArrowDown') {
|
|
239
|
+
e.preventDefault();
|
|
240
|
+
subtract();
|
|
241
|
+
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
|
|
229
245
|
const allowedKeys = [
|
|
230
246
|
'Backspace',
|
|
231
247
|
'Delete',
|
|
@@ -293,6 +309,7 @@ onMounted(() => {
|
|
|
293
309
|
v-model:input-ref="_inputRef"
|
|
294
310
|
:type="BaseInputType.number"
|
|
295
311
|
:grouped="indicators ? Grouped.center : Grouped.none"
|
|
312
|
+
:autocomplete="autocomplete"
|
|
296
313
|
wrapper-class="grow"
|
|
297
314
|
:state="state"
|
|
298
315
|
:size="size"
|
|
@@ -74,7 +74,6 @@ const props = withDefaults(defineProps<{
|
|
|
74
74
|
default: false,
|
|
75
75
|
nullable: false,
|
|
76
76
|
inputRef: null,
|
|
77
|
-
step: 1,
|
|
78
77
|
});
|
|
79
78
|
const slot = useSlots();
|
|
80
79
|
const hasInputState = computed(() => props.skeleton || props.disabled);
|
|
@@ -163,26 +162,13 @@ const icon = computed(() => icons[props.state]);
|
|
|
163
162
|
const _modelValue = computed<string | number | null>({
|
|
164
163
|
get: () => props.modelValue,
|
|
165
164
|
set: (val: string | number | null) => {
|
|
166
|
-
if (props.type === BaseInputType.number) {
|
|
167
|
-
|
|
168
|
-
emit('update:modelValue', null);
|
|
169
|
-
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
const num = Number(val);
|
|
174
|
-
|
|
175
|
-
if (!isNaN(num)) {
|
|
176
|
-
emit('update:modelValue', num);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
return;
|
|
165
|
+
if (props.type === BaseInputType.number && typeof val !== 'number') {
|
|
166
|
+
return emit('update:modelValue', null);
|
|
180
167
|
}
|
|
181
168
|
|
|
182
169
|
emit('update:modelValue', val);
|
|
183
170
|
},
|
|
184
171
|
});
|
|
185
|
-
|
|
186
172
|
const inputIconSize = computed(() => {
|
|
187
173
|
if (props.size === Size.xs || props.size === Size.xs2) {
|
|
188
174
|
return IconSize.xs;
|
|
@@ -285,7 +271,6 @@ function onClickClearIcon() {
|
|
|
285
271
|
:min="min"
|
|
286
272
|
:max="max"
|
|
287
273
|
title=""
|
|
288
|
-
:step="step"
|
|
289
274
|
v-bind="$attrs"
|
|
290
275
|
:data-e2e-state="state"
|
|
291
276
|
@blur="onBlur"
|
|
@@ -62,6 +62,18 @@ const meta = {
|
|
|
62
62
|
control: {
|
|
63
63
|
type: "number"
|
|
64
64
|
}
|
|
65
|
+
},
|
|
66
|
+
autocomplete: {
|
|
67
|
+
control: {
|
|
68
|
+
type: "inline-radio"
|
|
69
|
+
},
|
|
70
|
+
options: ["on", "off"],
|
|
71
|
+
description: "Enables or disables browser suggestions and autocomplete.",
|
|
72
|
+
table: {
|
|
73
|
+
defaultValue: {
|
|
74
|
+
summary: "off"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
65
77
|
}
|
|
66
78
|
}
|
|
67
79
|
};
|
|
@@ -83,7 +95,8 @@ const Docs = exports.Docs = {
|
|
|
83
95
|
steps: 1,
|
|
84
96
|
label: "Standard Number Input",
|
|
85
97
|
description: "Basic usage with manual entry or indicators",
|
|
86
|
-
onValidate: (0, _test.fn)()
|
|
98
|
+
onValidate: (0, _test.fn)(),
|
|
99
|
+
autocomplete: "off"
|
|
87
100
|
}
|
|
88
101
|
};
|
|
89
102
|
const SelectAllOnFocus = exports.SelectAllOnFocus = {
|
|
@@ -63,6 +63,21 @@ const meta = {
|
|
|
63
63
|
control: {
|
|
64
64
|
type: "number"
|
|
65
65
|
}
|
|
66
|
+
},
|
|
67
|
+
autocomplete: {
|
|
68
|
+
control: {
|
|
69
|
+
type: "inline-radio"
|
|
70
|
+
},
|
|
71
|
+
options: [
|
|
72
|
+
"on",
|
|
73
|
+
"off"
|
|
74
|
+
],
|
|
75
|
+
description: "Enables or disables browser suggestions and autocomplete.",
|
|
76
|
+
table: {
|
|
77
|
+
defaultValue: {
|
|
78
|
+
summary: "off"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
66
81
|
}
|
|
67
82
|
}
|
|
68
83
|
};
|
|
@@ -84,7 +99,8 @@ export const Docs = {
|
|
|
84
99
|
steps: 1,
|
|
85
100
|
label: "Standard Number Input",
|
|
86
101
|
description: "Basic usage with manual entry or indicators",
|
|
87
|
-
onValidate: fn()
|
|
102
|
+
onValidate: fn(),
|
|
103
|
+
autocomplete: "off"
|
|
88
104
|
}
|
|
89
105
|
};
|
|
90
106
|
export const SelectAllOnFocus = {
|