@duxweb/dvha-pro 1.0.18 → 1.0.20

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 (147) 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 -1
  16. package/dist/cjs/components/layout/filter.cjs +1 -1
  17. package/dist/cjs/components/layout/filterLayout.cjs +1 -0
  18. package/dist/cjs/components/layout/list.cjs +1 -1
  19. package/dist/cjs/components/layout/table.cjs +1 -1
  20. package/dist/cjs/components/level/level.cjs +1 -1
  21. package/dist/cjs/components/modal/modal.cjs +1 -1
  22. package/dist/cjs/components/modal/modalPage.cjs +1 -1
  23. package/dist/cjs/components/panel/collapse.cjs +1 -0
  24. package/dist/cjs/components/panel/setting.cjs +1 -1
  25. package/dist/cjs/components/status/listEmpty.cjs +1 -0
  26. package/dist/cjs/components/table/table.cjs +1 -0
  27. package/dist/cjs/components/table/tablePage.cjs +1 -1
  28. package/dist/cjs/components/tree/treeFilter.cjs +1 -1
  29. package/dist/cjs/components/upload/config.cjs +1 -0
  30. package/dist/cjs/components/upload/file.cjs +1 -1
  31. package/dist/cjs/components/upload/image.cjs +1 -1
  32. package/dist/cjs/components/upload/manage/item.cjs +1 -1
  33. package/dist/cjs/components/upload/manager.cjs +1 -1
  34. package/dist/cjs/dvha-pro.css +1 -1
  35. package/dist/cjs/hooks/action.cjs +1 -1
  36. package/dist/cjs/hooks/dialog.cjs +1 -1
  37. package/dist/cjs/hooks/drawer.cjs +1 -1
  38. package/dist/cjs/hooks/modal.cjs +1 -1
  39. package/dist/cjs/hooks/table/image.cjs +1 -1
  40. package/dist/cjs/hooks/table/media.cjs +1 -1
  41. package/dist/cjs/hooks/table.cjs +1 -1
  42. package/dist/cjs/index.cjs +1 -1
  43. package/dist/cjs/langs/en-US.json.cjs +1 -1
  44. package/dist/cjs/langs/zh-CN.json.cjs +1 -1
  45. package/dist/cjs/pages/authLayout.cjs +1 -1
  46. package/dist/cjs/pages/layout/page.cjs +1 -1
  47. package/dist/cjs/pages/login.cjs +1 -1
  48. package/dist/cjs/pages/menu/avatar.cjs +1 -1
  49. package/dist/cjs/pages/menu/button.cjs +1 -1
  50. package/dist/cjs/pages/menu/cmd.cjs +1 -1
  51. package/dist/cjs/pages/menu/main.cjs +1 -1
  52. package/dist/cjs/pages/menu/mobile.cjs +1 -1
  53. package/dist/cjs/pages/page.cjs +1 -1
  54. package/dist/cjs/pages/page404.cjs +1 -1
  55. package/dist/cjs/pages/pageStatus.cjs +1 -1
  56. package/dist/cjs/theme/naiveTheme.cjs +1 -1
  57. package/dist/cjs/theme/uno.css.cjs +23 -7
  58. package/dist/esm/component.js +36 -34
  59. package/dist/esm/components/card/card.js +6 -6
  60. package/dist/esm/components/chart/echart.js +17 -6
  61. package/dist/esm/components/code/code.js +53 -0
  62. package/dist/esm/components/crop/imageCrop.js +37 -26
  63. package/dist/esm/components/data/dynamicSelect.js +29 -18
  64. package/dist/esm/components/data/selectModal.js +49 -38
  65. package/dist/esm/components/drawer/drawer.js +17 -28
  66. package/dist/esm/components/drawer/drawerPage.js +54 -17
  67. package/dist/esm/components/form/formItem.js +17 -17
  68. package/dist/esm/components/form/formLayout.js +8 -8
  69. package/dist/esm/components/form/modalForm.js +44 -35
  70. package/dist/esm/components/form/pageForm.js +81 -43
  71. package/dist/esm/components/form/settingForm.js +28 -17
  72. package/dist/esm/components/icon/icon.js +23 -12
  73. package/dist/esm/components/layout/filter.js +15 -11
  74. package/dist/esm/components/layout/filterLayout.js +34 -0
  75. package/dist/esm/components/layout/list.js +211 -161
  76. package/dist/esm/components/layout/table.js +217 -186
  77. package/dist/esm/components/level/level.js +28 -17
  78. package/dist/esm/components/modal/modal.js +9 -9
  79. package/dist/esm/components/modal/modalPage.js +2 -2
  80. package/dist/esm/components/panel/collapse.js +49 -0
  81. package/dist/esm/components/panel/setting.js +3 -3
  82. package/dist/esm/components/status/listEmpty.js +26 -0
  83. package/dist/esm/components/table/table.js +110 -0
  84. package/dist/esm/components/table/tablePage.js +24 -18
  85. package/dist/esm/components/tree/treeFilter.js +44 -39
  86. package/dist/esm/components/upload/config.js +32 -0
  87. package/dist/esm/components/upload/file.js +142 -116
  88. package/dist/esm/components/upload/image.js +95 -66
  89. package/dist/esm/components/upload/manage/item.js +17 -6
  90. package/dist/esm/components/upload/manager.js +202 -164
  91. package/dist/esm/dvha-pro.css +1 -1
  92. package/dist/esm/hooks/action.js +77 -75
  93. package/dist/esm/hooks/dialog.js +13 -2
  94. package/dist/esm/hooks/drawer.js +13 -2
  95. package/dist/esm/hooks/modal.js +13 -2
  96. package/dist/esm/hooks/table/image.js +21 -10
  97. package/dist/esm/hooks/table/media.js +20 -9
  98. package/dist/esm/hooks/table.js +16 -16
  99. package/dist/esm/index.js +174 -164
  100. package/dist/esm/langs/en-US.json.js +5 -3
  101. package/dist/esm/langs/zh-CN.json.js +5 -3
  102. package/dist/esm/pages/authLayout.js +19 -8
  103. package/dist/esm/pages/layout/page.js +17 -6
  104. package/dist/esm/pages/login.js +40 -29
  105. package/dist/esm/pages/menu/avatar.js +97 -86
  106. package/dist/esm/pages/menu/button.js +23 -12
  107. package/dist/esm/pages/menu/cmd.js +45 -34
  108. package/dist/esm/pages/menu/main.js +40 -27
  109. package/dist/esm/pages/menu/mobile.js +13 -2
  110. package/dist/esm/pages/page.js +1 -1
  111. package/dist/esm/pages/page404.js +20 -9
  112. package/dist/esm/pages/pageStatus.js +31 -15
  113. package/dist/esm/theme/naiveTheme.js +6 -6
  114. package/dist/esm/theme/uno.css.js +23 -7
  115. package/dist/types/components/code/code.d.ts +44 -0
  116. package/dist/types/components/code/index.d.ts +1 -0
  117. package/dist/types/components/drawer/drawer.d.ts +2 -0
  118. package/dist/types/components/drawer/drawerPage.d.ts +20 -1
  119. package/dist/types/components/form/formItem.d.ts +2 -2
  120. package/dist/types/components/form/formLayout.d.ts +3 -3
  121. package/dist/types/components/form/modalForm.d.ts +3 -3
  122. package/dist/types/components/form/pageForm.d.ts +12 -0
  123. package/dist/types/components/index.d.ts +1 -0
  124. package/dist/types/components/layout/filterLayout.d.ts +32 -0
  125. package/dist/types/components/layout/index.d.ts +1 -0
  126. package/dist/types/components/layout/list.d.ts +7 -1
  127. package/dist/types/components/layout/table.d.ts +10 -1
  128. package/dist/types/components/list/card.d.ts +6 -0
  129. package/dist/types/components/list/list.d.ts +6 -0
  130. package/dist/types/components/panel/collapse.d.ts +14 -0
  131. package/dist/types/components/panel/index.d.ts +1 -0
  132. package/dist/types/components/select/cardSelect.d.ts +1 -1
  133. package/dist/types/components/status/index.d.ts +1 -0
  134. package/dist/types/components/status/listEmpty.d.ts +11 -0
  135. package/dist/types/components/table/index.d.ts +1 -0
  136. package/dist/types/components/table/table.d.ts +6552 -0
  137. package/dist/types/components/table/tablePage.d.ts +9 -0
  138. package/dist/types/components/tree/treeFilter.d.ts +13 -12
  139. package/dist/types/components/upload/config.d.ts +13 -0
  140. package/dist/types/components/upload/file.d.ts +4 -0
  141. package/dist/types/components/upload/image.d.ts +30 -2
  142. package/dist/types/components/upload/manager.d.ts +4 -0
  143. package/dist/types/hooks/drawer.d.ts +1 -0
  144. package/dist/types/hooks/table/types.d.ts +1 -0
  145. package/dist/types/main.d.ts +6 -0
  146. package/dist/types/pages/pageStatus.d.ts +11 -1
  147. package/package.json +7 -5
