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,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Oe, useAttrs as Te, useSlots as Le, computed as l, ref as S, getCurrentInstance as je, shallowRef as H, watch as U, nextTick as E, onMounted as We, withDirectives as He, createElementBlock as c, openBlock as i, mergeProps as
|
|
1
|
+
import { defineComponent as Oe, useAttrs as Te, useSlots as Le, computed as l, ref as S, getCurrentInstance as je, shallowRef as H, watch as U, nextTick as E, onMounted as We, withDirectives as He, createElementBlock as c, openBlock as i, mergeProps as h, Fragment as q, createCommentVNode as u, createElementVNode as w, normalizeClass as r, unref as a, renderSlot as $, createBlock as V, withKeys as Ue, withModifiers as me, toDisplayString as D, normalizeStyle as qe, vShow as Ge } from "vue";
|
|
2
2
|
import "../form/index.js";
|
|
3
3
|
import { VftIcon as B } from "../icon/index.js";
|
|
4
4
|
import { useResizeObserver as Je, isClient as Qe } from "@vueuse/core";
|
|
@@ -6,16 +6,16 @@ import { isString as A, singleAttrToObj as G, noop as Xe, isObject as ve } from
|
|
|
6
6
|
import { debugWarn as J } from "../../utils/error.js";
|
|
7
7
|
import "../config-provider/hooks/use-global-config.js";
|
|
8
8
|
import { isNil as Ye } from "lodash-es";
|
|
9
|
-
import { useNamespace as
|
|
9
|
+
import { useNamespace as ye } from "../../hooks/use-namespace/index.js";
|
|
10
10
|
import "../../hooks/use-model-toggle/index.js";
|
|
11
11
|
import "@popperjs/core";
|
|
12
12
|
import "../../hooks/use-z-index/index.js";
|
|
13
13
|
import { UPDATE_MODEL_EVENT as Q } from "@vft/constants";
|
|
14
14
|
import { useAttrs as Ze, useCursor as _e } from "@vft/use";
|
|
15
|
-
import { calcTextareaHeight as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
const
|
|
15
|
+
import { calcTextareaHeight as he } from "./utils.js";
|
|
16
|
+
import { useFormItem as et, useFormItemInputId as tt } from "../form/hooks/use-form-item.js";
|
|
17
|
+
import { useFormSize as at, useFormDisabled as nt } from "../form/hooks/use-form-common-props.js";
|
|
18
|
+
const ot = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form"], st = ["id", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form"], It = /* @__PURE__ */ Oe({
|
|
19
19
|
__name: "input",
|
|
20
20
|
props: {
|
|
21
21
|
id: {},
|
|
@@ -61,33 +61,33 @@ const nt = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
61
61
|
compositionupdate: (e) => e instanceof CompositionEvent,
|
|
62
62
|
compositionend: (e) => e instanceof CompositionEvent
|
|
63
63
|
},
|
|
64
|
-
setup(e, { expose:
|
|
65
|
-
const s =
|
|
64
|
+
setup(e, { expose: xe, emit: pe }) {
|
|
65
|
+
const s = pe, g = Te(), m = Le(), X = l(() => {
|
|
66
66
|
const t = {};
|
|
67
67
|
return e.containerRole === "combobox" && (t["aria-haspopup"] = g["aria-haspopup"], t["aria-owns"] = g["aria-owns"], t["aria-expanded"] = g["aria-expanded"]), t;
|
|
68
|
-
}),
|
|
69
|
-
e.type === "textarea" ? Z.b() :
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
}), be = l(() => [
|
|
69
|
+
e.type === "textarea" ? Z.b() : n.b(),
|
|
70
|
+
n.m(ke.value),
|
|
71
|
+
n.is("disabled", x.value),
|
|
72
|
+
n.is("exceed", Ee.value),
|
|
73
|
+
n.is("focus", v.value),
|
|
74
74
|
{
|
|
75
|
-
[
|
|
76
|
-
[
|
|
77
|
-
[
|
|
78
|
-
[
|
|
79
|
-
[
|
|
80
|
-
[
|
|
75
|
+
[n.b("group")]: m.prepend || m.append,
|
|
76
|
+
[n.bm("group", "append")]: m.append,
|
|
77
|
+
[n.bm("group", "prepend")]: m.prepend,
|
|
78
|
+
[n.m("prefix")]: m.prefix || e.prefixIcon,
|
|
79
|
+
[n.m("suffix")]: m.suffix || e.suffixIcon || e.clearable || e.showPassword,
|
|
80
|
+
[n.bm("suffix", "password-clear")]: P.value && L.value
|
|
81
81
|
},
|
|
82
82
|
g.class
|
|
83
|
-
]),
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
]), we = je(), ge = l(() => [
|
|
84
|
+
n.e("wrapper"),
|
|
85
|
+
n.is("focus", v.value)
|
|
86
86
|
]), d = Ze({
|
|
87
87
|
excludeKeys: l(() => Object.keys(X.value))
|
|
88
|
-
}), { form: Ce, formItem: F } =
|
|
88
|
+
}), { form: Ce, formItem: F } = et(), { inputId: Y } = tt(we.props, {
|
|
89
89
|
formItemContext: F
|
|
90
|
-
}), ke =
|
|
90
|
+
}), ke = at(), x = nt(), n = ye("input"), Z = ye("textarea"), M = H(), p = H(), v = S(!1), N = S(!1), C = S(!1), K = S(!1), _ = S(), O = H(e.inputStyle), k = l(() => M.value || p.value), T = l(() => G(e.prefixIcon, "icon", { size: 16 })), ee = l(() => G(e.suffixIcon, "icon", { size: 16 })), Ie = l(() => G(e.clearIcon, "icon", {
|
|
91
91
|
icon: "icon-circle-close",
|
|
92
92
|
size: 16
|
|
93
93
|
})), te = l(() => Ce?.statusIcon ?? !1), I = l(() => F?.validateState || ""), ae = l(
|
|
@@ -101,59 +101,59 @@ const nt = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
101
101
|
), Se = l(() => [
|
|
102
102
|
g.style,
|
|
103
103
|
e.inputStyle
|
|
104
|
-
]),
|
|
104
|
+
]), ne = l(() => [
|
|
105
105
|
e.inputStyle,
|
|
106
106
|
O.value,
|
|
107
107
|
{ resize: e.resize }
|
|
108
108
|
]), f = l(
|
|
109
109
|
() => Ye(e.modelValue) ? "" : String(e.modelValue)
|
|
110
110
|
), P = l(
|
|
111
|
-
() => e.clearable && !
|
|
111
|
+
() => e.clearable && !x.value && !e.readonly && !!f.value && (v.value || N.value)
|
|
112
112
|
), L = l(
|
|
113
|
-
() => e.showPassword && !
|
|
114
|
-
),
|
|
115
|
-
() => e.showWordLimit && !!d.value.maxlength && (e.type === "text" || e.type === "textarea") && !
|
|
113
|
+
() => e.showPassword && !x.value && !e.readonly && !!f.value && (!!f.value || v.value)
|
|
114
|
+
), b = l(
|
|
115
|
+
() => e.showWordLimit && !!d.value.maxlength && (e.type === "text" || e.type === "textarea") && !x.value && !e.readonly && !e.showPassword
|
|
116
116
|
), j = l(() => Array.from(f.value).length), Ee = l(
|
|
117
117
|
() => (
|
|
118
118
|
// show exceed style if length of initial value greater then maxlength
|
|
119
|
-
!!
|
|
119
|
+
!!b.value && j.value > Number(d.value.maxlength)
|
|
120
120
|
)
|
|
121
121
|
), Ve = l(
|
|
122
|
-
() => !!m.suffix || !!e.suffixIcon || P.value || e.showPassword ||
|
|
122
|
+
() => !!m.suffix || !!e.suffixIcon || P.value || e.showPassword || b.value || !!I.value && te.value
|
|
123
123
|
), [Be, Ae] = _e(M);
|
|
124
|
-
Je(
|
|
125
|
-
if (!
|
|
126
|
-
const
|
|
124
|
+
Je(p, (t) => {
|
|
125
|
+
if (!b.value || e.resize !== "both") return;
|
|
126
|
+
const o = t[0], { width: y } = o.contentRect;
|
|
127
127
|
_.value = {
|
|
128
128
|
/** right: 100% - width + padding(15) + right(6) */
|
|
129
|
-
right: `calc(100% - ${
|
|
129
|
+
right: `calc(100% - ${y + 15 + 6}px)`
|
|
130
130
|
};
|
|
131
131
|
});
|
|
132
132
|
const R = () => {
|
|
133
133
|
if (!(!Qe || e.type !== "textarea"))
|
|
134
134
|
if (e.autosize) {
|
|
135
|
-
const t = ve(e.autosize) ? e.autosize.minRows : void 0,
|
|
135
|
+
const t = ve(e.autosize) ? e.autosize.minRows : void 0, o = ve(e.autosize) ? e.autosize.maxRows : void 0;
|
|
136
136
|
O.value = {
|
|
137
|
-
...
|
|
137
|
+
...he(p.value, t, o)
|
|
138
138
|
};
|
|
139
139
|
} else
|
|
140
140
|
O.value = {
|
|
141
|
-
minHeight:
|
|
141
|
+
minHeight: he(p.value).minHeight
|
|
142
142
|
};
|
|
143
143
|
}, z = () => {
|
|
144
144
|
const t = k.value;
|
|
145
145
|
!t || t.value === f.value || (t.value = f.value);
|
|
146
146
|
}, W = async (t) => {
|
|
147
147
|
Be();
|
|
148
|
-
let { value:
|
|
149
|
-
if (d.value.maxlength &&
|
|
150
|
-
if (
|
|
148
|
+
let { value: o } = t.target;
|
|
149
|
+
if (d.value.maxlength && o.length >= d.value.maxlength && (o = o.slice(0, Number(d.value.maxlength))), e.formatter && (o = e.parser ? e.parser(o) : o, o = e.formatter(o)), !C.value) {
|
|
150
|
+
if (o === f.value) {
|
|
151
151
|
z();
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
s(Q,
|
|
154
|
+
s(Q, o), s("input", o), await E(), z(), Ae();
|
|
155
155
|
}
|
|
156
|
-
},
|
|
156
|
+
}, oe = (t) => {
|
|
157
157
|
s("change", t.target.value);
|
|
158
158
|
}, Fe = () => {
|
|
159
159
|
s("suffixClick", e.modelValue);
|
|
@@ -163,8 +163,8 @@ const nt = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
163
163
|
s("compositionstart", t), C.value = !0;
|
|
164
164
|
}, Ke = (t) => /([(\uAC00-\uD7AF)|\u3130-\u318F])+/.test(t), se = (t) => {
|
|
165
165
|
s("compositionupdate", t);
|
|
166
|
-
const
|
|
167
|
-
C.value = !Ke(
|
|
166
|
+
const o = t.target?.value, y = o[o.length - 1] || "";
|
|
167
|
+
C.value = !Ke(y);
|
|
168
168
|
}, ie = (t) => {
|
|
169
169
|
s("compositionend", t), C.value && (C.value = !1, W(t));
|
|
170
170
|
}, Pe = () => {
|
|
@@ -174,14 +174,14 @@ const nt = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
174
174
|
}, Re = () => k.value?.blur(), re = (t) => {
|
|
175
175
|
v.value = !0, s("focus", t);
|
|
176
176
|
}, ce = (t) => {
|
|
177
|
-
v.value = !1, s("blur", t), e.validateEvent && F?.validate?.("blur").catch((
|
|
177
|
+
v.value = !1, s("blur", t), e.validateEvent && F?.validate?.("blur").catch((o) => J(o));
|
|
178
178
|
}, $e = (t) => {
|
|
179
179
|
N.value = !1, s("mouseleave", t);
|
|
180
180
|
}, De = (t) => {
|
|
181
181
|
N.value = !0, s("mouseenter", t);
|
|
182
182
|
}, de = (t) => {
|
|
183
|
-
let
|
|
184
|
-
if (t.target.type === "number" && ["e", "+", "-0", "E"].includes(
|
|
183
|
+
let o = t.key;
|
|
184
|
+
if (t.target.type === "number" && ["e", "+", "-0", "E"].includes(o))
|
|
185
185
|
return t.returnValue = !1, !1;
|
|
186
186
|
s("keydown", t);
|
|
187
187
|
}, Ne = () => {
|
|
@@ -204,15 +204,15 @@ const nt = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
204
204
|
"VftInput",
|
|
205
205
|
"If you set the parser, you also need to set the formatter."
|
|
206
206
|
), z(), E(R);
|
|
207
|
-
}),
|
|
207
|
+
}), xe({
|
|
208
208
|
/** @description HTML input element */
|
|
209
209
|
input: M,
|
|
210
210
|
/** @description HTML textarea element */
|
|
211
|
-
textarea:
|
|
211
|
+
textarea: p,
|
|
212
212
|
/** @description HTML element, input or textarea */
|
|
213
213
|
ref: k,
|
|
214
214
|
/** @description style of textarea. */
|
|
215
|
-
textareaStyle:
|
|
215
|
+
textareaStyle: ne,
|
|
216
216
|
/** @description from props (used on unit test) */
|
|
217
217
|
autosize: e.autosize,
|
|
218
218
|
/** @description HTML input element native method */
|
|
@@ -225,109 +225,109 @@ const nt = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
225
225
|
clear: fe,
|
|
226
226
|
/** @description resize textarea. */
|
|
227
227
|
resizeTextarea: R
|
|
228
|
-
}), (t,
|
|
229
|
-
class:
|
|
228
|
+
}), (t, o) => He((i(), c("div", h(X.value, {
|
|
229
|
+
class: be.value,
|
|
230
230
|
style: Se.value,
|
|
231
|
-
role:
|
|
231
|
+
role: e.containerRole,
|
|
232
232
|
onMouseenter: De,
|
|
233
233
|
onMouseleave: $e,
|
|
234
|
-
onMousewheel:
|
|
234
|
+
onMousewheel: o[1] || (o[1] = (y) => e.type === "number" && v.value ? y.preventDefault() : null)
|
|
235
235
|
}), [
|
|
236
|
-
|
|
236
|
+
e.type !== "textarea" ? (i(), c(q, { key: 0 }, [
|
|
237
237
|
t.$slots.prepend ? (i(), c("div", {
|
|
238
238
|
key: 0,
|
|
239
|
-
class: r(a(
|
|
239
|
+
class: r(a(n).be("group", "prepend"))
|
|
240
240
|
}, [
|
|
241
241
|
$(t.$slots, "prepend")
|
|
242
242
|
], 2)) : u("", !0),
|
|
243
|
-
|
|
243
|
+
w("div", {
|
|
244
244
|
class: r(ge.value)
|
|
245
245
|
}, [
|
|
246
246
|
t.$slots.prefix || T.value?.icon ? (i(), c("span", {
|
|
247
247
|
key: 0,
|
|
248
|
-
class: r(a(
|
|
248
|
+
class: r(a(n).e("prefix"))
|
|
249
249
|
}, [
|
|
250
|
-
|
|
251
|
-
class: r(a(
|
|
250
|
+
w("span", {
|
|
251
|
+
class: r(a(n).e("prefix-inner")),
|
|
252
252
|
onClick: Me
|
|
253
253
|
}, [
|
|
254
254
|
$(t.$slots, "prefix"),
|
|
255
|
-
T.value?.icon ? (i(), V(a(B),
|
|
255
|
+
T.value?.icon ? (i(), V(a(B), h({
|
|
256
256
|
key: 0,
|
|
257
257
|
pointer: ""
|
|
258
258
|
}, T.value, {
|
|
259
|
-
class: a(
|
|
259
|
+
class: a(n).e("icon")
|
|
260
260
|
}), null, 16, ["class"])) : u("", !0)
|
|
261
261
|
], 2)
|
|
262
262
|
], 2)) : u("", !0),
|
|
263
|
-
|
|
263
|
+
w("input", h({
|
|
264
264
|
id: a(Y),
|
|
265
265
|
ref_key: "input",
|
|
266
266
|
ref: M,
|
|
267
|
-
class: a(
|
|
267
|
+
class: a(n).e("inner")
|
|
268
268
|
}, a(d), {
|
|
269
|
-
type:
|
|
270
|
-
disabled: a(
|
|
271
|
-
formatter:
|
|
272
|
-
parser:
|
|
273
|
-
readonly:
|
|
274
|
-
autocomplete:
|
|
275
|
-
tabindex:
|
|
276
|
-
"aria-label":
|
|
277
|
-
placeholder:
|
|
278
|
-
style:
|
|
279
|
-
form:
|
|
269
|
+
type: e.showPassword ? K.value ? "text" : "password" : e.type,
|
|
270
|
+
disabled: a(x),
|
|
271
|
+
formatter: e.formatter,
|
|
272
|
+
parser: e.parser,
|
|
273
|
+
readonly: e.readonly,
|
|
274
|
+
autocomplete: e.autocomplete,
|
|
275
|
+
tabindex: e.tabindex,
|
|
276
|
+
"aria-label": e.label,
|
|
277
|
+
placeholder: e.placeholder,
|
|
278
|
+
style: e.inputStyle,
|
|
279
|
+
form: e.form,
|
|
280
280
|
onCompositionstart: le,
|
|
281
281
|
onCompositionupdate: se,
|
|
282
282
|
onCompositionend: ie,
|
|
283
283
|
onInput: W,
|
|
284
284
|
onFocus: re,
|
|
285
285
|
onBlur: ce,
|
|
286
|
-
onChange:
|
|
286
|
+
onChange: oe,
|
|
287
287
|
onKeydown: de,
|
|
288
|
-
onKeyup:
|
|
288
|
+
onKeyup: o[0] || (o[0] = Ue((y) => s("enter"), ["enter"]))
|
|
289
289
|
}), null, 16, lt),
|
|
290
290
|
Ve.value ? (i(), c("span", {
|
|
291
291
|
key: 1,
|
|
292
|
-
class: r(a(
|
|
292
|
+
class: r(a(n).e("suffix"))
|
|
293
293
|
}, [
|
|
294
|
-
|
|
295
|
-
class: r(a(
|
|
294
|
+
w("span", {
|
|
295
|
+
class: r(a(n).e("suffix-inner")),
|
|
296
296
|
onClick: Fe
|
|
297
297
|
}, [
|
|
298
|
-
!P.value || !L.value || !
|
|
298
|
+
!P.value || !L.value || !b.value ? (i(), c(q, { key: 0 }, [
|
|
299
299
|
$(t.$slots, "suffix"),
|
|
300
|
-
ee.value?.icon ? (i(), V(a(B),
|
|
301
|
-
class: a(
|
|
300
|
+
ee.value?.icon ? (i(), V(a(B), h({ key: 0 }, ee.value, {
|
|
301
|
+
class: a(n).e("icon")
|
|
302
302
|
}), null, 16, ["class"])) : u("", !0)
|
|
303
303
|
], 64)) : u("", !0),
|
|
304
|
-
P.value ? (i(), V(a(B),
|
|
304
|
+
P.value ? (i(), V(a(B), h({
|
|
305
305
|
key: 1,
|
|
306
306
|
pointer: "",
|
|
307
|
-
class: [a(
|
|
307
|
+
class: [a(n).e("icon"), a(n).e("clear")]
|
|
308
308
|
}, Ie.value, {
|
|
309
309
|
onMousedown: me(a(Xe), ["prevent"]),
|
|
310
310
|
onClick: me(fe, ["stop"])
|
|
311
311
|
}), null, 16, ["class", "onMousedown"])) : u("", !0),
|
|
312
|
-
L.value ? (i(), V(a(B),
|
|
313
|
-
class: [a(
|
|
312
|
+
L.value ? (i(), V(a(B), h({ key: 2 }, ze.value, {
|
|
313
|
+
class: [a(n).e("icon"), a(n).e("password")],
|
|
314
314
|
onClick: Pe
|
|
315
315
|
}), null, 16, ["class"])) : u("", !0),
|
|
316
|
-
|
|
316
|
+
b.value ? (i(), c("span", {
|
|
317
317
|
key: 3,
|
|
318
|
-
class: r(a(
|
|
318
|
+
class: r(a(n).e("count"))
|
|
319
319
|
}, [
|
|
320
|
-
|
|
321
|
-
class: r(a(
|
|
320
|
+
w("span", {
|
|
321
|
+
class: r(a(n).e("count-inner"))
|
|
322
322
|
}, D(j.value) + " / " + D(a(d).maxlength), 3)
|
|
323
323
|
], 2)) : u("", !0),
|
|
324
324
|
I.value && ae.value && te.value ? (i(), V(a(B), {
|
|
325
325
|
key: 4,
|
|
326
326
|
icon: ae.value,
|
|
327
327
|
class: r([
|
|
328
|
-
a(
|
|
329
|
-
a(
|
|
330
|
-
a(
|
|
328
|
+
a(n).e("icon"),
|
|
329
|
+
a(n).e("validateIcon"),
|
|
330
|
+
a(n).is("loading", I.value === "validating")
|
|
331
331
|
])
|
|
332
332
|
}, null, 8, ["icon", "class"])) : u("", !0)
|
|
333
333
|
], 2)
|
|
@@ -335,42 +335,42 @@ const nt = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
335
335
|
], 2),
|
|
336
336
|
t.$slots.append ? (i(), c("div", {
|
|
337
337
|
key: 1,
|
|
338
|
-
class: r(a(
|
|
338
|
+
class: r(a(n).be("group", "append"))
|
|
339
339
|
}, [
|
|
340
340
|
$(t.$slots, "append")
|
|
341
341
|
], 2)) : u("", !0)
|
|
342
342
|
], 64)) : (i(), c(q, { key: 1 }, [
|
|
343
|
-
|
|
343
|
+
w("textarea", h({
|
|
344
344
|
id: a(Y),
|
|
345
345
|
ref_key: "textarea",
|
|
346
|
-
ref:
|
|
346
|
+
ref: p,
|
|
347
347
|
class: a(Z).e("inner")
|
|
348
348
|
}, a(d), {
|
|
349
|
-
tabindex:
|
|
350
|
-
disabled: a(
|
|
351
|
-
readonly:
|
|
352
|
-
autocomplete:
|
|
353
|
-
style:
|
|
354
|
-
"aria-label":
|
|
355
|
-
placeholder:
|
|
356
|
-
form:
|
|
349
|
+
tabindex: e.tabindex,
|
|
350
|
+
disabled: a(x),
|
|
351
|
+
readonly: e.readonly,
|
|
352
|
+
autocomplete: e.autocomplete,
|
|
353
|
+
style: ne.value,
|
|
354
|
+
"aria-label": e.label,
|
|
355
|
+
placeholder: e.placeholder,
|
|
356
|
+
form: e.form,
|
|
357
357
|
onCompositionstart: le,
|
|
358
358
|
onCompositionupdate: se,
|
|
359
359
|
onCompositionend: ie,
|
|
360
360
|
onInput: W,
|
|
361
361
|
onFocus: re,
|
|
362
362
|
onBlur: ce,
|
|
363
|
-
onChange:
|
|
363
|
+
onChange: oe,
|
|
364
364
|
onKeydown: de
|
|
365
365
|
}), null, 16, st),
|
|
366
|
-
|
|
366
|
+
b.value ? (i(), c("span", {
|
|
367
367
|
key: 0,
|
|
368
368
|
style: qe(_.value),
|
|
369
|
-
class: r(a(
|
|
369
|
+
class: r(a(n).e("count"))
|
|
370
370
|
}, D(j.value) + " / " + D(a(d).maxlength), 7)) : u("", !0)
|
|
371
371
|
], 64))
|
|
372
|
-
], 16,
|
|
373
|
-
[Ge,
|
|
372
|
+
], 16, ot)), [
|
|
373
|
+
[Ge, e.type !== "hidden"]
|
|
374
374
|
]);
|
|
375
375
|
}
|
|
376
376
|
});
|