@duxweb/dvha-pro 1.0.22 → 1.0.24

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 (157) hide show
  1. package/dist/cjs/component.cjs +1 -1
  2. package/dist/cjs/components/card/card.cjs +1 -1
  3. package/dist/cjs/components/card/store.cjs +1 -1
  4. package/dist/cjs/components/carousel/carousel.cjs +1 -1
  5. package/dist/cjs/components/crop/imageCrop.cjs +1 -1
  6. package/dist/cjs/components/crop/imageCropModal.cjs +1 -1
  7. package/dist/cjs/components/dashboard/hello.cjs +1 -1
  8. package/dist/cjs/components/dashboard/helloBig.cjs +1 -1
  9. package/dist/cjs/components/dashboard/quick.cjs +1 -1
  10. package/dist/cjs/components/data/dynamicData.cjs +1 -1
  11. package/dist/cjs/components/data/dynamicSelect.cjs +1 -1
  12. package/dist/cjs/components/data/selectModal.cjs +1 -1
  13. package/dist/cjs/components/dialog/dialog.cjs +1 -1
  14. package/dist/cjs/components/drawer/drawer.cjs +1 -1
  15. package/dist/cjs/components/drawer/drawerPage.cjs +1 -1
  16. package/dist/cjs/components/editor/aiEditor.cjs +1 -1
  17. package/dist/cjs/components/form/drawerForm.cjs +1 -0
  18. package/dist/cjs/components/form/formItem.cjs +1 -1
  19. package/dist/cjs/components/form/formLayout.cjs +1 -1
  20. package/dist/cjs/components/form/modalForm.cjs +1 -1
  21. package/dist/cjs/components/form/pageForm.cjs +1 -1
  22. package/dist/cjs/components/form/settingForm.cjs +1 -1
  23. package/dist/cjs/components/icon/iconPicker.cjs +1 -1
  24. package/dist/cjs/components/layout/filter.cjs +1 -1
  25. package/dist/cjs/components/layout/filterLayout.cjs +1 -1
  26. package/dist/cjs/components/layout/list.cjs +1 -1
  27. package/dist/cjs/components/layout/table.cjs +1 -1
  28. package/dist/cjs/components/layout/tools.cjs +1 -1
  29. package/dist/cjs/components/list/card.cjs +1 -1
  30. package/dist/cjs/components/list/list.cjs +1 -1
  31. package/dist/cjs/components/media/media.cjs +1 -1
  32. package/dist/cjs/components/modal/modal.cjs +1 -1
  33. package/dist/cjs/components/modal/modalPage.cjs +1 -1
  34. package/dist/cjs/components/modal/modalTab.cjs +1 -1
  35. package/dist/cjs/components/panel/alert.cjs +1 -1
  36. package/dist/cjs/components/panel/collapse.cjs +1 -1
  37. package/dist/cjs/components/panel/setting.cjs +1 -1
  38. package/dist/cjs/components/select/cardSelect.cjs +1 -1
  39. package/dist/cjs/components/status/listEmpty.cjs +1 -1
  40. package/dist/cjs/components/table/tablePage.cjs +1 -1
  41. package/dist/cjs/components/tree/treeFilter.cjs +1 -1
  42. package/dist/cjs/components/upload/config.cjs +1 -1
  43. package/dist/cjs/components/upload/file.cjs +1 -1
  44. package/dist/cjs/components/upload/image.cjs +1 -1
  45. package/dist/cjs/components/upload/manage/item.cjs +1 -1
  46. package/dist/cjs/components/upload/manager.cjs +1 -1
  47. package/dist/cjs/components/widget/connect.cjs +1 -1
  48. package/dist/cjs/dvha-pro.css +1 -1
  49. package/dist/cjs/hooks/action.cjs +1 -1
  50. package/dist/cjs/hooks/download.cjs +1 -1
  51. package/dist/cjs/hooks/echart.cjs +1 -1
  52. package/dist/cjs/hooks/image.cjs +1 -1
  53. package/dist/cjs/hooks/level.cjs +1 -1
  54. package/dist/cjs/hooks/table/color.cjs +1 -0
  55. package/dist/cjs/hooks/table/column.cjs +1 -1
  56. package/dist/cjs/hooks/table/image.cjs +1 -1
  57. package/dist/cjs/hooks/table/input.cjs +1 -1
  58. package/dist/cjs/hooks/table/map.cjs +1 -1
  59. package/dist/cjs/hooks/table/status.cjs +1 -1
  60. package/dist/cjs/hooks/table/switch.cjs +1 -1
  61. package/dist/cjs/hooks/table.cjs +1 -1
  62. package/dist/cjs/index.cjs +1 -1
  63. package/dist/cjs/pages/layout/global.cjs +1 -1
  64. package/dist/cjs/pages/layout/tab.cjs +1 -1
  65. package/dist/cjs/pages/login.cjs +1 -1
  66. package/dist/cjs/pages/menu/avatar.cjs +1 -1
  67. package/dist/cjs/pages/menu/button.cjs +1 -1
  68. package/dist/cjs/pages/menu/cmd.cjs +1 -1
  69. package/dist/cjs/pages/page.cjs +1 -1
  70. package/dist/cjs/pages/pageStatus.cjs +1 -1
  71. package/dist/cjs/stores/ui.cjs +1 -1
  72. package/dist/cjs/theme/uno.css.cjs +2 -1
  73. package/dist/esm/component.js +3 -3
  74. package/dist/esm/components/card/card.js +24 -27
  75. package/dist/esm/components/card/store.js +33 -39
  76. package/dist/esm/components/carousel/carousel.js +16 -19
  77. package/dist/esm/components/crop/imageCrop.js +32 -35
  78. package/dist/esm/components/crop/imageCropModal.js +36 -37
  79. package/dist/esm/components/dashboard/hello.js +27 -30
  80. package/dist/esm/components/dashboard/helloBig.js +328 -331
  81. package/dist/esm/components/dashboard/quick.js +30 -33
  82. package/dist/esm/components/data/dynamicData.js +86 -98
  83. package/dist/esm/components/data/dynamicSelect.js +29 -31
  84. package/dist/esm/components/data/selectModal.js +45 -49
  85. package/dist/esm/components/dialog/dialog.js +54 -55
  86. package/dist/esm/components/drawer/drawer.js +23 -22
  87. package/dist/esm/components/drawer/drawerPage.js +39 -49
  88. package/dist/esm/components/editor/aiEditor.js +64 -70
  89. package/dist/esm/components/form/drawerForm.js +149 -0
  90. package/dist/esm/components/form/formItem.js +44 -50
  91. package/dist/esm/components/form/formLayout.js +7 -10
  92. package/dist/esm/components/form/modalForm.js +50 -50
  93. package/dist/esm/components/form/pageForm.js +47 -50
  94. package/dist/esm/components/form/settingForm.js +34 -37
  95. package/dist/esm/components/icon/iconPicker.js +54 -58
  96. package/dist/esm/components/layout/filter.js +13 -16
  97. package/dist/esm/components/layout/filterLayout.js +7 -10
  98. package/dist/esm/components/layout/list.js +299 -326
  99. package/dist/esm/components/layout/table.js +268 -283
  100. package/dist/esm/components/layout/tools.js +38 -41
  101. package/dist/esm/components/list/card.js +35 -38
  102. package/dist/esm/components/list/list.js +15 -18
  103. package/dist/esm/components/media/media.js +35 -36
  104. package/dist/esm/components/modal/modal.js +10 -10
  105. package/dist/esm/components/modal/modalPage.js +32 -36
  106. package/dist/esm/components/modal/modalTab.js +39 -45
  107. package/dist/esm/components/panel/alert.js +19 -22
  108. package/dist/esm/components/panel/collapse.js +33 -36
  109. package/dist/esm/components/panel/setting.js +25 -31
  110. package/dist/esm/components/select/cardSelect.js +27 -28
  111. package/dist/esm/components/status/listEmpty.js +13 -13
  112. package/dist/esm/components/table/tablePage.js +25 -25
  113. package/dist/esm/components/tree/treeFilter.js +137 -147
  114. package/dist/esm/components/upload/config.js +15 -27
  115. package/dist/esm/components/upload/file.js +90 -94
  116. package/dist/esm/components/upload/image.js +116 -123
  117. package/dist/esm/components/upload/manage/item.js +44 -47
  118. package/dist/esm/components/upload/manager.js +190 -207
  119. package/dist/esm/components/widget/connect.js +103 -106
  120. package/dist/esm/dvha-pro.css +1 -1
  121. package/dist/esm/hooks/action.js +141 -157
  122. package/dist/esm/hooks/download.js +55 -56
  123. package/dist/esm/hooks/echart.js +156 -179
  124. package/dist/esm/hooks/image.js +14 -15
  125. package/dist/esm/hooks/level.js +7 -7
  126. package/dist/esm/hooks/table/color.js +19 -0
  127. package/dist/esm/hooks/table/column.js +25 -23
  128. package/dist/esm/hooks/table/image.js +2 -2
  129. package/dist/esm/hooks/table/input.js +28 -28
  130. package/dist/esm/hooks/table/map.js +7 -7
  131. package/dist/esm/hooks/table/status.js +8 -9
  132. package/dist/esm/hooks/table/switch.js +19 -19
  133. package/dist/esm/hooks/table.js +27 -31
  134. package/dist/esm/index.js +162 -158
  135. package/dist/esm/pages/layout/global.js +12 -15
  136. package/dist/esm/pages/layout/tab.js +58 -71
  137. package/dist/esm/pages/login.js +81 -85
  138. package/dist/esm/pages/menu/avatar.js +136 -149
  139. package/dist/esm/pages/menu/button.js +16 -20
  140. package/dist/esm/pages/menu/cmd.js +68 -74
  141. package/dist/esm/pages/page.js +21 -25
  142. package/dist/esm/pages/pageStatus.js +21 -24
  143. package/dist/esm/stores/ui.js +15 -15
  144. package/dist/esm/theme/uno.css.js +2 -1
  145. package/dist/types/components/drawer/drawerPage.d.ts +1 -1
  146. package/dist/types/components/form/drawerForm.d.ts +104 -0
  147. package/dist/types/components/form/index.d.ts +1 -0
  148. package/dist/types/components/form/modalForm.d.ts +6 -0
  149. package/dist/types/components/form/pageForm.d.ts +6 -0
  150. package/dist/types/components/form/settingForm.d.ts +6 -0
  151. package/dist/types/components/layout/table.d.ts +9 -0
  152. package/dist/types/components/table/tablePage.d.ts +9 -0
  153. package/dist/types/hooks/table/color.d.ts +13 -0
  154. package/dist/types/hooks/table/column.d.ts +1 -0
  155. package/dist/types/hooks/table/index.d.ts +1 -0
  156. package/dist/types/hooks/table/types.d.ts +2 -2
  157. package/package.json +3 -3
