@duxweb/dvha-pro 1.0.17 → 1.0.19

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 (150) 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/chart/echart.cjs +1 -1
  4. package/dist/cjs/components/code/code.cjs +1 -0
  5. package/dist/cjs/components/crop/imageCrop.cjs +1 -1
  6. package/dist/cjs/components/data/dynamicSelect.cjs +1 -1
  7. package/dist/cjs/components/data/selectModal.cjs +1 -1
  8. package/dist/cjs/components/drawer/drawer.cjs +1 -1
  9. package/dist/cjs/components/drawer/drawerPage.cjs +1 -1
  10. package/dist/cjs/components/form/formItem.cjs +1 -1
  11. package/dist/cjs/components/form/formLayout.cjs +1 -1
  12. package/dist/cjs/components/form/modalForm.cjs +1 -1
  13. package/dist/cjs/components/form/pageForm.cjs +1 -1
  14. package/dist/cjs/components/form/settingForm.cjs +1 -1
  15. package/dist/cjs/components/icon/icon.cjs +1 -0
  16. package/dist/cjs/components/icon/iconPicker.cjs +1 -0
  17. package/dist/cjs/components/layout/filter.cjs +1 -1
  18. package/dist/cjs/components/layout/filterLayout.cjs +1 -0
  19. package/dist/cjs/components/layout/list.cjs +1 -1
  20. package/dist/cjs/components/layout/table.cjs +1 -1
  21. package/dist/cjs/components/level/level.cjs +1 -1
  22. package/dist/cjs/components/modal/modal.cjs +1 -1
  23. package/dist/cjs/components/modal/modalPage.cjs +1 -1
  24. package/dist/cjs/components/panel/collapse.cjs +1 -0
  25. package/dist/cjs/components/panel/setting.cjs +1 -1
  26. package/dist/cjs/components/status/listEmpty.cjs +1 -0
  27. package/dist/cjs/components/table/table.cjs +1 -0
  28. package/dist/cjs/components/table/tablePage.cjs +1 -1
  29. package/dist/cjs/components/tree/treeFilter.cjs +1 -0
  30. package/dist/cjs/components/upload/config.cjs +1 -0
  31. package/dist/cjs/components/upload/file.cjs +1 -1
  32. package/dist/cjs/components/upload/image.cjs +1 -1
  33. package/dist/cjs/components/upload/manage/item.cjs +1 -1
  34. package/dist/cjs/components/upload/manager.cjs +1 -1
  35. package/dist/cjs/dvha-pro.css +1 -1
  36. package/dist/cjs/hooks/action.cjs +1 -1
  37. package/dist/cjs/hooks/dialog.cjs +1 -1
  38. package/dist/cjs/hooks/drawer.cjs +1 -1
  39. package/dist/cjs/hooks/modal.cjs +1 -1
  40. package/dist/cjs/hooks/table/image.cjs +1 -1
  41. package/dist/cjs/hooks/table/media.cjs +1 -1
  42. package/dist/cjs/hooks/table.cjs +1 -1
  43. package/dist/cjs/index.cjs +1 -1
  44. package/dist/cjs/langs/en-US.json.cjs +1 -1
  45. package/dist/cjs/langs/zh-CN.json.cjs +1 -1
  46. package/dist/cjs/pages/authLayout.cjs +1 -1
  47. package/dist/cjs/pages/layout/page.cjs +1 -1
  48. package/dist/cjs/pages/login.cjs +1 -1
  49. package/dist/cjs/pages/menu/avatar.cjs +1 -1
  50. package/dist/cjs/pages/menu/button.cjs +1 -1
  51. package/dist/cjs/pages/menu/cmd.cjs +1 -1
  52. package/dist/cjs/pages/menu/main.cjs +1 -1
  53. package/dist/cjs/pages/menu/mobile.cjs +1 -1
  54. package/dist/cjs/pages/page.cjs +1 -1
  55. package/dist/cjs/pages/page404.cjs +1 -1
  56. package/dist/cjs/pages/pageStatus.cjs +1 -1
  57. package/dist/cjs/theme/naiveTheme.cjs +1 -1
  58. package/dist/cjs/theme/uno.css.cjs +27 -7
  59. package/dist/esm/component.js +52 -47
  60. package/dist/esm/components/card/card.js +6 -6
  61. package/dist/esm/components/chart/echart.js +18 -6
  62. package/dist/esm/components/code/code.js +53 -0
  63. package/dist/esm/components/crop/imageCrop.js +38 -26
  64. package/dist/esm/components/data/dynamicSelect.js +31 -19
  65. package/dist/esm/components/data/selectModal.js +50 -38
  66. package/dist/esm/components/drawer/drawer.js +17 -28
  67. package/dist/esm/components/drawer/drawerPage.js +54 -17
  68. package/dist/esm/components/form/formItem.js +13 -13
  69. package/dist/esm/components/form/formLayout.js +8 -8
  70. package/dist/esm/components/form/modalForm.js +46 -36
  71. package/dist/esm/components/form/pageForm.js +82 -43
  72. package/dist/esm/components/form/settingForm.js +39 -27
  73. package/dist/esm/components/icon/icon.js +89 -0
  74. package/dist/esm/components/icon/iconPicker.js +83 -0
  75. package/dist/esm/components/layout/filter.js +15 -11
  76. package/dist/esm/components/layout/filterLayout.js +34 -0
  77. package/dist/esm/components/layout/list.js +207 -160
  78. package/dist/esm/components/layout/table.js +213 -185
  79. package/dist/esm/components/level/level.js +29 -17
  80. package/dist/esm/components/modal/modal.js +9 -9
  81. package/dist/esm/components/modal/modalPage.js +2 -2
  82. package/dist/esm/components/panel/collapse.js +49 -0
  83. package/dist/esm/components/panel/setting.js +3 -3
  84. package/dist/esm/components/status/listEmpty.js +26 -0
  85. package/dist/esm/components/table/table.js +110 -0
  86. package/dist/esm/components/table/tablePage.js +24 -18
  87. package/dist/esm/components/tree/treeFilter.js +212 -0
  88. package/dist/esm/components/upload/config.js +32 -0
  89. package/dist/esm/components/upload/file.js +143 -116
  90. package/dist/esm/components/upload/image.js +96 -66
  91. package/dist/esm/components/upload/manage/item.js +18 -6
  92. package/dist/esm/components/upload/manager.js +203 -164
  93. package/dist/esm/dvha-pro.css +1 -1
  94. package/dist/esm/hooks/action.js +77 -75
  95. package/dist/esm/hooks/dialog.js +14 -2
  96. package/dist/esm/hooks/drawer.js +14 -2
  97. package/dist/esm/hooks/modal.js +14 -2
  98. package/dist/esm/hooks/table/image.js +22 -10
  99. package/dist/esm/hooks/table/media.js +22 -10
  100. package/dist/esm/hooks/table.js +16 -13
  101. package/dist/esm/index.js +200 -184
  102. package/dist/esm/langs/en-US.json.js +1 -1
  103. package/dist/esm/langs/zh-CN.json.js +1 -1
  104. package/dist/esm/pages/authLayout.js +23 -11
  105. package/dist/esm/pages/layout/page.js +29 -17
  106. package/dist/esm/pages/login.js +41 -29
  107. package/dist/esm/pages/menu/avatar.js +46 -34
  108. package/dist/esm/pages/menu/button.js +26 -14
  109. package/dist/esm/pages/menu/cmd.js +46 -34
  110. package/dist/esm/pages/menu/main.js +41 -27
  111. package/dist/esm/pages/menu/mobile.js +14 -2
  112. package/dist/esm/pages/page.js +1 -1
  113. package/dist/esm/pages/page404.js +21 -9
  114. package/dist/esm/pages/pageStatus.js +33 -16
  115. package/dist/esm/theme/naiveTheme.js +6 -6
  116. package/dist/esm/theme/uno.css.js +27 -7
  117. package/dist/types/components/code/code.d.ts +44 -0
  118. package/dist/types/components/code/index.d.ts +1 -0
  119. package/dist/types/components/drawer/drawer.d.ts +2 -0
  120. package/dist/types/components/drawer/drawerPage.d.ts +20 -1
  121. package/dist/types/components/form/formItem.d.ts +2 -2
  122. package/dist/types/components/form/formLayout.d.ts +3 -3
  123. package/dist/types/components/form/modalForm.d.ts +3 -3
  124. package/dist/types/components/form/pageForm.d.ts +12 -0
  125. package/dist/types/components/icon/icon.d.ts +7 -0
  126. package/dist/types/components/icon/iconPicker.d.ts +9 -0
  127. package/dist/types/components/icon/index.d.ts +2 -0
  128. package/dist/types/components/index.d.ts +3 -0
  129. package/dist/types/components/layout/filterLayout.d.ts +32 -0
  130. package/dist/types/components/layout/index.d.ts +1 -0
  131. package/dist/types/components/layout/table.d.ts +3 -0
  132. package/dist/types/components/panel/collapse.d.ts +14 -0
  133. package/dist/types/components/panel/index.d.ts +1 -0
  134. package/dist/types/components/select/cardSelect.d.ts +1 -1
  135. package/dist/types/components/status/index.d.ts +1 -0
  136. package/dist/types/components/status/listEmpty.d.ts +11 -0
  137. package/dist/types/components/table/index.d.ts +1 -0
  138. package/dist/types/components/table/table.d.ts +6552 -0
  139. package/dist/types/components/table/tablePage.d.ts +3 -0
  140. package/dist/types/components/tree/index.d.ts +1 -0
  141. package/dist/types/components/tree/treeFilter.d.ts +24 -0
  142. package/dist/types/components/upload/config.d.ts +13 -0
  143. package/dist/types/components/upload/file.d.ts +4 -0
  144. package/dist/types/components/upload/image.d.ts +30 -2
  145. package/dist/types/components/upload/manager.d.ts +4 -0
  146. package/dist/types/hooks/drawer.d.ts +1 -0
  147. package/dist/types/hooks/table/types.d.ts +1 -0
  148. package/dist/types/main.d.ts +6 -0
  149. package/dist/types/pages/pageStatus.d.ts +11 -1
  150. package/package.json +6 -4
