@dazhicheng/ui 1.5.224 → 1.5.226

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 (27) hide show
  1. package/dist/components/tt-drawer/src/RenderDrawer.vue.js +86 -82
  2. package/dist/components/tt-form/index.d.ts +5 -3
  3. package/dist/components/tt-form/src/form/RenderContent.vue.js +8 -8
  4. package/dist/components/tt-form/src/form-render/FormField.vue2.js +122 -122
  5. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.d.ts +4 -4
  6. package/dist/components/tt-form/src/form-render/context.d.ts +1 -1
  7. package/dist/components/tt-form/src/form-render/dependencies.js +56 -56
  8. package/dist/components/tt-form/src/form-render/form.vue.d.ts +1 -1
  9. package/dist/components/tt-form/src/formApi.d.ts +1 -1
  10. package/dist/components/tt-form/src/group-form/GroupForm.vue.d.ts +1 -1
  11. package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +35 -35
  12. package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +135 -134
  13. package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +68 -68
  14. package/dist/components/tt-form/src/group-form/groupFormApi.js +4 -4
  15. package/dist/components/tt-form/src/group-form/types.d.ts +25 -24
  16. package/dist/components/tt-form/src/group-form/useGroupForm.d.ts +2 -6
  17. package/dist/components/tt-form/src/group-form/utils.d.ts +8 -8
  18. package/dist/components/tt-form/src/index.vue.d.ts +12 -12
  19. package/dist/components/tt-form/src/types.d.ts +48 -47
  20. package/dist/components/tt-form/src/useForm.d.ts +2 -2
  21. package/dist/components/tt-select/src/Select.vue.d.ts +4 -4
  22. package/dist/components/tt-select/src/components/Table.vue.d.ts +4 -4
  23. package/dist/components/tt-table/index.d.ts +12 -12
  24. package/dist/components/tt-table/src/Table.vue.d.ts +4 -4
  25. package/dist/components/tt-table/src/TableForm.vue.d.ts +1 -1
  26. package/dist/components/tt-table/src/hooks/useTableForm.d.ts +1 -1
  27. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- import { defineComponent as Y, useAttrs as Z, ref as $, useId as ee, getCurrentInstance as oe, reactive as te, computed as l, unref as o, toValue as r, watch as re, nextTick as se, onMounted as ie, createBlock as B, createCommentVNode as S, openBlock as w, mergeProps as V, createSlots as D, withCtx as n, withDirectives as ne, createVNode as T, createElementBlock as ae, normalizeClass as le, normalizeStyle as me, renderSlot as m, renderList as ce, normalizeProps as pe, guardReactiveProps as ue } from "vue";
1
+ import { defineComponent as Z, useAttrs as ee, ref as $, useId as oe, getCurrentInstance as te, reactive as re, computed as a, unref as t, toValue as s, watch as se, nextTick as ie, onMounted as ne, onUnmounted as le, createBlock as B, createCommentVNode as S, openBlock as w, mergeProps as V, createSlots as D, withCtx as n, withDirectives as ae, createVNode as T, createElementBlock as me, normalizeClass as ce, normalizeStyle as de, renderSlot as m, renderList as pe, normalizeProps as ue, guardReactiveProps as fe } from "vue";
2
2
  import "../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
3
- import { useDesign as de } from "../../../packages/hooks/src/useDesign.js";
4
- import { usePriorityValues as fe, getPriorityValues as he } from "../../../packages/hooks/src/usePriorityValue.js";
3
+ import { useDesign as he } from "../../../packages/hooks/src/useDesign.js";
4
+ import { usePriorityValues as ge, getPriorityValues as ke } from "../../../packages/hooks/src/usePriorityValue.js";
5
5
  import "axios";
6
- import { drawerProps as O, ElDrawer as ge } from "element-plus";
7
- import { isNumber as ke } from "../../../packages/utils/src/is.js";
6
+ import { drawerProps as O, ElDrawer as we } from "element-plus";
7
+ import { isNumber as Ce } from "../../../packages/utils/src/is.js";
8
8
  import "xe-utils";
9
9
  import "dayjs";
10
10
  import "dayjs/plugin/utc";
@@ -14,22 +14,23 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.j
14
14
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
15
15
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
16
16
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
17
- import { omit as we, pick as R } from "lodash-es";
17
+ import { omit as be, pick as R } from "lodash-es";
18
18
  import "../../tt-loading/index.js";
19
- import { useStore as be } from "@tanstack/vue-store";
20
- import Ce from "./components/DrawerFooter.vue.js";
19
+ import { useStore as ve } from "@tanstack/vue-store";
20
+ import Pe from "./components/DrawerFooter.vue.js";
21
21
  /* empty css */
