vft 0.0.129 → 0.0.131

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,26 +1,27 @@
1
- import { defineComponent as r, watch as o, computed as d, onActivated as f, onDeactivated as u, onBeforeUnmount as l, getCurrentInstance as h, openBlock as g, createElementBlock as p, normalizeClass as v, unref as C, normalizeStyle as V, renderSlot as b } from "vue";
2
- import { inBrowser as k, kebabCase as B } from "@vft/utils";
1
+ import { defineComponent as r, watch as m, computed as f, onActivated as d, onDeactivated as l, onBeforeUnmount as u, getCurrentInstance as h, openBlock as g, createElementBlock as p, normalizeClass as v, unref as C, normalizeStyle as V, renderSlot as b } from "vue";
2
+ import { inBrowser as k, kebabCase as y } from "@vft/utils";
3
3
  import "@vueuse/core";
4
4
  import "../../utils/ns-cover.js";
5
5
  import "lodash";
6
- import { useNamespace as D } from "../../hooks/use-namespace/index.js";
6
+ import { useNamespace as B } from "../../hooks/use-namespace/index.js";
7
7
  import "@popperjs/core";
8
8
  import "../../hooks/use-z-index/index.js";
9
- import { messageConfig as E } from "./constants.js";
10
- import { provideGlobalConfig as L } from "./hooks/use-global-config.js";
11
- const S = (
9
+ import { messageConfig as D } from "./constants.js";
10
+ import { provideGlobalConfig as E } from "./hooks/use-global-config.js";
11
+ const L = (
12
12
  /* hoist-static*/
13
- D("config-provider")
14
- ), T = r({
13
+ B("config-provider")
14
+ ), S = r({
15
15
  name: "vft-config-provider"
16
16
  }), N = /* @__PURE__ */ r({
17
- ...T,
17
+ ...S,
18
18
  props: {
19
19
  theme: { default: "light" },
20
20
  themeVars: {},
21
21
  themeVarsDark: {},
22
22
  themeVarsLight: {},
23
- iconPrefix: {},
23
+ iconfontClass: {},
24
+ iconifyPrefixClass: { default: "ico-" },
24
25
  namespace: { default: "vft" },
25
26
  zIndex: {},
26
27
  message: {},
@@ -28,14 +29,14 @@ const S = (
28
29
  button: {}
29
30
  },
30
31
  setup(t) {
31
- o(
32
+ m(
32
33
  () => t.message,
33
34
  (e) => {
34
- Object.assign(E, e ?? {});
35
+ Object.assign(D, e ?? {});
35
36
  },
36
37
  { immediate: !0, deep: !0 }
37
38
  );
38
- const s = d(() => {
39
+ const s = f(() => {
39
40
  const e = t.theme === "dark";
40
41
  return i({
41
42
  ...t.themeVars,
@@ -45,26 +46,26 @@ const S = (
45
46
  if (k) {
46
47
  const e = () => {
47
48
  document.documentElement.classList.add(t.theme);
48
- }, m = (n = t.theme) => {
49
+ }, a = (n = t.theme) => {
49
50
  document.documentElement.classList.remove(n);
50
51
  };
51
- o(
52
+ m(
52
53
  () => t.theme,
53
- (n, a) => {
54
- a && m(a), e();
54
+ (n, o) => {
55
+ o && a(o), e();
55
56
  },
56
57
  { immediate: !0 }
57
- ), f(e), u(m), l(m);
58
+ ), d(e), l(a), u(a);
58
59
  }
59
60
  function i(e) {
60
- const m = {};
61
+ const a = {};
61
62
  return Object.keys(e).forEach((n) => {
62
- m[`--${t.namespace}-${B(n)}`] = e[n];
63
- }), m;
63
+ a[`--${t.namespace}-${y(n)}`] = e[n];
64
+ }), a;
64
65
  }
65
66
  const c = h();
66
- return L(c.props), (e, m) => (g(), p("div", {
67
- class: v(C(S).b()),
67
+ return E(c.props), (e, a) => (g(), p("div", {
68
+ class: v(C(L).b()),
68
69
  style: V(s.value)
69
70
  }, [
70
71
  b(e.$slots, "default")
@@ -1,20 +1,20 @@
1
- import { defineComponent as m, computed as i, openBlock as n, createElementBlock as r, normalizeClass as l, unref as a, normalizeStyle as s } from "vue";
2
- import { addUnit as d } from "@vft/utils";
1
+ import { defineComponent as u, computed as r, openBlock as c, createElementBlock as a, normalizeClass as l, unref as i, normalizeStyle as m } from "vue";
2
+ import { addUnit as y } from "@vft/utils";
3
3
  import "../config-provider/index.js";
4
4
  import "@vueuse/core";
5
- import { generateCssVars as v } from "../../utils/ns-cover.js";
5
+ import { generateCssVars as C } from "../../utils/ns-cover.js";
6
6
  import "lodash";
7
- import { useNamespace as y } from "../../hooks/use-namespace/index.js";
7
+ import { useNamespace as g } from "../../hooks/use-namespace/index.js";
8
8
  import "@popperjs/core";
9
9
  import "../../hooks/use-z-index/index.js";
10
- import { useGlobalConfig as g } from "../config-provider/hooks/use-global-config.js";
11
- const C = ["src"], c = (
10
+ import { useGlobalConfig as h } from "../config-provider/hooks/use-global-config.js";
11
+ const z = ["src"], f = (
12
12
  /* hoist-static*/
13
- y("icon")
14
- ), h = m({
13
+ g("icon")
14
+ ), I = u({
15
15
  name: "vft-icon"
16
- }), V = /* @__PURE__ */ m({
17
- ...h,
16
+ }), W = /* @__PURE__ */ u({
17
+ ...I,
18
18
  props: {
19
19
  icon: {},
20
20
  size: {},
@@ -25,28 +25,27 @@ const C = ["src"], c = (
25
25
  hoverColor: {}
26
26
  },
27
27
  setup(o) {
28
- const u = g(), t = i(() => v({
29
- size: d(o.size),
28
+ var s;
29
+ const t = h(), n = r(() => C({
30
+ size: y(o.size),
30
31
  color: o.color,
31
32
  hoverColor: o.hoverColor,
32
33
  cursor: o.pointer ? "pointer" : void 0,
33
- animation: o.rotate ? `${u.value.namespace}-rotate ${o.rotateSpeed}s linear 0s infinite` : void 0
34
- }, "icon")), f = (e) => e == null ? void 0 : e.includes("/"), p = i(() => f(o.icon));
35
- return (e, z) => p.value ? (n(), r("img", {
34
+ animation: o.rotate ? `${t.value.namespace}-rotate ${o.rotateSpeed}s linear 0s infinite` : void 0
35
+ }, "icon")), d = (e) => e == null ? void 0 : e.includes("/"), p = r(() => d(o.icon)), v = o.icon.startsWith((s = t.value) == null ? void 0 : s.iconifyPrefixClass) ? "" : t.value.iconfontClass;
36
+ return (e, B) => p.value ? (c(), a("img", {
36
37
  key: 0,
37
- class: l(a(c).e("image")),
38
+ class: l(i(f).e("image")),
38
39
  src: e.icon,
39
40
  alt: "",
40
- style: s(t.value)
41
- }, null, 14, C)) : (n(), r("i", {
41
+ style: m(n.value)
42
+ }, null, 14, z)) : (c(), a("i", {
42
43
  key: 1,
43
- class: l([a(c).b(), e.icon]),
44
- style: s({
45
- ...t.value
46
- })
44
+ class: l([i(f).b(), e.icon, i(v)]),
45
+ style: m(n.value)
47
46
  }, null, 6));
48
47
  }
49
48
  });
50
49
  export {
51
- V as default
50
+ W as default
52
51
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as V, useAttrs as k, ref as c, getCurrentInstance as M, computed as s, unref as t, watchEffect as S, watch as F, nextTick as d, openBlock as p, createBlock as m, mergeProps as P, createSlots as R, withCtx as B, renderSlot as _, createCommentVNode as A } from "vue";
1
+ import { defineComponent as k, useAttrs as v, ref as i, getCurrentInstance as M, computed as u, unref as t, watchEffect as S, watch as F, nextTick as r, openBlock as m, createBlock as B, mergeProps as P, createSlots as R, withCtx as h, renderSlot as _, createCommentVNode as A } from "vue";
2
2
  import { isFunction as T, deepMerge as D } from "@vft/utils";
3
3
  import { VftDialog as G } from "../dialog/index.js";
4
4
  import I from "./modal-footer-action.vue2.js";
5
- const N = /* @__PURE__ */ V({
5
+ const N = /* @__PURE__ */ k({
6
6
  __name: "modal",
7
7
  props: {
8
8
  closeFunc: {},
@@ -44,23 +44,23 @@ const N = /* @__PURE__ */ V({
44
44
  "update:modelValue": [],
45
45
  submit: []
46
46
  },
47
- setup(h, { emit: n }) {
48
- const o = h, y = k(), u = c(null), l = c(!1), a = c(null), C = {
47
+ setup(y, { emit: n }) {
48
+ const o = y, C = v(), c = i(null), l = i(!1), a = i(null), f = {
49
49
  setModalProps: g,
50
50
  emitVisible: void 0,
51
51
  redoModalHeight: () => {
52
- d(() => {
52
+ r(() => {
53
53
  t(a) && t(a).setModalHeight();
54
54
  });
55
55
  }
56
- }, r = M();
57
- r && n("register", C, r.uid);
58
- const w = s(() => ({
56
+ }, s = M();
57
+ s && n("register", f, s.uid);
58
+ const b = u(() => ({
59
59
  ...o,
60
- ...t(u)
61
- })), b = s(() => ({
62
- ...y,
63
- ...t(w),
60
+ ...t(c)
61
+ })), w = u(() => ({
62
+ ...C,
63
+ ...t(b),
64
64
  modelValue: t(l)
65
65
  }));
66
66
  S(() => {
@@ -68,7 +68,9 @@ const N = /* @__PURE__ */ V({
68
68
  }), F(
69
69
  () => t(l),
70
70
  (e) => {
71
- n("visible-change", e), n("update:modelValue", e), d(() => {
71
+ n("visible-change", e), n("update:modelValue", e), s && r(() => {
72
+ f.emitVisible(e, s.uid);
73
+ }), r(() => {
72
74
  o.scrollTop && e && t(a) && t(a).scrollTop();
73
75
  });
74
76
  },
@@ -76,39 +78,39 @@ const N = /* @__PURE__ */ V({
76
78
  immediate: !1
77
79
  }
78
80
  );
79
- async function i(e) {
81
+ async function d(e) {
80
82
  if (e == null || e.stopPropagation(), o.closeFunc && T(o.closeFunc)) {
81
- const f = await o.closeFunc();
82
- l.value = !f;
83
+ const p = await o.closeFunc();
84
+ l.value = !p;
83
85
  return;
84
86
  }
85
87
  l.value = !1, n("close", e);
86
88
  }
87
89
  function g(e) {
88
- u.value = D(t(u) || {}, e), Reflect.has(e, "modelValue") && (l.value = !!e.modelValue);
90
+ c.value = D(t(c) || {}, e), Reflect.has(e, "modelValue") && (l.value = !!e.modelValue);
89
91
  }
90
- const O = s(() => ({
91
- onClick: (e) => i(e),
92
+ const O = u(() => ({
93
+ onClick: (e) => d(e),
92
94
  ...o.cancelButtonOptions
93
- })), v = s(() => ({
95
+ })), V = u(() => ({
94
96
  onClick: () => n("submit"),
95
97
  ...o.submitButtonOptions
96
98
  }));
97
- return (e, f) => (p(), m(t(G), P(b.value, { onClose: i }), R({
98
- default: B(() => [
99
+ return (e, p) => (m(), B(t(G), P(w.value, { onClose: d }), R({
100
+ default: h(() => [
99
101
  _(e.$slots, "default")
100
102
  ]),
101
103
  _: 2
102
104
  }, [
103
105
  e.$slots.footer || e.showActionButtonGroup ? {
104
106
  name: "footer",
105
- fn: B(() => [
106
- e.showActionButtonGroup ? (p(), m(I, {
107
+ fn: h(() => [
108
+ e.showActionButtonGroup ? (m(), B(I, {
107
109
  key: 0,
108
110
  showCancelButton: e.showCancelButton,
109
111
  showSubmitButton: e.showSubmitButton,
110
112
  cancelButtonOptions: O.value,
111
- submitButtonOptions: v.value
113
+ submitButtonOptions: V.value
112
114
  }, null, 8, ["showCancelButton", "showSubmitButton", "cancelButtonOptions", "submitButtonOptions"])) : A("", !0)
113
115
  ]),
114
116
  key: "0"
@@ -1,15 +1,16 @@
1
- import { getDynamicProps as s } from "@vft/utils";
2
- import { tryOnBeforeUnmount as d } from "@vueuse/core";
3
- function f(r) {
4
- const o = ref(null), l = ref(!1), u = ref(null);
5
- let n;
6
- function i(e, a) {
7
- d(() => {
8
- o.value = null, l.value = null;
9
- }), !(unref(l) && e === unref(o)) && (o.value = e, u.value = a, r && e.setProps(s(r)), l.value = !0, n == null || n(), n = watch(
10
- () => r,
1
+ import { getDynamicProps as c } from "@vft/utils";
2
+ import { tryOnBeforeUnmount as f } from "@vueuse/core";
3
+ import { ref as u, unref as i, watch as w, toRaw as r } from "vue";
4
+ function y(o) {
5
+ const n = u(null), s = u(!1), d = u(null);
6
+ let l;
7
+ function g(e, a) {
8
+ f(() => {
9
+ n.value = null, s.value = null;
10
+ }), !(i(s) && e === i(n)) && (n.value = e, d.value = a, o && e.setProps(c(o)), s.value = !0, l == null || l(), l = w(
11
+ () => o,
11
12
  () => {
12
- r && e.setProps(s(r));
13
+ o && e.setProps(c(o));
13
14
  },
14
15
  {
15
16
  immediate: !0,
@@ -18,10 +19,10 @@ function f(r) {
18
19
  ));
19
20
  }
20
21
  function t() {
21
- const e = unref(o);
22
+ const e = i(n);
22
23
  return e || console.error("The table instance has not been obtained yet, please make sure the table is presented when performing the table operation!"), e;
23
24
  }
24
- return [i, {
25
+ return [g, {
25
26
  reload: async (e) => await t().reload(e),
26
27
  setProps: (e) => {
27
28
  t().setProps(e);
@@ -29,7 +30,7 @@ function f(r) {
29
30
  redoHeight: () => {
30
31
  t().redoHeight();
31
32
  },
32
- setSelectedRows: (e) => toRaw(t().setSelectedRows(e)),
33
+ setSelectedRows: (e) => r(t().setSelectedRows(e)),
33
34
  setLoading: (e) => {
34
35
  t().setLoading(e);
35
36
  },
@@ -37,7 +38,7 @@ function f(r) {
37
38
  getRawDataSource: () => t().getRawDataSource(),
38
39
  getColumns: ({ ignoreIndex: e = !1 } = {}) => {
39
40
  const a = t().getColumns({ ignoreIndex: e }) || [];
40
- return toRaw(a);
41
+ return r(a);
41
42
  },
42
43
  setColumns: (e) => {
43
44
  t().setColumns(e);
@@ -47,8 +48,8 @@ function f(r) {
47
48
  deleteSelectRowByKey: (e) => {
48
49
  t().deleteSelectRowByKey(e);
49
50
  },
50
- getSelectRowKeys: () => toRaw(t().getSelectRowKeys()),
51
- getSelectRows: () => toRaw(t().getSelectRows()),
51
+ getSelectRowKeys: () => r(t().getSelectRowKeys()),
52
+ getSelectRows: () => r(t().getSelectRows()),
52
53
  clearSelectedRowKeys: () => {
53
54
  t().clearSelectedRowKeys();
54
55
  },
@@ -56,8 +57,8 @@ function f(r) {
56
57
  t().setSelectedRowKeys(e);
57
58
  },
58
59
  getPaginationRef: () => t().getPaginationRef(),
59
- getSize: () => toRaw(t().getSize()),
60
- updateTableData: (e, a, c) => t().updateTableData(e, a, c),
60
+ getSize: () => r(t().getSize()),
61
+ updateTableData: (e, a, R) => t().updateTableData(e, a, R),
61
62
  deleteTableDataRecord: (e, a) => t().deleteTableDataRecord(e, a),
62
63
  insertTableDataRecord: (e, a) => t().insertTableDataRecord(e, a),
63
64
  updateTableDataRecord: (e, a) => t().updateTableDataRecord(e, a),
@@ -65,9 +66,9 @@ function f(r) {
65
66
  setShowPagination: async (e) => {
66
67
  t().setShowPagination(e);
67
68
  },
68
- getShowPagination: () => toRaw(t().getShowPagination())
69
+ getShowPagination: () => r(t().getShowPagination())
69
70
  }];
70
71
  }
71
72
  export {
72
- f as useTable
73
+ y as useTable
73
74
  };
@@ -1,4 +1,4 @@
1
- const o = "0.0.129";
1
+ const o = "0.0.131";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("@vft/utils");require("@vueuse/core");require("../../utils/ns-cover.cjs");require("lodash");const m=require("../../hooks/use-namespace/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const l=require("./constants.cjs"),d=require("./hooks/use-global-config.cjs"),f=m.useNamespace("config-provider"),h=e.defineComponent({name:"vft-config-provider"}),g=e.defineComponent({...h,props:{theme:{default:"light"},themeVars:{},themeVarsDark:{},themeVarsLight:{},iconPrefix:{},namespace:{default:"vft"},zIndex:{},message:{},projectCfg:{},button:{}},setup(n){e.watch(()=>n.message,t=>{Object.assign(l.messageConfig,t??{})},{immediate:!0,deep:!0});const i=e.computed(()=>{const t=n.theme==="dark";return c({...n.themeVars,...t?n.themeVarsDark:n.themeVarsLight})});if(o.inBrowser){const t=()=>{document.documentElement.classList.add(n.theme)},r=(s=n.theme)=>{document.documentElement.classList.remove(s)};e.watch(()=>n.theme,(s,a)=>{a&&r(a),t()},{immediate:!0}),e.onActivated(t),e.onDeactivated(r),e.onBeforeUnmount(r)}function c(t){const r={};return Object.keys(t).forEach(s=>{r[`--${n.namespace}-${o.kebabCase(s)}`]=t[s]}),r}const u=e.getCurrentInstance();return d.provideGlobalConfig(u.props),(t,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(f).b()),style:e.normalizeStyle(i.value)},[e.renderSlot(t.$slots,"default")],6))}});exports.default=g;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("@vft/utils");require("@vueuse/core");require("../../utils/ns-cover.cjs");require("lodash");const m=require("../../hooks/use-namespace/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const l=require("./constants.cjs"),d=require("./hooks/use-global-config.cjs"),f=m.useNamespace("config-provider"),h=e.defineComponent({name:"vft-config-provider"}),g=e.defineComponent({...h,props:{theme:{default:"light"},themeVars:{},themeVarsDark:{},themeVarsLight:{},iconfontClass:{},iconifyPrefixClass:{default:"ico-"},namespace:{default:"vft"},zIndex:{},message:{},projectCfg:{},button:{}},setup(n){e.watch(()=>n.message,t=>{Object.assign(l.messageConfig,t??{})},{immediate:!0,deep:!0});const i=e.computed(()=>{const t=n.theme==="dark";return c({...n.themeVars,...t?n.themeVarsDark:n.themeVarsLight})});if(o.inBrowser){const t=()=>{document.documentElement.classList.add(n.theme)},s=(r=n.theme)=>{document.documentElement.classList.remove(r)};e.watch(()=>n.theme,(r,a)=>{a&&s(a),t()},{immediate:!0}),e.onActivated(t),e.onDeactivated(s),e.onBeforeUnmount(s)}function c(t){const s={};return Object.keys(t).forEach(r=>{s[`--${n.namespace}-${o.kebabCase(r)}`]=t[r]}),s}const u=e.getCurrentInstance();return d.provideGlobalConfig(u.props),(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(f).b()),style:e.normalizeStyle(i.value)},[e.renderSlot(t.$slots,"default")],6))}});exports.default=g;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("@vft/utils");require("../config-provider/index.cjs");require("@vueuse/core");const a=require("../../utils/ns-cover.cjs");require("lodash");const u=require("../../hooks/use-namespace/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const d=require("../config-provider/hooks/use-global-config.cjs"),m=["src"],r=u.useNamespace("icon"),f=e.defineComponent({name:"vft-icon"}),v=e.defineComponent({...f,props:{icon:{},size:{},color:{},rotate:{type:Boolean},rotateSpeed:{default:2},pointer:{type:Boolean},hoverColor:{}},setup(o){const i=d.useGlobalConfig(),t=e.computed(()=>a.generateCssVars({size:c.addUnit(o.size),color:o.color,hoverColor:o.hoverColor,cursor:o.pointer?"pointer":void 0,animation:o.rotate?`${i.value.namespace}-rotate ${o.rotateSpeed}s linear 0s infinite`:void 0},"icon")),l=n=>n==null?void 0:n.includes("/"),s=e.computed(()=>l(o.icon));return(n,C)=>s.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:e.normalizeClass(e.unref(r).e("image")),src:n.icon,alt:"",style:e.normalizeStyle(t.value)},null,14,m)):(e.openBlock(),e.createElementBlock("i",{key:1,class:e.normalizeClass([e.unref(r).b(),n.icon]),style:e.normalizeStyle({...t.value})},null,6))}});exports.default=v;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("@vft/utils");require("../config-provider/index.cjs");require("@vueuse/core");const f=require("../../utils/ns-cover.cjs");require("lodash");const d=require("../../hooks/use-namespace/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const m=require("../config-provider/hooks/use-global-config.cjs"),v=["src"],s=d.useNamespace("icon"),C=e.defineComponent({name:"vft-icon"}),y=e.defineComponent({...C,props:{icon:{},size:{},color:{},rotate:{type:Boolean},rotateSpeed:{default:2},pointer:{type:Boolean},hoverColor:{}},setup(o){var r;const t=m.useGlobalConfig(),i=e.computed(()=>f.generateCssVars({size:u.addUnit(o.size),color:o.color,hoverColor:o.hoverColor,cursor:o.pointer?"pointer":void 0,animation:o.rotate?`${t.value.namespace}-rotate ${o.rotateSpeed}s linear 0s infinite`:void 0},"icon")),l=n=>n==null?void 0:n.includes("/"),c=e.computed(()=>l(o.icon)),a=o.icon.startsWith((r=t.value)==null?void 0:r.iconifyPrefixClass)?"":t.value.iconfontClass;return(n,q)=>c.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:e.normalizeClass(e.unref(s).e("image")),src:n.icon,alt:"",style:e.normalizeStyle(i.value)},null,14,v)):(e.openBlock(),e.createElementBlock("i",{key:1,class:e.normalizeClass([e.unref(s).b(),n.icon,e.unref(a)]),style:e.normalizeStyle(i.value)},null,6))}});exports.default=y;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("@vft/utils"),g=require("../dialog/index.cjs"),b=require("./modal-footer-action.vue2.cjs"),w=e.defineComponent({__name:"modal",props:{closeFunc:{},showActionButtonGroup:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!1},beforeClose:{},destroyOnClose:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},openDelay:{default:0},closeDelay:{default:0},top:{},modelValue:{type:Boolean,default:!1},modalClass:{},width:{},zIndex:{},trapFocus:{type:Boolean,default:!1},center:{type:Boolean,default:!1},alignCenter:{type:Boolean,default:!1},closeIcon:{},customClass:{default:""},draggable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},title:{default:""},showSubmitButton:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},submitButtonOptions:{},cancelButtonOptions:{},actionRowOptions:{}},emits:{"visible-change":[],close:[],ok:[],register:[],"update:modelValue":[],submit:[]},setup(f,{emit:n}){const o=f,d=e.useAttrs(),a=e.ref(null),l=e.ref(!1),u=e.ref(null),p={setModalProps:h,emitVisible:void 0,redoModalHeight:()=>{e.nextTick(()=>{e.unref(u)&&e.unref(u).setModalHeight()})}},s=e.getCurrentInstance();s&&n("register",p,s.uid);const B=e.computed(()=>({...o,...e.unref(a)})),m=e.computed(()=>({...d,...e.unref(B),modelValue:e.unref(l)}));e.watchEffect(()=>{l.value=!!o.modelValue}),e.watch(()=>e.unref(l),t=>{n("visible-change",t),n("update:modelValue",t),e.nextTick(()=>{o.scrollTop&&t&&e.unref(u)&&e.unref(u).scrollTop()})},{immediate:!1});async function r(t){if(t==null||t.stopPropagation(),o.closeFunc&&i.isFunction(o.closeFunc)){const c=await o.closeFunc();l.value=!c;return}l.value=!1,n("close",t)}function h(t){a.value=i.deepMerge(e.unref(a)||{},t),Reflect.has(t,"modelValue")&&(l.value=!!t.modelValue)}const y=e.computed(()=>({onClick:t=>r(t),...o.cancelButtonOptions})),C=e.computed(()=>({onClick:()=>n("submit"),...o.submitButtonOptions}));return(t,c)=>(e.openBlock(),e.createBlock(e.unref(g.VftDialog),e.mergeProps(m.value,{onClose:r}),e.createSlots({default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:2},[t.$slots.footer||t.showActionButtonGroup?{name:"footer",fn:e.withCtx(()=>[t.showActionButtonGroup?(e.openBlock(),e.createBlock(b.default,{key:0,showCancelButton:t.showCancelButton,showSubmitButton:t.showSubmitButton,cancelButtonOptions:y.value,submitButtonOptions:C.value},null,8,["showCancelButton","showSubmitButton","cancelButtonOptions","submitButtonOptions"])):e.createCommentVNode("",!0)]),key:"0"}:void 0]),1040))}});exports.default=w;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("@vft/utils"),b=require("../dialog/index.cjs"),g=require("./modal-footer-action.vue2.cjs"),w=e.defineComponent({__name:"modal",props:{closeFunc:{},showActionButtonGroup:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!1},beforeClose:{},destroyOnClose:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},openDelay:{default:0},closeDelay:{default:0},top:{},modelValue:{type:Boolean,default:!1},modalClass:{},width:{},zIndex:{},trapFocus:{type:Boolean,default:!1},center:{type:Boolean,default:!1},alignCenter:{type:Boolean,default:!1},closeIcon:{},customClass:{default:""},draggable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},title:{default:""},showSubmitButton:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},submitButtonOptions:{},cancelButtonOptions:{},actionRowOptions:{}},emits:{"visible-change":[],close:[],ok:[],register:[],"update:modelValue":[],submit:[]},setup(d,{emit:n}){const o=d,p=e.useAttrs(),s=e.ref(null),l=e.ref(!1),u=e.ref(null),c={setModalProps:h,emitVisible:void 0,redoModalHeight:()=>{e.nextTick(()=>{e.unref(u)&&e.unref(u).setModalHeight()})}},a=e.getCurrentInstance();a&&n("register",c,a.uid);const B=e.computed(()=>({...o,...e.unref(s)})),m=e.computed(()=>({...p,...e.unref(B),modelValue:e.unref(l)}));e.watchEffect(()=>{l.value=!!o.modelValue}),e.watch(()=>e.unref(l),t=>{n("visible-change",t),n("update:modelValue",t),a&&e.nextTick(()=>{c.emitVisible(t,a.uid)}),e.nextTick(()=>{o.scrollTop&&t&&e.unref(u)&&e.unref(u).scrollTop()})},{immediate:!1});async function r(t){if(t==null||t.stopPropagation(),o.closeFunc&&f.isFunction(o.closeFunc)){const i=await o.closeFunc();l.value=!i;return}l.value=!1,n("close",t)}function h(t){s.value=f.deepMerge(e.unref(s)||{},t),Reflect.has(t,"modelValue")&&(l.value=!!t.modelValue)}const y=e.computed(()=>({onClick:t=>r(t),...o.cancelButtonOptions})),C=e.computed(()=>({onClick:()=>n("submit"),...o.submitButtonOptions}));return(t,i)=>(e.openBlock(),e.createBlock(e.unref(b.VftDialog),e.mergeProps(m.value,{onClose:r}),e.createSlots({default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:2},[t.$slots.footer||t.showActionButtonGroup?{name:"footer",fn:e.withCtx(()=>[t.showActionButtonGroup?(e.openBlock(),e.createBlock(g.default,{key:0,showCancelButton:t.showCancelButton,showSubmitButton:t.showSubmitButton,cancelButtonOptions:y.value,submitButtonOptions:C.value},null,8,["showCancelButton","showSubmitButton","cancelButtonOptions","submitButtonOptions"])):e.createCommentVNode("",!0)]),key:"0"}:void 0]),1040))}});exports.default=w;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@vft/utils"),d=require("@vueuse/core");function g(r){const o=ref(null),l=ref(!1),u=ref(null);let n;function c(e,a){d.tryOnBeforeUnmount(()=>{o.value=null,l.value=null}),!(unref(l)&&e===unref(o))&&(o.value=e,u.value=a,r&&e.setProps(s.getDynamicProps(r)),l.value=!0,n==null||n(),n=watch(()=>r,()=>{r&&e.setProps(s.getDynamicProps(r))},{immediate:!0,deep:!0}))}function t(){const e=unref(o);return e||console.error("The table instance has not been obtained yet, please make sure the table is presented when performing the table operation!"),e}return[c,{reload:async e=>await t().reload(e),setProps:e=>{t().setProps(e)},redoHeight:()=>{t().redoHeight()},setSelectedRows:e=>toRaw(t().setSelectedRows(e)),setLoading:e=>{t().setLoading(e)},getDataSource:()=>t().getDataSource(),getRawDataSource:()=>t().getRawDataSource(),getColumns:({ignoreIndex:e=!1}={})=>{const a=t().getColumns({ignoreIndex:e})||[];return toRaw(a)},setColumns:e=>{t().setColumns(e)},setTableData:e=>t().setTableData(e),setPagination:e=>t().setPagination(e),deleteSelectRowByKey:e=>{t().deleteSelectRowByKey(e)},getSelectRowKeys:()=>toRaw(t().getSelectRowKeys()),getSelectRows:()=>toRaw(t().getSelectRows()),clearSelectedRowKeys:()=>{t().clearSelectedRowKeys()},setSelectedRowKeys:e=>{t().setSelectedRowKeys(e)},getPaginationRef:()=>t().getPaginationRef(),getSize:()=>toRaw(t().getSize()),updateTableData:(e,a,i)=>t().updateTableData(e,a,i),deleteTableDataRecord:(e,a)=>t().deleteTableDataRecord(e,a),insertTableDataRecord:(e,a)=>t().insertTableDataRecord(e,a),updateTableDataRecord:(e,a)=>t().updateTableDataRecord(e,a),findTableDataRecord:e=>t().findTableDataRecord(e),setShowPagination:async e=>{t().setShowPagination(e)},getShowPagination:()=>toRaw(t().getShowPagination())}]}exports.useTable=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@vft/utils"),g=require("@vueuse/core"),a=require("vue");function R(o){const n=a.ref(null),u=a.ref(!1),c=a.ref(null);let l;function i(e,r){g.tryOnBeforeUnmount(()=>{n.value=null,u.value=null}),!(a.unref(u)&&e===a.unref(n))&&(n.value=e,c.value=r,o&&e.setProps(s.getDynamicProps(o)),u.value=!0,l==null||l(),l=a.watch(()=>o,()=>{o&&e.setProps(s.getDynamicProps(o))},{immediate:!0,deep:!0}))}function t(){const e=a.unref(n);return e||console.error("The table instance has not been obtained yet, please make sure the table is presented when performing the table operation!"),e}return[i,{reload:async e=>await t().reload(e),setProps:e=>{t().setProps(e)},redoHeight:()=>{t().redoHeight()},setSelectedRows:e=>a.toRaw(t().setSelectedRows(e)),setLoading:e=>{t().setLoading(e)},getDataSource:()=>t().getDataSource(),getRawDataSource:()=>t().getRawDataSource(),getColumns:({ignoreIndex:e=!1}={})=>{const r=t().getColumns({ignoreIndex:e})||[];return a.toRaw(r)},setColumns:e=>{t().setColumns(e)},setTableData:e=>t().setTableData(e),setPagination:e=>t().setPagination(e),deleteSelectRowByKey:e=>{t().deleteSelectRowByKey(e)},getSelectRowKeys:()=>a.toRaw(t().getSelectRowKeys()),getSelectRows:()=>a.toRaw(t().getSelectRows()),clearSelectedRowKeys:()=>{t().clearSelectedRowKeys()},setSelectedRowKeys:e=>{t().setSelectedRowKeys(e)},getPaginationRef:()=>t().getPaginationRef(),getSize:()=>a.toRaw(t().getSize()),updateTableData:(e,r,d)=>t().updateTableData(e,r,d),deleteTableDataRecord:(e,r)=>t().deleteTableDataRecord(e,r),insertTableDataRecord:(e,r)=>t().insertTableDataRecord(e,r),updateTableDataRecord:(e,r)=>t().updateTableDataRecord(e,r),findTableDataRecord:e=>t().findTableDataRecord(e),setShowPagination:async e=>{t().setShowPagination(e)},getShowPagination:()=>a.toRaw(t().getShowPagination())}]}exports.useTable=R;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.129";exports.version=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.131";exports.version=e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vft",
3
- "version": "0.0.129",
3
+ "version": "0.0.131",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -54,9 +54,9 @@
54
54
  "resize-detector": "0.3.0",
55
55
  "sortablejs": "^1.15.0",
56
56
  "@vft/constants": "0.0.59",
57
+ "@vft/router": "0.0.28",
57
58
  "@vft/store": "0.0.28",
58
59
  "@vft/use": "0.0.31",
59
- "@vft/router": "0.0.28",
60
60
  "@vft/utils": "0.0.43",
61
61
  "@vft/directives": "0.0.24"
62
62
  },