vft 0.0.472 → 0.0.474

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.
Files changed (31) hide show
  1. package/es/components/carousel/use-carousel.js +1 -1
  2. package/es/components/iframe-layout/iframe-layout.vue.d.ts +9 -2
  3. package/es/components/iframe-layout/iframe-layout.vue2.js +24 -21
  4. package/es/components/iframe-layout/iframe-page.vue.d.ts +7 -1
  5. package/es/components/iframe-layout/iframe-page.vue2.js +32 -35
  6. package/es/components/iframe-layout/index.d.ts +13 -6
  7. package/es/components/iframe-layout/style/css.d.ts +1 -0
  8. package/es/components/iframe-layout/style/css.js +1 -0
  9. package/es/components/iframe-layout/style/index.d.ts +1 -0
  10. package/es/components/iframe-layout/style/index.js +1 -0
  11. package/es/components/input/input.vue2.js +4 -4
  12. package/es/components/input-tag/composables/use-input-tag.js +1 -1
  13. package/es/components/super-form/super-form-item.vue2.js +1 -1
  14. package/es/hooks/use-z-index/index.js +3 -3
  15. package/es/package.json.d.ts +1 -1
  16. package/es/package.json.js +1 -1
  17. package/es/utils/vue/vnode.js +1 -1
  18. package/lib/components/iframe-layout/iframe-layout.vue.d.ts +9 -2
  19. package/lib/components/iframe-layout/iframe-layout.vue2.cjs +1 -1
  20. package/lib/components/iframe-layout/iframe-page.vue.d.ts +7 -1
  21. package/lib/components/iframe-layout/iframe-page.vue2.cjs +1 -1
  22. package/lib/components/iframe-layout/index.d.ts +13 -6
  23. package/lib/components/iframe-layout/style/css.cjs +1 -1
  24. package/lib/components/iframe-layout/style/css.d.ts +1 -0
  25. package/lib/components/iframe-layout/style/index.cjs +1 -1
  26. package/lib/components/iframe-layout/style/index.d.ts +1 -0
  27. package/lib/components/input/input.vue2.cjs +1 -1
  28. package/lib/package.json.cjs +1 -1
  29. package/lib/package.json.d.ts +1 -1
  30. package/package.json +4 -4
  31. package/web-types.json +1 -1
@@ -11,7 +11,7 @@ import "../../hooks/use-model-toggle/index.js";
11
11
  import { useOrderedChildren as ge } from "../../hooks/use-ordered-children/index.js";
12
12
  import "@popperjs/core";
13
13
  import "../../hooks/use-z-index/index.js";
