@done-coding/admin-core 0.17.0 → 0.17.1-alpha.0

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 (53) hide show
  1. package/es/components/app-layout/AppBody.vue.mjs +2 -2
  2. package/es/components/app-layout/AppBody.vue2.mjs +53 -54
  3. package/es/components/app-layout/keep-alive.mjs +22 -0
  4. package/es/components/data-view/DataListView.vue.mjs +2 -2
  5. package/es/components/data-view/DataListView.vue2.mjs +55 -53
  6. package/es/components/display/ActionConfirm.vue.mjs +2 -2
  7. package/es/components/display/ActionConfirm.vue2.mjs +1 -1
  8. package/es/components/display/TabsRefineFlow.vue.mjs +34 -32
  9. package/es/components/list-page/ListPage.vue.mjs +2 -2
  10. package/es/components/list-page/ListPage.vue2.mjs +74 -75
  11. package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
  12. package/es/components/misc/AutoRefreshGroup.vue2.mjs +42 -35
  13. package/es/components/modal/{ConfirmModal.vue.mjs → ModalConfirm.vue.mjs} +3 -3
  14. package/es/components/modal/{ConfirmModal.vue2.mjs → ModalConfirm.vue2.mjs} +34 -34
  15. package/es/components/modal/ModalDetail.vue.mjs +63 -0
  16. package/es/components/modal/ModalDetail.vue2.mjs +4 -0
  17. package/es/components/modal/ModalForm.vue.mjs +75 -0
  18. package/es/components/modal/ModalForm.vue2.mjs +4 -0
  19. package/es/components/panel/PanelItem.vue.mjs +5 -81
  20. package/es/components/panel/PanelItem.vue2.mjs +93 -2
  21. package/es/components/panel/PanelMain.vue2.mjs +14 -14
  22. package/es/components/table/TableMain.vue.mjs +2 -2
  23. package/es/components/table/TableMain.vue2.mjs +210 -174
  24. package/es/components/table/TableSkeleton.vue.mjs +7 -0
  25. package/es/components/table/TableSkeleton.vue2.mjs +89 -0
  26. package/es/components/table/TableToolbar.vue.mjs +2 -2
  27. package/es/components/table/TableToolbar.vue2.mjs +22 -21
  28. package/es/components/table/use-fill-height.mjs +14 -0
  29. package/es/components/table/use-table-skeleton.mjs +19 -0
  30. package/es/index.mjs +230 -223
  31. package/es/router/group-redirect.mjs +20 -0
  32. package/es/style.css +1 -1
  33. package/package.json +2 -2
  34. package/types/components/app-layout/keep-alive.d.ts +14 -0
  35. package/types/components/data-view/types.d.ts +1 -0
  36. package/types/components/misc/AutoRefreshGroup.vue.d.ts +2 -1
  37. package/types/components/misc/types.d.ts +1 -0
  38. package/types/components/modal/{ConfirmModal.vue.d.ts → ModalConfirm.vue.d.ts} +1 -1
  39. package/types/components/modal/{DetailModal.vue.d.ts → ModalDetail.vue.d.ts} +2 -2
  40. package/types/components/modal/ModalForm.vue.d.ts +24 -0
  41. package/types/components/modal/index.d.ts +4 -3
  42. package/types/components/modal/types.d.ts +26 -2
  43. package/types/components/panel/PanelItem.vue.d.ts +1 -1
  44. package/types/components/panel/types.d.ts +4 -1
  45. package/types/components/table/TableSkeleton.vue.d.ts +7 -0
  46. package/types/components/table/types.d.ts +10 -0
  47. package/types/components/table/use-fill-height.d.ts +11 -0
  48. package/types/components/table/use-table-skeleton.d.ts +17 -0
  49. package/types/injectInfo.json.d.ts +1 -1
  50. package/types/router/group-redirect.d.ts +5 -0
  51. package/types/router/index.d.ts +1 -0
  52. package/es/components/modal/DetailModal.vue.mjs +0 -74
  53. package/es/components/modal/DetailModal.vue2.mjs +0 -4
