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.
@@ -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 v, Fragment as q, createCommentVNode as r, createElementVNode as w, normalizeClass as u, unref as a, renderSlot as $, createBlock as V, withKeys as Ue, withModifiers as me, toDisplayString as N, normalizeStyle as qe, vShow as Ge } from "vue";
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 A } from "../icon/index.js";
7
- import { useResizeObserver as Ye, isClient as Ze } from "@vueuse/core";
8
- import { debugWarn as Q } from "../../utils/error.js";
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 _e } from "lodash-es";
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
- [G]: (e) => B(e),
48
- input: (e) => B(e),
49
- change: (e) => B(e),
50
- suffixClick: (e) => B(e),
51
- prefixClick: (e) => B(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, x = Te(), m = Le(), X = l(() => {
65
+ const s = be, g = Te(), m = Le(), X = l(() => {
66
66
  const t = {};
67
- return e.containerRole === "combobox" && (t["aria-haspopup"] = x["aria-haspopup"], t["aria-owns"] = x["aria-owns"], t["aria-expanded"] = x["aria-expanded"]), t;
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", p.value),
71
+ o.is("disabled", h.value),
72
72
  o.is("exceed", Ee.value),
73
- o.is("focus", h.value),
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
- x.class
82
+ g.class
83
83
  ]), xe = je(), ge = l(() => [
84
84
  o.e("wrapper"),
85
- o.is("focus", h.value)
86
- ]), d = Je({
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(), p = tt(), o = pe("input"), Z = pe("textarea"), K = H(), y = H(), h = S(!1), D = S(!1), g = S(!1), M = S(!1), _ = S(), O = H(e.inputStyle), C = l(() => K.value || y.value), T = l(() => J(e.prefixIcon, "icon", { size: 16 })), ee = l(() => J(e.suffixIcon, "icon", { size: 16 })), Ie = l(() => J(e.clearIcon, "icon", {
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), k = l(() => F?.validateState || ""), ae = l(
94
- () => k.value && {
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
- }[k.value]
98
+ }[I.value]
99
99
  ), ze = l(
100
- () => M.value ? { icon: "icon-view", size: 16 } : { icon: "icon-hide", size: 16 }
100
+ () => K.value ? { icon: "icon-view", size: 16 } : { icon: "icon-hide", size: 16 }
101
101
  ), Se = l(() => [
102
- x.style,
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
- () => _e(e.modelValue) ? "" : String(e.modelValue)
109
+ () => Ye(e.modelValue) ? "" : String(e.modelValue)
110
110
  ), P = l(
111
- () => e.clearable && !p.value && !e.readonly && !!f.value && (h.value || D.value)
111
+ () => e.clearable && !h.value && !e.readonly && !!f.value && (v.value || N.value)
112
112
  ), L = l(
113
- () => e.showPassword && !p.value && !e.readonly && !!f.value && (!!f.value || h.value)
114
- ), b = l(
115
- () => e.showWordLimit && !!d.value.maxlength && (e.type === "text" || e.type === "textarea") && !p.value && !e.readonly && !e.showPassword
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
- !!b.value && j.value > Number(d.value.maxlength)
119
+ !!w.value && j.value > Number(d.value.maxlength)
120
120
  )
121
121
  ), Ve = l(
122
- () => !!m.suffix || !!e.suffixIcon || P.value || e.showPassword || b.value || !!k.value && te.value
123
- ), [Be, Ae] = Qe(K);
124
- Ye(y, (t) => {
125
- if (!b.value || e.resize !== "both") return;
126
- const n = t[0], { width: z } = n.contentRect;
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% - ${z + 15 + 6}px)`
129
+ right: `calc(100% - ${p + 15 + 6}px)`
130
130
  };
131
131
  });
132
132
  const R = () => {
133
- if (!(!Ze || e.type !== "textarea"))
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(y.value, t, n)
137
+ ...ye(b.value, t, n)
138
138
  };
139
139
  } else
140
140
  O.value = {
141
- minHeight: ye(y.value).minHeight
141
+ minHeight: ye(b.value).minHeight
142
142
  };
143
- }, I = () => {
144
- const t = C.value;
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)), !g.value) {
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
- I();
151
+ z();
152
152
  return;
153
153
  }
154
- s(G, n), s("input", n), await E(), I(), Ae();
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
- }, Ke = () => {
160
+ }, Me = () => {
161
161
  s("prefixClick", e.modelValue);
162
162
  }, le = (t) => {
163
- s("compositionstart", t), g.value = !0;
164
- }, Me = (t) => /([(\uAC00-\uD7AF)|\u3130-\u318F])+/.test(t), se = (t) => {
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, z = n[n.length - 1] || "";
167
- g.value = !Me(z);
166
+ const n = t.target?.value, p = n[n.length - 1] || "";
167
+ C.value = !Ke(p);
168
168
  }, ie = (t) => {
169
- s("compositionend", t), g.value && (g.value = !1, W(t));
169
+ s("compositionend", t), C.value && (C.value = !1, W(t));
170
170
  }, Pe = () => {
171
- M.value = !M.value, re();
172
- }, re = async () => {
173
- await E(), C.value?.focus();
174
- }, Re = () => C.value?.blur(), ue = (t) => {
175
- h.value = !0, s("focus", t);
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
- h.value = !1, s("blur", t), e.validateEvent && F?.validate?.("blur").catch((n) => Q(n));
177
+ v.value = !1, s("blur", t), e.validateEvent && F?.validate?.("blur").catch((n) => J(n));
178
178
  }, $e = (t) => {
179
- D.value = !1, s("mouseleave", t);
180
- }, Ne = (t) => {
181
- D.value = !0, s("mouseenter", t);
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
- }, De = () => {
188
- C.value?.select();
187
+ }, Ne = () => {
188
+ k.value?.select();
189
189
  }, fe = () => {
190
- s(G, ""), s("change", ""), s("clear"), s("input", "");
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) => Q(t));
195
+ E(() => R()), e.validateEvent && F?.validate?.("change").catch((t) => J(t));
196
196
  }
197
- ), U(f, () => I()), U(
197
+ ), U(f, () => z()), U(
198
198
  () => e.type,
199
199
  async () => {
200
- await E(), I(), R();
200
+ await E(), z(), R();
201
201
  }
202
202
  ), We(() => {
203
- !e.formatter && e.parser && Q(
203
+ !e.formatter && e.parser && J(
204
204
  "VftInput",
205
205
  "If you set the parser, you also need to set the formatter."
206
- ), I(), E(R);
206
+ ), z(), E(R);
207
207
  }), he({
208
208
  /** @description HTML input element */
209
- input: K,
209
+ input: M,
210
210
  /** @description HTML textarea element */
211
- textarea: y,
211
+ textarea: b,
212
212
  /** @description HTML element, input or textarea */
213
- ref: C,
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: re,
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: De,
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", v(X.value, {
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: Ne,
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: u(a(o).be("group", "prepend"))
239
+ class: r(a(o).be("group", "prepend"))
239
240
  }, [
240
241
  $(t.$slots, "prepend")
241
- ], 2)) : r("", !0),
242
- w("div", {
243
- class: u(ge.value)
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: u(a(o).e("prefix"))
248
+ class: r(a(o).e("prefix"))
248
249
  }, [
249
- w("span", {
250
- class: u(a(o).e("prefix-inner")),
251
- onClick: Ke
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(A), v({
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"])) : r("", !0)
260
+ }), null, 16, ["class"])) : u("", !0)
260
261
  ], 2)
261
- ], 2)) : r("", !0),
262
- w("input", v({
262
+ ], 2)) : u("", !0),
263
+ x("input", y({
263
264
  id: a(Y),
264
265
  ref_key: "input",
265
- ref: K,
266
+ ref: M,
266
267
  class: a(o).e("inner")
267
268
  }, a(d), {
268
- type: t.showPassword ? M.value ? "text" : "password" : t.type,
269
- disabled: a(p),
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: ue,
284
+ onFocus: re,
284
285
  onBlur: ce,
285
286
  onChange: ne,
286
287
  onKeydown: de,
287
- onKeyup: n[0] || (n[0] = Ue((z) => s("enter"), ["enter"]))
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: u(a(o).e("suffix"))
292
+ class: r(a(o).e("suffix"))
292
293
  }, [
293
- w("span", {
294
- class: u(a(o).e("suffix-inner")),
294
+ x("span", {
295
+ class: r(a(o).e("suffix-inner")),
295
296
  onClick: Fe
296
297
  }, [
297
- !P.value || !L.value || !b.value ? (i(), c(q, { key: 0 }, [
298
+ !P.value || !L.value || !w.value ? (i(), c(q, { key: 0 }, [
298
299
  $(t.$slots, "suffix"),
299
- ee.value?.icon ? (i(), V(a(A), v({ key: 0 }, ee.value, {
300
+ ee.value?.icon ? (i(), V(a(B), y({ key: 0 }, ee.value, {
300
301
  class: a(o).e("icon")
301
- }), null, 16, ["class"])) : r("", !0)
302
- ], 64)) : r("", !0),
303
- P.value ? (i(), V(a(A), v({
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"])) : r("", !0),
311
- L.value ? (i(), V(a(A), v({ key: 2 }, ze.value, {
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"])) : r("", !0),
315
- b.value ? (i(), c("span", {
315
+ }), null, 16, ["class"])) : u("", !0),
316
+ w.value ? (i(), c("span", {
316
317
  key: 3,
317
- class: u(a(o).e("count"))
318
+ class: r(a(o).e("count"))
318
319
  }, [
319
- w("span", {
320
- class: u(a(o).e("count-inner"))
321
- }, N(j.value) + " / " + N(a(d).maxlength), 3)
322
- ], 2)) : r("", !0),
323
- k.value && ae.value && te.value ? (i(), V(a(A), {
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: u([
327
+ class: r([
327
328
  a(o).e("icon"),
328
329
  a(o).e("validateIcon"),
329
- a(o).is("loading", k.value === "validating")
330
+ a(o).is("loading", I.value === "validating")
330
331
  ])
331
- }, null, 8, ["icon", "class"])) : r("", !0)
332
+ }, null, 8, ["icon", "class"])) : u("", !0)
332
333
  ], 2)
333
- ], 2)) : r("", !0)
334
+ ], 2)) : u("", !0)
334
335
  ], 2),
335
336
  t.$slots.append ? (i(), c("div", {
336
337
  key: 1,
337
- class: u(a(o).be("group", "append"))
338
+ class: r(a(o).be("group", "append"))
338
339
  }, [
339
340
  $(t.$slots, "append")
340
- ], 2)) : r("", !0)
341
+ ], 2)) : u("", !0)
341
342
  ], 64)) : (i(), c(q, { key: 1 }, [
342
- w("textarea", v({
343
+ x("textarea", y({
343
344
  id: a(Y),
344
345
  ref_key: "textarea",
345
- ref: y,
346
+ ref: b,
346
347
  class: a(Z).e("inner")
347
348
  }, a(d), {
348
349
  tabindex: t.tabindex,
349
- disabled: a(p),
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: ue,
361
+ onFocus: re,
361
362
  onBlur: ce,
362
363
  onChange: ne,
363
364
  onKeydown: de
364
365
  }), null, 16, st),
365
- b.value ? (i(), c("span", {
366
+ w.value ? (i(), c("span", {
366
367
  key: 0,
367
368
  style: qe(_.value),
368
- class: u(a(o).e("count"))
369
- }, N(j.value) + " / " + N(a(d).maxlength), 7)) : r("", !0)
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,7 @@
1
+ import o from "./super-form-simple.vue2.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b35ac0e7"]]);
5
+ export {
6
+ e as default
7
+ };
@@ -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
+ };
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.331",
3
+ "version": "0.0.332",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",