22
- import ve from "./components/DrawerHeader.vue.js";
23
- import { useDrawerResizable as Pe } from "./hooks/useResizable.js";
24
- import { basicProps as ye } from "./props.js";
25
- import { DrawerApi as $e } from "./utils/drawer-api.js";
26
- import { vTtLoading as Be } from "../../tt-loading/src/directive.js";
27
- const Ye = /* @__PURE__ */ Y({
22
+ import ye from "./components/DrawerHeader.vue.js";
23
+ import { useDrawerResizable as $e } from "./hooks/useResizable.js";
24
+ import { basicProps as Be } from "./props.js";
25
+ import { DrawerApi as Se } from "./utils/drawer-api.js";
26
+ import { pushModal as Ve, removeModal as x } from "../../tt-modal/src/utils/modal-stack.js";
27
+ import { vTtLoading as De } from "../../tt-loading/src/directive.js";
28
+ const to = /* @__PURE__ */ Z({
28
29
  name: "TtDrawer",
29
30
  __name: "RenderDrawer",
30
31
  props: {
31
32
  ...O,
32
- ...ye,
33
+ ...Be,
33
34
  /** drawerApi */
34
35
  drawerApi: {
35
36
  type: Object,
@@ -37,109 +38,112 @@ const Ye = /* @__PURE__ */ Y({
37
38
  }
38
39
  },
39
40
  emits: ["visible-change", "register", "update:visible"],
40
- setup(x, { expose: F, emit: H }) {
41
+ setup(F, { expose: H, emit: z }) {
41
42
  var P;
42
- const c = x, p = H, u = Z(), d = $(!1), b = ee(), f = $(null), { prefixCls: C } = de("drawer"), s = oe();
43
- let t = c.drawerApi;
44
- t || (t = new $e(c), t.useStore = (e) => be(t.store, e));
45
- const a = te({
46
- setDrawerProps: t.setState,
43
+ const c = F, d = z, p = ee(), u = $(!1), C = oe(), f = $(null), { prefixCls: b } = he("drawer"), o = te();
44
+ let r = c.drawerApi;
45
+ r || (r = new Se(c), r.useStore = (e) => ve(r.store, e));
46
+ const l = re({
47
+ setDrawerProps: r.setState,
47
48
  emitVisible: void 0
48
- }), z = (P = t.useStore) == null ? void 0 : P.call(t), {
49
- confirmLoading: A,
49
+ }), A = (P = r.useStore) == null ? void 0 : P.call(r), {
50
+ confirmLoading: L,
50
51
  visible: h,
51
52
  showFooter: g,
52
53
  footerHeight: v,
53
- cancelButtonProps: L,
54
- showCancelBtn: _,
55
- cancelText: N,
56
- showOkBtn: j,
57
- okButtonProps: E,
54
+ cancelButtonProps: _,
55
+ showCancelBtn: N,
56
+ cancelText: j,
57
+ showOkBtn: E,
58
+ okButtonProps: M,
58
59
  okText: I,
59
- title: M,
60
- loading: U,
61
- loadingText: q,
62
- ...G
63
- } = fe(c, z), J = l(() => {
64
- const e = he(G), i = we(u, ["onOk", "onClosed", "onClose", "onVisibleChange", "onReceiveSharedData"]);
60
+ title: U,
61
+ loading: q,
62
+ loadingText: G,
63
+ ...J
64
+ } = ge(c, A), K = a(() => {
65
+ const e = ke(J), i = be(p, ["onOk", "onClosed", "onClose", "onVisibleChange", "onReceiveSharedData"]);
65
66
  return {
66
67
  ...R(e, Object.keys(O)),
67
68
  ...i,
68
- modelValue: o(h),
69
- class: `${C} ${o(e).class || ""}`,
70
- modalClass: `${o(e).modalClass || o(e).class}`
69
+ modelValue: t(h),
70
+ closeOnPressEscape: !1,
71
+ class: `${b} ${t(e).class || ""}`,
72
+ modalClass: `${t(e).modalClass || t(e).class}`
71
73
  };
72
- }), K = l(() => ({
73
- confirmLoading: r(A),
74
- showFooter: r(g),
75
- footerHeight: r(v),
76
- cancelButtonProps: r(L),
77
- cancelText: r(N),
78
- showOkBtn: r(j),
79
- okText: r(I),
80
- okButtonProps: r(E),
81
- showCancelBtn: r(_)
82
- })), Q = l(() => {
83
- const e = r(v);
84
- return r(g) && e ? `${ke(e) ? e : Number.parseFloat(e)}px` : "0px";
85
- }), W = l(() => ({
86
- height: `calc(100% - ${o(Q)})`
74
+ }), Q = a(() => ({
75
+ confirmLoading: s(L),
76
+ showFooter: s(g),
77
+ footerHeight: s(v),
78
+ cancelButtonProps: s(_),
79
+ cancelText: s(j),
80
+ showOkBtn: s(E),
81
+ okText: s(I),
82
+ okButtonProps: s(M),
83
+ showCancelBtn: s(N)
84
+ })), W = a(() => {
85
+ const e = s(v);
86
+ return s(g) && e ? `${Ce(e) ? e : Number.parseFloat(e)}px` : "0px";
87
+ }), X = a(() => ({
88
+ height: `calc(100% - ${t(W)})`
87
89
  }));
88
- re(
90
+ se(
89
91
  () => h.value,
90
92
  (e) => {
91
- se(() => {
93
+ ie(() => {
92
94
  var i;
93
- p("update:visible", e), p("visible-change", e), s && ((i = a.emitVisible) == null || i.call(a, e, s == null ? void 0 : s.uid)), e ? d.value = e : (setTimeout(() => {
94
- d.value = e;
95
- }, 300), t.changeOkLoading(!1));
95
+ d("update:visible", e), d("visible-change", e), o && ((i = l.emitVisible) == null || i.call(l, e, o == null ? void 0 : o.uid)), o != null && o.uid && (e ? Ve({ uid: o.uid, close: () => r.onClosed() }) : x(o.uid)), e ? u.value = e : (setTimeout(() => {
96
+ u.value = e;
97
+ }, 300), r.changeOkLoading(!1));
96
98
  });
97
99
  }
98
100
  );
99
- const [X] = Pe(b, h, t.setState);
100
- return s && p("register", a, s == null ? void 0 : s.uid), ie(() => {
101
- const e = R(u, ["onOk", "onClosed", "onVisibleChange"]);
102
- t.mount(f.value, {
101
+ const [Y] = $e(C, h, r.setState);
102
+ return o && d("register", l, o == null ? void 0 : o.uid), ne(() => {
103
+ const e = R(p, ["onOk", "onClosed", "onVisibleChange"]);
104
+ r.mount(f.value, {
103
105
  ...e,
104
106
  // 兼容 BasicDrawer 组件的 onClose 事件
105
- onClosed: e.onClosed || u.onClose
107
+ onClosed: e.onClosed || p.onClose
106
108
  });
107
- }), F({
109
+ }), le(() => {
110
+ o != null && o.uid && x(o.uid);
111
+ }), H({
108
112
  drawerRef: f,
109
- drawerApi: t
110
- }), (e, i) => d.value ? (w(), B(o(ge), V({
113
+ drawerApi: r
114
+ }), (e, i) => u.value ? (w(), B(t(we), V({
111
115
  key: 0,
112
- id: o(b),
116
+ id: t(C),
113
117
  ref_key: "drawerRef",
114
118
  ref: f
115
- }, J.value, {
119
+ }, K.value, {
116
120
  "destroy-on-close": !0,
117
- "before-close": o(t).onClosed
121
+ "before-close": t(r).onClosed
118
122
  }), D({
119
123
  default: n(() => [
120
- ne((w(), ae("div", {
121
- style: me(W.value),
122
- class: le(`${o(C)}-content`)
124
+ ae((w(), me("div", {
125
+ style: de(X.value),
126
+ class: ce(`${t(b)}-content`)
123
127
  }, [
124
128
  m(e.$slots, "default")
125
129
  ], 6)), [
126
- [o(Be), {
127
- visible: o(U),
128
- text: o(q)
130
+ [t(De), {
131
+ visible: t(q),
132
+ text: t(G)
129
133
  }]
130
134
  ]),
131
- o(g) || e.$slots.footer ? (w(), B(Ce, V({ key: 0 }, K.value, {
132
- onClose: o(t).onClosed,
133
- onFooterok: o(t).onOk
135
+ t(g) || e.$slots.footer ? (w(), B(Pe, V({ key: 0 }, Q.value, {
136
+ onClose: t(r).onClosed,
137
+ onFooterok: t(r).onOk
134
138
  }), D({ _: 2 }, [
135
- ce(Object.keys(e.$slots), (k) => ({
139
+ pe(Object.keys(e.$slots), (k) => ({
136
140
  name: k,
137
141
  fn: n((y) => [
138
- m(e.$slots, k, pe(ue(y)))
142
+ m(e.$slots, k, ue(fe(y)))
139
143
  ])
140
144
  }))
141
145
  ]), 1040, ["onClose", "onFooterok"])) : S("", !0),
142
- T(o(X))
146
+ T(t(Y))
143
147
  ]),
144
148
  _: 2
145
149
  }, [
@@ -152,7 +156,7 @@ const Ye = /* @__PURE__ */ Y({
152
156
  } : {
153
157
  name: "header",
154
158
  fn: n(() => [
155
- T(ve, { title: o(M) }, {
159
+ T(ye, { title: t(U) }, {
156
160
  titleToolbar: n(() => [
157
161
  m(e.$slots, "titleToolbar")
158
162
  ]),
@@ -165,5 +169,5 @@ const Ye = /* @__PURE__ */ Y({
165
169
  }
166
170
  });
167
171
  export {
168
- Ye as default
172
+ to as default
169
173
  };
@@ -6,12 +6,14 @@ declare function setConfig(rules?: Record<string, (value: any, params: any, ctx:
6
6
  declare function addComponent(component?: Partial<Record<BaseFormComponentType, Component>>): void;
7
7
  export { addComponent, setConfig };
8
8
  export { COMPONENT_MAP, useForm };
9
- type TtFormSchema = FormSchema<BaseFormComponentType>;
10
- type TtFormRenderProps = FormRenderProps<BaseFormComponentType>;
9
+ export type { FormApi } from './src/formApi';
10
+ type TtFormSchema<TValues extends Record<string, any> = Record<string, any>> = FormSchema<TValues>;
11
+ type TtFormRenderProps<TValues extends Record<string, any> = Record<string, any>> = FormRenderProps<TValues>;
11
12
  type TtExtendedFormApi = ExtendedFormApi;
12
- export type { ArraySchemaContext, BaseFormComponentMap, BaseFormComponentType, FormArrayActions, FormSlotSchema, InferredComponentPropsType, NestedArrayHandle, } from './src/types';
13
+ export type { ArraySchemaContext, BaseFormComponentMap, BaseFormComponentType, ComponentProps, FormArrayActions, FormItemDependenciesCondition, FormItemDependenciesConditionWithProps, FormItemDependenciesConditionWithRules, FormSlotSchema, InferredComponentPropsType, NestedArrayHandle, RenderComponentContentType, } from './src/types';
13
14
  export type { FieldArrayContext, FieldEntry, ReadonlyFieldEntry, ResolvedFieldArrayContext } from './src/types/forms';
14
15
  export type { TtExtendedFormApi, TtFormProps, TtFormRenderProps, TtFormSchema };
15
16
  export * as z from 'zod';
16
17
  export { useGroupForm } from './src/group-form';
17
18
  export type * from './src/group-form';
19
+ export type { GroupFormApi } from './src/group-form';
@@ -1,7 +1,7 @@
1
1
  import "axios";
2
2
  import "element-plus";
3
- import { isObject as m, isFunction as o } from "../../../../packages/utils/src/is.js";
4
- import { defineComponent as c, h as u } from "vue";
3
+ import { isObject as c, isFunction as o } from "../../../../packages/utils/src/is.js";
4
+ import { defineComponent as u, unref as f, h as p } from "vue";
5
5
  import "xe-utils";
6
6
  import "dayjs";
7
7
  import "dayjs/plugin/utc";
@@ -12,9 +12,9 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/en
12
12
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
13
13
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
14
14
  import "lodash-es";
15
- import { useFormValues as f } from "vee-validate";
16
- import { injectRenderFormProps as p } from "../form-render/context.js";
17
- const y = c({
15
+ import { useFormValues as s } from "vee-validate";
16
+ import { injectFormProps as l } from "../useFormContext.js";
17
+ const S = u({
18
18
  name: "RenderContent",
19
19
  inheritAttrs: !1,
20
20
  props: {
@@ -27,8 +27,8 @@ const y = c({
27
27
  }
28
28
  },
29
29
  setup(t, { attrs: n, slots: e }) {
30
- const r = f(), i = p().form;
31
- return () => t.content ? (m(t.content) || o(t.content)) && t.content !== null ? o(t.content) ? t.content(r.value, i) : u(t.content, {
30
+ const r = s(), [i] = l(), m = f(i).formApi;
31
+ return () => t.content ? (c(t.content) || o(t.content)) && t.content !== null ? o(t.content) ? t.content(r.value, m) : p(t.content, {
32
32
  ...n,
33
33
  props: {
34
34
  ...t,
@@ -39,5 +39,5 @@ const y = c({
39
39
  }
40
40
  });
41
41
  export {
42
- y as default
42
+ S as default
43
43
  };