vft 0.0.397 → 0.0.399

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 (54) hide show
  1. package/dist/index.css +1 -1
  2. package/es/component.js +83 -81
  3. package/es/components/carousel/use-carousel.js +1 -1
  4. package/es/components/client-only/client-only.vue.d.ts +12 -0
  5. package/es/components/client-only/client-only.vue.js +4 -0
  6. package/es/components/client-only/client-only.vue2.js +13 -0
  7. package/es/components/client-only/index.d.ts +19 -0
  8. package/es/components/client-only/index.js +13 -0
  9. package/es/components/client-only/style/css.d.ts +1 -0
  10. package/es/components/client-only/style/css.js +2 -0
  11. package/es/components/client-only/style/index.d.ts +1 -0
  12. package/es/components/client-only/style/index.js +2 -0
  13. package/es/components/config-provider/hooks/use-global-config.js +3 -3
  14. package/es/components/index.d.ts +1 -0
  15. package/es/components/index.js +391 -389
  16. package/es/components/input/input.vue2.js +4 -4
  17. package/es/components/input-tag/composables/use-input-tag.js +1 -1
  18. package/es/components/side-menu/side-menu.vue2.js +87 -88
  19. package/es/components/skeleton/skeleton.vue.d.ts +0 -1
  20. package/es/components/skeleton/skeleton.vue2.js +0 -1
  21. package/es/components/super-form/super-form-item.vue2.js +4 -3
  22. package/es/components/table/table.vue2.js +123 -118
  23. package/es/index.js +1 -0
  24. package/es/package.json.d.ts +1 -1
  25. package/es/package.json.js +1 -1
  26. package/es/utils/vue/vnode.js +1 -1
  27. package/lib/component.cjs +1 -1
  28. package/lib/components/client-only/client-only.vue.cjs +1 -0
  29. package/lib/components/client-only/client-only.vue.d.ts +12 -0
  30. package/lib/components/client-only/client-only.vue2.cjs +1 -0
  31. package/lib/components/client-only/index.cjs +1 -0
  32. package/lib/components/client-only/index.d.ts +19 -0
  33. package/lib/components/client-only/style/css.cjs +1 -0
  34. package/lib/components/client-only/style/css.d.ts +1 -0
  35. package/lib/components/client-only/style/index.cjs +1 -0
  36. package/lib/components/client-only/style/index.d.ts +1 -0
  37. package/lib/components/index.cjs +1 -1
  38. package/lib/components/index.d.ts +1 -0
  39. package/lib/components/input/input.vue2.cjs +1 -1
  40. package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
  41. package/lib/components/skeleton/skeleton.vue.d.ts +0 -1
  42. package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
  43. package/lib/components/table/table.vue2.cjs +1 -1
  44. package/lib/index.cjs +1 -1
  45. package/lib/package.json.cjs +1 -1
  46. package/lib/package.json.d.ts +1 -1
  47. package/package.json +5 -5
  48. package/theme-style/index.css +1 -1
  49. package/theme-style/src/client-only.scss +0 -0
  50. package/theme-style/src/index.scss +1 -0
  51. package/theme-style/src/tabs.scss +0 -5
  52. package/theme-style/vft-client-only.css +0 -0
  53. package/theme-style/vft-tabs.css +1 -1
  54. package/web-types.json +1 -1