@@ -1,4 +1,4 @@
1
- import { defineComponent as L, useModel as x, computed as w, ref as $, withDirectives as D, openBlock as p, createElementBlock as P, createElementVNode as C, createBlock as y, unref as a, withCtx as i, createVNode as n, createTextVNode as c, createCommentVNode as A, vShow as z, mergeModels as N } from "vue";
1
+ import { defineComponent as L, useModel as x, computed as w, ref as $, withDirectives as D, openBlock as p, createElementBlock as P, createElementVNode as C, createBlock as y, unref as a, withCtx as i, createVNode as r, createTextVNode as c, createCommentVNode as A, vShow as N, mergeModels as z } from "vue";
2
2
  import { ElDropdown as U, ElButton as G, ElIcon as X, ElDropdownMenu as q, ElDropdownItem as v, ElSwitch as O, ElMessageBox as j, ElMessage as H } from "element-plus";
3
3
  import { ArrowDown as J, Calendar as K, Grid as Q } from "@element-plus/icons-vue";
4
4
  import V from "./ToolbarButtons.vue.mjs";
@@ -7,7 +7,7 @@ import { countAll as Y, fetchListAll as M } from "../../helpers/list-helper.mjs"
7
7
  import { EXPORT_MAX_LIMIT as d, exportCSV as Z } from "../../utils/export.mjs";