@@ -27,11 +27,22 @@ import "../../pages/page404.js";
27
27
  import "@iconify-json/tabler/icons.json";
28
28
  import "mime";
29
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";
30
41
  import { useModal as C } from "../../hooks/modal.js";
31
42
  import "dayjs";
32
43
  import "@tanstack/vue-query";
33
44
  import "pinia";
34
- const ot = /* @__PURE__ */ y({
45
+ const vt = /* @__PURE__ */ y({
35
46
  name: "DuxDynamicSelect",
36
47
  props: {
37
48
  rowKey: {
@@ -54,32 +65,32 @@ const ot = /* @__PURE__ */ y({
54
65
  }
55
66
  },
56
67
  setup(t, {
57
- emit: n
68
+ emit: p
58
69
  }) {
59
- const e = K(t, "value", n, {
70
+ const e = K(t, "value", p, {
60
71
  passive: !0,
61
72
  defaultValue: t.defaultValue,
62
73
  deep: !0
63
- }), p = C(), c = D(), {
74
+ }), n = C(), c = D(), {
64
75
  t: f
65
- } = S(), r = h(!0);
66
- return d([e, r], () => {
67
- var m;
68
- 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)
69
80
  return;
70
- 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])) || [];
71
82
  c.request({
72
83
  path: t.path,
73
84
  query: {
74
85
  ids: (o == null ? void 0 : o.join(",")) || ""
75
86
  }
76
- }).then((a) => {
87
+ }).then((m) => {
77
88
  var l;
78
- r.value = !1, (l = a == null ? void 0 : a.data) == null || l.forEach((i, u) => {
79
- e.value.some((v) => v[t.rowKey] === i[t.rowKey]) ? e.value[u] = {
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] = {
80
91
  ...e.value[u],
81
- ...i
82
- } : e.value.push(i);
92
+ ...a
93
+ } : e.value.push(a);
83
94
  });
84
95
  });
85
96
  }), () => s(A, {
@@ -87,7 +98,7 @@ const ot = /* @__PURE__ */ y({
87
98
  "onUpdate:value": (o) => e.value = o,
88
99
  columns: t.columns,
89
100
  onCreate: () => {
90
- p.show({
101
+ n.show({
91
102
  component: () => import("./selectModal.js"),
92
103
  componentProps: {
93
104
  path: t.path,
@@ -97,8 +108,8 @@ const ot = /* @__PURE__ */ y({
97
108
  width: 1e3,
98
109
  title: f("buttons.select")
99
110
  }).then((o) => {
100
- r.value = !1, o == null || o.forEach((m) => {
101
- 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);
102
113
  });
103
114
  });
104
115
  }
@@ -106,5 +117,5 @@ const ot = /* @__PURE__ */ y({
106
117
  }
107
118
  });
108
119
  export {
109
- ot as DuxDynamicSelect
120
+ vt as DuxDynamicSelect
110
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";
@@ -27,14 +27,25 @@ import "@duxweb/dvha-naiveui";
27
27
  import "../../pages/page404.js";
28
28
  import "@iconify-json/tabler/icons.json";
29
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";
30
41
  import "dayjs";
31
42
  import "@tanstack/vue-query";
32
43
  import { useTable as D } from "../../hooks/table.js";
33
44
  import "pinia";
34
- function p(e) {
35
- 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);
36
47
  }
37
- const ue = /* @__PURE__ */ h({
48
+ const bt = /* @__PURE__ */ h({
38
49
  name: "Select",
39
50
  props: {
40
51
  path: String,
@@ -49,13 +60,13 @@ const ue = /* @__PURE__ */ h({
49
60
  onConfirm: Function,
50
61
  onClose: Function
51
62
  },
52
- setup(e) {
63
+ setup(t) {
53
64
  const {
54
- t: l
65
+ t: n
55
66
  } = j(), f = C(() => [{
56
67
  type: "selection",
57
68
  fixed: "left"
58
- }, ...e.columns || []]), m = r({}), n = r({
69
+ }, ...t.columns || []]), l = m({}), a = m({
59
70
  page: 1,
60
71
  pageSize: 10
61
72
  }), {
@@ -65,72 +76,72 @@ const ue = /* @__PURE__ */ h({
65
76
  pageSizes: S,
66
77
  checkeds: v
67
78
  } = D({
68
- path: e.path || "",
79
+ path: t.path || "",
69
80
  columns: f.value || [],
70
- filters: m,
71
- pagination: n.value
72
- }), c = r([]);
73
- b(v, (t) => {
74
- var a;
75
- 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]));
76
87
  });
77
88
  const y = k({
78
- data: e.filterSchema || [],
89
+ data: t.filterSchema || [],
79
90
  context: {
80
- filter: m
91
+ filter: l
81
92
  }
82
93
  });
83
94
  return () => i(N, {
84
- title: l("components.data.selectTitle"),
95
+ title: n("components.data.selectTitle"),
85
96
  onClose: () => {
86
- var t;
87
- (t = e.onClose) == null || t.call(e);
97
+ var e;
98
+ (e = t.onClose) == null || e.call(t);
88
99
  }
89
100
  }, {
90
101
  default: () => i("div", {
91
102
  class: "flex flex-col gap-4"
92
- }, [e.filterSchema && i("div", {
103
+ }, [t.filterSchema && i("div", {
93
104
  class: "grid grid-cols-1 md:grid-cols-4 gap-2"
94
105
  }, [w(y.render)]), i(K, z({
95
106
  bordered: !1,
96
107
  maxHeight: 400,
97
- rowKey: (t) => t[e.rowKey]
108
+ rowKey: (e) => e[t.rowKey]
98
109
  }, d.value, {
99
110
  pagination: {
100
- page: n.value.page,
101
- pageSize: n.value.pageSize,
111
+ page: a.value.page,
112
+ pageSize: a.value.pageSize,
102
113
  pageCount: s.value,
103
114
  pageSizes: S,
104
- onUpdatePage: (t) => {
105
- n.value.page = t;
115
+ onUpdatePage: (e) => {
116
+ a.value.page = e;
106
117
  },
107
- onUpdatePageSize: (t) => {
108
- n.value.pageSize = t;
118
+ onUpdatePageSize: (e) => {
119
+ a.value.pageSize = e;
109
120
  }
110
121
  }
111
122
  }), null)]),
112
123
  footer: () => {
113
- let t, a;
114
- return i(x, null, [i(u, {
124
+ let e, r;
125
+ return i(x, null, [i(p, {
115
126
  onClick: () => {
116
127
  var o;
117
- (o = e.onClose) == null || o.call(e);
128
+ (o = t.onClose) == null || o.call(t);
118
129
  }
119
- }, p(t = l("components.button.cancel")) ? t : {
120
- default: () => [t]
121
- }), i(u, {
130
+ }, u(e = n("components.button.cancel")) ? e : {
131
+ default: () => [e]
132
+ }), i(p, {
122
133
  type: "primary",
123
134
  onClick: () => {
124
135
  var o;
125
- (o = e.onConfirm) == null || o.call(e, c.value);
136
+ (o = t.onConfirm) == null || o.call(t, c.value);
126
137
  }
127
- }, p(a = l("components.button.select")) ? a : {
128
- default: () => [a]
138
+ }, u(r = n("components.button.select")) ? r : {
139
+ default: () => [r]
129
140
  })]);
130
141
  }
131
142
  });
132
143
  }
133
144
  });
134
145
  export {
135
- ue as default
146
+ bt as default
136
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 g, computed as r, watch as b, 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,
@@ -17,17 +17,17 @@ const p = /* @__PURE__ */ x({
17
17
  message: [String, Object]
18
18
  },
19
19
  setup(e, {
20
- slots: a
20
+ slots: i
21
21
  }) {
22
- const c = g(e.message), {
22
+ const c = b(e.message), {
23
23
  errorMessage: d,
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
- b(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
- }), i = r(() => e.labelPlacement || u.labelPlacement), v = r(() => {
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`), i.value === "top" || i.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 lg:items-center", i.value !== "top" ? "md:flex-row gap-2" : "gap-1", u.divider && "pb-4", i.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: [i.value !== "top" && i.value !== "setting" ? "flex lg:items-center" : ""],
53
+ class: [a.value === "left" ? "flex lg:items-center" : ""],
54
54
  style: {
55
55
  width: v.value
56
56
  }
@@ -60,11 +60,11 @@ 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", i.value !== "left" ? "md:mt-1" : "", i.value === "setting" ? "flex-none" : "flex-1"]
67
- }, [l("div", null, [(t = a == null ? void 0 : a.default) == null ? void 0 : t.call(a)]), e.description && typeof e.description != "string" && l("div", {
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
+ }, [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", {
70
70
  class: "text-error"
@@ -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
  };