@@ -0,0 +1,149 @@
1
+ import { defineComponent as b, computed as v, toRef as C, createVNode as e, Fragment as F, mergeProps as x, isVNode as D } from "vue";
2
+ import { useI18n as E, useInvalidate as N, useExtendForm as h } from "@duxweb/dvha-core";
3
+ import { useMessage as j, NButton as a, NScrollbar as w } from "naive-ui";
4
+ import "clsx";
5
+ import "vue-echarts";
6
+ import "vue-router";
7
+ import "@overlastic/vue";
8
+ import "dayjs";
9
+ import "mime";
10
+ import "lodash-es";
11
+ import "@tanstack/vue-query";
12
+ import "@duxweb/dvha-naiveui";
13
+ import "@vueuse/core";
14
+ import "pinia";
15
+ import "vue-cropper";
16
+ import "jinrishici";
17
+ import "vue-draggable-plus";
18
+ import { DuxDrawerPage as O } from "../drawer/drawerPage.js";
19
+ import "aieditor";
20
+ import { DuxFormLayout as p } from "./formLayout.js";
21
+ import "vee-validate";
22
+ import "@vee-validate/i18n";
23
+ import "colorizr";
24
+ import "echarts";
25
+ import "@ant-design/colors";
26
+ import "@unocss/preset-icons/browser";
27
+ import "@unocss/preset-typography";
28
+ import "unocss/preset-wind4";
29
+ import "@vee-validate/i18n/dist/locale/en.json";
30
+ import "@vee-validate/i18n/dist/locale/zh_CN.json";
31
+ import "vue-command-palette";
32
+ import "../../pages/page404.js";
33
+ import "@iconify-json/tabler/icons.json";
34
+ import "vue3-ace-editor";
35
+ import "ace-builds/src-noconflict/mode-vue";
36
+ import "ace-builds/src-noconflict/mode-javascript";
37
+ import "ace-builds/src-noconflict/mode-html";
38
+ import "ace-builds/src-noconflict/mode-json";
39
+ import "ace-builds/src-noconflict/mode-json5";
40
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
41
+ import "ace-builds/src-noconflict/theme-tomorrow";
42
+ import "ace-builds/src-noconflict/ext-searchbox";
43
+ import "ace-builds/src-noconflict/ext-language_tools";
44
+ import "ace-builds/src-noconflict/mode-snippets";
45
+ function s(t) {
46
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !D(t);
47
+ }
48
+ const ht = /* @__PURE__ */ b({
49
+ name: "DuxDrawerForm",
50
+ props: {
51
+ id: {
52
+ type: [String, Number]
53
+ },
54
+ action: {
55
+ type: String
56
+ },
57
+ path: {
58
+ type: String
59
+ },
60
+ data: {
61
+ type: Object
62
+ },
63
+ onClose: {
64
+ type: Function
65
+ },
66
+ title: {
67
+ type: String
68
+ },
69
+ onSuccess: {
70
+ type: Function
71
+ },
72
+ onError: {
73
+ type: Function
74
+ },
75
+ invalidate: {
76
+ type: String
77
+ }
78
+ },
79
+ extends: p,
80
+ setup(t, {
81
+ slots: c
82
+ }) {
83
+ const {
84
+ t: r
85
+ } = E(), l = v(() => {
86
+ const {
87
+ onClose: o,
88
+ onSuccess: i,
89
+ onError: P,
90
+ action: _,
91
+ title: k,
92
+ id: I,
93
+ path: L,
94
+ data: R,
95
+ ...S
96
+ } = t;
97
+ return S;
98
+ }), u = C(t, "data", {}), n = j(), {
99
+ invalidate: d
100
+ } = N(), {
101
+ isLoading: m,
102
+ onSubmit: f,
103
+ onReset: g,
104
+ isEdit: y
105
+ } = h({
106
+ id: t.id,
107
+ path: t.path,
108
+ form: u,
109
+ action: t.action,
110
+ onError: (o) => {
111
+ n.error(o.message || r("components.form.error")), t.onError?.(o);
112
+ },
113
+ onSuccess: (o) => {
114
+ n.success(r("components.form.success")), t.onSuccess?.(o), t.onClose?.(), t.invalidate && d(t.invalidate);
115
+ }
116
+ });
117
+ return () => e(O, {
118
+ scrollbar: !1,
119
+ title: t?.title || (y.value ? r("components.form.edit") : r("components.form.create")),
120
+ onClose: t?.onClose
121
+ }, {
122
+ default: () => e(w, null, {
123
+ default: () => [e(p, x({
124
+ class: "p-4"
125
+ }, l.value), {
126
+ default: () => [c?.default?.()]
127
+ })]
128
+ }),
129
+ footer: () => {
130
+ let o, i;
131
+ return e(F, null, [e(a, {
132
+ onClick: g,
133
+ loading: m.value
134
+ }, s(o = r("components.button.reset")) ? o : {
135
+ default: () => [o]
136
+ }), e(a, {
137
+ type: "primary",
138
+ loading: m.value,
139
+ onClick: () => f()
140
+ }, s(i = r("components.button.submit")) ? i : {
141
+ default: () => [i]
142
+ })]);
143
+ }
144
+ });
145
+ }
146
+ });
147
+ export {
148
+ ht as DuxDrawerForm
149
+ };
@@ -1,4 +1,4 @@
1
- import { defineComponent as b, toRef as h, computed as a, watch as y, inject as j, createVNode as r, createTextVNode as q } from "vue";
1
+ import { defineComponent as b, toRef as h, computed as a, watch as y, inject as q, createVNode as l, createTextVNode as j } from "vue";
2
2
  import { watchThrottled as S } from "@vueuse/core";
