vft 0.0.429 → 0.0.430
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/attributes.json +1 -1
- package/es/components/alert/alert.vue2.js +38 -38
- package/es/components/autocomplete/autocomplete.vue2.js +82 -82
- package/es/components/avatar/avatar.vue2.js +23 -23
- package/es/components/avatar-stack/avatar-stack.vue2.js +25 -25
- package/es/components/breadcrumb/breadcrumb-item.vue2.js +19 -19
- package/es/components/button/button.vue2.js +37 -37
- package/es/components/card/card.vue2.js +19 -19
- package/es/components/carousel/carousel.vue2.js +75 -75
- package/es/components/carousel/use-carousel.js +1 -1
- package/es/components/cascader-panel/index.vue2.js +2 -2
- package/es/components/cascader-panel/menu.vue2.js +2 -2
- package/es/components/cascader-panel/node.vue2.js +3 -4
- package/es/components/checkbox/checkbox-button.vue2.js +52 -52
- package/es/components/checkbox/checkbox-group.vue2.js +26 -26
- package/es/components/checkbox/checkbox.vue2.js +57 -57
- package/es/components/clamp/clamp.vue2.js +14 -14
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +17 -17
- package/es/components/clamp-tooltip/clamp-tooltip.vue2.js +19 -19
- package/es/components/col/col.vue2.js +20 -20
- package/es/components/color-picker/color-picker.vue2.js +126 -128
- package/es/components/color-picker/components/sv-panel.vue.js +2 -2
- package/es/components/config-provider/hooks/use-global-config.js +3 -3
- package/es/components/context-menu/context-menu.vue2.js +18 -18
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +37 -39
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +8 -10
- package/es/components/date-picker/date-picker.d.ts +1 -1
- package/es/components/date-picker/index.d.ts +2 -2
- package/es/components/descriptions/description.vue2.js +44 -44
- package/es/components/descriptions/descriptions-row.vue2.js +12 -12
- package/es/components/dialog/dialog-content.vue2.js +31 -31
- package/es/components/dialog/dialog.vue2.js +46 -46
- package/es/components/divider/divider.vue2.js +19 -19
- package/es/components/drawer/drawer.vue2.js +41 -41
- package/es/components/dropdown/dropdown-item-impl.vue2.js +40 -40
- package/es/components/dropdown/dropdown-item.vue2.js +28 -28
- package/es/components/dropdown/dropdown.vue2.js +124 -124
- package/es/components/form/form-item.vue2.js +71 -71
- package/es/components/header-layout/header-layout.vue2.js +25 -25
- package/es/components/icon/icon.vue2.js +15 -15
- package/es/components/icon-text/icon-text.vue2.js +28 -28
- package/es/components/iframe-layout/iframe-layout.vue2.js +13 -13
- package/es/components/iframe-layout/iframe-page.vue2.js +11 -11
- package/es/components/image/image.vue2.js +63 -63
- package/es/components/image-viewer/image-viewer.vue2.js +88 -88
- package/es/components/infinite-scroll/index.d.ts +1 -1
- package/es/components/input/input.vue2.js +112 -112
- package/es/components/input-number/input-number.vue2.js +100 -100
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/link/link.vue2.js +20 -20
- package/es/components/list-cell/list-cell.vue2.js +19 -19
- package/es/components/logo/logo.vue2.js +22 -22
- package/es/components/menu/menu-item-group.vue2.js +8 -8
- package/es/components/menu/menu-item.vue2.js +48 -48
- package/es/components/message/message.vue2.js +66 -66
- package/es/components/modal/modal-footer-action.vue2.js +25 -25
- package/es/components/modal/modal.vue2.js +40 -40
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +30 -30
- package/es/components/page-wrapper/page-wrapper.vue2.js +12 -12
- package/es/components/pagination/components/jumper.vue2.js +18 -18
- package/es/components/pagination/components/next.vue2.js +11 -11
- package/es/components/pagination/components/pager.vue2.js +74 -74
- package/es/components/pagination/components/prev.vue2.js +9 -9
- package/es/components/pagination/components/sizes.vue2.js +18 -18
- package/es/components/pagination/components/total.vue2.js +8 -8
- package/es/components/popconfirm/popconfirm.vue2.js +47 -47
- package/es/components/popover/popover.vue2.js +28 -28
- package/es/components/popper/trigger.vue2.js +9 -9
- package/es/components/progress/progress.vue2.js +87 -87
- package/es/components/qrcode/qrcode.vue2.js +31 -31
- package/es/components/radio/radio-button.vue2.js +17 -17
- package/es/components/radio/radio-group.vue2.js +35 -35
- package/es/components/router-view-content/router-view-content.vue2.js +25 -25
- package/es/components/roving-focus-group/roving-focus-item.vue2.js +30 -30
- package/es/components/row/row.vue2.js +5 -5
- package/es/components/scrollbar/bar.vue2.js +16 -16
- package/es/components/scrollbar/scrollbar.vue2.js +48 -48
- package/es/components/scrollbar/thumb.vue2.js +27 -27
- package/es/components/search/search.vue2.js +29 -29
- package/es/components/select/index.d.ts +1 -1
- package/es/components/select/select.vue.d.ts +1 -1
- package/es/components/side-menu/index.d.ts +2 -8
- package/es/components/side-menu/side-menu.vue.d.ts +5 -59
- package/es/components/side-menu/types.d.ts +107 -0
- package/es/components/skeleton/skeleton-item.vue2.js +9 -9
- package/es/components/skeleton/skeleton.vue2.js +14 -14
- package/es/components/slider/button.vue2.js +54 -54
- package/es/components/slider/slider.vue2.js +106 -106
- package/es/components/steps/item.vue2.js +56 -56
- package/es/components/steps/steps.vue2.js +16 -16
- package/es/components/super-form/super-form-action.vue2.js +28 -28
- package/es/components/super-form/super-form-item.vue2.js +1 -1
- package/es/components/switch/switch.vue2.js +108 -108
- package/es/components/table/field.d.ts +4 -4
- package/es/components/teleport/teleport.vue2.js +6 -6
- package/es/components/time-picker/common/picker.vue.d.ts +1 -1
- package/es/components/time-picker/index.d.ts +2 -2
- package/es/components/time-picker/time-picker.d.ts +1 -1
- package/es/components/timeline/timeline-item.vue2.js +20 -20
- package/es/components/tooltip/content.vue2.js +57 -57
- package/es/components/tooltip/tooltip.vue2.js +66 -66
- package/es/components/tooltip/trigger.vue2.js +42 -42
- package/es/components/tree/tree.vue2.js +72 -72
- package/es/components/upload/upload-content.vue2.js +85 -85
- package/es/components/upload/upload-list.vue2.js +70 -70
- package/es/components/upload/upload.vue2.js +86 -86
- package/es/components/verify-code/verify-code.vue2.js +18 -18
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/vue/vnode.js +1 -1
- package/lib/components/alert/alert.vue2.cjs +1 -1
- package/lib/components/autocomplete/autocomplete.vue2.cjs +1 -1
- package/lib/components/avatar/avatar.vue2.cjs +1 -1
- package/lib/components/avatar-stack/avatar-stack.vue2.cjs +1 -1
- package/lib/components/breadcrumb/breadcrumb-item.vue2.cjs +1 -1
- package/lib/components/button/button.vue2.cjs +1 -1
- package/lib/components/card/card.vue2.cjs +1 -1
- package/lib/components/carousel/carousel.vue2.cjs +1 -1
- package/lib/components/cascader-panel/index.vue2.cjs +1 -1
- package/lib/components/cascader-panel/menu.vue2.cjs +1 -1
- package/lib/components/cascader-panel/node.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox-button.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox-group.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox.vue2.cjs +1 -1
- package/lib/components/clamp/clamp.vue2.cjs +1 -1
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/clamp-tooltip/clamp-tooltip.vue2.cjs +1 -1
- package/lib/components/col/col.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/color-picker/components/sv-panel.vue.cjs +1 -1
- package/lib/components/context-menu/context-menu.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker.d.ts +1 -1
- package/lib/components/date-picker/index.d.ts +2 -2
- package/lib/components/descriptions/description.vue2.cjs +1 -1
- package/lib/components/descriptions/descriptions-row.vue2.cjs +1 -1
- package/lib/components/dialog/dialog-content.vue2.cjs +1 -1
- package/lib/components/dialog/dialog.vue2.cjs +1 -1
- package/lib/components/divider/divider.vue2.cjs +1 -1
- package/lib/components/drawer/drawer.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item-impl.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/form/form-item.vue2.cjs +1 -1
- package/lib/components/header-layout/header-layout.vue2.cjs +1 -1
- package/lib/components/icon/icon.vue2.cjs +1 -1
- package/lib/components/icon-text/icon-text.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-layout.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-page.vue2.cjs +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
- package/lib/components/infinite-scroll/index.d.ts +1 -1
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/input-number/input-number.vue2.cjs +1 -1
- package/lib/components/link/link.vue2.cjs +1 -1
- package/lib/components/list-cell/list-cell.vue2.cjs +1 -1
- package/lib/components/logo/logo.vue2.cjs +1 -1
- package/lib/components/menu/menu-item-group.vue2.cjs +1 -1
- package/lib/components/menu/menu-item.vue2.cjs +1 -1
- package/lib/components/message/message.vue2.cjs +1 -1
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/modal/modal.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/page-wrapper/page-wrapper.vue2.cjs +1 -1
- package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
- package/lib/components/pagination/components/next.vue2.cjs +1 -1
- package/lib/components/pagination/components/pager.vue2.cjs +1 -1
- package/lib/components/pagination/components/prev.vue2.cjs +1 -1
- package/lib/components/pagination/components/sizes.vue2.cjs +1 -1
- package/lib/components/pagination/components/total.vue2.cjs +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/popover/popover.vue2.cjs +1 -1
- package/lib/components/popper/trigger.vue2.cjs +1 -1
- package/lib/components/progress/progress.vue2.cjs +5 -5
- package/lib/components/qrcode/qrcode.vue2.cjs +1 -1
- package/lib/components/radio/radio-button.vue2.cjs +1 -1
- package/lib/components/radio/radio-group.vue2.cjs +1 -1
- package/lib/components/router-view-content/router-view-content.vue2.cjs +1 -1
- package/lib/components/roving-focus-group/roving-focus-item.vue2.cjs +1 -1
- package/lib/components/row/row.vue2.cjs +1 -1
- package/lib/components/scrollbar/bar.vue2.cjs +1 -1
- package/lib/components/scrollbar/scrollbar.vue2.cjs +1 -1
- package/lib/components/scrollbar/thumb.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/select/index.d.ts +1 -1
- package/lib/components/select/select.vue.d.ts +1 -1
- package/lib/components/side-menu/index.d.ts +2 -8
- package/lib/components/side-menu/side-menu.vue.d.ts +5 -59
- package/lib/components/side-menu/types.d.ts +107 -0
- package/lib/components/skeleton/skeleton-item.vue2.cjs +1 -1
- package/lib/components/skeleton/skeleton.vue2.cjs +1 -1
- package/lib/components/slider/button.vue2.cjs +1 -1
- package/lib/components/slider/slider.vue2.cjs +1 -1
- package/lib/components/steps/item.vue2.cjs +1 -1
- package/lib/components/steps/steps.vue2.cjs +1 -1
- package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
- package/lib/components/switch/switch.vue2.cjs +1 -1
- package/lib/components/table/field.d.ts +4 -4
- package/lib/components/teleport/teleport.vue2.cjs +1 -1
- package/lib/components/time-picker/common/picker.vue.d.ts +1 -1
- package/lib/components/time-picker/index.d.ts +2 -2
- package/lib/components/time-picker/time-picker.d.ts +1 -1
- package/lib/components/timeline/timeline-item.vue2.cjs +1 -1
- package/lib/components/tooltip/content.vue2.cjs +1 -1
- package/lib/components/tooltip/tooltip.vue2.cjs +1 -1
- package/lib/components/tooltip/trigger.vue2.cjs +1 -1
- package/lib/components/tree/tree.vue2.cjs +1 -1
- package/lib/components/upload/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/components/verify-code/verify-code.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +5 -5
- package/tags.json +1 -1
- package/theme-style/src/mixins/mixins.scss +1 -0
- package/web-types.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as L, ref as ee, reactive as te, computed as d, watch as ne, onMounted as ie, onUpdated as ue, createElementBlock as C, openBlock as S, withModifiers as V, normalizeClass as P, unref as u, withDirectives as R, createCommentVNode as W, createVNode as B, withKeys as N } from "vue";
|
|
2
2
|
import { isNumber as s, isUndefined as h, isString as le } from "@vft/utils";
|
|
3
3
|
import "../form/index.js";
|
|
4
|
-
import { VftIcon as
|
|
4
|
+
import { VftIcon as Y } from "../icon/index.js";
|
|
5
5
|
import { VftInput as ae } from "../input/index.js";
|
|
6
|
-
import { UPDATE_MODEL_EVENT as f, INPUT_EVENT as I, CHANGE_EVENT as
|
|
6
|
+
import { UPDATE_MODEL_EVENT as f, INPUT_EVENT as I, CHANGE_EVENT as $ } from "../../constants/event.js";
|
|
7
7
|
import "@vueuse/core";
|
|
8
8
|
import { debugWarn as O } from "../../utils/error.js";
|
|
9
9
|
import "../config-provider/hooks/use-global-config.js";
|
|
@@ -12,13 +12,13 @@ import { useNamespace as re } from "../../hooks/use-namespace/index.js";
|
|
|
12
12
|
import "../../hooks/use-model-toggle/index.js";
|
|
13
13
|
import "@popperjs/core";
|
|
14
14
|
import "../../hooks/use-z-index/index.js";
|
|
15
|
-
import { vRepeatClick as
|
|
15
|
+
import { vRepeatClick as H } from "./directives.js";
|
|
16
16
|
import { useFormItem as oe } from "../form/hooks/use-form-item.js";
|
|
17
|
-
import { useFormSize as se, useFormDisabled as
|
|
18
|
-
const
|
|
17
|
+
import { useFormSize as se, useFormDisabled as ce } from "../form/hooks/use-form-common-props.js";
|
|
18
|
+
const me = L({
|
|
19
19
|
name: "vft-input-number"
|
|
20
|
-
}), Be = /* @__PURE__ */
|
|
21
|
-
...
|
|
20
|
+
}), Be = /* @__PURE__ */ L({
|
|
21
|
+
...me,
|
|
22
22
|
props: {
|
|
23
23
|
id: { default: void 0 },
|
|
24
24
|
step: { default: 1 },
|
|
@@ -39,154 +39,154 @@ const ce = H({
|
|
|
39
39
|
validateEvent: { type: Boolean, default: !0 }
|
|
40
40
|
},
|
|
41
41
|
emits: {
|
|
42
|
-
[
|
|
43
|
-
blur: (
|
|
44
|
-
focus: (
|
|
45
|
-
[I]: (
|
|
46
|
-
[f]: (
|
|
42
|
+
[$]: (e, x) => x !== e,
|
|
43
|
+
blur: (e) => e instanceof FocusEvent,
|
|
44
|
+
focus: (e) => e instanceof FocusEvent,
|
|
45
|
+
[I]: (e) => s(e) || b(e),
|
|
46
|
+
[f]: (e) => s(e) || b(e)
|
|
47
47
|
},
|
|
48
|
-
setup(
|
|
49
|
-
const o = re("input-number"), r =
|
|
50
|
-
currentValue:
|
|
48
|
+
setup(e, { expose: x, emit: j }) {
|
|
49
|
+
const o = re("input-number"), r = j, c = ee(), l = te({
|
|
50
|
+
currentValue: e.modelValue,
|
|
51
51
|
userInput: null
|
|
52
52
|
}), { formItem: T } = oe(), D = d(
|
|
53
|
-
() =>
|
|
53
|
+
() => e.modelValue && s(e.modelValue) && e.modelValue <= e.min
|
|
54
54
|
), M = d(
|
|
55
|
-
() =>
|
|
56
|
-
),
|
|
57
|
-
const
|
|
58
|
-
return h(
|
|
55
|
+
() => e.modelValue && s(e.modelValue) && e.modelValue >= e.max
|
|
56
|
+
), q = d(() => {
|
|
57
|
+
const t = z(e.step);
|
|
58
|
+
return h(e.precision) ? Math.max(z(e.modelValue), t) : (t > e.precision && O(
|
|
59
59
|
"InputNumber",
|
|
60
60
|
"precision should not be less than the decimal places of step"
|
|
61
|
-
),
|
|
62
|
-
}),
|
|
61
|
+
), e.precision);
|
|
62
|
+
}), y = d(() => e.controls && e.controlsPosition === "right"), k = se(), m = ce(), w = d(() => {
|
|
63
63
|
if (l.userInput !== null)
|
|
64
64
|
return l.userInput;
|
|
65
|
-
let
|
|
66
|
-
if (b(
|
|
67
|
-
if (s(
|
|
68
|
-
if (Number.isNaN(
|
|
69
|
-
h(
|
|
65
|
+
let t = l.currentValue;
|
|
66
|
+
if (b(t)) return "";
|
|
67
|
+
if (s(t)) {
|
|
68
|
+
if (Number.isNaN(t)) return "";
|
|
69
|
+
h(e.precision) || (t = t?.toFixed(e.precision));
|
|
70
70
|
}
|
|
71
|
-
return
|
|
72
|
-
}),
|
|
73
|
-
if (h(n) && (n =
|
|
74
|
-
let i = String(
|
|
71
|
+
return t;
|
|
72
|
+
}), g = (t, n) => {
|
|
73
|
+
if (h(n) && (n = q.value), n === 0) return Math.round(t);
|
|
74
|
+
let i = String(t);
|
|
75
75
|
const a = i.indexOf(".");
|
|
76
|
-
if (a === -1 || !i.replace(".", "").split("")[a + n]) return
|
|
77
|
-
const
|
|
78
|
-
return i.charAt(
|
|
79
|
-
}, z = (
|
|
80
|
-
if (b(
|
|
81
|
-
const n =
|
|
76
|
+
if (a === -1 || !i.replace(".", "").split("")[a + n]) return t;
|
|
77
|
+
const G = i.length;
|
|
78
|
+
return i.charAt(G - 1) === "5" && (i = `${i.slice(0, Math.max(0, G - 1))}6`), Number.parseFloat(Number(i).toFixed(n));
|
|
79
|
+
}, z = (t) => {
|
|
80
|
+
if (b(t)) return 0;
|
|
81
|
+
const n = t.toString(), i = n.indexOf(".");
|
|
82
82
|
let a = 0;
|
|
83
83
|
return i !== -1 && (a = n.length - i - 1), a;
|
|
84
|
-
}, K = (
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
84
|
+
}, K = (t, n = 1) => s(t) ? g(t + e.step * n) : l.currentValue, E = () => {
|
|
85
|
+
if (e.readonly || m.value || M.value) return;
|
|
86
|
+
const t = Number(w.value) || 0, n = K(t);
|
|
87
87
|
v(n), r(I, l.currentValue);
|
|
88
|
-
},
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
88
|
+
}, F = () => {
|
|
89
|
+
if (e.readonly || m.value || D.value) return;
|
|
90
|
+
const t = Number(w.value) || 0, n = K(t, -1);
|
|
91
91
|
v(n), r(I, l.currentValue);
|
|
92
|
-
}, A = (
|
|
93
|
-
let i = Number(
|
|
94
|
-
if (b(
|
|
92
|
+
}, A = (t, n) => {
|
|
93
|
+
let i = Number(t);
|
|
94
|
+
if (b(t) || Number.isNaN(i))
|
|
95
95
|
return null;
|
|
96
|
-
if (
|
|
97
|
-
if (
|
|
96
|
+
if (t === "") {
|
|
97
|
+
if (e.valueOnClear === null)
|
|
98
98
|
return null;
|
|
99
|
-
i = le(
|
|
99
|
+
i = le(e.valueOnClear) ? { min: e.min, max: e.max }[e.valueOnClear] : e.valueOnClear;
|
|
100
100
|
}
|
|
101
|
-
return
|
|
102
|
-
}, v = (
|
|
103
|
-
const i = l.currentValue, a = A(
|
|
101
|
+
return e.stepStrictly && (i = g(Math.round(i / e.step) * e.step, e.precision)), h(e.precision) || (i = g(i, e.precision)), (i > e.max || i < e.min) && (i = i > e.max ? e.max : e.min, n && r(f, i)), i;
|
|
102
|
+
}, v = (t, n = !0) => {
|
|
103
|
+
const i = l.currentValue, a = A(t);
|
|
104
104
|
if (!n) {
|
|
105
105
|
r(f, a);
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
|
-
i !== a && (l.userInput = null, r(f, a), r(
|
|
109
|
-
},
|
|
110
|
-
l.userInput =
|
|
111
|
-
const n =
|
|
108
|
+
i !== a && (l.userInput = null, r(f, a), r($, a, i), e.validateEvent && T?.validate?.("change").catch((U) => O(U)), l.currentValue = a);
|
|
109
|
+
}, J = (t) => {
|
|
110
|
+
l.userInput = t;
|
|
111
|
+
const n = t === "" ? null : Number(t);
|
|
112
112
|
r(I, n), v(n, !1);
|
|
113
|
-
},
|
|
114
|
-
const n =
|
|
115
|
-
(s(n) && !Number.isNaN(n) ||
|
|
116
|
-
}, Q = () => {
|
|
117
|
-
m.value?.focus?.();
|
|
113
|
+
}, Q = (t) => {
|
|
114
|
+
const n = t !== "" ? Number(t) : "";
|
|
115
|
+
(s(n) && !Number.isNaN(n) || t === "") && v(n), l.userInput = null;
|
|
118
116
|
}, X = () => {
|
|
119
|
-
|
|
120
|
-
}, Z = (
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
r("
|
|
117
|
+
c.value?.focus?.();
|
|
118
|
+
}, Z = () => {
|
|
119
|
+
c.value?.blur?.();
|
|
120
|
+
}, p = (t) => {
|
|
121
|
+
r("focus", t);
|
|
122
|
+
}, _ = (t) => {
|
|
123
|
+
r("blur", t), e.validateEvent && T?.validate?.("blur").catch((n) => O(n));
|
|
124
124
|
};
|
|
125
125
|
return ne(
|
|
126
|
-
() =>
|
|
127
|
-
(
|
|
128
|
-
const n = A(l.userInput), i = A(
|
|
126
|
+
() => e.modelValue,
|
|
127
|
+
(t) => {
|
|
128
|
+
const n = A(l.userInput), i = A(t, !0);
|
|
129
129
|
!s(n) && (!n || n !== i) && (l.currentValue = i, l.userInput = null);
|
|
130
130
|
},
|
|
131
131
|
{ immediate: !0 }
|
|
132
132
|
), ie(() => {
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
let n = Number(
|
|
133
|
+
const t = c.value?.input;
|
|
134
|
+
if (t.setAttribute("role", "spinbutton"), Number.isFinite(e.max) ? t.setAttribute("aria-valuemax", String(e.max)) : t.removeAttribute("aria-valuemax"), Number.isFinite(e.min) ? t.setAttribute("aria-valuemin", String(e.min)) : t.removeAttribute("aria-valuemin"), t.setAttribute("aria-valuenow", String(l.currentValue)), t.setAttribute("aria-disabled", String(m.value)), !s(e.modelValue) && e.modelValue !== null) {
|
|
135
|
+
let n = Number(e.modelValue);
|
|
136
136
|
Number.isNaN(n) && (n = null), r(f, n);
|
|
137
137
|
}
|
|
138
138
|
}), ue(() => {
|
|
139
|
-
|
|
140
|
-
}),
|
|
139
|
+
c.value?.input?.setAttribute("aria-valuenow", `${l.currentValue}`);
|
|
140
|
+
}), x({
|
|
141
141
|
/** @description get focus the input component */
|
|
142
|
-
focus:
|
|
142
|
+
focus: X,
|
|
143
143
|
/** @description remove focus the input component */
|
|
144
|
-
blur:
|
|
145
|
-
}), (
|
|
144
|
+
blur: Z
|
|
145
|
+
}), (t, n) => (S(), C("div", {
|
|
146
146
|
class: P([
|
|
147
147
|
u(o).b(),
|
|
148
148
|
u(o).m(u(k)),
|
|
149
|
-
u(o).is("disabled", u(
|
|
149
|
+
u(o).is("disabled", u(m)),
|
|
150
150
|
u(o).is("without-controls", !e.controls),
|
|
151
|
-
u(o).is("controls-right",
|
|
151
|
+
u(o).is("controls-right", y.value)
|
|
152
152
|
]),
|
|
153
153
|
onDragstart: n[1] || (n[1] = V(() => {
|
|
154
154
|
}, ["prevent"]))
|
|
155
155
|
}, [
|
|
156
|
-
e.controls ?
|
|
156
|
+
e.controls ? R((S(), C("span", {
|
|
157
157
|
key: 0,
|
|
158
158
|
role: "button",
|
|
159
159
|
class: P([u(o).e("decrease"), u(o).is("disabled", D.value)]),
|
|
160
|
-
onKeydown: N(
|
|
160
|
+
onKeydown: N(F, ["enter"])
|
|
161
161
|
}, [
|
|
162
|
-
B(u(
|
|
163
|
-
icon:
|
|
162
|
+
B(u(Y), {
|
|
163
|
+
icon: y.value ? "icon-arrow-down" : "icon-minus"
|
|
164
164
|
}, null, 8, ["icon"])
|
|
165
165
|
], 34)), [
|
|
166
|
-
[u(
|
|
167
|
-
]) :
|
|
168
|
-
e.controls ?
|
|
166
|
+
[u(H), F]
|
|
167
|
+
]) : W("", !0),
|
|
168
|
+
e.controls ? R((S(), C("span", {
|
|
169
169
|
key: 1,
|
|
170
170
|
role: "button",
|
|
171
171
|
class: P([u(o).e("increase"), u(o).is("disabled", M.value)]),
|
|
172
|
-
onKeydown: N(
|
|
172
|
+
onKeydown: N(E, ["enter"])
|
|
173
173
|
}, [
|
|
174
|
-
B(u(
|
|
175
|
-
icon:
|
|
174
|
+
B(u(Y), {
|
|
175
|
+
icon: y.value ? "icon-arrow-up" : "icon-plus"
|
|
176
176
|
}, null, 8, ["icon"])
|
|
177
177
|
], 34)), [
|
|
178
|
-
[u(
|
|
179
|
-
]) :
|
|
178
|
+
[u(H), E]
|
|
179
|
+
]) : W("", !0),
|
|
180
180
|
B(u(ae), {
|
|
181
181
|
id: e.id,
|
|
182
182
|
ref_key: "input",
|
|
183
|
-
ref:
|
|
183
|
+
ref: c,
|
|
184
184
|
type: "number",
|
|
185
185
|
step: e.step,
|
|
186
|
-
"model-value":
|
|
186
|
+
"model-value": w.value,
|
|
187
187
|
placeholder: e.placeholder,
|
|
188
188
|
readonly: e.readonly,
|
|
189
|
-
disabled: u(
|
|
189
|
+
disabled: u(m),
|
|
190
190
|
size: u(k),
|
|
191
191
|
max: e.max,
|
|
192
192
|
min: e.min,
|
|
@@ -196,13 +196,13 @@ const ce = H({
|
|
|
196
196
|
onWheel: n[0] || (n[0] = V(() => {
|
|
197
197
|
}, ["prevent"])),
|
|
198
198
|
onKeydown: [
|
|
199
|
-
N(V(
|
|
200
|
-
N(V(
|
|
199
|
+
N(V(E, ["prevent"]), ["up"]),
|
|
200
|
+
N(V(F, ["prevent"]), ["down"])
|
|
201
201
|
],
|
|
202
202
|
onBlur: _,
|
|
203
|
-
onFocus:
|
|
204
|
-
onInput:
|
|
205
|
-
onChange:
|
|
203
|
+
onFocus: p,
|
|
204
|
+
onInput: J,
|
|
205
|
+
onChange: Q
|
|
206
206
|
}, null, 8, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "label", "onKeydown"])
|
|
207
207
|
], 34));
|
|
208
208
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { shallowRef as B, ref as L, computed as c, watch as G } from "vue";
|
|
2
2
|
import { EVENT_CODE as g } from "../../../constants/aria.js";
|
|
3
|
-
import { CHANGE_EVENT as i,
|
|
3
|
+
import { CHANGE_EVENT as i, UPDATE_MODEL_EVENT as d, INPUT_EVENT as H } from "../../../constants/event.js";
|
|
4
4
|
import "@vueuse/core";
|
|
5
5
|
import { isUndefined as K } from "@vft/utils";
|
|
6
6
|
import { debugWarn as C } from "../../../utils/error.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as s, getCurrentInstance as k, computed as b, createElementBlock as l, openBlock as i, normalizeClass as a, unref as t, createBlock as y, createCommentVNode as c, normalizeProps as C, mergeProps as g, renderSlot as B } from "vue";
|
|
2
2
|
import { VftIcon as v } from "../icon/index.js";
|
|
3
3
|
import "@vueuse/core";
|
|
4
4
|
import { singleAttrToObj as P } from "@vft/utils";
|
|
@@ -11,9 +11,9 @@ import "@popperjs/core";
|
|
|
11
11
|
import "../../hooks/use-z-index/index.js";
|
|
12
12
|
import { useRouterHelper as $ } from "@vft/router";
|
|
13
13
|
import "vue-router";
|
|
14
|
-
const h =
|
|
14
|
+
const h = s({
|
|
15
15
|
name: "vft-link"
|
|
16
|
-
}),
|
|
16
|
+
}), F = /* @__PURE__ */ s({
|
|
17
17
|
...h,
|
|
18
18
|
props: {
|
|
19
19
|
type: { default: "default" },
|
|
@@ -24,31 +24,31 @@ const h = c({
|
|
|
24
24
|
icon: {}
|
|
25
25
|
},
|
|
26
26
|
emits: ["click"],
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
29
|
-
function
|
|
30
|
-
|
|
27
|
+
setup(e, { emit: m }) {
|
|
28
|
+
const o = R("link"), u = m, d = k().appContext.config.globalProperties.$router, { go: f } = $(d);
|
|
29
|
+
function p(n) {
|
|
30
|
+
e.route && f(e.route, e.isReplace), e.disabled || u("click", n);
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
return (
|
|
32
|
+
const r = b(() => P(e.icon, "icon"));
|
|
33
|
+
return (n, I) => (i(), l("span", {
|
|
34
34
|
class: a([
|
|
35
|
-
t(
|
|
36
|
-
t(
|
|
37
|
-
t(
|
|
38
|
-
t(
|
|
35
|
+
t(o).b(),
|
|
36
|
+
t(o).m(e.type),
|
|
37
|
+
t(o).is("disabled", e.disabled),
|
|
38
|
+
t(o).is("underline", e.underline && !e.disabled)
|
|
39
39
|
]),
|
|
40
|
-
onClick:
|
|
40
|
+
onClick: p
|
|
41
41
|
}, [
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
r.value?.icon ? (i(), y(t(v), C(g({ key: 0 }, r.value)), null, 16)) : c("", !0),
|
|
43
|
+
n.$slots.default ? (i(), l("span", {
|
|
44
44
|
key: 1,
|
|
45
|
-
class: a(t(
|
|
45
|
+
class: a(t(o).e("inner"))
|
|
46
46
|
}, [
|
|
47
|
-
B(
|
|
48
|
-
], 2)) :
|
|
47
|
+
B(n.$slots, "default")
|
|
48
|
+
], 2)) : c("", !0)
|
|
49
49
|
], 2));
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
export {
|
|
53
|
-
|
|
53
|
+
F as default
|
|
54
54
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as h, ref as y, computed as
|
|
1
|
+
import { defineComponent as h, ref as y, computed as _, createElementBlock as m, openBlock as l, normalizeClass as r, normalizeStyle as V, unref as e, Fragment as N, renderList as z, createElementVNode as f, createVNode as B, mergeProps as d, toDisplayString as D, createBlock as p, createCommentVNode as T } from "vue";
|
|
2
2
|
import { VftIcon as g } from "../icon/index.js";
|
|
3
3
|
import "@vueuse/core";
|
|
4
4
|
import { VNode as b, singleAttrToObj as E } from "@vft/utils";
|
|
@@ -21,45 +21,45 @@ const j = ["onClick"], A = h({
|
|
|
21
21
|
activeIndex: {}
|
|
22
22
|
},
|
|
23
23
|
emits: ["item-click"],
|
|
24
|
-
setup(
|
|
25
|
-
const n = S("list-cell"), C = k, u = y(
|
|
24
|
+
setup(c, { emit: k }) {
|
|
25
|
+
const n = S("list-cell"), C = k, u = y(c.activeIndex), I = _(() => H(
|
|
26
26
|
{
|
|
27
|
-
height: v(
|
|
28
|
-
"left-text-distance": v(
|
|
27
|
+
height: v(c.cellHeight),
|
|
28
|
+
"left-text-distance": v(c.leftTextDistance)
|
|
29
29
|
},
|
|
30
30
|
"list-cell"
|
|
31
31
|
));
|
|
32
|
-
function
|
|
33
|
-
u.value =
|
|
32
|
+
function x(i, o) {
|
|
33
|
+
u.value = o, C("item-click", i, o);
|
|
34
34
|
}
|
|
35
|
-
const s = (
|
|
35
|
+
const s = (i, o = {}) => E(i, "icon", {
|
|
36
36
|
size: 16,
|
|
37
|
-
...
|
|
37
|
+
...o
|
|
38
38
|
});
|
|
39
|
-
return (
|
|
39
|
+
return (i, o) => (l(), m("div", {
|
|
40
40
|
style: V(I.value),
|
|
41
|
-
class:
|
|
41
|
+
class: r(e(n).b())
|
|
42
42
|
}, [
|
|
43
|
-
(
|
|
44
|
-
onClick: (F) =>
|
|
43
|
+
(l(!0), m(N, null, z(c.list, (t, a) => (l(), m("div", {
|
|
44
|
+
onClick: (F) => x(t, a),
|
|
45
45
|
key: a,
|
|
46
|
-
class:
|
|
46
|
+
class: r([e(n).e("item"), e(n).is("active", u.value === a)])
|
|
47
47
|
}, [
|
|
48
48
|
f("div", {
|
|
49
|
-
class:
|
|
49
|
+
class: r(e(n).m("left"))
|
|
50
50
|
}, [
|
|
51
51
|
B(e(g), d({ ref_for: !0 }, s(t.leftIcon)), null, 16),
|
|
52
52
|
f("span", {
|
|
53
|
-
class:
|
|
53
|
+
class: r(e(n).e("text"))
|
|
54
54
|
}, D(t.text), 3)
|
|
55
55
|
], 2),
|
|
56
56
|
f("div", {
|
|
57
|
-
class:
|
|
57
|
+
class: r(e(n).m("right"))
|
|
58
58
|
}, [
|
|
59
|
-
t?.rightContent ? (
|
|
59
|
+
t?.rightContent ? (l(), p(e(b), {
|
|
60
60
|
key: 0,
|
|
61
61
|
content: t.rightContent
|
|
62
|
-
}, null, 8, ["content"])) : s(t.rightIcon)?.icon ? (
|
|
62
|
+
}, null, 8, ["content"])) : s(t.rightIcon)?.icon ? (l(), p(e(g), d({
|
|
63
63
|
key: 1,
|
|
64
64
|
ref_for: !0
|
|
65
65
|
}, s(t.rightIcon)), null, 16)) : T("", !0)
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as c, computed as r, getCurrentInstance as p, createElementBlock as o, createCommentVNode as l, openBlock as n, normalizeStyle as d, normalizeClass as i, unref as a, toDisplayString as k } from "vue";
|
|
2
2
|
import "@vueuse/core";
|
|
3
3
|
import "@vft/utils";
|
|
4
4
|
import "../config-provider/hooks/use-global-config.js";
|
|
5
5
|
import "lodash-es";
|
|
6
6
|
import "../form/index.js";
|
|
7
|
-
import { useNamespace as
|
|
7
|
+
import { useNamespace as C } from "../../hooks/use-namespace/index.js";
|
|
8
8
|
import "../../hooks/use-model-toggle/index.js";
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import "../../hooks/use-z-index/index.js";
|
|
11
|
-
import { useRouterHelper as
|
|
12
|
-
const
|
|
11
|
+
import { useRouterHelper as h } from "@vft/router";
|
|
12
|
+
const y = ["src"], v = c({
|
|
13
13
|
name: "vft-logo"
|
|
14
|
-
}),
|
|
15
|
-
...
|
|
14
|
+
}), R = /* @__PURE__ */ c({
|
|
15
|
+
...v,
|
|
16
16
|
props: {
|
|
17
17
|
title: {},
|
|
18
18
|
logo: {},
|
|
19
19
|
jumpPath: { default: "/" }
|
|
20
20
|
},
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
21
|
+
setup(t) {
|
|
22
|
+
const e = C("logo"), s = r(() => [e.b()]), m = p().appContext.config.globalProperties.$router, { go: u } = h(m);
|
|
23
23
|
function g() {
|
|
24
|
-
|
|
24
|
+
t.jumpPath && u(t.jumpPath);
|
|
25
25
|
}
|
|
26
|
-
const f =
|
|
27
|
-
() =>
|
|
26
|
+
const f = r(
|
|
27
|
+
() => t.jumpPath ? {} : e.cssVarBlock({ cursor: "inital" })
|
|
28
28
|
);
|
|
29
|
-
return (
|
|
29
|
+
return (j, x) => t.logo || t.title ? (n(), o("div", {
|
|
30
30
|
key: 0,
|
|
31
|
-
class: s
|
|
31
|
+
class: i(s.value),
|
|
32
32
|
onClick: g,
|
|
33
|
-
style:
|
|
33
|
+
style: d(f.value)
|
|
34
34
|
}, [
|
|
35
|
-
|
|
35
|
+
t.logo ? (n(), o("img", {
|
|
36
36
|
key: 0,
|
|
37
|
-
class:
|
|
38
|
-
src:
|
|
37
|
+
class: i(a(e).e("img")),
|
|
38
|
+
src: t.logo,
|
|
39
39
|
alt: ""
|
|
40
|
-
}, null, 10,
|
|
41
|
-
|
|
40
|
+
}, null, 10, y)) : l("", !0),
|
|
41
|
+
t.title ? (n(), o("div", {
|
|
42
42
|
key: 1,
|
|
43
|
-
class:
|
|
44
|
-
},
|
|
43
|
+
class: i(a(e).e("title"))
|
|
44
|
+
}, k(t.title), 3)) : l("", !0)
|
|
45
45
|
], 6)) : l("", !0);
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
R as default
|
|
50
50
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { defineComponent as n, createElementBlock as o, openBlock as r, normalizeClass as l, unref as i, createElementVNode as m, renderSlot as s, Fragment as
|
|
1
|
+
import { defineComponent as n, createElementBlock as o, openBlock as r, normalizeClass as l, unref as i, createElementVNode as m, renderSlot as s, Fragment as a, createTextVNode as u, toDisplayString as c } from "vue";
|
|
2
2
|
import "@vueuse/core";
|
|
3
3
|
import "@vft/utils";
|
|
4
4
|
import "../config-provider/hooks/use-global-config.js";
|
|
5
5
|
import "lodash-es";
|
|
6
6
|
import "../form/index.js";
|
|
7
|
-
import { useNamespace as
|
|
7
|
+
import { useNamespace as f } from "../../hooks/use-namespace/index.js";
|
|
8
8
|
import "../../hooks/use-model-toggle/index.js";
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import "../../hooks/use-z-index/index.js";
|
|
11
|
-
const
|
|
11
|
+
const d = n({
|
|
12
12
|
name: "vft-menu-item-group"
|
|
13
13
|
}), V = /* @__PURE__ */ n({
|
|
14
|
-
...
|
|
14
|
+
...d,
|
|
15
15
|
props: {
|
|
16
16
|
title: {}
|
|
17
17
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const t =
|
|
18
|
+
setup(p) {
|
|
19
|
+
const t = f("menu-item-group");
|
|
20
20
|
return (e, _) => (r(), o("li", {
|
|
21
21
|
class: l(i(t).b())
|
|
22
22
|
}, [
|
|
23
23
|
m("div", {
|
|
24
24
|
class: l(i(t).e("title"))
|
|
25
25
|
}, [
|
|
26
|
-
e.$slots.title ? s(e.$slots, "title", { key: 1 }) : (r(), o(
|
|
27
|
-
|
|
26
|
+
e.$slots.title ? s(e.$slots, "title", { key: 1 }) : (r(), o(a, { key: 0 }, [
|
|
27
|
+
u(c(p.title), 1)
|
|
28
28
|
], 64))
|
|
29
29
|
], 2),
|
|
30
30
|
m("ul", null, [
|