8
8
  const _ = { class: "table-toolbar" }, ee = { class: "table-toolbar-left" }, te = { class: "table-toolbar-right" }, ue = /* @__PURE__ */ L({
9
9
  __name: "TableToolbar",
10
- props: /* @__PURE__ */ N({
10
+ props: /* @__PURE__ */ z({
11
11
  exportByFe: { type: Boolean, default: !0 },
12
12
  exportFn: {},
13
13
  exportColumns: {},
@@ -56,14 +56,14 @@ const _ = { class: "table-toolbar" }, ee = { class: "table-toolbar-left" }, te =
56
56
  ].filter(Boolean).length;
57
57
  }
58
58
  ), f = $(!1), k = async (l) => {
59
- const { selectedList: e, currentPageList: r, api: m, query: h } = t.exportContext, T = t.exportColumns;
59
+ const { selectedList: e, currentPageList: n, api: m, query: h } = t.exportContext, T = t.exportColumns;
60
60
  let u;
61
61
  switch (l) {
62
62
  case "selected":
63
63
  u = e;
64
64
  break;
65
65
  case "current":
66
- u = r;
66
+ u = n;
67
67
  break;
68
68
  case "all":
69
69
  try {
@@ -98,10 +98,10 @@ const _ = { class: "table-toolbar" }, ee = { class: "table-toolbar-left" }, te =
98
98
  const F = `${document.title}-${Date.now()}`;
99
99
  Z({ columns: T, list: u, filename: F });
100
100
  }, I = (l) => {
101
- var r;
101
+ var n;
102
102
  if (f.value) return;
103
103
  f.value = !0;
104
- const e = t.exportByFe ? k(l) : (r = t.exportFn) == null ? void 0 : r.call(t, l);
104
+ const e = t.exportByFe ? k(l) : (n = t.exportFn) == null ? void 0 : n.call(t, l);
105
105
  Promise.resolve(e).catch(() => {
106
106
  }).finally(() => {
107
107
  f.value = !1;
@@ -115,9 +115,9 @@ const _ = { class: "table-toolbar" }, ee = { class: "table-toolbar-left" }, te =
115
115
  onCommand: I
116
116
  }, {
117
117
  dropdown: i(() => [
118
- n(a(q), null, {
118
+ r(a(q), null, {
119
119
  default: i(() => [
120
- n(a(v), {
120
+ r(a(v), {
121
121
  disabled: o.exportContext.hasSelection && !o.exportContext.selectedList.length,
122
122
  command: "selected"
123
123
  }, {
@@ -126,13 +126,13 @@ const _ = { class: "table-toolbar" }, ee = { class: "table-toolbar-left" }, te =
126
126
  ])]),
127
127
  _: 1
128
128
  }, 8, ["disabled"]),
129
- n(a(v), { command: "current" }, {
129
+ r(a(v), { command: "current" }, {
130
130
  default: i(() => [...e[5] || (e[5] = [
131
131
  c("导出本页", -1)
132
132
  ])]),
133
133
  _: 1
134
134
  }),
135
- n(a(v), { command: "all" }, {
135
+ r(a(v), { command: "all" }, {
136
136
  default: i(() => [...e[6] || (e[6] = [
137
137
  c("导出全部", -1)
138
138
  ])]),
@@ -143,16 +143,16 @@ const _ = { class: "table-toolbar" }, ee = { class: "table-toolbar-left" }, te =
143
143
  })
144
144
  ]),
145
145
  default: i(() => [
146
- n(a(G), {
146
+ r(a(G), {
147
147
  size: "small",
148
148
  type: "primary",
149
149
  loading: f.value
150
150
  }, {
151
151
  default: i(() => [
152
152
  e[3] || (e[3] = c(" 导出 ", -1)),
153
- n(a(X), null, {
153
+ r(a(X), null, {
154
154
  default: i(() => [
155
- n(a(J))
155
+ r(a(J))
156
156
  ]),
157
157
  _: 1
158
158
  })
@@ -162,38 +162,39 @@ const _ = { class: "table-toolbar" }, ee = { class: "table-toolbar-left" }, te =
162
162
  ]),
163
163
  _: 1
164
164
  }, 8, ["disabled"])) : A("", !0),
165
- n(V, {
165
+ r(V, {
166
166
  buttons: o.leftExtraButtons,
167
167
  ctx: R.value
168
168
  }, null, 8, ["buttons", "ctx"])
169
169
  ]),
170
170
  C("div", te, [
171
- n(V, {
171
+ r(V, {
172
172
  buttons: o.rightExtraButtons,
173
173
  ctx: R.value
174
174
  }, null, 8, ["buttons", "ctx"]),
175
175
  o.showSwitchView ? (p(), y(a(O), {
176
176
  key: 0,
177
177
  modelValue: E.value,
178
- "onUpdate:modelValue": e[0] || (e[0] = (r) => E.value = r),
178
+ "onUpdate:modelValue": e[0] || (e[0] = (n) => E.value = n),
179
179
  class: "table-toolbar-switch-view",
180
180
  "inline-prompt": "",
181
181
  "active-icon": a(Q),
182
182
  "inactive-icon": a(K)
183
183
  }, null, 8, ["modelValue", "active-icon", "inactive-icon"])) : A("", !0),
184
- n(W, {
184
+ r(W, {
185
185
  isAutoRefresh: g.value,
186
- "onUpdate:isAutoRefresh": e[1] || (e[1] = (r) => g.value = r),
186
+ "onUpdate:isAutoRefresh": e[1] || (e[1] = (n) => g.value = n),
187
187
  interval: b.value,
188
- "onUpdate:interval": e[2] || (e[2] = (r) => b.value = r),
188
+ "onUpdate:interval": e[2] || (e[2] = (n) => b.value = n),
189
189
  showAutoRefresh: o.showAutoRefresh,
190
190
  showRefresh: o.showRefresh,
191
191
  refreshFn: o.tableExpose.refresh,
192
- loading: o.loading
192
+ loading: o.loading,
193
+ needRootNode: !1
193
194
  }, null, 8, ["isAutoRefresh", "interval", "showAutoRefresh", "showRefresh", "refreshFn", "loading"])
194
195
  ])
195
196
  ], 512)), [
196
- [z, S.value]
197
+ [N, S.value]
197
198
  ]);
198
199
  }
199
200
  });
@@ -0,0 +1,14 @@
1
+ import { computed as t } from "vue";
2
+ const a = (l) => {
3
+ const e = t(() => {
4
+ if (!l.enabled()) return;
5
+ const i = l.rawAvailableHeight();
6
+ return i && i > 0 ? i : void 0;
7
+ }), r = t(() => e.value !== void 0), n = t(
8
+ () => e.value ? `${e.value}px` : ""
9
+ );
10
+ return { fillActive: r, fillMinHeight: e, fillMinHeightCss: n };
11
+ };
12
+ export {
13
+ a as useFillHeight
14
+ };
@@ -0,0 +1,19 @@
1
+ import { computed as t } from "vue";
2
+ const h = (e) => {
3
+ const l = t(
4
+ () => e.enabled() && e.loading() && e.dataLength() === 0
5
+ ), o = t(
6
+ () => e.isGrid() ? "grid" : "table"
7
+ ), r = t(
8
+ () => Math.min(Math.max(e.columnCount(), 1), 8)
9
+ ), s = t(() => {
10
+ const n = e.skeletonRows();
11
+ if (n && n > 0) return n;
12
+ const a = e.availableHeight();
13
+ return a ? Math.min(Math.max(Math.floor((a - 44) / 48), 3), 8) : 5;
14
+ });
15
+ return { showSkeleton: l, skeletonMode: o, skeletonColumns: r, skeletonRowsFinal: s };
16
+ };
17
+ export {
18
+ h as useTableSkeleton
19
+ };