@@ -1,4 +1,4 @@
1
- import { defineComponent as d, createVNode as a } from "vue";
1
+ import { defineComponent as d, createVNode as p } from "vue";
2
2
  import { useI18n as f, useManage as g, useUpload as v } from "@duxweb/dvha-core";
3
3
  import { useVModel as h } from "@vueuse/core";
4
4
  import { useMessage as x } from "naive-ui";
@@ -25,12 +25,24 @@ import "@vee-validate/i18n/dist/locale/zh_CN.json";
25
25
  import "vue-command-palette";
26
26
  import "@duxweb/dvha-naiveui";
27
27
  import "../../pages/page404.js";
28
+ import "@iconify-json/tabler/icons.json";
28
29
  import "mime";
30
+ import "vue3-ace-editor";
31
+ import "ace-builds/src-noconflict/mode-vue";
32
+ import "ace-builds/src-noconflict/mode-javascript";
33
+ import "ace-builds/src-noconflict/mode-html";
34
+ import "ace-builds/src-noconflict/mode-json";
35
+ import "ace-builds/src-noconflict/mode-json5";
36
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
37
+ import "ace-builds/src-noconflict/theme-tomorrow";
38
+ import "ace-builds/src-noconflict/ext-searchbox";
39
+ import "ace-builds/src-noconflict/ext-language_tools";
40
+ import "ace-builds/src-noconflict/mode-snippets";
29
41
  import { useModal as C } from "../../hooks/modal.js";