3
3
  import { useField as w } from "vee-validate";
4
4
  const F = /* @__PURE__ */ b({
@@ -24,68 +24,62 @@ const F = /* @__PURE__ */ b({
24
24
  message: [String, Object]
25
25
  },
26
26
  setup(e, {
27
- slots: i
27
+ slots: d
28
28
  }) {
29
- const c = h(e.message), f = a(() => {
30
- var t;
31
- return typeof e.rule == "object" ? {
32
- ...e.rule,
33
- required: !!e.required
34
- } : typeof e.rule == "string" ? (t = e.rule) != null && t.includes("required") ? e.rule : `${e.rule}|required` : e.rule;
35
- }), {
36
- errorMessage: d,
37
- value: m,
38
- setErrors: s,
29
+ const s = h(e.message), c = a(() => typeof e.rule == "object" ? {
30
+ ...e.rule,
31
+ required: !!e.required
32
+ } : typeof e.rule == "string" ? e.rule?.includes("required") ? e.rule : e.rule ? `${e.rule}|required` : "required" : e.rule), {
33
+ errorMessage: n,
34
+ value: f,
35
+ setErrors: m,
39
36
  validate: g
40
- } = w(e.path || "", f.value || {}, {
37
+ } = w(e.path || "", c.value || {}, {
41
38
  label: e.label
42
- }), v = a(() => e.required ? !0 : e.rule ? typeof e.rule == "string" ? e.rule.includes("required") : typeof e.rule == "object" ? "required" in e.rule : !1 : !1), n = a(() => d.value && (c.value || d.value));
43
- y(n, (t) => {
44
- t && s(t);
39
+ }), v = a(() => e.required ? !0 : e.rule ? typeof e.rule == "string" ? e.rule.includes("required") : typeof e.rule == "object" ? "required" in e.rule : !1 : !1), u = a(() => n.value && (s.value || n.value));
40
+ y(u, (r) => {
41
+ r && m(r);
45
42
  }, {
46
43
  immediate: !0
47
- }), S(m, (t) => {
48
- t && g();
44
+ }), S(f, (r) => {
45
+ r && g();
49
46
  }, {
50
47
  throttle: 300,
51
48
  deep: !0
52
49
  });
53
- const u = j("dux.form", {
50
+ const i = q("dux.form", {
54
51
  labelPlacement: "left",
55
52
  labelAlign: "left",
56
53
  labelWidth: 70,
57
54
  divider: !1
58
- }), l = a(() => e.labelPlacement || u.labelPlacement), o = a(() => {
59
- let t = e.labelWidth || u.labelWidth || 70;
60
- return typeof t == "number" && (t = `${t}px`), l.value !== "left" ? "auto" : t;
61
- }), x = a(() => u.divider || l.value === "page");
62
- return () => {
63
- var t;
64
- return r("div", {
65
- class: [l.value !== "top" ? "md:flex-row gap-2 lg:items-center" : "gap-1", x.value ? "py-6" : "", l.value === "setting" ? "md:justify-between md:items-start md:gap-4" : "", l.value === "page" ? "grid grid-cols-1 lg:grid-cols-4 px-4" : "flex flex-col"]
66
- }, [r("div", {
67
- class: [l.value === "left" ? "flex lg:items-center" : "", l.value === "left" && u.labelAlign === "right" ? "justify-end" : ""],
68
- style: {
69
- width: o.value
70
- }
71
- }, [r("div", {
72
- class: "flex flex-col"
73
- }, [r("div", null, [r("span", {
74
- class: "relative flex items-center gap-1"
75
- }, [e.label, v.value && r("span", {
76
- class: "text-error font-mono text-xs"
77
- }, [q("*")])])]), e.description && (l.value === "setting" || l.value === "page") && r("div", {
78
- class: "text-sm text-muted"
79
- }, [e.description])])]), r("div", {
80
- class: ["flex flex-col gap-1", l.value !== "left" ? "md:mt-1" : "", l.value === "setting" ? "flex-none md:w-40%" : "flex-1", l.value === "page" ? "col-span-3" : ""]
81
- }, [r("div", {
82
- class: l.value === "setting" ? "flex-1 lg:flex lg:justify-end" : ""
83
- }, [(t = i == null ? void 0 : i.default) == null ? void 0 : t.call(i)]), e.description && l.value === "left" && r("div", {
84
- class: "text-sm text-muted"
85
- }, [e.description]), n.value && r("div", {
86
- class: "text-error"
87
- }, [n.value])])]);
88
- };
55
+ }), t = a(() => e.labelPlacement || i.labelPlacement), o = a(() => {
56
+ let r = e.labelWidth || i.labelWidth || 70;
57
+ return typeof r == "number" && (r = `${r}px`), t.value !== "left" ? "auto" : r;
58
+ }), x = a(() => i.divider || t.value === "page");
59
+ return () => l("div", {
60
+ class: [t.value !== "top" ? "md:flex-row gap-2 lg:items-center" : "gap-1", x.value ? "py-6" : "", t.value === "setting" ? "md:justify-between md:items-start md:gap-4" : "", t.value === "page" ? "grid grid-cols-1 lg:grid-cols-4 px-4" : "flex flex-col"]
61
+ }, [l("div", {
62
+ class: [t.value === "left" ? "flex lg:items-center" : "", t.value === "left" && i.labelAlign === "right" ? "justify-end" : ""],
63
+ style: {
64
+ width: o.value
65
+ }
66
+ }, [l("div", {
67
+ class: "flex flex-col"
68
+ }, [l("div", null, [l("span", {
69
+ class: "relative flex items-center gap-1"
70
+ }, [e.label, v.value && l("span", {
71
+ class: "text-error font-mono text-xs"
72
+ }, [j("*")])])]), e.description && (t.value === "setting" || t.value === "page") && l("div", {
73
+ class: "text-sm text-muted"
74
+ }, [e.description])])]), l("div", {
75
+ class: ["flex flex-col gap-1", t.value !== "left" ? "md:mt-1" : "", t.value === "setting" ? "flex-none md:w-40%" : "flex-1", t.value === "page" ? "col-span-3" : ""]
76
+ }, [l("div", {
77
+ class: t.value === "setting" ? "flex-1 lg:flex lg:justify-end" : ""
78
+ }, [d?.default?.()]), e.description && t.value === "left" && l("div", {
79
+ class: "text-sm text-muted"
80
+ }, [e.description]), u.value && l("div", {
81
+ class: "text-error"
82
+ }, [u.value])])]);
89
83
  }
90
84
  });
91
85
  export {
@@ -1,5 +1,5 @@
1
- import { defineComponent as i, provide as d, createVNode as t } from "vue";
2
- const f = /* @__PURE__ */ i({
1
+ import { defineComponent as a, provide as t, createVNode as i } from "vue";
2
+ const n = /* @__PURE__ */ a({
3
3
  name: "DuxFormLayout",
4
4
  props: {
5
5
  labelPlacement: {
@@ -25,19 +25,16 @@ const f = /* @__PURE__ */ i({
25
25
  setup(e, {
26
26
  slots: l
27
27
  }) {
28
- return d("dux.form", {
28
+ return t("dux.form", {
29
29
  labelPlacement: e.labelPlacement,
30
30
  labelAlign: e.labelAlign,
31
31
  labelWidth: e.labelWidth,
32
32
  divider: e.divider
33
- }), () => {
34
- var a;
35
- return t("div", {
36
- class: ["flex ", e.divider || e.labelPlacement === "page" ? " divide-y divide-default dark:divide-gray-800" : "", e.inline ? "flex-row" : "flex-col", e.labelPlacement === "page" || e.labelPlacement === "setting" ? "container mx-auto" : "gap-4"]
37
- }, [(a = l == null ? void 0 : l.default) == null ? void 0 : a.call(l)]);
38
- };
33
+ }), () => i("div", {
34
+ class: ["flex ", e.divider || e.labelPlacement === "page" ? " divide-y divide-default dark:divide-gray-800" : "", e.inline ? "flex-row" : "flex-col", e.labelPlacement === "page" || e.labelPlacement === "setting" ? "container mx-auto" : "gap-4"]
35
+ }, [l?.default?.()]);
39
36
  }
40
37
  });
41
38
  export {
42
- f as DuxFormLayout
39
+ n as DuxFormLayout
43
40
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as s, computed as C, toRef as F, createVNode as n, Fragment as x, isVNode as E } from "vue";
2
- import { useI18n as h, useExtendForm as j } from "@duxweb/dvha-core";
3
- import { useMessage as v, NButton as a } from "naive-ui";
1
+ import { defineComponent as b, computed as v, toRef as C, createVNode as i, Fragment as F, isVNode as x } from "vue";
2
+ import { useI18n as E, useInvalidate as h, useExtendForm as j } from "@duxweb/dvha-core";
3
+ import { useMessage as D, NButton as p } from "naive-ui";
4
4
  import "clsx";
5
5
  import "vue-echarts";
6
6
  import "vue-router";
@@ -13,12 +13,12 @@ import "@duxweb/dvha-naiveui";
13
13
  import "@vueuse/core";
14
14
  import "pinia";
15
15
  import "vue-cropper";
16
- import D from "../modal/modalPage.js";
16
+ import M from "../modal/modalPage.js";
17
17
  import "jinrishici";
18
18
  import "vue-draggable-plus";
19
19
  import "aieditor";
20
+ import { DuxFormLayout as a } from "./formLayout.js";
20
21
  import "vee-validate";
21
- import { DuxFormLayout as d } from "./formLayout.js";
22
22
  import "@vee-validate/i18n";
23
23
  import "colorizr";
24
24
  import "echarts";
@@ -42,10 +42,10 @@ import "ace-builds/src-noconflict/theme-tomorrow";
42
42
  import "ace-builds/src-noconflict/ext-searchbox";
43
43
  import "ace-builds/src-noconflict/ext-language_tools";
44
44
  import "ace-builds/src-noconflict/mode-snippets";
45
- function l(t) {
46
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !E(t);
45
+ function c(t) {
46
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !x(t);
47
47
  }
48
- const Et = /* @__PURE__ */ s({
48
+ const ht = /* @__PURE__ */ b({
49
49
  name: "DuxModalForm",
50
50
  props: {
51
51
  id: {
@@ -66,6 +66,9 @@ const Et = /* @__PURE__ */ s({
66
66
  title: {
67
67
  type: String
68
68
  },
69
+ invalidate: {
70
+ type: String
71
+ },
69
72
  onSuccess: {
70
73
  type: Function
71
74
  },
@@ -73,72 +76,69 @@ const Et = /* @__PURE__ */ s({
73
76
  type: Function
74
77
  }
75
78
  },
76
- extends: d,
79
+ extends: a,
77
80
  setup(t, {
78
- slots: m
81
+ slots: s
79
82
  }) {
80
83
  const {
81
- t: i
82
- } = h(), f = C(() => {
84
+ t: e
85
+ } = E(), u = v(() => {
83
86
  const {
84
87
  onClose: o,
85
- onSuccess: e,
86
- onError: r,
87
- action: M,
88
- title: N,
89
- id: O,
90
- path: _,
91
- data: k,
92
- ...b
88
+ onSuccess: r,
89
+ onError: N,
90
+ action: O,
91
+ title: _,
92
+ id: k,
93
+ path: I,
94
+ data: L,
95
+ ...S
93
96
  } = t;
94
- return b;
95
- }), p = F(t, "data", {}), c = v(), {
96
- isLoading: u,
97
- onSubmit: g,
98
- onReset: y,
99
- isEdit: S
97
+ return S;
98
+ }), l = C(t, "data", {}), n = D(), {
99
+ invalidate: d
100
+ } = h(), {
101
+ isLoading: m,
102
+ onSubmit: f,
103
+ onReset: g,
104
+ isEdit: y
100
105
  } = j({
101
106
  id: t.id,
102
107
  path: t.path,
103
- form: p,
108
+ form: l,
104
109
  action: t.action,
105
110
  onError: (o) => {
106
- var e;
107
- c.error(o.message || i("components.form.error")), (e = t.onError) == null || e.call(t, o);
111
+ n.error(o.message || e("components.form.error")), t.onError?.(o);
108
112
  },
109
113
  onSuccess: (o) => {
110
- var e, r;
111
- c.success(i("components.form.success")), (e = t.onSuccess) == null || e.call(t, o), (r = t.onClose) == null || r.call(t);
114
+ t.invalidate && d(t.invalidate), n.success(e("components.form.success")), t.onSuccess?.(o), t.onClose?.();
112
115
  }
113
116
  });
114
- return () => n(D, {
115
- title: (t == null ? void 0 : t.title) || (S.value ? i("components.form.edit") : i("components.form.create")),
116
- onClose: t == null ? void 0 : t.onClose
117
+ return () => i(M, {
118
+ title: t?.title || (y.value ? e("components.form.edit") : e("components.form.create")),
119
+ onClose: t?.onClose
117
120
  }, {
118
- default: () => n(d, f.value, {
119
- default: () => {
120
- var o;
121
- return [(o = m == null ? void 0 : m.default) == null ? void 0 : o.call(m)];
122
- }
121
+ default: () => i(a, u.value, {
122
+ default: () => [s?.default?.()]
123
123
  }),
124
124
  footer: () => {
125
- let o, e;
126
- return n(x, null, [n(a, {
127
- onClick: y,
128
- loading: u.value
129
- }, l(o = i("components.button.reset")) ? o : {
125
+ let o, r;
126
+ return i(F, null, [i(p, {
127
+ onClick: g,
128
+ loading: m.value
129
+ }, c(o = e("components.button.reset")) ? o : {
130
130
  default: () => [o]
131
- }), n(a, {
131
+ }), i(p, {
132
132
  type: "primary",
133
- loading: u.value,
134
- onClick: () => g()
135
- }, l(e = i("components.button.submit")) ? e : {
136
- default: () => [e]
133
+ loading: m.value,
134
+ onClick: () => f()
135
+ }, c(r = e("components.button.submit")) ? r : {
136
+ default: () => [r]
137
137
  })]);
138
138
  }
139
139
  });
140
140
  }
141
141
  });
142
142
  export {
143
- Et as DuxModalForm
143
+ ht as DuxModalForm
144
144
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as b, toRef as g, createVNode as i } from "vue";
2
- import { useI18n as x, useTabStore as y, useExtendForm as S } from "@duxweb/dvha-core";
3
- import { useMessage as s, NButton as p, NScrollbar as h } from "naive-ui";
1
+ import { defineComponent as f, toRef as b, createVNode as e } from "vue";
2
+ import { useI18n as g, useTabStore as y, useInvalidate as S, useExtendForm as x } from "@duxweb/dvha-core";
3
+ import { useMessage as h, NButton as p, NScrollbar as v } from "naive-ui";
4
4
  import { useRouter as E } from "vue-router";
5
5
  import "@overlastic/vue";
6
6
  import { DuxCard as F } from "../card/card.js";
@@ -12,8 +12,8 @@ import "jinrishici";
12
12
  import "lodash-es";
13
13
  import "vue-draggable-plus";
14
14
  import "aieditor";
15
+ import { DuxFormLayout as C } from "./formLayout.js";
15
16
  import "vee-validate";
16
- import { DuxFormLayout as v } from "./formLayout.js";
17
17
  import "@iconify-json/tabler/icons.json";
18
18
  import "mime";
19
19
  import "vue3-ace-editor";
@@ -41,9 +41,9 @@ import "unocss/preset-wind4";
41
41
  import "@vee-validate/i18n/dist/locale/en.json";
42
42
  import "@vee-validate/i18n/dist/locale/zh_CN.json";
43
43
  import "vue-command-palette";
44
- import { DuxPage as C } from "../../pages/page.js";
44
+ import { DuxPage as D } from "../../pages/page.js";
45
45
  import "../../pages/page404.js";
46
- const xt = /* @__PURE__ */ b({
46
+ const yt = /* @__PURE__ */ f({
47
47
  name: "DuxPageForm",
48
48
  props: {
49
49
  id: {
@@ -73,76 +73,73 @@ const xt = /* @__PURE__ */ b({
73
73
  size: {
74
74
  type: String,
75
75
  default: "medium"
76
+ },
77
+ invalidate: {
78
+ type: String
76
79
  }
77
80
  },
78
81
  setup(t, {
79
- slots: r
82
+ slots: m
80
83
  }) {
81
84
  const {
82
85
  t: o
83
- } = x(), d = g(t, "data", {}), u = s(), l = E(), n = y(), m = S({
86
+ } = g(), s = b(t, "data", {}), a = h(), c = E(), n = y(), {
87
+ invalidate: l
88
+ } = S(), r = x({
84
89
  id: t.id,
85
90
  path: t.path,
86
- form: d,
91
+ form: s,
87
92
  action: t.action,
88
- onError: (e) => {
89
- var a;
90
- u.error(e.message || o("components.form.error")), (a = t.onError) == null || a.call(t, e);
93
+ onError: (i) => {
94
+ a.error(i.message || o("components.form.error")), t.onError?.(i);
91
95
  },
92
- onSuccess: (e) => {
93
- var a;
94
- u.success(o("components.form.success")), (a = t.onSuccess) == null || a.call(t, e), !m.isEdit.value && n.current && n.delTab(n.current, (f) => l.push(f.path || ""));
96
+ onSuccess: (i) => {
97
+ a.success(o("components.form.success")), t.onSuccess?.(i), !r.isEdit.value && n.current && n.delTab(n.current, (d) => c.push(d.path || "")), t.invalidate && l(t.invalidate);
95
98
  }
96
- }), c = n.tabs.find((e) => e.path === n.current);
97
- return () => i(C, {
99
+ }), u = n.tabs.find((i) => i.path === n.current);
100
+ return () => e(D, {
98
101
  card: !1,
99
102
  scrollbar: !1
100
103
  }, {
101
- default: () => [i(F, {
102
- title: (t == null ? void 0 : t.title) || (c == null ? void 0 : c.label) || (m.isEdit.value ? o("components.form.edit") : o("components.form.create")),
103
- description: t == null ? void 0 : t.description,
104
+ default: () => [e(F, {
105
+ title: t?.title || u?.label || (r.isEdit.value ? o("components.form.edit") : o("components.form.create")),
106
+ description: t?.description,
104
107
  class: "h-full flex flex-col",
105
108
  contentClass: "flex-1 min-h-0",
106
109
  contentSize: "none",
107
110
  "header-bordered": !0
108
111
  }, {
109
- default: () => i(h, null, {
110
- default: () => [i(v, {
112
+ default: () => e(v, null, {
113
+ default: () => [e(C, {
111
114
  "label-placement": "page"
112
115
  }, {
113
- default: () => {
114
- var e;
115
- return [(e = r == null ? void 0 : r.default) == null ? void 0 : e.call(r, m)];
116
- }
116
+ default: () => [m?.default?.(r)]
117
117
  })]
118
118
  }),
119
- headerExtra: () => {
120
- var e;
121
- return i("div", {
122
- class: "flex gap-6 items-center"
123
- }, [(e = r == null ? void 0 : r.actions) == null ? void 0 : e.call(r, m), i("div", {
124
- class: "flex gap-2"
125
- }, [i(p, {
126
- onClick: () => m.onReset()
127
- }, {
128
- default: () => o("components.button.reset"),
129
- icon: () => i("i", {
130
- class: "i-tabler:refresh"
131
- }, null)
132
- }), i(p, {
133
- type: "primary",
134
- onClick: () => m.onSubmit()
135
- }, {
136
- default: () => o("components.button.submit"),
137
- icon: () => i("i", {
138
- class: "i-tabler:device-floppy"
139
- }, null)
140
- })])]);
141
- }
119
+ headerExtra: () => e("div", {
120
+ class: "flex gap-6 items-center"
121
+ }, [m?.actions?.(r), e("div", {
122
+ class: "flex gap-2"
123
+ }, [e(p, {
124
+ onClick: () => r.onReset()
125
+ }, {
126
+ default: () => o("components.button.reset"),
127
+ icon: () => e("i", {
128
+ class: "i-tabler:refresh"
129
+ }, null)
130
+ }), e(p, {
131
+ type: "primary",
132
+ onClick: () => r.onSubmit()
133
+ }, {
134
+ default: () => o("components.button.submit"),
135
+ icon: () => e("i", {
136
+ class: "i-tabler:device-floppy"
137
+ }, null)
138
+ })])])
142
139
  })]
143
140
  });
144
141
  }
145
142
  });
146
143
  export {
147
- xt as DuxPageForm
144
+ yt as DuxPageForm
148
145
  };