vft 0.0.331 → 0.0.332
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/es/components/button/index.d.ts +9 -9
- package/es/components/form/form-item.vue.d.ts +1 -1
- package/es/components/form/index.d.ts +30 -30
- package/es/components/input/input.vue2.js +126 -125
- package/es/components/popconfirm/index.d.ts +15 -15
- package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/es/components/super-form/super-form-simple.vue.d.ts +46 -0
- package/es/components/super-form/super-form-simple.vue.js +7 -0
- package/es/components/super-form/super-form-simple.vue2.js +32 -0
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/script.css +1 -1
- package/lib/components/button/index.d.ts +9 -9
- package/lib/components/form/form-item.vue.d.ts +1 -1
- package/lib/components/form/index.d.ts +30 -30
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/popconfirm/index.d.ts +15 -15
- package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/lib/components/super-form/super-form-simple.vue.cjs +1 -0
- package/lib/components/super-form/super-form-simple.vue.d.ts +46 -0
- package/lib/components/super-form/super-form-simple.vue2.cjs +1 -0
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/lib/script.css +1 -1
- package/package.json +4 -4
- package/web-types.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
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
|
|
2
|
-
import { UPDATE_MODEL_EVENT as G } from "@vft/constants";
|
|
3
|
-
import { useAttrs as Je, useCursor as Qe } from "@vft/use";
|
|
4
|
-
import { isString as B, singleAttrToObj as J, noop as Xe, isObject as ve } from "@vft/utils";
|
|
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 y, Fragment as q, createCommentVNode as u, createElementVNode as x, 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";
|
|
5
2
|
import "../form/index.js";
|
|
6
|
-
import { VftIcon as
|
|
7
|
-
import { useResizeObserver as
|
|
8
|
-
import {
|
|
3
|
+
import { VftIcon as B } from "../icon/index.js";
|
|
4
|
+
import { useResizeObserver as Je, isClient as Qe } from "@vueuse/core";
|
|
5
|
+
import { isString as A, singleAttrToObj as G, noop as Xe, isObject as ve } from "@vft/utils";
|
|
6
|
+
import { debugWarn as J } from "../../utils/error.js";
|
|
9
7
|
import "../config-provider/hooks/use-global-config.js";
|
|
10
|
-
import { isNil as
|
|
8
|
+
import { isNil as Ye } from "lodash-es";
|
|
11
9
|
import { useNamespace as pe } from "../../hooks/use-namespace/index.js";
|
|
12
10
|
import "../../hooks/use-model-toggle/index.js";
|
|
13
11
|
import "@popperjs/core";
|
|
14
12
|
import "../../hooks/use-z-index/index.js";
|
|
13
|
+
import { UPDATE_MODEL_EVENT as Q } from "@vft/constants";
|
|
14
|
+
import { useAttrs as Ze, useCursor as _e } from "@vft/use";
|
|
15
15
|
import { calcTextareaHeight as ye } from "./utils.js";
|
|
16
16
|
import { useFormSize as et, useFormDisabled as tt } from "../form/hooks/use-form-common-props.js";
|
|
17
17
|
import { useFormItem as at, useFormItemInputId as ot } from "../form/hooks/use-form-item.js";
|
|
@@ -44,11 +44,11 @@ const nt = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
44
44
|
inputStyle: { type: [Boolean, null, String, Object, Array] }
|
|
45
45
|
},
|
|
46
46
|
emits: {
|
|
47
|
-
[
|
|
48
|
-
input: (e) =>
|
|
49
|
-
change: (e) =>
|
|
50
|
-
suffixClick: (e) =>
|
|
51
|
-
prefixClick: (e) =>
|
|
47
|
+
[Q]: (e) => A(e),
|
|
48
|
+
input: (e) => A(e),
|
|
49
|
+
change: (e) => A(e),
|
|
50
|
+
suffixClick: (e) => A(e),
|
|
51
|
+
prefixClick: (e) => A(e),
|
|
52
52
|
focus: (e) => e instanceof FocusEvent,
|
|
53
53
|
blur: (e) => e instanceof FocusEvent,
|
|
54
54
|
clear: () => !0,
|
|
@@ -62,15 +62,15 @@ const nt = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
62
62
|
compositionend: (e) => e instanceof CompositionEvent
|
|
63
63
|
},
|
|
64
64
|
setup(e, { expose: he, emit: be }) {
|
|
65
|
-
const s = be,
|
|
65
|
+
const s = be, g = Te(), m = Le(), X = l(() => {
|
|
66
66
|
const t = {};
|
|
67
|
-
return e.containerRole === "combobox" && (t["aria-haspopup"] =
|
|
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
68
|
}), we = l(() => [
|
|
69
69
|
e.type === "textarea" ? Z.b() : o.b(),
|
|
70
70
|
o.m(ke.value),
|
|
71
|
-
o.is("disabled",
|
|
71
|
+
o.is("disabled", h.value),
|
|
72
72
|
o.is("exceed", Ee.value),
|
|
73
|
-
o.is("focus",
|
|
73
|
+
o.is("focus", v.value),
|
|
74
74
|
{
|
|
75
75
|
[o.b("group")]: m.prepend || m.append,
|
|
76
76
|
[o.bm("group", "append")]: m.append,
|
|
@@ -79,194 +79,195 @@ const nt = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
79
79
|
[o.m("suffix")]: m.suffix || e.suffixIcon || e.clearable || e.showPassword,
|
|
80
80
|
[o.bm("suffix", "password-clear")]: P.value && L.value
|
|
81
81
|
},
|
|
82
|
-
|
|
82
|
+
g.class
|
|
83
83
|
]), xe = je(), ge = l(() => [
|
|
84
84
|
o.e("wrapper"),
|
|
85
|
-
o.is("focus",
|
|
86
|
-
]), d =
|
|
85
|
+
o.is("focus", v.value)
|
|
86
|
+
]), d = Ze({
|
|
87
87
|
excludeKeys: l(() => Object.keys(X.value))
|
|
88
88
|
}), { form: Ce, formItem: F } = at(), { inputId: Y } = ot(xe.props, {
|
|
89
89
|
formItemContext: F
|
|
90
|
-
}), ke = et(),
|
|
90
|
+
}), ke = et(), h = tt(), o = pe("input"), Z = pe("textarea"), M = H(), b = H(), v = S(!1), N = S(!1), C = S(!1), K = S(!1), _ = S(), O = H(e.inputStyle), k = l(() => M.value || b.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
|
-
})), te = l(() => Ce?.statusIcon ?? !1),
|
|
94
|
-
() =>
|
|
93
|
+
})), te = l(() => Ce?.statusIcon ?? !1), I = l(() => F?.validateState || ""), ae = l(
|
|
94
|
+
() => I.value && {
|
|
95
95
|
validating: "icon-loading",
|
|
96
96
|
success: "icon-circle-check",
|
|
97
97
|
error: "icon-circle-close"
|
|
98
|
-
}[
|
|
98
|
+
}[I.value]
|
|
99
99
|
), ze = l(
|
|
100
|
-
() =>
|
|
100
|
+
() => K.value ? { icon: "icon-view", size: 16 } : { icon: "icon-hide", size: 16 }
|
|
101
101
|
), Se = l(() => [
|
|
102
|
-
|
|
102
|
+
g.style,
|
|
103
103
|
e.inputStyle
|
|
104
104
|
]), oe = 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 && !h.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 && !h.value && !e.readonly && !!f.value && (!!f.value || v.value)
|
|
114
|
+
), w = l(
|
|
115
|
+
() => e.showWordLimit && !!d.value.maxlength && (e.type === "text" || e.type === "textarea") && !h.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
|
+
!!w.value && j.value > Number(d.value.maxlength)
|
|
120
120
|
)
|
|
121
121
|
), Ve = l(
|
|
122
|
-
() => !!m.suffix || !!e.suffixIcon || P.value || e.showPassword ||
|
|
123
|
-
), [Be, Ae] =
|
|
124
|
-
|
|
125
|
-
if (!
|
|
126
|
-
const n = t[0], { width:
|
|
122
|
+
() => !!m.suffix || !!e.suffixIcon || P.value || e.showPassword || w.value || !!I.value && te.value
|
|
123
|
+
), [Be, Ae] = _e(M);
|
|
124
|
+
Je(b, (t) => {
|
|
125
|
+
if (!w.value || e.resize !== "both") return;
|
|
126
|
+
const n = t[0], { width: p } = n.contentRect;
|
|
127
127
|
_.value = {
|
|
128
128
|
/** right: 100% - width + padding(15) + right(6) */
|
|
129
|
-
right: `calc(100% - ${
|
|
129
|
+
right: `calc(100% - ${p + 15 + 6}px)`
|
|
130
130
|
};
|
|
131
131
|
});
|
|
132
132
|
const R = () => {
|
|
133
|
-
if (!(!
|
|
133
|
+
if (!(!Qe || e.type !== "textarea"))
|
|
134
134
|
if (e.autosize) {
|
|
135
135
|
const t = ve(e.autosize) ? e.autosize.minRows : void 0, n = ve(e.autosize) ? e.autosize.maxRows : void 0;
|
|
136
136
|
O.value = {
|
|
137
|
-
...ye(
|
|
137
|
+
...ye(b.value, t, n)
|
|
138
138
|
};
|
|
139
139
|
} else
|
|
140
140
|
O.value = {
|
|
141
|
-
minHeight: ye(
|
|
141
|
+
minHeight: ye(b.value).minHeight
|
|
142
142
|
};
|
|
143
|
-
},
|
|
144
|
-
const t =
|
|
143
|
+
}, z = () => {
|
|
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
148
|
let { value: n } = t.target;
|
|
149
|
-
if (d.value.maxlength && n.length >= d.value.maxlength && (n = n.slice(0, Number(d.value.maxlength))), e.formatter && (n = e.parser ? e.parser(n) : n, n = e.formatter(n)), !
|
|
149
|
+
if (d.value.maxlength && n.length >= d.value.maxlength && (n = n.slice(0, Number(d.value.maxlength))), e.formatter && (n = e.parser ? e.parser(n) : n, n = e.formatter(n)), !C.value) {
|
|
150
150
|
if (n === f.value) {
|
|
151
|
-
|
|
151
|
+
z();
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
s(
|
|
154
|
+
s(Q, n), s("input", n), await E(), z(), Ae();
|
|
155
155
|
}
|
|
156
156
|
}, ne = (t) => {
|
|
157
157
|
s("change", t.target.value);
|
|
158
158
|
}, Fe = () => {
|
|
159
159
|
s("suffixClick", e.modelValue);
|
|
160
|
-
},
|
|
160
|
+
}, Me = () => {
|
|
161
161
|
s("prefixClick", e.modelValue);
|
|
162
162
|
}, le = (t) => {
|
|
163
|
-
s("compositionstart", t),
|
|
164
|
-
},
|
|
163
|
+
s("compositionstart", t), C.value = !0;
|
|
164
|
+
}, Ke = (t) => /([(\uAC00-\uD7AF)|\u3130-\u318F])+/.test(t), se = (t) => {
|
|
165
165
|
s("compositionupdate", t);
|
|
166
|
-
const n = t.target?.value,
|
|
167
|
-
|
|
166
|
+
const n = t.target?.value, p = n[n.length - 1] || "";
|
|
167
|
+
C.value = !Ke(p);
|
|
168
168
|
}, ie = (t) => {
|
|
169
|
-
s("compositionend", t),
|
|
169
|
+
s("compositionend", t), C.value && (C.value = !1, W(t));
|
|
170
170
|
}, Pe = () => {
|
|
171
|
-
|
|
172
|
-
},
|
|
173
|
-
await E(),
|
|
174
|
-
}, Re = () =>
|
|
175
|
-
|
|
171
|
+
K.value = !K.value, ue();
|
|
172
|
+
}, ue = async () => {
|
|
173
|
+
await E(), k.value?.focus();
|
|
174
|
+
}, Re = () => k.value?.blur(), re = (t) => {
|
|
175
|
+
v.value = !0, s("focus", t);
|
|
176
176
|
}, ce = (t) => {
|
|
177
|
-
|
|
177
|
+
v.value = !1, s("blur", t), e.validateEvent && F?.validate?.("blur").catch((n) => J(n));
|
|
178
178
|
}, $e = (t) => {
|
|
179
|
-
|
|
180
|
-
},
|
|
181
|
-
|
|
179
|
+
N.value = !1, s("mouseleave", t);
|
|
180
|
+
}, De = (t) => {
|
|
181
|
+
N.value = !0, s("mouseenter", t);
|
|
182
182
|
}, de = (t) => {
|
|
183
183
|
let n = t.key;
|
|
184
184
|
if (t.target.type === "number" && ["e", "+", "-0", "E"].includes(n))
|
|
185
185
|
return t.returnValue = !1, !1;
|
|
186
186
|
s("keydown", t);
|
|
187
|
-
},
|
|
188
|
-
|
|
187
|
+
}, Ne = () => {
|
|
188
|
+
k.value?.select();
|
|
189
189
|
}, fe = () => {
|
|
190
|
-
s(
|
|
190
|
+
s(Q, ""), s("change", ""), s("clear"), s("input", "");
|
|
191
191
|
};
|
|
192
192
|
return U(
|
|
193
193
|
() => e.modelValue,
|
|
194
194
|
() => {
|
|
195
|
-
E(() => R()), e.validateEvent && F?.validate?.("change").catch((t) =>
|
|
195
|
+
E(() => R()), e.validateEvent && F?.validate?.("change").catch((t) => J(t));
|
|
196
196
|
}
|
|
197
|
-
), U(f, () =>
|
|
197
|
+
), U(f, () => z()), U(
|
|
198
198
|
() => e.type,
|
|
199
199
|
async () => {
|
|
200
|
-
await E(),
|
|
200
|
+
await E(), z(), R();
|
|
201
201
|
}
|
|
202
202
|
), We(() => {
|
|
203
|
-
!e.formatter && e.parser &&
|
|
203
|
+
!e.formatter && e.parser && J(
|
|
204
204
|
"VftInput",
|
|
205
205
|
"If you set the parser, you also need to set the formatter."
|
|
206
|
-
),
|
|
206
|
+
), z(), E(R);
|
|
207
207
|
}), he({
|
|
208
208
|
/** @description HTML input element */
|
|
209
|
-
input:
|
|
209
|
+
input: M,
|
|
210
210
|
/** @description HTML textarea element */
|
|
211
|
-
textarea:
|
|
211
|
+
textarea: b,
|
|
212
212
|
/** @description HTML element, input or textarea */
|
|
213
|
-
ref:
|
|
213
|
+
ref: k,
|
|
214
214
|
/** @description style of textarea. */
|
|
215
215
|
textareaStyle: oe,
|
|
216
216
|
/** @description from props (used on unit test) */
|
|
217
217
|
autosize: e.autosize,
|
|
218
218
|
/** @description HTML input element native method */
|
|
219
|
-
focus:
|
|
219
|
+
focus: ue,
|
|
220
220
|
/** @description HTML input element native method */
|
|
221
221
|
blur: Re,
|
|
222
222
|
/** @description HTML input element native method */
|
|
223
|
-
select:
|
|
223
|
+
select: Ne,
|
|
224
224
|
/** @description clear input value */
|
|
225
225
|
clear: fe,
|
|
226
226
|
/** @description resize textarea. */
|
|
227
227
|
resizeTextarea: R
|
|
228
|
-
}), (t, n) => He((i(), c("div",
|
|
228
|
+
}), (t, n) => He((i(), c("div", y(X.value, {
|
|
229
229
|
class: we.value,
|
|
230
230
|
style: Se.value,
|
|
231
231
|
role: t.containerRole,
|
|
232
|
-
onMouseenter:
|
|
233
|
-
onMouseleave: $e
|
|
232
|
+
onMouseenter: De,
|
|
233
|
+
onMouseleave: $e,
|
|
234
|
+
onMousewheel: n[1] || (n[1] = (p) => t.type === "number" && v.value ? p.preventDefault() : null)
|
|
234
235
|
}), [
|
|
235
236
|
t.type !== "textarea" ? (i(), c(q, { key: 0 }, [
|
|
236
237
|
t.$slots.prepend ? (i(), c("div", {
|
|
237
238
|
key: 0,
|
|
238
|
-
class:
|
|
239
|
+
class: r(a(o).be("group", "prepend"))
|
|
239
240
|
}, [
|
|
240
241
|
$(t.$slots, "prepend")
|
|
241
|
-
], 2)) :
|
|
242
|
-
|
|
243
|
-
class:
|
|
242
|
+
], 2)) : u("", !0),
|
|
243
|
+
x("div", {
|
|
244
|
+
class: r(ge.value)
|
|
244
245
|
}, [
|
|
245
246
|
t.$slots.prefix || T.value?.icon ? (i(), c("span", {
|
|
246
247
|
key: 0,
|
|
247
|
-
class:
|
|
248
|
+
class: r(a(o).e("prefix"))
|
|
248
249
|
}, [
|
|
249
|
-
|
|
250
|
-
class:
|
|
251
|
-
onClick:
|
|
250
|
+
x("span", {
|
|
251
|
+
class: r(a(o).e("prefix-inner")),
|
|
252
|
+
onClick: Me
|
|
252
253
|
}, [
|
|
253
254
|
$(t.$slots, "prefix"),
|
|
254
|
-
T.value?.icon ? (i(), V(a(
|
|
255
|
+
T.value?.icon ? (i(), V(a(B), y({
|
|
255
256
|
key: 0,
|
|
256
257
|
pointer: ""
|
|
257
258
|
}, T.value, {
|
|
258
259
|
class: a(o).e("icon")
|
|
259
|
-
}), null, 16, ["class"])) :
|
|
260
|
+
}), null, 16, ["class"])) : u("", !0)
|
|
260
261
|
], 2)
|
|
261
|
-
], 2)) :
|
|
262
|
-
|
|
262
|
+
], 2)) : u("", !0),
|
|
263
|
+
x("input", y({
|
|
263
264
|
id: a(Y),
|
|
264
265
|
ref_key: "input",
|
|
265
|
-
ref:
|
|
266
|
+
ref: M,
|
|
266
267
|
class: a(o).e("inner")
|
|
267
268
|
}, a(d), {
|
|
268
|
-
type: t.showPassword ?
|
|
269
|
-
disabled: a(
|
|
269
|
+
type: t.showPassword ? K.value ? "text" : "password" : t.type,
|
|
270
|
+
disabled: a(h),
|
|
270
271
|
formatter: t.formatter,
|
|
271
272
|
parser: t.parser,
|
|
272
273
|
readonly: t.readonly,
|
|
@@ -280,73 +281,73 @@ const nt = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
280
281
|
onCompositionupdate: se,
|
|
281
282
|
onCompositionend: ie,
|
|
282
283
|
onInput: W,
|
|
283
|
-
onFocus:
|
|
284
|
+
onFocus: re,
|
|
284
285
|
onBlur: ce,
|
|
285
286
|
onChange: ne,
|
|
286
287
|
onKeydown: de,
|
|
287
|
-
onKeyup: n[0] || (n[0] = Ue((
|
|
288
|
+
onKeyup: n[0] || (n[0] = Ue((p) => s("enter"), ["enter"]))
|
|
288
289
|
}), null, 16, lt),
|
|
289
290
|
Ve.value ? (i(), c("span", {
|
|
290
291
|
key: 1,
|
|
291
|
-
class:
|
|
292
|
+
class: r(a(o).e("suffix"))
|
|
292
293
|
}, [
|
|
293
|
-
|
|
294
|
-
class:
|
|
294
|
+
x("span", {
|
|
295
|
+
class: r(a(o).e("suffix-inner")),
|
|
295
296
|
onClick: Fe
|
|
296
297
|
}, [
|
|
297
|
-
!P.value || !L.value || !
|
|
298
|
+
!P.value || !L.value || !w.value ? (i(), c(q, { key: 0 }, [
|
|
298
299
|
$(t.$slots, "suffix"),
|
|
299
|
-
ee.value?.icon ? (i(), V(a(
|
|
300
|
+
ee.value?.icon ? (i(), V(a(B), y({ key: 0 }, ee.value, {
|
|
300
301
|
class: a(o).e("icon")
|
|
301
|
-
}), null, 16, ["class"])) :
|
|
302
|
-
], 64)) :
|
|
303
|
-
P.value ? (i(), V(a(
|
|
302
|
+
}), null, 16, ["class"])) : u("", !0)
|
|
303
|
+
], 64)) : u("", !0),
|
|
304
|
+
P.value ? (i(), V(a(B), y({
|
|
304
305
|
key: 1,
|
|
305
306
|
pointer: "",
|
|
306
307
|
class: [a(o).e("icon"), a(o).e("clear")]
|
|
307
308
|
}, Ie.value, {
|
|
308
309
|
onMousedown: me(a(Xe), ["prevent"]),
|
|
309
310
|
onClick: me(fe, ["stop"])
|
|
310
|
-
}), null, 16, ["class", "onMousedown"])) :
|
|
311
|
-
L.value ? (i(), V(a(
|
|
311
|
+
}), null, 16, ["class", "onMousedown"])) : u("", !0),
|
|
312
|
+
L.value ? (i(), V(a(B), y({ key: 2 }, ze.value, {
|
|
312
313
|
class: [a(o).e("icon"), a(o).e("password")],
|
|
313
314
|
onClick: Pe
|
|
314
|
-
}), null, 16, ["class"])) :
|
|
315
|
-
|
|
315
|
+
}), null, 16, ["class"])) : u("", !0),
|
|
316
|
+
w.value ? (i(), c("span", {
|
|
316
317
|
key: 3,
|
|
317
|
-
class:
|
|
318
|
+
class: r(a(o).e("count"))
|
|
318
319
|
}, [
|
|
319
|
-
|
|
320
|
-
class:
|
|
321
|
-
},
|
|
322
|
-
], 2)) :
|
|
323
|
-
|
|
320
|
+
x("span", {
|
|
321
|
+
class: r(a(o).e("count-inner"))
|
|
322
|
+
}, D(j.value) + " / " + D(a(d).maxlength), 3)
|
|
323
|
+
], 2)) : u("", !0),
|
|
324
|
+
I.value && ae.value && te.value ? (i(), V(a(B), {
|
|
324
325
|
key: 4,
|
|
325
326
|
icon: ae.value,
|
|
326
|
-
class:
|
|
327
|
+
class: r([
|
|
327
328
|
a(o).e("icon"),
|
|
328
329
|
a(o).e("validateIcon"),
|
|
329
|
-
a(o).is("loading",
|
|
330
|
+
a(o).is("loading", I.value === "validating")
|
|
330
331
|
])
|
|
331
|
-
}, null, 8, ["icon", "class"])) :
|
|
332
|
+
}, null, 8, ["icon", "class"])) : u("", !0)
|
|
332
333
|
], 2)
|
|
333
|
-
], 2)) :
|
|
334
|
+
], 2)) : u("", !0)
|
|
334
335
|
], 2),
|
|
335
336
|
t.$slots.append ? (i(), c("div", {
|
|
336
337
|
key: 1,
|
|
337
|
-
class:
|
|
338
|
+
class: r(a(o).be("group", "append"))
|
|
338
339
|
}, [
|
|
339
340
|
$(t.$slots, "append")
|
|
340
|
-
], 2)) :
|
|
341
|
+
], 2)) : u("", !0)
|
|
341
342
|
], 64)) : (i(), c(q, { key: 1 }, [
|
|
342
|
-
|
|
343
|
+
x("textarea", y({
|
|
343
344
|
id: a(Y),
|
|
344
345
|
ref_key: "textarea",
|
|
345
|
-
ref:
|
|
346
|
+
ref: b,
|
|
346
347
|
class: a(Z).e("inner")
|
|
347
348
|
}, a(d), {
|
|
348
349
|
tabindex: t.tabindex,
|
|
349
|
-
disabled: a(
|
|
350
|
+
disabled: a(h),
|
|
350
351
|
readonly: t.readonly,
|
|
351
352
|
autocomplete: t.autocomplete,
|
|
352
353
|
style: oe.value,
|
|
@@ -357,16 +358,16 @@ const nt = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
357
358
|
onCompositionupdate: se,
|
|
358
359
|
onCompositionend: ie,
|
|
359
360
|
onInput: W,
|
|
360
|
-
onFocus:
|
|
361
|
+
onFocus: re,
|
|
361
362
|
onBlur: ce,
|
|
362
363
|
onChange: ne,
|
|
363
364
|
onKeydown: de
|
|
364
365
|
}), null, 16, st),
|
|
365
|
-
|
|
366
|
+
w.value ? (i(), c("span", {
|
|
366
367
|
key: 0,
|
|
367
368
|
style: qe(_.value),
|
|
368
|
-
class:
|
|
369
|
-
},
|
|
369
|
+
class: r(a(o).e("count"))
|
|
370
|
+
}, D(j.value) + " / " + D(a(d).maxlength), 7)) : u("", !0)
|
|
370
371
|
], 64))
|
|
371
372
|
], 16, nt)), [
|
|
372
373
|
[Ge, t.type !== "hidden"]
|
|
@@ -7,14 +7,14 @@ export declare const VftPopconfirm: import("vft/es/utils").SFCWithInstall<{
|
|
|
7
7
|
type: import("vue").PropType<string | number>;
|
|
8
8
|
default: number;
|
|
9
9
|
};
|
|
10
|
-
teleported: {
|
|
11
|
-
type: import("vue").PropType<boolean>;
|
|
12
|
-
default: boolean;
|
|
13
|
-
};
|
|
14
10
|
icon: {
|
|
15
11
|
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
16
12
|
default: string;
|
|
17
13
|
};
|
|
14
|
+
teleported: {
|
|
15
|
+
type: import("vue").PropType<boolean>;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
18
|
hideAfter: {
|
|
19
19
|
type: import("vue").PropType<number>;
|
|
20
20
|
default: number;
|
|
@@ -52,8 +52,8 @@ export declare const VftPopconfirm: import("vft/es/utils").SFCWithInstall<{
|
|
|
52
52
|
cancel: (val: MouseEvent) => void;
|
|
53
53
|
}, import("vue").PublicProps, {
|
|
54
54
|
width: string | number;
|
|
55
|
-
teleported: boolean;
|
|
56
55
|
icon: string | import("vft/es/vft").IconProps;
|
|
56
|
+
teleported: boolean;
|
|
57
57
|
hideAfter: number;
|
|
58
58
|
persistent: boolean;
|
|
59
59
|
confirmButtonType: import("vft/es/vft").ButtonType;
|
|
@@ -74,14 +74,14 @@ export declare const VftPopconfirm: import("vft/es/utils").SFCWithInstall<{
|
|
|
74
74
|
type: import("vue").PropType<string | number>;
|
|
75
75
|
default: number;
|
|
76
76
|
};
|
|
77
|
-
teleported: {
|
|
78
|
-
type: import("vue").PropType<boolean>;
|
|
79
|
-
default: boolean;
|
|
80
|
-
};
|
|
81
77
|
icon: {
|
|
82
78
|
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
83
79
|
default: string;
|
|
84
80
|
};
|
|
81
|
+
teleported: {
|
|
82
|
+
type: import("vue").PropType<boolean>;
|
|
83
|
+
default: boolean;
|
|
84
|
+
};
|
|
85
85
|
hideAfter: {
|
|
86
86
|
type: import("vue").PropType<number>;
|
|
87
87
|
default: number;
|
|
@@ -116,8 +116,8 @@ export declare const VftPopconfirm: import("vft/es/utils").SFCWithInstall<{
|
|
|
116
116
|
onConfirm?: ((val: MouseEvent) => any) | undefined;
|
|
117
117
|
}>, {}, {}, {}, {}, {
|
|
118
118
|
width: string | number;
|
|
119
|
-
teleported: boolean;
|
|
120
119
|
icon: string | import("vft/es/vft").IconProps;
|
|
120
|
+
teleported: boolean;
|
|
121
121
|
hideAfter: number;
|
|
122
122
|
persistent: boolean;
|
|
123
123
|
confirmButtonType: import("vft/es/vft").ButtonType;
|
|
@@ -135,14 +135,14 @@ export declare const VftPopconfirm: import("vft/es/utils").SFCWithInstall<{
|
|
|
135
135
|
type: import("vue").PropType<string | number>;
|
|
136
136
|
default: number;
|
|
137
137
|
};
|
|
138
|
-
teleported: {
|
|
139
|
-
type: import("vue").PropType<boolean>;
|
|
140
|
-
default: boolean;
|
|
141
|
-
};
|
|
142
138
|
icon: {
|
|
143
139
|
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
144
140
|
default: string;
|
|
145
141
|
};
|
|
142
|
+
teleported: {
|
|
143
|
+
type: import("vue").PropType<boolean>;
|
|
144
|
+
default: boolean;
|
|
145
|
+
};
|
|
146
146
|
hideAfter: {
|
|
147
147
|
type: import("vue").PropType<number>;
|
|
148
148
|
default: number;
|
|
@@ -180,8 +180,8 @@ export declare const VftPopconfirm: import("vft/es/utils").SFCWithInstall<{
|
|
|
180
180
|
cancel: (val: MouseEvent) => void;
|
|
181
181
|
}, string, {
|
|
182
182
|
width: string | number;
|
|
183
|
-
teleported: boolean;
|
|
184
183
|
icon: string | import("vft/es/vft").IconProps;
|
|
184
|
+
teleported: boolean;
|
|
185
185
|
hideAfter: number;
|
|
186
186
|
persistent: boolean;
|
|
187
187
|
confirmButtonType: import("vft/es/vft").ButtonType;
|
|
@@ -43,8 +43,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
43
43
|
onConfirm?: ((val: MouseEvent) => any) | undefined;
|
|
44
44
|
}>, {
|
|
45
45
|
width: string | number;
|
|
46
|
-
teleported: boolean;
|
|
47
46
|
icon: string | IconProps;
|
|
47
|
+
teleported: boolean;
|
|
48
48
|
hideAfter: number;
|
|
49
49
|
persistent: boolean;
|
|
50
50
|
confirmButtonType: ButtonType;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
interface SimpleFormProps {
|
|
2
|
+
commonButtonOptions?: {
|
|
3
|
+
loading?: boolean;
|
|
4
|
+
btnText?: string;
|
|
5
|
+
onClick?: (data?: any) => void;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SimpleFormProps>, {
|
|
9
|
+
commonButtonOptions: () => {
|
|
10
|
+
btnText: string;
|
|
11
|
+
loading: boolean;
|
|
12
|
+
};
|
|
13
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
"common-click": (data?: any) => void;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SimpleFormProps>, {
|
|
16
|
+
commonButtonOptions: () => {
|
|
17
|
+
btnText: string;
|
|
18
|
+
loading: boolean;
|
|
19
|
+
};
|
|
20
|
+
}>>> & Readonly<{
|
|
21
|
+
"onCommon-click"?: ((data?: any) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
commonButtonOptions: {
|
|
24
|
+
loading?: boolean;
|
|
25
|
+
btnText?: string;
|
|
26
|
+
onClick?: (data?: any) => void;
|
|
27
|
+
};
|
|
28
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
31
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
32
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
33
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
34
|
+
} : {
|
|
35
|
+
type: import('vue').PropType<T[K]>;
|
|
36
|
+
required: true;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
type __VLS_WithDefaults<P, D> = {
|
|
40
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
41
|
+
default: D[K];
|
|
42
|
+
}> : P[K];
|
|
43
|
+
};
|
|
44
|
+
type __VLS_Prettify<T> = {
|
|
45
|
+
[K in keyof T]: T[K];
|
|
46
|
+
} & {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineComponent as r, computed as l, unref as t, createElementBlock as a, openBlock as u, createVNode as f, mergeProps as d, withCtx as _, createTextVNode as k, toDisplayString as C } from "vue";
|
|
2
|
+
import { VftButton as x } from "../button/index.js";
|
|
3
|
+
const B = { class: "super-form-simple" }, v = /* @__PURE__ */ r({
|
|
4
|
+
__name: "super-form-simple",
|
|
5
|
+
props: {
|
|
6
|
+
commonButtonOptions: { default: () => ({
|
|
7
|
+
btnText: "取消",
|
|
8
|
+
loading: !1
|
|
9
|
+
}) }
|
|
10
|
+
},
|
|
11
|
+
emits: ["common-click"],
|
|
12
|
+
setup(m, { emit: s }) {
|
|
13
|
+
const n = m, i = s, e = l(() => ({
|
|
14
|
+
btnText: "取消",
|
|
15
|
+
...t(n.commonButtonOptions)
|
|
16
|
+
})), p = (c) => {
|
|
17
|
+
const o = t(n.commonButtonOptions);
|
|
18
|
+
o.onClick && o.onClick(), i("common-click");
|
|
19
|
+
};
|
|
20
|
+
return (c, o) => (u(), a("div", B, [
|
|
21
|
+
f(t(x), d(e.value, { onClick: p }), {
|
|
22
|
+
default: _(() => [
|
|
23
|
+
k(C(e.value.btnText), 1)
|
|
24
|
+
]),
|
|
25
|
+
_: 1
|
|
26
|
+
}, 16)
|
|
27
|
+
]));
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
v as default
|
|
32
|
+
};
|