30
42
  import "dayjs";
31
43
  import "@tanstack/vue-query";
32
44
  import "pinia";
33
- const $ = /* @__PURE__ */ d({
45
+ const so = /* @__PURE__ */ d({
34
46
  name: "DuxImageCrop",
35
47
  props: {
36
48
  defaultValue: {
@@ -50,56 +62,56 @@ const $ = /* @__PURE__ */ d({
50
62
  default: !0
51
63
  }
52
64
  },
53
- setup(t, {
65
+ setup(e, {
54
66
  emit: l
55
67
  }) {
56
68
  var u;
57
69
  const {
58
- t: p
59
- } = f(), i = h(t, "value", l, {
70
+ t: m
71
+ } = f(), i = h(e, "value", l, {
60
72
  passive: !0,
61
- defaultValue: t.defaultValue || ""
73
+ defaultValue: e.defaultValue || ""
62
74
  }), {
63
75
  config: n
64
- } = g(), s = C(), m = x(), c = v({
65
- path: t.path || ((u = n.apiPath) == null ? void 0 : u.upload) || "upload",
76
+ } = g(), s = C(), a = x(), c = v({
77
+ path: e.path || ((u = n.apiPath) == null ? void 0 : u.upload) || "upload",
66
78
  autoUpload: !0,
67
- onSuccess: (e) => {
79
+ onSuccess: (o) => {
68
80
  var r;
69
- i.value = (r = e.data) == null ? void 0 : r.url, m.success(p("components.upload.success"));
81
+ i.value = (r = o.data) == null ? void 0 : r.url, a.success(m("components.upload.success"));
70
82
  },
71
- onError: (e) => {
72
- m.error(e.message || p("components.upload.failed"));
83
+ onError: (o) => {
84
+ a.error(o.message || m("components.upload.failed"));
73
85
  }
74
86
  });
75
- return () => a("div", {
76
- class: ["relative size-80px overflow-hidden group", t.circle && "rounded-full"],
87
+ return () => p("div", {
88
+ class: ["relative size-80px overflow-hidden group", e.circle && "rounded-full"],
77
89
  onClick: () => {
78
- var e, r;
79
- (r = (e = s.show({
80
- component: () => import("./imageCropModal.js").then((o) => o.DuxImageCropModal),
90
+ var o, r;
91
+ (r = (o = s.show({
92
+ component: () => import("./imageCropModal.js").then((t) => t.DuxImageCropModal),
81
93
  componentProps: {
82
94
  value: i.value,
83
- onConfirm: (o) => {
84
- i.value = o;
95
+ onConfirm: (t) => {
96
+ i.value = t;
85
97
  }
86
98
  }
87
- })) == null ? void 0 : e.then) == null || r.call(e, (o) => {
88
- o && (o.name = "image.png", o.mime = "image/png", c.addFiles([o], "blob"));
99
+ })) == null ? void 0 : o.then) == null || r.call(o, (t) => {
100
+ t && (t.name = "image.png", t.mime = "image/png", c.addFiles([t], "blob"));
89
101
  }).catch(() => {
90
102
  });
91
103
  }
92
- }, [a(y, {
104
+ }, [p(y, {
93
105
  src: i.value,
94
- circle: t.circle,
106
+ circle: e.circle,
95
107
  size: 80
96
- }, null), a("div", {
108
+ }, null), p("div", {
97
109
  class: "absolute size-full bg-gray-900/30 items-center justify-center inset-0 cursor-pointer hidden z-1 group-hover:flex"
98
- }, [a("div", {
110
+ }, [p("div", {
99
111
  class: "i-tabler:pencil size-4 text-white/90"
100
112
  }, null)])]);
101
113
  }
102
114
  });
103
115
  export {
104
- $ as DuxImageCrop
116
+ so as DuxImageCrop
105
117
  };
@@ -24,13 +24,25 @@ import "@vee-validate/i18n/dist/locale/zh_CN.json";
24
24
  import "vue-command-palette";
25
25
  import "@duxweb/dvha-naiveui";
26
26
  import "../../pages/page404.js";
27
+ import "@iconify-json/tabler/icons.json";
27
28
  import "mime";
28
29
  import "vue-draggable-plus";
30
+ import "vue3-ace-editor";
31
+ import "ace-builds/src-noconflict/mode-vue";
32
+ import "ace-builds/src-noconflict/mode-javascript";
33
+ import "ace-builds/src-noconflict/mode-html";
34
+ import "ace-builds/src-noconflict/mode-json";
35
+ import "ace-builds/src-noconflict/mode-json5";
36
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
37
+ import "ace-builds/src-noconflict/theme-tomorrow";
38
+ import "ace-builds/src-noconflict/ext-searchbox";
39
+ import "ace-builds/src-noconflict/ext-language_tools";
40
+ import "ace-builds/src-noconflict/mode-snippets";
29
41
  import { useModal as C } from "../../hooks/modal.js";
30
42
  import "dayjs";
31
43
  import "@tanstack/vue-query";
32
44
  import "pinia";
33
- const et = /* @__PURE__ */ y({
45
+ const vt = /* @__PURE__ */ y({
34
46
  name: "DuxDynamicSelect",
35
47
  props: {
36
48
  rowKey: {
@@ -53,32 +65,32 @@ const et = /* @__PURE__ */ y({
53
65
  }
54
66
  },
55
67
  setup(t, {
56
- emit: n
68
+ emit: p
57
69
  }) {
58
- const e = K(t, "value", n, {
70
+ const e = K(t, "value", p, {
59
71
  passive: !0,
60
72
  defaultValue: t.defaultValue,
61
73
  deep: !0
62
- }), p = C(), c = D(), {
74
+ }), n = C(), c = D(), {
63
75
  t: f
64
- } = S(), r = h(!0);
65
- return d([e, r], () => {
66
- var m;
67
- if (!r.value || !e.value || e.value.length === 0)
76
+ } = S(), i = h(!0);
77
+ return d([e, i], () => {
78
+ var r;
79
+ if (!i.value || !e.value || e.value.length === 0)
68
80
  return;
69
- const o = ((m = e.value) == null ? void 0 : m.map((a) => a[t.rowKey])) || [];
81
+ const o = ((r = e.value) == null ? void 0 : r.map((m) => m[t.rowKey])) || [];
70
82
  c.request({
71
83
  path: t.path,
72
84
  query: {
73
85
  ids: (o == null ? void 0 : o.join(",")) || ""
74
86
  }
75
- }).then((a) => {
76
- var i;
77
- r.value = !1, (i = a == null ? void 0 : a.data) == null || i.forEach((l, u) => {
78
- e.value.some((v) => v[t.rowKey] === l[t.rowKey]) ? e.value[u] = {
87
+ }).then((m) => {
88
+ var l;
89
+ i.value = !1, (l = m == null ? void 0 : m.data) == null || l.forEach((a, u) => {
90
+ e.value.some((v) => v[t.rowKey] === a[t.rowKey]) ? e.value[u] = {
79
91
  ...e.value[u],
80
- ...l
81
- } : e.value.push(l);
92
+ ...a
93
+ } : e.value.push(a);
82
94
  });
83
95
  });
84
96
  }), () => s(A, {
@@ -86,7 +98,7 @@ const et = /* @__PURE__ */ y({
86
98
  "onUpdate:value": (o) => e.value = o,
87
99
  columns: t.columns,
88
100
  onCreate: () => {
89
- p.show({
101
+ n.show({
90
102
  component: () => import("./selectModal.js"),
91
103
  componentProps: {
92
104
  path: t.path,
@@ -96,8 +108,8 @@ const et = /* @__PURE__ */ y({
96
108
  width: 1e3,
97
109
  title: f("buttons.select")
98
110
  }).then((o) => {
99
- r.value = !1, o == null || o.forEach((m) => {
100
- e.value.some((a) => a[t.rowKey] === m[t.rowKey]) || e.value.push(m);
111
+ i.value = !1, o == null || o.forEach((r) => {
112
+ e.value.some((m) => m[t.rowKey] === r[t.rowKey]) || e.value.push(r);
101
113
  });
102
114
  });
103
115
  }
@@ -105,5 +117,5 @@ const et = /* @__PURE__ */ y({
105
117
  }
106
118
  });
107
119
  export {
108
- et as DuxDynamicSelect
120
+ vt as DuxDynamicSelect
109
121
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as h, computed as C, ref as r, watch as b, createVNode as i, Fragment as x, h as w, mergeProps as z, isVNode as P } from "vue";
1
+ import { defineComponent as h, computed as C, ref as m, watch as b, createVNode as i, Fragment as x, h as w, mergeProps as z, isVNode as P } from "vue";
2
2
  import { useI18n as j, useJsonSchema as k } from "@duxweb/dvha-core";
3
- import { NButton as u, NDataTable as K } from "naive-ui";
3
+ import { NButton as p, NDataTable as K } from "naive-ui";
4
4
  import "vue-router";
5
5
  import "@overlastic/vue";
6
6
  import "clsx";
@@ -25,15 +25,27 @@ import "@vee-validate/i18n/dist/locale/zh_CN.json";
25
25
  import "vue-command-palette";
26
26
  import "@duxweb/dvha-naiveui";
27
27
  import "../../pages/page404.js";
28
+ import "@iconify-json/tabler/icons.json";
28
29
  import "mime";
30
+ import "vue3-ace-editor";
31
+ import "ace-builds/src-noconflict/mode-vue";
32
+ import "ace-builds/src-noconflict/mode-javascript";
33
+ import "ace-builds/src-noconflict/mode-html";
34
+ import "ace-builds/src-noconflict/mode-json";
35
+ import "ace-builds/src-noconflict/mode-json5";
36
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
37
+ import "ace-builds/src-noconflict/theme-tomorrow";
38
+ import "ace-builds/src-noconflict/ext-searchbox";
39
+ import "ace-builds/src-noconflict/ext-language_tools";
40
+ import "ace-builds/src-noconflict/mode-snippets";
29
41
  import "dayjs";
30
42
  import "@tanstack/vue-query";
31
43
  import { useTable as D } from "../../hooks/table.js";
32
44
  import "pinia";
33
- function p(e) {
34
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !P(e);
45
+ function u(t) {
46
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !P(t);
35
47
  }
36
- const ce = /* @__PURE__ */ h({
48
+ const bt = /* @__PURE__ */ h({
37
49
  name: "Select",
38
50
  props: {
39
51
  path: String,
@@ -48,13 +60,13 @@ const ce = /* @__PURE__ */ h({
48
60
  onConfirm: Function,
49
61
  onClose: Function
50
62
  },
51
- setup(e) {
63
+ setup(t) {
52
64
  const {
53
- t: l
65
+ t: n
54
66
  } = j(), f = C(() => [{
55
67
  type: "selection",
56
68
  fixed: "left"
57
- }, ...e.columns || []]), m = r({}), n = r({
69
+ }, ...t.columns || []]), l = m({}), a = m({
58
70
  page: 1,
59
71
  pageSize: 10
60
72
  }), {
@@ -64,72 +76,72 @@ const ce = /* @__PURE__ */ h({
64
76
  pageSizes: S,
65
77
  checkeds: v
66
78
  } = D({
67
- path: e.path || "",
79
+ path: t.path || "",
68
80
  columns: f.value || [],
69
- filters: m,
70
- pagination: n.value
71
- }), c = r([]);
72
- b(v, (t) => {
73
- var a;
74
- c.value = (a = g.value) == null ? void 0 : a.filter((o) => t.includes(o[e.rowKey]));
81
+ filters: l,
82
+ pagination: a.value
83
+ }), c = m([]);
84
+ b(v, (e) => {
85
+ var r;
86
+ c.value = (r = g.value) == null ? void 0 : r.filter((o) => e.includes(o[t.rowKey]));
75
87
  });
76
88
  const y = k({
77
- data: e.filterSchema || [],
89
+ data: t.filterSchema || [],
78
90
  context: {
79
- filter: m
91
+ filter: l
80
92
  }
81
93
  });
82
94
  return () => i(N, {
83
- title: l("components.data.selectTitle"),
95
+ title: n("components.data.selectTitle"),
84
96
  onClose: () => {
85
- var t;
86
- (t = e.onClose) == null || t.call(e);
97
+ var e;
98
+ (e = t.onClose) == null || e.call(t);
87
99
  }
88
100
  }, {
89
101
  default: () => i("div", {
90
102
  class: "flex flex-col gap-4"
91
- }, [e.filterSchema && i("div", {
103
+ }, [t.filterSchema && i("div", {
92
104
  class: "grid grid-cols-1 md:grid-cols-4 gap-2"
93
105
  }, [w(y.render)]), i(K, z({
94
106
  bordered: !1,
95
107
  maxHeight: 400,
96
- rowKey: (t) => t[e.rowKey]
108
+ rowKey: (e) => e[t.rowKey]
97
109
  }, d.value, {
98
110
  pagination: {
99
- page: n.value.page,
100
- pageSize: n.value.pageSize,
111
+ page: a.value.page,
112
+ pageSize: a.value.pageSize,
101
113
  pageCount: s.value,
102
114
  pageSizes: S,
103
- onUpdatePage: (t) => {
104
- n.value.page = t;
115
+ onUpdatePage: (e) => {
116
+ a.value.page = e;
105
117
  },
106
- onUpdatePageSize: (t) => {
107
- n.value.pageSize = t;
118
+ onUpdatePageSize: (e) => {
119
+ a.value.pageSize = e;
108
120
  }
109
121
  }
110
122
  }), null)]),
111
123
  footer: () => {
112
- let t, a;
113
- return i(x, null, [i(u, {
124
+ let e, r;
125
+ return i(x, null, [i(p, {
114
126
  onClick: () => {
115
127
  var o;
116
- (o = e.onClose) == null || o.call(e);
128
+ (o = t.onClose) == null || o.call(t);
117
129
  }
118
- }, p(t = l("components.button.cancel")) ? t : {
119
- default: () => [t]
120
- }), i(u, {
130
+ }, u(e = n("components.button.cancel")) ? e : {
131
+ default: () => [e]
132
+ }), i(p, {
121
133
  type: "primary",
122
134
  onClick: () => {
123
135
  var o;
124
- (o = e.onConfirm) == null || o.call(e, c.value);
136
+ (o = t.onConfirm) == null || o.call(t, c.value);
125
137
  }
126
- }, p(a = l("components.button.select")) ? a : {
127
- default: () => [a]
138
+ }, u(r = n("components.button.select")) ? r : {
139
+ default: () => [r]
128
140
  })]);
129
141
  }
130
142
  });
131
143
  }
132
144
  });
133
145
  export {
134
- ce as default
146
+ bt as default
135
147
  };
@@ -1,11 +1,12 @@
1
- import { defineComponent as u, defineAsyncComponent as r, createVNode as t, Suspense as d } from "vue";
1
+ import { defineComponent as u, defineAsyncComponent as c, createVNode as t, Suspense as d } from "vue";
2
2
  import { useExtendOverlay as f } from "@overlastic/vue";
3
- import { NDrawer as s, NButton as m, NSpin as b } from "naive-ui";
3
+ import { NDrawer as r, NSpin as s } from "naive-ui";
4
4
  const w = /* @__PURE__ */ u({
5
5
  name: "DuxDrawer",
6
6
  props: {
7
7
  title: String,
8
8
  width: [Number, String],
9
+ maxWidth: [Number],
9
10
  placement: {
10
11
  type: String,
11
12
  default: "right"
@@ -20,17 +21,18 @@ const w = /* @__PURE__ */ u({
20
21
  const {
21
22
  visible: i,
22
23
  resolve: a,
23
- reject: n,
24
+ reject: l,
24
25
  vanish: o
25
26
  } = f({
26
27
  duration: 1e3
27
- }), l = (e == null ? void 0 : e.componentProps) || {};
28
- l.onConfirm = a, l.onClose = n;
29
- const c = typeof e.component == "function" ? r(e.component) : e.component;
30
- return () => t(s, {
28
+ }), n = (e == null ? void 0 : e.componentProps) || {};
29
+ n.title = e.title, n.onConfirm = a, n.onClose = l;
30
+ const m = typeof e.component == "function" ? c(e.component) : e.component;
31
+ return () => t(r, {
31
32
  closeOnEsc: !1,
32
33
  maskClosable: !1,
33
- minWidth: 400,
34
+ minWidth: 200,
35
+ maxWidth: (e == null ? void 0 : e.maxWidth) || 800,
34
36
  defaultWidth: (e == null ? void 0 : e.width) || 400,
35
37
  resizable: !0,
36
38
  placement: e.placement,
@@ -40,28 +42,15 @@ const w = /* @__PURE__ */ u({
40
42
  o();
41
43
  },
42
44
  onEsc: () => {
43
- n();
44
- }
45
+ l();
46
+ },
47
+ autoFocus: !1
45
48
  }, {
46
49
  default: () => [t("div", {
47
- class: "h-full flex flex-col"
48
- }, [t("div", {
49
- class: "flex justify-between items-center px-4 py-3 border-b border-default"
50
- }, [t("div", {
51
- class: "text-base"
52
- }, [e == null ? void 0 : e.title]), t("div", null, [t(m, {
53
- quaternary: !0,
54
- size: "small",
55
- color: "default",
56
- class: "!px-1 h-6",
57
- onClick: () => n()
58
- }, {
59
- default: () => [t("div", {
60
- class: "i-tabler:x w-5 h-5"
61
- }, null)]
62
- })])]), t(d, null, {
63
- default: () => t(c, l, null),
64
- fallback: () => t(b, {
50
+ class: "h-full"
51
+ }, [t(d, null, {
52
+ default: () => t(m, n, null),
53
+ fallback: () => t(s, {
65
54
  show: !0
66
55
  }, {
67
56
  default: () => [t("div", {
@@ -1,28 +1,65 @@
1
- import { defineComponent as f, createVNode as r } from "vue";
2
- import { NScrollbar as p } from "naive-ui";
3
- const c = /* @__PURE__ */ f({
1
+ import { defineComponent as t, ref as u, watch as d, nextTick as m, createVNode as a } from "vue";
2
+ import { NButton as o, NScrollbar as x } from "naive-ui";
3
+ const h = /* @__PURE__ */ t({
4
4
  name: "DuxDrawerPage",
5
- props: {},
6
- setup(d, {
5
+ props: {
6
+ title: String,
7
+ onClose: Function,
8
+ onConfirm: Function,
9
+ scrollbar: {
10
+ type: Boolean,
11
+ default: !0
12
+ }
13
+ },
14
+ setup(n, {
7
15
  slots: e
8
16
  }) {
9
- return () => {
10
- var a;
11
- return r("div", {
12
- class: "flex-1 min-h-1 flex flex-col"
13
- }, [r("div", {
17
+ const c = u();
18
+ return d(c, (r) => {
19
+ r && m(() => {
20
+ var i, f;
21
+ (f = (i = r.$el) == null ? void 0 : i.focus) == null || f.call(i);
22
+ });
23
+ }), () => {
24
+ var r, i, f;
25
+ return a("div", {
26
+ class: "h-full flex flex-col"
27
+ }, [a("div", {
28
+ class: "flex justify-between items-center p-2 border-b border-default"
29
+ }, [a("div", {
30
+ class: "text-base"
31
+ }, [n == null ? void 0 : n.title]), a("div", {
32
+ class: "flex items-center gap-2"
33
+ }, [(r = e.header) == null ? void 0 : r.call(e), a(o, {
34
+ quaternary: !0,
35
+ ref: c,
36
+ size: "small",
37
+ color: "default",
38
+ class: "!px-1 h-6",
39
+ onClick: () => {
40
+ var l;
41
+ return (l = n.onClose) == null ? void 0 : l.call(n);
42
+ }
43
+ }, {
44
+ default: () => [a("div", {
45
+ class: "i-tabler:x w-5 h-5"
46
+ }, null)]
47
+ })])]), a("div", {
14
48
  class: "flex-1 min-h-1"
15
- }, [r(p, null, {
49
+ }, [n.scrollbar ? a(x, null, {
16
50
  default: () => {
17
- var n;
18
- return [(n = e.default) == null ? void 0 : n.call(e)];
51
+ var l;
52
+ return [(l = e.default) == null ? void 0 : l.call(e)];
19
53
  }
20
- })]), r("div", {
21
- class: "flex-none border-t border-gray-3 p-4 flex justify-end gap-2"
22
- }, [(a = e.action) == null ? void 0 : a.call(e)])]);
54
+ }) : (i = e.default) == null ? void 0 : i.call(e)]), e.actions && a("div", {
55
+ class: "flex-none border-t border-muted p-4 flex justify-end gap-2"
56
+ }, [(f = e.actions) == null ? void 0 : f.call(e, {
57
+ onClose: n.onClose,
58
+ onConfirm: n.onConfirm
59
+ })])]);
23
60
  };
24
61
  }
25
62
  });
26
63
  export {
27
- c as DuxDrawerPage
64
+ h as DuxDrawerPage
28
65
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as x, toRef as b, computed as r, watch as g, inject as h, createVNode as l, createTextVNode as y } from "vue";
1
+ import { defineComponent as x, toRef as b, computed as r, watch as h, inject as y, createVNode as l, createTextVNode as p } from "vue";
2
2
  import { watchThrottled as j } from "@vueuse/core";
3
- import { useField as S } from "vee-validate";
4
- const p = /* @__PURE__ */ x({
3
+ import { useField as w } from "vee-validate";
4
+ const q = /* @__PURE__ */ x({
5
5
  name: "DuxFormItem",
6
6
  props: {
7
7
  label: String,
@@ -24,10 +24,10 @@ const p = /* @__PURE__ */ x({
24
24
  value: m,
25
25
  setErrors: f,
26
26
  validate: s
27
- } = S(e.path || "", e.rule || {}, {
27
+ } = w(e.path || "", e.rule || {}, {
28
28
  label: e.label
29
29
  }), o = r(() => e.rule ? typeof e.rule == "string" ? e.rule.includes("required") : typeof e.rule == "object" ? "required" in e.rule : !1 : !1), n = r(() => d.value && (c.value || d.value));
30
- g(n, (t) => {
30
+ h(n, (t) => {
31
31
  t && f(t);
32
32
  }, {
33
33
  immediate: !0
@@ -37,20 +37,20 @@ const p = /* @__PURE__ */ x({
37
37
  throttle: 300,
38
38
  deep: !0
39
39
  });
40
- const u = h("dux.form", {
40
+ const u = y("dux.form", {
41
41
  labelPlacement: "left",
42
42
  labelWidth: 70,
43
43
  divider: !1
44
44
  }), a = r(() => e.labelPlacement || u.labelPlacement), v = r(() => {
45
45
  let t = e.labelWidth || u.labelWidth || 70;
46
- return typeof t == "number" && (t = `${t}px`), a.value === "top" || a.value === "setting" ? "auto" : t;
47
- });
46
+ return typeof t == "number" && (t = `${t}px`), a.value !== "left" ? "auto" : t;
47
+ }), g = r(() => u.divider || a.value === "page");
48
48
  return () => {
49
49
  var t;
50
50
  return l("div", {
51
- class: ["flex flex-col ", a.value !== "top" ? "md:flex-row gap-2" : "gap-1", u.divider && "pb-4", a.value === "setting" ? "md:justify-between md:items-start md:gap-4" : ""]
51
+ class: [a.value !== "top" ? "md:flex-row gap-2" : "gap-1", g.value ? "py-6" : "", a.value === "setting" ? "md:justify-between md:items-start md:gap-4" : "", a.value === "page" ? "grid grid-cols-1 lg:grid-cols-4 px-4" : "flex flex-col lg:items-center"]
52
52
  }, [l("div", {
53
- class: [a.value !== "top" && a.value !== "setting" ? "mt-1.5" : ""],
53
+ class: [a.value === "left" ? "flex lg:items-center" : ""],
54
54
  style: {
55
55
  width: v.value
56
56
  }
@@ -60,10 +60,10 @@ const p = /* @__PURE__ */ x({
60
60
  class: "relative flex items-center gap-1"
61
61
  }, [e.label, o.value && l("span", {
62
62
  class: "text-error font-mono text-xs"
63
- }, [y("*")])])]), e.description && typeof e.description == "string" && l("div", {
63
+ }, [p("*")])])]), e.description && typeof e.description == "string" && l("div", {
64
64
  class: "text-sm text-muted"
65
65
  }, [e.description])])]), l("div", {
66
- class: ["flex flex-col gap-1", a.value !== "left" ? "md:mt-1" : "", a.value === "setting" ? "flex-none" : "flex-1"]
66
+ class: ["flex flex-col gap-1", a.value !== "left" ? "md:mt-1" : "", a.value === "setting" ? "flex-none min-w-200px" : "flex-1", a.value === "page" ? "col-span-3" : ""]
67
67
  }, [l("div", null, [(t = i == null ? void 0 : i.default) == null ? void 0 : t.call(i)]), e.description && typeof e.description != "string" && l("div", {
68
68
  class: "text-sm text-muted"
69
69
  }, [e.description]), n.value && l("div", {
@@ -73,5 +73,5 @@ const p = /* @__PURE__ */ x({
73
73
  }
74
74
  });
75
75
  export {
76
- p as DuxFormItem
76
+ q as DuxFormItem
77
77
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as a, provide as l, createVNode as t } from "vue";
2
- const r = /* @__PURE__ */ a({
1
+ import { defineComponent as d, provide as i, createVNode as t } from "vue";
2
+ const m = /* @__PURE__ */ d({
3
3
  name: "DuxFormLayout",
4
4
  props: {
5
5
  labelPlacement: {
@@ -19,20 +19,20 @@ const r = /* @__PURE__ */ a({
19
19
  }
20
20
  },
21
21
  setup(e, {
22
- slots: d
22
+ slots: a
23
23
  }) {
24
- return l("dux.form", {
24
+ return i("dux.form", {
25
25
  labelPlacement: e.labelPlacement,
26
26
  labelWidth: e.labelWidth,
27
27
  divider: e.divider
28
28
  }), () => {
29
- var i;
29
+ var l;
30
30
  return t("div", {
31
- class: ["flex gap-4", e.divider && "divide-y divide-muted", e.inline ? "flex-row" : "flex-col"]
32
- }, [(i = d == null ? void 0 : d.default) == null ? void 0 : i.call(d)]);
31
+ 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"]
32
+ }, [(l = a == null ? void 0 : a.default) == null ? void 0 : l.call(a)]);
33
33
  };
34
34
  }
35
35
  });
36
36
  export {
37
- r as DuxFormLayout
37
+ m as DuxFormLayout
38
38
  };