14
- import { CAROUSEL_ITEM_NAME as H, carouselContextKey as Se } from "./constants.js";
14
+ import { carouselContextKey as Se, CAROUSEL_ITEM_NAME as H } from "./constants.js";
15
15
  const L = 300, ze = (t, O, M) => {
16
16
  const {
17
17
  children: o,
@@ -1,9 +1,16 @@
1
1
  import type { RouteLocationNormalized } from 'vue-router';
2
2
  interface Props {
3
3
  iframePages: RouteLocationNormalized[];
4
- preloadPage?: boolean;
4
+ currentPath?: string;
5
5
  }
6
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {
7
+ iframePageRef: import("vue").Ref<any, any>;
8
+ iframeIsLoaded: import("vue").ComputedRef<boolean>;
9
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ "iframe-loaded": (item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => void;
11
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
12
+ "onIframe-loaded"?: ((item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
7
14
  export default _default;
8
15
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
16
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -1,34 +1,37 @@
1
- import { defineComponent as o, createElementBlock as t, openBlock as r, Fragment as a, renderList as n, withDirectives as p, createCommentVNode as f, createBlock as c, vShow as u } from "vue";
2
- import "@vueuse/core";
3
- import "@vft/utils";
4
- import "../config-provider/hooks/use-global-config.js";
5
- import "lodash-es";
6
- import "../form/index.js";
7
- import "../../hooks/use-model-toggle/index.js";
8
- import "@popperjs/core";
9
- import "../../hooks/use-z-index/index.js";
10
- import i from "./iframe-page.vue2.js";
11
- const s = o({
1
+ import { defineComponent as c, ref as p, computed as P, createElementBlock as n, openBlock as t, Fragment as m, renderList as _, withDirectives as g, createCommentVNode as k, createBlock as v, vShow as L } from "vue";
2
+ import y from "./iframe-page.vue2.js";
3
+ const B = c({
12
4
  name: "vft-iframe-layout"
13
- }), C = /* @__PURE__ */ o({
14
- ...s,
5
+ }), x = /* @__PURE__ */ c({
6
+ ...B,
15
7
  props: {
16
8
  iframePages: {},
17
- preloadPage: { type: Boolean }
9
+ currentPath: {}
18
10
  },
19
- setup(m) {
20
- return (l, _) => (r(!0), t(a, null, n(m.iframePages, (e) => (r(), t(a, {
11
+ emits: ["iframe-loaded"],
12
+ setup(o, { expose: l, emit: u }) {
13
+ const d = u, r = p(), s = (a, f) => {
14
+ d("iframe-loaded", a, f);
15
+ }, i = P(() => !r?.value?.[r?.value?.length - 1]?.isLoading);
16
+ return l({
17
+ iframePageRef: r,
18
+ iframeIsLoaded: i
19
+ }), (a, f) => (t(!0), n(m, null, _(o.iframePages, (e, h) => (t(), n(m, {
21
20
  key: e.query ? e.fullPath : e.path
22
21
  }, [
23
- e.meta.frameSrc && e.meta.loaded ? p((r(), c(i, {
22
+ e.meta.frameSrc && e.meta.loaded ? g((t(), v(y, {
24
23
  key: 0,
24
+ ref_for: !0,
25
+ ref_key: "iframePageRef",
26
+ ref: r,
27
+ onLoaded: (S) => s(e, h),
25
28
  "frame-src": e.meta.frameSrc
26
- }, null, 8, ["frame-src"])), [
27
- [u, e.fullPath === l.$route.fullPath]
28
- ]) : f("", !0)
29
+ }, null, 8, ["onLoaded", "frame-src"])), [
30
+ [L, e.fullPath === (o.currentPath || a.$route.fullPath)]
31
+ ]) : k("", !0)
29
32
  ], 64))), 128));
30
33
  }
31
34
  });
32
35
  export {
33
- C as default
36
+ x as default
34
37
  };
@@ -1,7 +1,13 @@
1
1
  interface IframePageProps {
2
2
  frameSrc: string;
3
3
  }
4
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
4
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>, {
5
+ isLoading: import("vue").Ref<boolean, boolean>;
6
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ loaded: () => void;
8
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>> & Readonly<{
9
+ onLoaded?: (() => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
5
11
  export default _default;
6
12
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
7
13
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -1,57 +1,54 @@
1
- import { defineComponent as m, ref as n, onMounted as p, nextTick as d, withDirectives as u, createElementBlock as v, openBlock as _, normalizeClass as i, unref as r, createElementVNode as w } from "vue";
1
+ import { defineComponent as n, ref as t, onMounted as u, nextTick as a, createElementBlock as _, openBlock as v, normalizeClass as w, unref as g } 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 g } from "../../hooks/use-namespace/index.js";
7
+ import { useNamespace as h } 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 { vLoading as h } from "../loading/directive.js";
12
- import "../icon/index.js";
13
- const b = ["src"], k = m({
11
+ const b = ["src"], k = n({
14
12
  name: "vft-iframe-page"
15
- }), M = /* @__PURE__ */ m({
13
+ }), I = /* @__PURE__ */ n({
16
14
  ...k,
17
15
  props: {
18
16
  frameSrc: {}
19
17
  },
20
- setup(s) {
21
- const a = g("iframe-page"), e = n(), o = n(!0), t = () => {
22
- o.value = !1;
23
- }, l = () => {
24
- o.value = !1;
25
- }, c = () => {
18
+ emits: ["loaded"],
19
+ setup(i, { expose: m, emit: s }) {
20
+ const l = s, c = h("iframe-page"), e = t(), o = t(!0), r = () => {
21
+ a(() => {
22
+ o.value = !1, l("loaded");
23
+ });
24
+ }, f = () => {
25
+ r();
26
+ }, p = () => {
26
27
  if (!e.value) return;
27
28
  e.value?.contentDocument?.readyState === "complete" && setTimeout(() => {
28
- t();
29
+ r();
29
30
  }, 1e3);
30
31
  };
31
- return p(() => {
32
- d(() => {
33
- c();
32
+ return u(() => {
33
+ o.value = !0, a(() => {
34
+ p();
34
35
  });
35
- }), (f, y) => u((_(), v("div", {
36
- class: i(r(a).b())
37
- }, [
38
- w("iframe", {
39
- ref_key: "iframeRef",
40
- ref: e,
41
- sandbox: "allow-scripts allow-same-origin allow-top-navigation allow-modals allow-forms allow-top-navigation-by-user-activation",
42
- referrerPolicy: "no-referrer-when-downgrade",
43
- frameborder: "0",
44
- style: { border: "none", outline: "none" },
45
- class: i(r(a).b()),
46
- src: s.frameSrc,
47
- onLoad: t,
48
- onError: l
49
- }, null, 42, b)
50
- ], 2)), [
51
- [r(h), o.value]
52
- ]);
36
+ }), m({
37
+ isLoading: o
38
+ }), (d, x) => (v(), _("iframe", {
39
+ ref_key: "iframeRef",
40
+ ref: e,
41
+ sandbox: "allow-scripts allow-same-origin allow-top-navigation allow-modals allow-forms allow-top-navigation-by-user-activation",
42
+ referrerPolicy: "no-referrer-when-downgrade",
43
+ frameborder: "0",
44
+ style: { border: "none", outline: "none" },
45
+ class: w(g(c).b()),
46
+ src: i.frameSrc,
47
+ onLoad: r,
48
+ onError: f
49
+ }, null, 42, b));
53
50
  }
54
51
  });
55
52
  export {
56
- M as default
53
+ I as default
57
54
  };
@@ -3,16 +3,23 @@ export declare const VftIframeLayout: import("vft/es/utils").SFCWithInstall<impo
3
3
  type: import("vue").PropType<import("vue-router").RouteLocationNormalizedGeneric[]>;
4
4
  required: true;
5
5
  };
6
- preloadPage: {
7
- type: import("vue").PropType<boolean>;
6
+ currentPath: {
7
+ type: import("vue").PropType<string>;
8
8
  };
9
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ }>, {
10
+ iframePageRef: import("vue").Ref<any, any>;
11
+ iframeIsLoaded: import("vue").ComputedRef<boolean>;
12
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "iframe-loaded": (item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => void;
14
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
10
15
  iframePages: {
11
16
  type: import("vue").PropType<import("vue-router").RouteLocationNormalizedGeneric[]>;
12
17
  required: true;
13
18
  };
14
- preloadPage: {
15
- type: import("vue").PropType<boolean>;
19
+ currentPath: {
20
+ type: import("vue").PropType<string>;
16
21
  };
17
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
22
+ }>> & Readonly<{
23
+ "onIframe-loaded"?: ((item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => any) | undefined;
24
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
18
25
  export default VftIframeLayout;
@@ -1 +1,2 @@
1
1
  import 'vft/theme-style/vft-iframe-layout.css';
2
+ import 'vft/theme-style/vft-loading.css';
@@ -1,2 +1,3 @@
1
1
  import "vft/theme-style/base.css";
2
2
  import "vft/theme-style/vft-iframe-layout.css";
3
+ import "vft/theme-style/vft-loading.css";
@@ -1 +1,2 @@
1
1
  import 'vft/theme-style/src/iframe-layout.scss';
2
+ import 'vft/theme-style/src/loading.scss';
@@ -1,2 +1,3 @@
1
1
  import "vft/theme-style/src/base.scss";
2
2
  import "vft/theme-style/src/iframe-layout.scss";
3
+ import "vft/theme-style/src/loading.scss";
@@ -13,8 +13,8 @@ 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
15
  import { calcTextareaHeight as he } from "./utils.js";
16
- import { useFormSize as et, useFormDisabled as tt } from "../form/hooks/use-form-common-props.js";
17
- import { useFormItem as at, useFormItemInputId as nt } from "../form/hooks/use-form-item.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
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: {
@@ -85,9 +85,9 @@ const ot = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
85
85
  n.is("focus", v.value)
86
86
  ]), d = Ze({
87
87
  excludeKeys: l(() => Object.keys(X.value))
88
- }), { form: Ce, formItem: F } = at(), { inputId: Y } = nt(we.props, {
88
+ }), { form: Ce, formItem: F } = et(), { inputId: Y } = tt(we.props, {
89
89
  formItemContext: F
90
- }), ke = et(), x = tt(), 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", {
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(
@@ -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, INPUT_EVENT as H, UPDATE_MODEL_EVENT as d } from "../../../constants/event.js";
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 X, computed as j, ref as re, unref as c, useSlots as oe, createVNode as a, mergeProps as q, withDirectives as ie, vShow as ne, isVNode as le, createTextVNode as O, resolveComponent as N } from "vue";
1
+ import { defineComponent as X, computed as j, ref as re, unref as c, useSlots as oe, createVNode as a, mergeProps as q, withDirectives as ie, vShow as ne, createTextVNode as O, isVNode as le, resolveComponent as N } from "vue";
2
2
  import "../alert/index.js";
3
3
  import "../avatar/index.js";
4
4
  import "../avatar-stack/index.js";
@@ -2,14 +2,14 @@ import "@vueuse/core";
2
2
  import { isNumber as m, isClient as p } from "@vft/utils";
3
3
  import { debugWarn as l } from "../../utils/error.js";
4
4
  import "../../components/config-provider/hooks/use-global-config.js";
5
- import { ref as v, getCurrentInstance as i, inject as e, computed as c, unref as Z } from "vue";
5
+ import { getCurrentInstance as i, inject as e, computed as c, unref as v, ref as Z } from "vue";
6
6
  import "lodash-es";
7
7
  import "../../components/form/index.js";
8
8
  const s = {
9
9
  current: 0
10
- }, u = v(0), f = 2e3, d = Symbol("vftZIndexContextKey"), y = Symbol("zIndexContextKey"), K = (I) => {
10
+ }, u = Z(0), f = 2e3, d = Symbol("vftZIndexContextKey"), y = Symbol("zIndexContextKey"), K = (I) => {
11
11
  const n = i() ? e(d, s) : s, x = I || (i() ? e(y, void 0) : void 0), t = c(() => {
12
- const r = Z(x);
12
+ const r = v(x);
13
13
  return m(r) ? r : f;
14
14
  }), o = c(() => t.value + u.value), a = () => (n.current++, u.value = n.current, o.value);
15
15
  return !p && !e(d) && l(
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.472",
3
+ "version": "0.0.474",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -1,4 +1,4 @@
1
- const o = "0.0.472";
1
+ const o = "0.0.474";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1,4 +1,4 @@
1
- import { isArray as E, hasOwn as m, camelize as N } from "@vft/utils";
1
+ import { hasOwn as m, camelize as N, isArray as E } from "@vft/utils";
2
2
  import { isVNode as o, Fragment as S, Comment as A, Text as s, createCommentVNode as L, createBlock as _, openBlock as C } from "vue";
3
3
  import { debugWarn as O } from "../error.js";
4
4
  const R = "utils/vue/vnode";
@@ -1,9 +1,16 @@
1
1
  import type { RouteLocationNormalized } from 'vue-router';
2
2
  interface Props {
3
3
  iframePages: RouteLocationNormalized[];
4
- preloadPage?: boolean;
4
+ currentPath?: string;
5
5
  }
6
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {
7
+ iframePageRef: import("vue").Ref<any, any>;
8
+ iframeIsLoaded: import("vue").ComputedRef<boolean>;
9
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ "iframe-loaded": (item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => void;
11
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
12
+ "onIframe-loaded"?: ((item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
7
14
  export default _default;
8
15
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
16
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const u=require("./iframe-page.vue2.cjs"),o=e.defineComponent({name:"vft-iframe-layout"}),l=e.defineComponent({...o,props:{iframePages:{},preloadPage:{type:Boolean}},setup(t){return(a,n)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.iframePages,r=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.query?r.fullPath:r.path},[r.meta.frameSrc&&r.meta.loaded?e.withDirectives((e.openBlock(),e.createBlock(u.default,{key:0,"frame-src":r.meta.frameSrc},null,8,["frame-src"])),[[e.vShow,r.fullPath===a.$route.fullPath]]):e.createCommentVNode("",!0)],64))),128))}});exports.default=l;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("./iframe-page.vue2.cjs"),i=e.defineComponent({name:"vft-iframe-layout"}),_=e.defineComponent({...i,props:{iframePages:{},currentPath:{}},emits:["iframe-loaded"],setup(o,{expose:u,emit:l}){const c=l,t=e.ref(),f=(a,n)=>{c("iframe-loaded",a,n)},d=e.computed(()=>!t?.value?.[t?.value?.length-1]?.isLoading);return u({iframePageRef:t,iframeIsLoaded:d}),(a,n)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.iframePages,(r,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.query?r.fullPath:r.path},[r.meta.frameSrc&&r.meta.loaded?e.withDirectives((e.openBlock(),e.createBlock(m.default,{key:0,ref_for:!0,ref_key:"iframePageRef",ref:t,onLoaded:p=>f(r,s),"frame-src":r.meta.frameSrc},null,8,["onLoaded","frame-src"])),[[e.vShow,r.fullPath===(o.currentPath||a.$route.fullPath)]]):e.createCommentVNode("",!0)],64))),128))}});exports.default=_;
@@ -1,7 +1,13 @@
1
1
  interface IframePageProps {
2
2
  frameSrc: string;
3
3
  }
4
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
4
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>, {
5
+ isLoading: import("vue").Ref<boolean, boolean>;
6
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ loaded: () => void;
8
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>> & Readonly<{
9
+ onLoaded?: (() => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
5
11
  export default _default;
6
12
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
7
13
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const c=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const u=require("../loading/directive.cjs");require("../icon/index.cjs");const f=["src"],d=e.defineComponent({name:"vft-iframe-page"}),m=e.defineComponent({...d,props:{frameSrc:{}},setup(t){const a=c.useNamespace("iframe-page"),r=e.ref(),o=e.ref(!0),n=()=>{o.value=!1},i=()=>{o.value=!1},s=()=>{if(!r.value)return;r.value?.contentDocument?.readyState==="complete"&&setTimeout(()=>{n()},1e3)};return e.onMounted(()=>{e.nextTick(()=>{s()})}),(l,v)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(a).b())},[e.createElementVNode("iframe",{ref_key:"iframeRef",ref:r,sandbox:"allow-scripts allow-same-origin allow-top-navigation allow-modals allow-forms allow-top-navigation-by-user-activation",referrerPolicy:"no-referrer-when-downgrade",frameborder:"0",style:{border:"none",outline:"none"},class:e.normalizeClass(e.unref(a).b()),src:t.frameSrc,onLoad:n,onError:i},null,42,f)],2)),[[e.unref(u.vLoading),o.value]])}});exports.default=m;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const d=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const m=["src"],p=e.defineComponent({name:"vft-iframe-page"}),_=e.defineComponent({...p,props:{frameSrc:{}},emits:["loaded"],setup(a,{expose:t,emit:i}){const s=i,l=d.useNamespace("iframe-page"),r=e.ref(),o=e.ref(!0),n=()=>{e.nextTick(()=>{o.value=!1,s("loaded")})},c=()=>{n()},u=()=>{if(!r.value)return;r.value?.contentDocument?.readyState==="complete"&&setTimeout(()=>{n()},1e3)};return e.onMounted(()=>{o.value=!0,e.nextTick(()=>{u()})}),t({isLoading:o}),(f,v)=>(e.openBlock(),e.createElementBlock("iframe",{ref_key:"iframeRef",ref:r,sandbox:"allow-scripts allow-same-origin allow-top-navigation allow-modals allow-forms allow-top-navigation-by-user-activation",referrerPolicy:"no-referrer-when-downgrade",frameborder:"0",style:{border:"none",outline:"none"},class:e.normalizeClass(e.unref(l).b()),src:a.frameSrc,onLoad:n,onError:c},null,42,m))}});exports.default=_;
@@ -3,16 +3,23 @@ export declare const VftIframeLayout: import("vft/es/utils").SFCWithInstall<impo
3
3
  type: import("vue").PropType<import("vue-router").RouteLocationNormalizedGeneric[]>;
4
4
  required: true;
5
5
  };
6
- preloadPage: {
7
- type: import("vue").PropType<boolean>;
6
+ currentPath: {
7
+ type: import("vue").PropType<string>;
8
8
  };
9
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ }>, {
10
+ iframePageRef: import("vue").Ref<any, any>;
11
+ iframeIsLoaded: import("vue").ComputedRef<boolean>;
12
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "iframe-loaded": (item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => void;
14
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
10
15
  iframePages: {
11
16
  type: import("vue").PropType<import("vue-router").RouteLocationNormalizedGeneric[]>;
12
17
  required: true;
13
18
  };
14
- preloadPage: {
15
- type: import("vue").PropType<boolean>;
19
+ currentPath: {
20
+ type: import("vue").PropType<string>;
16
21
  };
17
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
22
+ }>> & Readonly<{
23
+ "onIframe-loaded"?: ((item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => any) | undefined;
24
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
18
25
  export default VftIframeLayout;
@@ -1 +1 @@
1
- "use strict";require("vft/theme-style/base.css");require("vft/theme-style/vft-iframe-layout.css");
1
+ "use strict";require("vft/theme-style/base.css");require("vft/theme-style/vft-iframe-layout.css");require("vft/theme-style/vft-loading.css");
@@ -1 +1,2 @@
1
1
  import 'vft/theme-style/vft-iframe-layout.css';
2
+ import 'vft/theme-style/vft-loading.css';
@@ -1 +1 @@
1
- "use strict";require("vft/theme-style/src/base.scss");require("vft/theme-style/src/iframe-layout.scss");
1
+ "use strict";require("vft/theme-style/src/base.scss");require("vft/theme-style/src/iframe-layout.scss");require("vft/theme-style/src/loading.scss");
@@ -1 +1,2 @@
1
1
  import 'vft/theme-style/src/iframe-layout.scss';
2
+ import 'vft/theme-style/src/loading.scss';
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../form/index.cjs");const b=require("../icon/index.cjs"),Y=require("@vueuse/core"),s=require("@vft/utils"),T=require("../../utils/error.cjs");require("../config-provider/hooks/use-global-config.cjs");const Be=require("lodash-es"),Z=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const q=require("@vft/constants"),_=require("@vft/use"),ee=require("./utils.cjs"),te=require("../form/hooks/use-form-common-props.cjs"),ne=require("../form/hooks/use-form-item.cjs"),Ve=["role"],Ie=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form"],Se=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form"],ze=e.defineComponent({__name:"input",props:{id:{},size:{default:""},disabled:{type:Boolean},modelValue:{},type:{default:"text"},resize:{},autosize:{type:[Object,Boolean],default:!1},autocomplete:{default:"off"},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean},showPassword:{type:Boolean},showWordLimit:{type:Boolean},suffixIcon:{},prefixIcon:{},clearIcon:{},containerRole:{},label:{},tabindex:{default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:[Boolean,null,String,Object,Array]}},emits:{[q.UPDATE_MODEL_EVENT]:t=>s.isString(t),input:t=>s.isString(t),change:t=>s.isString(t),suffixClick:t=>s.isString(t),prefixClick:t=>s.isString(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,enter:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},setup(t,{expose:oe,emit:ae}){const l=ae,p=e.useAttrs(),i=e.useSlots(),M=e.computed(()=>{const n={};return t.containerRole==="combobox"&&(n["aria-haspopup"]=p["aria-haspopup"],n["aria-owns"]=p["aria-owns"],n["aria-expanded"]=p["aria-expanded"]),n}),le=e.computed(()=>[t.type==="textarea"?A.b():o.b(),o.m(ie.value),o.is("disabled",m.value),o.is("exceed",fe.value),o.is("focus",c.value),{[o.b("group")]:i.prepend||i.append,[o.bm("group","append")]:i.append,[o.bm("group","prepend")]:i.prepend,[o.m("prefix")]:i.prefix||t.prefixIcon,[o.m("suffix")]:i.suffix||t.suffixIcon||t.clearable||t.showPassword,[o.bm("suffix","password-clear")]:E.value&&z.value},p.class]),se=e.getCurrentInstance(),re=e.computed(()=>[o.e("wrapper"),o.is("focus",c.value)]),r=_.useAttrs({excludeKeys:e.computed(()=>Object.keys(M.value))}),{form:ue,formItem:k}=ne.useFormItem(),{inputId:F}=ne.useFormItemInputId(se.props,{formItemContext:k}),ie=te.useFormSize(),m=te.useFormDisabled(),o=Z.useNamespace("input"),A=Z.useNamespace("textarea"),C=e.shallowRef(),f=e.shallowRef(),c=e.ref(!1),V=e.ref(!1),y=e.ref(!1),w=e.ref(!1),D=e.ref(),I=e.shallowRef(t.inputStyle),h=e.computed(()=>C.value||f.value),S=e.computed(()=>s.singleAttrToObj(t.prefixIcon,"icon",{size:16})),O=e.computed(()=>s.singleAttrToObj(t.suffixIcon,"icon",{size:16})),ce=e.computed(()=>s.singleAttrToObj(t.clearIcon,"icon",{icon:"icon-circle-close",size:16})),R=e.computed(()=>ue?.statusIcon??!1),x=e.computed(()=>k?.validateState||""),K=e.computed(()=>x.value&&{validating:"icon-loading",success:"icon-circle-check",error:"icon-circle-close"}[x.value]),de=e.computed(()=>w.value?{icon:"icon-view",size:16}:{icon:"icon-hide",size:16}),me=e.computed(()=>[p.style,t.inputStyle]),$=e.computed(()=>[t.inputStyle,I.value,{resize:t.resize}]),u=e.computed(()=>Be.isNil(t.modelValue)?"":String(t.modelValue)),E=e.computed(()=>t.clearable&&!m.value&&!t.readonly&&!!u.value&&(c.value||V.value)),z=e.computed(()=>t.showPassword&&!m.value&&!t.readonly&&!!u.value&&(!!u.value||c.value)),v=e.computed(()=>t.showWordLimit&&!!r.value.maxlength&&(t.type==="text"||t.type==="textarea")&&!m.value&&!t.readonly&&!t.showPassword),N=e.computed(()=>Array.from(u.value).length),fe=e.computed(()=>!!v.value&&N.value>Number(r.value.maxlength)),ve=e.computed(()=>!!i.suffix||!!t.suffixIcon||E.value||t.showPassword||v.value||!!x.value&&R.value),[pe,ye]=_.useCursor(C);Y.useResizeObserver(f,n=>{if(!v.value||t.resize!=="both")return;const a=n[0],{width:d}=a.contentRect;D.value={right:`calc(100% - ${d+15+6}px)`}});const B=()=>{if(!(!Y.isClient||t.type!=="textarea"))if(t.autosize){const n=s.isObject(t.autosize)?t.autosize.minRows:void 0,a=s.isObject(t.autosize)?t.autosize.maxRows:void 0;I.value={...ee.calcTextareaHeight(f.value,n,a)}}else I.value={minHeight:ee.calcTextareaHeight(f.value).minHeight}},g=()=>{const n=h.value;!n||n.value===u.value||(n.value=u.value)},P=async n=>{pe();let{value:a}=n.target;if(r.value.maxlength&&a.length>=r.value.maxlength&&(a=a.slice(0,Number(r.value.maxlength))),t.formatter&&(a=t.parser?t.parser(a):a,a=t.formatter(a)),!y.value){if(a===u.value){g();return}l(q.UPDATE_MODEL_EVENT,a),l("input",a),await e.nextTick(),g(),ye()}},j=n=>{l("change",n.target.value)},he=()=>{l("suffixClick",t.modelValue)},xe=()=>{l("prefixClick",t.modelValue)},L=n=>{l("compositionstart",n),y.value=!0},ge=n=>/([(\uAC00-\uD7AF)|\u3130-\u318F])+/.test(n),W=n=>{l("compositionupdate",n);const a=n.target?.value,d=a[a.length-1]||"";y.value=!ge(d)},H=n=>{l("compositionend",n),y.value&&(y.value=!1,P(n))},be=()=>{w.value=!w.value,U()},U=async()=>{await e.nextTick(),h.value?.focus()},ke=()=>h.value?.blur(),G=n=>{c.value=!0,l("focus",n)},J=n=>{c.value=!1,l("blur",n),t.validateEvent&&k?.validate?.("blur").catch(a=>T.debugWarn(a))},Ce=n=>{V.value=!1,l("mouseleave",n)},we=n=>{V.value=!0,l("mouseenter",n)},Q=n=>{const a=n.key;if(n.target.type==="number"&&["e","+","-0","E"].includes(a))return n.returnValue=!1,!1;l("keydown",n)},Ee=()=>{h.value?.select()},X=()=>{l(q.UPDATE_MODEL_EVENT,""),l("change",""),l("clear"),l("input","")};return e.watch(()=>t.modelValue,()=>{e.nextTick(()=>B()),t.validateEvent&&k?.validate?.("change").catch(n=>T.debugWarn(n))}),e.watch(u,()=>g()),e.watch(()=>t.type,async()=>{await e.nextTick(),g(),B()}),e.onMounted(()=>{!t.formatter&&t.parser&&T.debugWarn("VftInput","If you set the parser, you also need to set the formatter."),g(),e.nextTick(B)}),oe({input:C,textarea:f,ref:h,textareaStyle:$,autosize:t.autosize,focus:U,blur:ke,select:Ee,clear:X,resizeTextarea:B}),(n,a)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",e.mergeProps(M.value,{class:le.value,style:me.value,role:t.containerRole,onMouseenter:we,onMouseleave:Ce,onMousewheel:a[1]||(a[1]=d=>t.type==="number"&&c.value?d.preventDefault():null)}),[t.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o).be("group","prepend"))},[e.renderSlot(n.$slots,"prepend")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(re.value)},[n.$slots.prefix||S.value?.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(o).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("prefix-inner")),onClick:xe},[e.renderSlot(n.$slots,"prefix"),S.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0,pointer:""},S.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(F),ref_key:"input",ref:C,class:e.unref(o).e("inner")},e.unref(r),{type:t.showPassword?w.value?"text":"password":t.type,disabled:e.unref(m),formatter:t.formatter,parser:t.parser,readonly:t.readonly,autocomplete:t.autocomplete,tabindex:t.tabindex,"aria-label":t.label,placeholder:t.placeholder,style:t.inputStyle,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q,onKeyup:a[0]||(a[0]=e.withKeys(d=>l("enter"),["enter"]))}),null,16,Ie),ve.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(o).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("suffix-inner")),onClick:he},[!E.value||!z.value||!v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(n.$slots,"suffix"),O.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0},O.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:1,pointer:"",class:[e.unref(o).e("icon"),e.unref(o).e("clear")]},ce.value,{onMousedown:e.withModifiers(e.unref(s.noop),["prevent"]),onClick:e.withModifiers(X,["stop"])}),null,16,["class","onMousedown"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:2},de.value,{class:[e.unref(o).e("icon"),e.unref(o).e("password")],onClick:be}),null,16,["class"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(o).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("count-inner"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),3)],2)):e.createCommentVNode("",!0),x.value&&K.value&&R.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),{key:4,icon:K.value,class:e.normalizeClass([e.unref(o).e("icon"),e.unref(o).e("validateIcon"),e.unref(o).is("loading",x.value==="validating")])},null,8,["icon","class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0)],2),n.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(o).be("group","append"))},[e.renderSlot(n.$slots,"append")],2)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("textarea",e.mergeProps({id:e.unref(F),ref_key:"textarea",ref:f,class:e.unref(A).e("inner")},e.unref(r),{tabindex:t.tabindex,disabled:e.unref(m),readonly:t.readonly,autocomplete:t.autocomplete,style:$.value,"aria-label":t.label,placeholder:t.placeholder,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q}),null,16,Se),v.value?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(D.value),class:e.normalizeClass(e.unref(o).e("count"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),7)):e.createCommentVNode("",!0)],64))],16,Ve)),[[e.vShow,t.type!=="hidden"]])}});exports.default=ze;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../form/index.cjs");const b=require("../icon/index.cjs"),Y=require("@vueuse/core"),s=require("@vft/utils"),T=require("../../utils/error.cjs");require("../config-provider/hooks/use-global-config.cjs");const Be=require("lodash-es"),Z=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const q=require("@vft/constants"),_=require("@vft/use"),ee=require("./utils.cjs"),te=require("../form/hooks/use-form-item.cjs"),ne=require("../form/hooks/use-form-common-props.cjs"),Ve=["role"],Ie=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form"],Se=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form"],ze=e.defineComponent({__name:"input",props:{id:{},size:{default:""},disabled:{type:Boolean},modelValue:{},type:{default:"text"},resize:{},autosize:{type:[Object,Boolean],default:!1},autocomplete:{default:"off"},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean},showPassword:{type:Boolean},showWordLimit:{type:Boolean},suffixIcon:{},prefixIcon:{},clearIcon:{},containerRole:{},label:{},tabindex:{default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:[Boolean,null,String,Object,Array]}},emits:{[q.UPDATE_MODEL_EVENT]:t=>s.isString(t),input:t=>s.isString(t),change:t=>s.isString(t),suffixClick:t=>s.isString(t),prefixClick:t=>s.isString(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,enter:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},setup(t,{expose:oe,emit:ae}){const l=ae,p=e.useAttrs(),i=e.useSlots(),M=e.computed(()=>{const n={};return t.containerRole==="combobox"&&(n["aria-haspopup"]=p["aria-haspopup"],n["aria-owns"]=p["aria-owns"],n["aria-expanded"]=p["aria-expanded"]),n}),le=e.computed(()=>[t.type==="textarea"?A.b():o.b(),o.m(ie.value),o.is("disabled",m.value),o.is("exceed",fe.value),o.is("focus",c.value),{[o.b("group")]:i.prepend||i.append,[o.bm("group","append")]:i.append,[o.bm("group","prepend")]:i.prepend,[o.m("prefix")]:i.prefix||t.prefixIcon,[o.m("suffix")]:i.suffix||t.suffixIcon||t.clearable||t.showPassword,[o.bm("suffix","password-clear")]:E.value&&z.value},p.class]),se=e.getCurrentInstance(),re=e.computed(()=>[o.e("wrapper"),o.is("focus",c.value)]),r=_.useAttrs({excludeKeys:e.computed(()=>Object.keys(M.value))}),{form:ue,formItem:k}=te.useFormItem(),{inputId:F}=te.useFormItemInputId(se.props,{formItemContext:k}),ie=ne.useFormSize(),m=ne.useFormDisabled(),o=Z.useNamespace("input"),A=Z.useNamespace("textarea"),C=e.shallowRef(),f=e.shallowRef(),c=e.ref(!1),V=e.ref(!1),y=e.ref(!1),w=e.ref(!1),D=e.ref(),I=e.shallowRef(t.inputStyle),h=e.computed(()=>C.value||f.value),S=e.computed(()=>s.singleAttrToObj(t.prefixIcon,"icon",{size:16})),O=e.computed(()=>s.singleAttrToObj(t.suffixIcon,"icon",{size:16})),ce=e.computed(()=>s.singleAttrToObj(t.clearIcon,"icon",{icon:"icon-circle-close",size:16})),R=e.computed(()=>ue?.statusIcon??!1),x=e.computed(()=>k?.validateState||""),K=e.computed(()=>x.value&&{validating:"icon-loading",success:"icon-circle-check",error:"icon-circle-close"}[x.value]),de=e.computed(()=>w.value?{icon:"icon-view",size:16}:{icon:"icon-hide",size:16}),me=e.computed(()=>[p.style,t.inputStyle]),$=e.computed(()=>[t.inputStyle,I.value,{resize:t.resize}]),u=e.computed(()=>Be.isNil(t.modelValue)?"":String(t.modelValue)),E=e.computed(()=>t.clearable&&!m.value&&!t.readonly&&!!u.value&&(c.value||V.value)),z=e.computed(()=>t.showPassword&&!m.value&&!t.readonly&&!!u.value&&(!!u.value||c.value)),v=e.computed(()=>t.showWordLimit&&!!r.value.maxlength&&(t.type==="text"||t.type==="textarea")&&!m.value&&!t.readonly&&!t.showPassword),N=e.computed(()=>Array.from(u.value).length),fe=e.computed(()=>!!v.value&&N.value>Number(r.value.maxlength)),ve=e.computed(()=>!!i.suffix||!!t.suffixIcon||E.value||t.showPassword||v.value||!!x.value&&R.value),[pe,ye]=_.useCursor(C);Y.useResizeObserver(f,n=>{if(!v.value||t.resize!=="both")return;const a=n[0],{width:d}=a.contentRect;D.value={right:`calc(100% - ${d+15+6}px)`}});const B=()=>{if(!(!Y.isClient||t.type!=="textarea"))if(t.autosize){const n=s.isObject(t.autosize)?t.autosize.minRows:void 0,a=s.isObject(t.autosize)?t.autosize.maxRows:void 0;I.value={...ee.calcTextareaHeight(f.value,n,a)}}else I.value={minHeight:ee.calcTextareaHeight(f.value).minHeight}},g=()=>{const n=h.value;!n||n.value===u.value||(n.value=u.value)},P=async n=>{pe();let{value:a}=n.target;if(r.value.maxlength&&a.length>=r.value.maxlength&&(a=a.slice(0,Number(r.value.maxlength))),t.formatter&&(a=t.parser?t.parser(a):a,a=t.formatter(a)),!y.value){if(a===u.value){g();return}l(q.UPDATE_MODEL_EVENT,a),l("input",a),await e.nextTick(),g(),ye()}},j=n=>{l("change",n.target.value)},he=()=>{l("suffixClick",t.modelValue)},xe=()=>{l("prefixClick",t.modelValue)},L=n=>{l("compositionstart",n),y.value=!0},ge=n=>/([(\uAC00-\uD7AF)|\u3130-\u318F])+/.test(n),W=n=>{l("compositionupdate",n);const a=n.target?.value,d=a[a.length-1]||"";y.value=!ge(d)},H=n=>{l("compositionend",n),y.value&&(y.value=!1,P(n))},be=()=>{w.value=!w.value,U()},U=async()=>{await e.nextTick(),h.value?.focus()},ke=()=>h.value?.blur(),G=n=>{c.value=!0,l("focus",n)},J=n=>{c.value=!1,l("blur",n),t.validateEvent&&k?.validate?.("blur").catch(a=>T.debugWarn(a))},Ce=n=>{V.value=!1,l("mouseleave",n)},we=n=>{V.value=!0,l("mouseenter",n)},Q=n=>{const a=n.key;if(n.target.type==="number"&&["e","+","-0","E"].includes(a))return n.returnValue=!1,!1;l("keydown",n)},Ee=()=>{h.value?.select()},X=()=>{l(q.UPDATE_MODEL_EVENT,""),l("change",""),l("clear"),l("input","")};return e.watch(()=>t.modelValue,()=>{e.nextTick(()=>B()),t.validateEvent&&k?.validate?.("change").catch(n=>T.debugWarn(n))}),e.watch(u,()=>g()),e.watch(()=>t.type,async()=>{await e.nextTick(),g(),B()}),e.onMounted(()=>{!t.formatter&&t.parser&&T.debugWarn("VftInput","If you set the parser, you also need to set the formatter."),g(),e.nextTick(B)}),oe({input:C,textarea:f,ref:h,textareaStyle:$,autosize:t.autosize,focus:U,blur:ke,select:Ee,clear:X,resizeTextarea:B}),(n,a)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",e.mergeProps(M.value,{class:le.value,style:me.value,role:t.containerRole,onMouseenter:we,onMouseleave:Ce,onMousewheel:a[1]||(a[1]=d=>t.type==="number"&&c.value?d.preventDefault():null)}),[t.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o).be("group","prepend"))},[e.renderSlot(n.$slots,"prepend")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(re.value)},[n.$slots.prefix||S.value?.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(o).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("prefix-inner")),onClick:xe},[e.renderSlot(n.$slots,"prefix"),S.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0,pointer:""},S.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(F),ref_key:"input",ref:C,class:e.unref(o).e("inner")},e.unref(r),{type:t.showPassword?w.value?"text":"password":t.type,disabled:e.unref(m),formatter:t.formatter,parser:t.parser,readonly:t.readonly,autocomplete:t.autocomplete,tabindex:t.tabindex,"aria-label":t.label,placeholder:t.placeholder,style:t.inputStyle,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q,onKeyup:a[0]||(a[0]=e.withKeys(d=>l("enter"),["enter"]))}),null,16,Ie),ve.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(o).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("suffix-inner")),onClick:he},[!E.value||!z.value||!v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(n.$slots,"suffix"),O.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0},O.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:1,pointer:"",class:[e.unref(o).e("icon"),e.unref(o).e("clear")]},ce.value,{onMousedown:e.withModifiers(e.unref(s.noop),["prevent"]),onClick:e.withModifiers(X,["stop"])}),null,16,["class","onMousedown"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:2},de.value,{class:[e.unref(o).e("icon"),e.unref(o).e("password")],onClick:be}),null,16,["class"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(o).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("count-inner"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),3)],2)):e.createCommentVNode("",!0),x.value&&K.value&&R.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),{key:4,icon:K.value,class:e.normalizeClass([e.unref(o).e("icon"),e.unref(o).e("validateIcon"),e.unref(o).is("loading",x.value==="validating")])},null,8,["icon","class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0)],2),n.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(o).be("group","append"))},[e.renderSlot(n.$slots,"append")],2)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("textarea",e.mergeProps({id:e.unref(F),ref_key:"textarea",ref:f,class:e.unref(A).e("inner")},e.unref(r),{tabindex:t.tabindex,disabled:e.unref(m),readonly:t.readonly,autocomplete:t.autocomplete,style:$.value,"aria-label":t.label,placeholder:t.placeholder,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q}),null,16,Se),v.value?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(D.value),class:e.normalizeClass(e.unref(o).e("count"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),7)):e.createCommentVNode("",!0)],64))],16,Ve)),[[e.vShow,t.type!=="hidden"]])}});exports.default=ze;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.472";exports.version=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.474";exports.version=e;
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.472",
3
+ "version": "0.0.474",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vft",
3
- "version": "0.0.472",
3
+ "version": "0.0.474",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -56,12 +56,12 @@
56
56
  "resize-detector": "0.3.0",
57
57
  "sortablejs": "1.15.0",
58
58
  "photoswipe": "5.4.4",
59
- "@vft/router": "0.0.71",
60
59
  "@vft/store": "0.0.63",
61
60
  "@vft/utils": "0.0.151",
62
61
  "@vft/use": "0.0.92",
63
- "@vft/constants": "0.0.75",
64
- "@vft/directives": "0.0.36"
62
+ "@vft/router": "0.0.71",
63
+ "@vft/directives": "0.0.36",
64
+ "@vft/constants": "0.0.75"
65
65
  },
66
66
  "vetur": {
67
67
  "tags": "tags.json",