@@ -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 ye } 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 ot } 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 ot } from "../form/hooks/use-form-common-props.js";
18
18
  const nt = ["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 nt = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
85
85
  o.is("focus", v.value)
86
86
  ]), d = Ze({
87
87
  excludeKeys: l(() => Object.keys(X.value))
88
- }), { form: Ce, formItem: F } = at(), { inputId: Y } = ot(xe.props, {
88
+ }), { form: Ce, formItem: F } = et(), { inputId: Y } = tt(xe.props, {
89
89
  formItemContext: F
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", {
90
+ }), ke = at(), h = ot(), 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
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,25 +1,25 @@
1
- import { defineComponent as j, toRefs as le, useSlots as ne, getCurrentInstance as ae, ref as g, computed as m, h as b, createVNode as p, onMounted as ue, nextTick as se, watch as ie, isVNode as de } from "vue";
2
- import { listenerRouteChange as re, useRouterHelper as ce } from "@vft/router";
3
- import { useSortable as pe } from "@vft/use/sortable";
4
- import { isUrl as fe, isNullOrUndefined as W, isNumber as me } from "@vft/utils";
1
+ import { defineComponent as j, toRefs as oe, useSlots as le, getCurrentInstance as ne, ref as h, computed as g, watch as ae, onMounted as ue, nextTick as se, createVNode as p, h as b, isVNode as ie } from "vue";
2
+ import { listenerRouteChange as de, useRouterHelper as re } from "@vft/router";
3
+ import { useSortable as ce } from "@vft/use/sortable";
4
+ import { isNullOrUndefined as W, isNumber as pe, isUrl as fe } from "@vft/utils";
5
5
  import "@vueuse/core";
6
6
  import { addUnit as I } from "../../utils/helper.js";
7
7
  import "lodash-es";
8
8
  import "../form/index.js";
9
- import { VftIcon as ve } from "../icon/index.js";
10
- import { VftMenu as he, VftSubMenu as ge, VftMenuItem as V } from "../menu/index.js";
11
- import { useNamespace as be } from "../../hooks/use-namespace/index.js";
9
+ import { VftIcon as me } from "../icon/index.js";
10
+ import { VftMenu as ve, VftSubMenu as he, VftMenuItem as V } from "../menu/index.js";
11
+ import { useNamespace as ge } from "../../hooks/use-namespace/index.js";
12
12
  import "../../hooks/use-model-toggle/index.js";
13
13
  import "@popperjs/core";
14
14
  import "../../hooks/use-z-index/index.js";
15
- import { useDragLine as ye } from "./use-drag-line.js";
16
- function Ce(v) {
17
- return typeof v == "function" || Object.prototype.toString.call(v) === "[object Object]" && !de(v);
15
+ import { useDragLine as be } from "./use-drag-line.js";
16
+ function ye(m) {
17
+ return typeof m == "function" || Object.prototype.toString.call(m) === "[object Object]" && !ie(m);
18
18
  }
19
- const Me = j({
19
+ const Ce = j({
20
20
  name: "vft-side-menu"
21
- }), je = /* @__PURE__ */ j({
22
- ...Me,
21
+ }), Ve = /* @__PURE__ */ j({
22
+ ...Ce,
23
23
  props: {
24
24
  isFixedLeft: {
25
25
  type: Boolean,
@@ -79,17 +79,17 @@ const Me = j({
79
79
  defaultOpeneds: {}
80
80
  },
81
81
  emits: ["update:collapse", "update:width", "dragEnd", "dragWidthEnd", "select", "subMenuClick", "menuItemMouseenter", "menuItemMouseleave"],
82
- setup(v, {
82
+ setup(m, {
83
83
  expose: q,
84
84
  emit: J
85
85
  }) {
86
- const t = v, {
86
+ const t = m, {
87
87
  defaultActive: E,
88
88
  collapse: f,
89
89
  uniqueOpened: L,
90
90
  defaultOpeneds: P,
91
91
  openMenuCollapse: H
92
- } = le(t), r = J, u = be("side-menu"), s = ne(), M = ae(), S = g(), a = m(() => ({
92
+ } = oe(t), r = J, u = ge("side-menu"), s = le(), S = ne(), M = h(), a = g(() => ({
93
93
  path: "path",
94
94
  children: "children",
95
95
  title: "title",
@@ -98,15 +98,15 @@ const Me = j({
98
98
  disabled: "disabled",
99
99
  ...t.attrMapping
100
100
  }));
101
- re(({
101
+ de(({
102
102
  route: e
103
103
  }) => {
104
- !e || e.meta?.hideSide && !t.useRouterJump || (S.value = e.path);
104
+ !e || e.meta?.hideSide && !t.useRouterJump || (M.value = e.path);
105
105
  });
106
106
  const U = (e) => {
107
107
  const n = e.e;
108
108
  if (t.autoScrollActiveDom && n) {
109
- const o = me(t.autoScrollActiveDom) ? t.autoScrollActiveDom : 0, l = n.target;
109
+ const o = pe(t.autoScrollActiveDom) ? t.autoScrollActiveDom : 0, l = n.target;
110
110
  O({
111
111
  activeDom: l,
112
112
  offset: o
@@ -118,9 +118,9 @@ const Me = j({
118
118
  offset: n = 0,
119
119
  delay: o = 300
120
120
  } = {}) => {
121
- h.value?.menu && setTimeout(() => {
121
+ v.value?.menu && setTimeout(() => {
122
122
  const l = e || document.querySelector(".vft-menu-item.is-active") || document.querySelector(".vft-sub-menu.is-active");
123
- l && (h.value.menu.scrollTop = h.value.menu.scrollTop + (l.getBoundingClientRect().top - h.value.menu.getBoundingClientRect().top) + n);
123
+ l && (v.value.menu.scrollTop = v.value.menu.scrollTop + (l.getBoundingClientRect().top - v.value.menu.getBoundingClientRect().top) + n);
124
124
  }, o);
125
125
  }, F = (e) => {
126
126
  r("menuItemMouseenter", e);
@@ -130,7 +130,7 @@ const Me = j({
130
130
  const o = e[a.value.path], l = e[a.value.title], i = e?.[a.value.children], c = e?.[a.value.index], D = e?.[a.value.icon], T = !!e?.[a.value.disabled], R = t.disabledJudgeTurnOver ? !T : T, k = c || o || n + l;
131
131
  return i?.length ? b(
132
132
  // @ts-ignore
133
- ge,
133
+ he,
134
134
  {
135
135
  ...e,
136
136
  popperAppendToBody: !0,
@@ -142,18 +142,18 @@ const Me = j({
142
142
  popperClass: u.e("popper")
143
143
  },
144
144
  {
145
- default: () => i?.map((d, X) => {
146
- const C = d[a.value.path], A = d[a.value.index], ee = d[a.value.icon], te = d[a.value.title], N = !!d[a.value.disabled], oe = t.disabledJudgeTurnOver ? !N : N;
147
- return d?.[a.value.children]?.length ? _(d, X) : (
145
+ default: () => i?.map((d, Q) => {
146
+ const C = d[a.value.path], A = d[a.value.index], X = d[a.value.icon], ee = d[a.value.title], N = !!d[a.value.disabled], te = t.disabledJudgeTurnOver ? !N : N;
147
+ return d?.[a.value.children]?.length ? _(d, Q) : (
148
148
  // @ts-ignore
149
149
  b(V, {
150
150
  ...d,
151
151
  key: A || C,
152
152
  index: A || C,
153
153
  route: C,
154
- icon: ee,
155
- title: te,
156
- disabled: t.openDisabled && oe
154
+ icon: X,
155
+ title: ee,
156
+ disabled: t.openDisabled && te
157
157
  }, s.menuItem ? () => s.menuItem?.({
158
158
  item: d
159
159
  }) : "")
@@ -174,33 +174,17 @@ const Me = j({
174
174
  item: e,
175
175
  index: n
176
176
  }) : "");
177
- }, h = g(), $ = m(() => ({
177
+ }, v = h(), $ = g(() => ({
178
178
  ...t.collapseWidth === 0 && f.value ? {
179
179
  width: 0
180
180
  } : {},
181
181
  height: `calc(100% - ${t.menuTopBottomHeight}px)`
182
- })), z = m(() => {
183
- let e;
184
- return b(p(he, {
185
- ref: h,
186
- onSelect: Y,
187
- onOpen: U,
188
- defaultActive: E?.value || S.value,
189
- defaultOpeneds: P?.value,
190
- class: [u.e("con"), t.dragOption?.dragClassName ? u.e(t.dragOption?.dragClassName) : ""],
191
- style: $.value,
192
- collapse: H.value ? f.value : !1,
193
- uniqueOpened: L.value,
194
- collapseTransition: !1
195
- }, Ce(e = t.menus.map((n, o) => _(n, o))) ? e : {
196
- default: () => [e]
197
- }));
198
- }), x = M.appContext.config.globalProperties.$router;
199
- async function Y(e) {
182
+ })), x = S.appContext.config.globalProperties.$router;
183
+ async function z(e) {
200
184
  if (t.useRouterJump) {
201
185
  const {
202
186
  go: n
203
- } = ce(x), o = e.route;
187
+ } = re(x), o = e.route;
204
188
  let l = e.route;
205
189
  e.indexPath.some((c) => fe(c)) && (l = e.indexPath.slice(-2).join("/"));
206
190
  const i = x.getRoutes().filter((c) => c.path === l)?.[0]?.meta?.linkTarget;
@@ -213,12 +197,25 @@ const Me = j({
213
197
  }
214
198
  r("select", e);
215
199
  }
216
- ue(() => {
200
+ const y = h(), w = h(), B = h(), Y = g(() => ({
201
+ ...t.collapseWidth === 0 && f.value ? {
202
+ borderRight: "none"
203
+ } : {},
204
+ width: I(t.width),
205
+ height: t.height
206
+ }));
207
+ ae(() => f.value, (e) => {
208
+ e ? r("update:width", t.collapseWidth) : r("update:width", B.value || t.width), B.value = t.width;
209
+ }), t.dragWidthCfg && be(y, w, S);
210
+ const G = g(() => ({
211
+ left: I(t.width)
212
+ })), K = g(() => [u.b(), t.isFixedLeft ? u.m("fixed") : ""]);
213
+ return ue(() => {
217
214
  se(() => {
218
215
  if (t.dragOption?.dragClassName) {
219
216
  const e = document.querySelectorAll("." + u.e(t.dragOption?.dragClassName))?.[0], {
220
217
  initSortable: n
221
- } = pe(e, {
218
+ } = ce(e, {
222
219
  draggable: ".vft-menu-item",
223
220
  onEnd: (o) => {
224
221
  const {
@@ -232,47 +229,49 @@ const Me = j({
232
229
  n();
233
230
  }
234
231
  });
235
- });
236
- const y = g(), w = g(), B = g(), G = m(() => ({
237
- ...t.collapseWidth === 0 && f.value ? {
238
- borderRight: "none"
239
- } : {},
240
- width: I(t.width),
241
- height: t.height
242
- }));
243
- ie(() => f.value, (e) => {
244
- e ? r("update:width", t.collapseWidth) : r("update:width", B.value || t.width), B.value = t.width;
245
- }), t.dragWidthCfg && ye(y, w, M);
246
- const K = m(() => ({
247
- left: I(t.width)
248
- })), Q = m(() => [u.b(), t.isFixedLeft ? u.m("fixed") : ""]);
249
- return q({
232
+ }), q({
250
233
  sideRef: y,
251
234
  jumpActiveDom: O
252
- }), () => p("div", {
253
- ref: y,
254
- class: Q.value,
255
- style: G.value
256
- }, [s.top ? p("div", {
257
- class: u.e("top")
258
- }, [s.top()]) : null, z.value, s.bottom ? p("div", {
259
- class: u.e("bottom")
260
- }, [s.bottom()]) : t.showCollapse ? p("div", {
261
- onClick: () => r("update:collapse", !f.value),
262
- class: [u.e("bottom"), u.e("collapse")]
263
- }, [p(ve, {
264
- style: {
265
- transform: f.value ? "rotateY(180deg)" : ""
266
- },
267
- size: 20,
268
- icon: "icon-sidebar-collapse"
269
- }, null)]) : null, s.default?.(), t.dragWidthCfg ? p("div", {
270
- ref: w,
271
- style: K.value,
272
- class: u.e("drag-bar")
273
- }, null) : null]);
235
+ }), () => {
236
+ let e;
237
+ return p("div", {
238
+ ref: y,
239
+ class: K.value,
240
+ style: Y.value
241
+ }, [s.top ? p("div", {
242
+ class: u.e("top")
243
+ }, [s.top()]) : null, b(p(ve, {
244
+ ref: v,
245
+ onSelect: z,
246
+ onOpen: U,
247
+ defaultActive: E?.value || M.value,
248
+ defaultOpeneds: P?.value,
249
+ class: [u.e("con"), t.dragOption?.dragClassName ? u.e(t.dragOption?.dragClassName) : ""],
250
+ style: $.value,
251
+ collapse: H.value ? f.value : !1,
252
+ uniqueOpened: L.value,
253
+ collapseTransition: !1
254
+ }, ye(e = t.menus.map((n, o) => _(n, o))) ? e : {
255
+ default: () => [e]
256
+ })), s.bottom ? p("div", {
257
+ class: u.e("bottom")
258
+ }, [s.bottom()]) : t.showCollapse ? p("div", {
259
+ onClick: () => r("update:collapse", !f.value),
260
+ class: [u.e("bottom"), u.e("collapse")]
261
+ }, [p(me, {
262
+ style: {
263
+ transform: f.value ? "rotateY(180deg)" : ""
264
+ },
265
+ size: 20,
266
+ icon: "icon-sidebar-collapse"
267
+ }, null)]) : null, s.default?.(), t.dragWidthCfg ? p("div", {
268
+ ref: w,
269
+ style: G.value,
270
+ class: u.e("drag-bar")
271
+ }, null) : null]);
272
+ };
274
273
  }
275
274
  });
276
275
  export {
277
- je as default
276
+ Ve as default
278
277
  };
@@ -14,7 +14,6 @@ declare function __VLS_template(): {
14
14
  }): any;
15
15
  };
16
16
  declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {
17
- /** @description loading state */
18
17
  uiLoading: import("vue").Ref<boolean, boolean>;
19
18
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
20
19
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
@@ -27,7 +27,6 @@ const N = k({
27
27
  n.throttle
28
28
  );
29
29
  return g({
30
- /** @description loading state */
31
30
  uiLoading: l
32
31
  }), (e, z) => t(l) ? (o(), a("div", u({
33
32
  key: 0,
@@ -1,4 +1,4 @@
1
- import { defineComponent as Q, computed as v, ref as re, unref as c, useSlots as oe, createVNode as s, mergeProps as L, withDirectives as ie, vShow as ne, isVNode as le, createTextVNode as G, resolveComponent as V } from "vue";
1
+ import { defineComponent as Q, computed as v, ref as re, unref as c, useSlots as oe, createVNode as s, mergeProps as L, withDirectives as ie, vShow as ne, createTextVNode as G, isVNode as le, resolveComponent as V } from "vue";
2
2
  import "../alert/index.js";
3
3
  import "../avatar/index.js";
4
4
  import "../avatar-stack/index.js";
@@ -10,6 +10,7 @@ import "../cascader-panel/index.js";
10
10
  import "../check-tag/index.js";
11
11
  import "../checkbox/index.js";
12
12
  import "../clamp/index.js";
13
+ import "../client-only/index.js";
13
14
  import "../clamp-toggle/index.js";
14
15
  import "../clamp-tooltip/index.js";
15
16
  import { VftCol as X } from "../col/index.js";
@@ -116,7 +117,7 @@ function q(o) {
116
117
  }
117
118
  const Ce = Q({
118
119
  inheritAttrs: !1
119
- }), yr = /* @__PURE__ */ Q({
120
+ }), Ar = /* @__PURE__ */ Q({
120
121
  ...Ce,
121
122
  __name: "super-form-item",
122
123
  props: {
@@ -493,5 +494,5 @@ const Ce = Q({
493
494
  }
494
495
  });
495
496
  export {
496
- yr as default
497
+ Ar as default
497
498
  };