@ithinkdt/ui 4.0.0-40 → 4.0.0-401

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.
@@ -1,5 +1,5 @@
1
1
  import "./use-i18n-Dx7V4KrY.js";
2
- import "./directives-DUuJW647.js";
2
+ import "./directives-qqYcWl1I.js";
3
3
  import "./use-style-DcT-1dj4.js";
4
- import { a as NRadios, c as DataSelection, d as useLocaleEdit, f as DataFilter, g as NCheckboxes, h as DataActions, i as renderUsers, l as DataPagination, m as DataCustom, n as DtUserDept, o as DataTable, p as DataForm, r as DtUserRender, s as useDataTableDrag, t as DtDeptRender, u as DataLocaleInput } from "./components-BC8oa62b.js";
5
- export { DataActions, DataCustom, DataFilter, DataForm, DataLocaleInput, DataPagination, DataSelection, DataTable, DtDeptRender, DtUserDept, DtUserRender, NCheckboxes, NRadios, renderUsers, useDataTableDrag, useLocaleEdit };
4
+ import { _ as DataActions, a as NRadios, c as DataSelection, d as useLocaleEdit, f as DataFilter, g as DataCustom, h as dataFormActionsProps, i as renderUsers, l as DataPagination, m as DataFormActions, n as DtUserDept, o as DataTable, p as DataForm, r as DtUserRender, s as useDataTableDrag, t as DtDeptRender, u as DataLocaleInput, v as NCheckboxes } from "./components-B_qzc9ro.js";
5
+ export { DataActions, DataCustom, DataFilter, DataForm, DataFormActions, DataLocaleInput, DataPagination, DataSelection, DataTable, DtDeptRender, DtUserDept, DtUserRender, NCheckboxes, NRadios, dataFormActionsProps, renderUsers, useDataTableDrag, useLocaleEdit };
@@ -2,10 +2,11 @@ import { g as useStyle, i as cM, n as cB, r as cE, t as c } from "./use-style-Dc
2
2
  import { Fragment, createVNode, defineComponent, h, nextTick, reactive, ref, shallowRef, toRef, watch } from "vue";
3
3
  import { promiseTimeout, useEventListener } from "@vueuse/core";
4
4
  import { NTooltip } from "ithinkdt-ui";
5
+ import { nanoid } from "nanoid";
6
+ import { debounce, throttle } from "@ithinkdt/common/fn";
5
7
  import { useElementIntersectionRect } from "@ithinkdt/common/composables";
6
8
  import { string2dom } from "@ithinkdt/common/dom";
7
- import { debounce } from "@ithinkdt/common/fn";
8
- var Tooltip = /* @__PURE__ */ Symbol("tooltip-dir"), current = /* @__PURE__ */ shallowRef(), _update;
9
+ var Tooltip = /* @__PURE__ */ Symbol("tooltip-dir"), current = /* @__PURE__ */ shallowRef(), _update, _current;
9
10
  const TooltipDirectiveProvider = /* @__PURE__ */ defineComponent({
10
11
  name: "TooltipDirectiveProvider",
11
12
  props: { delay: {
@@ -13,69 +14,79 @@ const TooltipDirectiveProvider = /* @__PURE__ */ defineComponent({
13
14
  default: 180
14
15
  } },
15
16
  setup(d) {
16
- let k = shallowRef(), A = reactive({
17
+ let M = shallowRef(), N = reactive({
17
18
  show: !1,
18
19
  tip: void 0,
19
20
  placement: "top",
20
21
  x: 0,
21
22
  y: 0
22
23
  });
23
- return _update = async () => {
24
+ _update = async () => {
24
25
  if (!current.value) return;
25
26
  d.delay > 0 && await promiseTimeout(d.delay);
26
- let j = current.value, M = j?.[Tooltip];
27
- if (!M) return;
28
- let N = M.tip;
29
- k.value = typeof N == "function" ? N : () => N || j.attributes.getNamedItem("title") || j.textContent;
30
- let { auto: P } = M.binding.modifiers;
31
- if (!P || j.firstChild.offsetWidth > j.clientWidth || j.firstChild.offsetHeight > j.clientHeight) {
32
- A.show = !0;
33
- let d = j.getBoundingClientRect();
34
- switch (A.placement = Object.keys(M.binding.modifiers).find((d) => [
27
+ let P = current.value, F = P?.[Tooltip];
28
+ if (!F) return;
29
+ let I = F.tip;
30
+ M.value = typeof I == "function" ? I : () => I || P.attributes.getNamedItem("title") || P.textContent;
31
+ let { auto: L } = F.binding.modifiers;
32
+ if (!L || P.firstChild.offsetWidth > P.clientWidth || P.firstChild.offsetHeight > P.clientHeight) {
33
+ N.show = !0;
34
+ let d = P.getBoundingClientRect();
35
+ switch (N.placement = Object.keys(F.binding.modifiers).find((d) => [
35
36
  "top",
36
37
  "right",
37
38
  "left",
38
39
  "bottom"
39
- ].find((k) => d.startsWith(k))) ?? "top", A.placement.split("-")[0]) {
40
+ ].find((M) => d.startsWith(M))) ?? "top", N.placement.split("-")[0]) {
40
41
  case "top":
41
- A.x = d.left + d.width / 2, A.y = d.top;
42
+ N.x = d.left + d.width / 2, N.y = d.top;
42
43
  break;
43
44
  case "right":
44
- A.x = d.left + d.width, A.y = d.top + d.height / 2;
45
+ N.x = d.left + d.width, N.y = d.top + d.height / 2;
45
46
  break;
46
47
  case "left":
47
- A.x = d.left, A.y = d.top + d.height / 2;
48
+ N.x = d.left, N.y = d.top + d.height / 2;
48
49
  break;
49
50
  case "bottom":
50
- A.x = d.left + d.width / 2, A.y = d.bottom;
51
+ N.x = d.left + d.width / 2, N.y = d.bottom;
51
52
  break;
52
53
  }
53
- } else A.show &&= !1;
54
- }, useEventListener("mouseover", (d) => {
55
- let k = d.target;
56
- !current.value || current.value?.contains(k) || (A.show = !1, current.value = void 0);
54
+ } else N.show &&= !1;
55
+ };
56
+ let P = `ithinkdt-tooltip-${nanoid()}`, F = throttle((d) => {
57
+ !_current || _current.contains(d) || d.closest(`.${P}`) || (N.show = !1, current.value = void 0);
58
+ }, 100, { leading: !1 });
59
+ return useEventListener("mouseover", (d) => {
60
+ _current = current.value, F(d.target);
57
61
  }, { capture: !0 }), () => createVNode(NTooltip, {
58
62
  trigger: "manual",
59
- show: !!current.value && A.show,
60
- x: A.x,
61
- y: A.y,
62
- placement: A.placement,
63
- keepAliveOnHover: !0
64
- }, { default: () => [k.value?.()] });
63
+ show: !!current.value && N.show,
64
+ x: N.x,
65
+ y: N.y,
66
+ placement: N.placement,
67
+ internalInheritedEventHandlers: [{
68
+ onMouseenter: () => {
69
+ console.log("111");
70
+ },
71
+ onMouseleave: () => {
72
+ console.log("222");
73
+ }
74
+ }]
75
+ }, { default: () => [createVNode("div", { class: P }, [M.value?.()])] });
65
76
  }
66
77
  });
67
78
  var _listener = (d) => {
68
- current.value = d.target, _update?.();
79
+ _current = void 0, current.value = d.target, _update?.();
69
80
  };
70
81
  const vTooltip = {
71
- mounted(d, k) {
82
+ mounted(d, M) {
72
83
  d[Tooltip] = {
73
- binding: k,
74
- tip: k.value
84
+ binding: M,
85
+ tip: M.value
75
86
  }, d.addEventListener("mouseenter", _listener);
76
87
  },
77
- updated(d, k) {
78
- d[Tooltip].binding = k, d[Tooltip].tip = k.value, _update();
88
+ updated(d, M) {
89
+ d[Tooltip].binding = M, d[Tooltip].tip = M.value, _update();
79
90
  },
80
91
  beforeUnmount(d) {
81
92
  d[Tooltip] && d.removeEventListener("mouseenter", _listener), current.value === d && (current.value = void 0), delete d[Tooltip];
@@ -105,19 +116,19 @@ var clsPrefix, isDark, style = /* @__PURE__ */ c([c(({ props: d }) => `:where(${
105
116
  const SpinDirectiveProvider = /* @__PURE__ */ defineComponent({
106
117
  name: "SpinDirectiveProvider",
107
118
  props: { dark: Boolean },
108
- setup(k) {
109
- return clsPrefix = useStyle("-spin-directive", style), isDark = toRef(k, "dark"), () => h(Fragment);
119
+ setup(M) {
120
+ return clsPrefix = useStyle("-spin-directive", style), isDark = toRef(M, "dark"), () => h(Fragment);
110
121
  }
111
122
  });
112
- var Spin = /* @__PURE__ */ Symbol("spin-dir"), updateLoading = (d, { value: k, modifiers: A }) => {
113
- if (d[Spin].loading.value = !!k, !d[Spin].loading.value) return;
114
- let j = A.dark || !A.light && isDark.value;
115
- d[Spin].spinEl.style.setProperty("--host-bg", j ? "0 0 0" : "255 255 255");
123
+ var Spin = /* @__PURE__ */ Symbol("spin-dir"), updateLoading = (d, { value: M, modifiers: N }) => {
124
+ if (d[Spin].loading.value = !!M, !d[Spin].loading.value) return;
125
+ let P = N.dark || !N.light && isDark.value;
126
+ d[Spin].spinEl.style.setProperty("--host-bg", P ? "0 0 0" : "255 255 255");
116
127
  };
117
128
  const vSpin = {
118
129
  beforeMount(d) {
119
130
  if (d.classList.add(`${clsPrefix.value}-spin-host`), d[Spin]) return;
120
- let k = ref(!1), A = string2dom(`
131
+ let M = ref(!1), N = string2dom(`
121
132
  <div class="${clsPrefix.value}-spin-directive">
122
133
  <svg class="${clsPrefix.value}-spin-directive__icon" width="32" height="32" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
123
134
  <g>
@@ -130,42 +141,42 @@ const vSpin = {
130
141
  </svg>
131
142
  <div class="${clsPrefix.value}-spin-directive__tip"></div>
132
143
  </div>
133
- `.trim()), j, { stop: M, update: N } = useElementIntersectionRect(d, (d) => {
134
- j = d, Object.assign(A.style, {
144
+ `.trim()), P, { stop: F, update: I } = useElementIntersectionRect(d, (d) => {
145
+ P = d, Object.assign(N.style, {
135
146
  left: 0,
136
147
  top: 0,
137
- width: j.width + "px",
138
- height: j.height + "px"
148
+ width: P.width + "px",
149
+ height: P.height + "px"
139
150
  });
140
- }, { interval: 1e3 / 30 }), P, F = watch(k, debounce(() => {
141
- if (k.value) P === void 0 && (clearTimeout(P), P = void 0), N(), d.append(A), requestAnimationFrame(() => {
142
- k.value && A.classList.add(`${clsPrefix.value}-spin-directive--spining`);
151
+ }, { interval: 1e3 / 30 }), L, R = watch(M, debounce(() => {
152
+ if (M.value) L === void 0 && (clearTimeout(L), L = void 0), I(), d.append(N), requestAnimationFrame(() => {
153
+ M.value && N.classList.add(`${clsPrefix.value}-spin-directive--spining`);
143
154
  });
144
155
  else {
145
- A.classList.remove(`${clsPrefix.value}-spin-directive--spining`);
156
+ N.classList.remove(`${clsPrefix.value}-spin-directive--spining`);
146
157
  let d = () => {
147
- A.remove(), k && clearTimeout(k), k = null, A.removeEventListener("transitioncancel", d), A.removeEventListener("transitionend", d);
158
+ N.remove(), M && clearTimeout(M), M = null, N.removeEventListener("transitioncancel", d), N.removeEventListener("transitionend", d);
148
159
  };
149
- A.addEventListener("transitioncancel", d), A.addEventListener("transitionend", d);
150
- let k = setTimeout(d, 300);
160
+ N.addEventListener("transitioncancel", d), N.addEventListener("transitionend", d);
161
+ let M = setTimeout(d, 300);
151
162
  }
152
163
  }, 30));
153
164
  d[Spin] = {
154
- loading: k,
155
- spinEl: A,
165
+ loading: M,
166
+ spinEl: N,
156
167
  updateTip: () => {
157
- let k = A.querySelector(`.${clsPrefix.value}-spin-directive__tip`);
158
- k.textContent = d.dataset.spinTip;
168
+ let M = N.querySelector(`.${clsPrefix.value}-spin-directive__tip`);
169
+ M.textContent = d.dataset.spinTip;
159
170
  },
160
171
  stop: () => {
161
- M(), F();
172
+ F(), R();
162
173
  }
163
174
  };
164
175
  },
165
- mounted(d, k) {
166
- updateLoading(d, k), d[Spin].updateTip(), !d[Spin].observer && nextTick().then(() => {
167
- (d[Spin].observer = new MutationObserver((k) => {
168
- for (let A of k) if (A.type === "attributes" && A.attributeName === "data-spin-tip") {
176
+ mounted(d, M) {
177
+ updateLoading(d, M), d[Spin].updateTip(), !d[Spin].observer && nextTick().then(() => {
178
+ (d[Spin].observer = new MutationObserver((M) => {
179
+ for (let N of M) if (N.type === "attributes" && N.attributeName === "data-spin-tip") {
169
180
  d[Spin].updateTip();
170
181
  return;
171
182
  }
@@ -1,3 +1,3 @@
1
- import { i as vTooltip, n as vSpin, r as TooltipDirectiveProvider, t as SpinDirectiveProvider } from "./directives-DUuJW647.js";
1
+ import { i as vTooltip, n as vSpin, r as TooltipDirectiveProvider, t as SpinDirectiveProvider } from "./directives-qqYcWl1I.js";
2
2
  import "./use-style-DcT-1dj4.js";
3
3
  export { SpinDirectiveProvider, TooltipDirectiveProvider, vSpin, vTooltip };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as useI18n, t as UI_I18N_INJECTION } from "./use-i18n-Dx7V4KrY.js";
2
- import { i as vTooltip, n as vSpin, r as TooltipDirectiveProvider, t as SpinDirectiveProvider } from "./directives-DUuJW647.js";
2
+ import { i as vTooltip, n as vSpin, r as TooltipDirectiveProvider, t as SpinDirectiveProvider } from "./directives-qqYcWl1I.js";
3
3
  import { g as useStyle, i as cM, n as cB, r as cE, t as c } from "./use-style-DcT-1dj4.js";
4
4
  import { Fragment, computed, createVNode, defineComponent, inject, isVNode, mergeProps, provide, reactive, ref, renderSlot, shallowRef, toRef, toValue, unref, useTemplateRef, watch, withDirectives } from "vue";
5
5
  import { computedAsync, promiseTimeout, useElementHover, useElementSize, useEventListener, useFullscreen, watchDebounced } from "@vueuse/core";
@@ -330,7 +330,9 @@ var style = /* @__PURE__ */ c([
330
330
  }),
331
331
  cB("footer", {
332
332
  gridArea: "footer",
333
- lineHeight: "24px"
333
+ lineHeight: "32px",
334
+ textAlign: "center",
335
+ color: "gray"
334
336
  })
335
337
  ]), IFold = () => createVNode("svg", {
336
338
  xmlns: "http://www.w3.org/2000/svg",
@@ -628,7 +630,7 @@ function useCtxMenu(z, B, V) {
628
630
  {
629
631
  key: "reload",
630
632
  label: H("common.layout.tabs.reloadTab"),
631
- disabled: U.tab && U.tab.key !== B.value,
633
+ disabled: !U.tab || U.tab.key !== B.value,
632
634
  icon: () => createVNode(NIcon, { size: 20 }, { default: () => [createVNode("svg", {
633
635
  xmlns: "http://www.w3.org/2000/svg",
634
636
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
@@ -663,7 +665,7 @@ function useCtxMenu(z, B, V) {
663
665
  {
664
666
  key: "open",
665
667
  label: H("common.layout.tabs.openTabBlank"),
666
- disabled: U.tab?.key !== B.value,
668
+ disabled: !U.tab,
667
669
  icon: () => createVNode(NIcon, { size: 20 }, { default: () => [createVNode("svg", {
668
670
  xmlns: "http://www.w3.org/2000/svg",
669
671
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
@@ -754,19 +756,7 @@ function useCtxMenu(z, B, V) {
754
756
  V();
755
757
  return;
756
758
  }
757
- if (!U.tab) {
758
- let z = H.find((d) => d.key === B.value);
759
- switch (d) {
760
- case "open":
761
- window.open(z.href, "_blank");
762
- break;
763
- case "reload":
764
- z.reloading ||= (z.reloading = !0, await promiseTimeout(220), !1);
765
- break;
766
- }
767
- return;
768
- }
769
- switch (d) {
759
+ if (U.tab) switch (d) {
770
760
  case "open":
771
761
  window.open(U.tab.href, "_blank");
772
762
  break;
@@ -1208,7 +1198,7 @@ const AppTenant = /* @__PURE__ */ defineComponent({
1208
1198
  d: "M728 600.2c8.1-13.2 4-30.4-9.1-38.5-30.7-19-63.6-33.8-97.8-44.4 69.4-43 115.6-119.8 115.6-207.4C736.7 175.2 627.5 66 492.8 66S249 175.2 249 309.9c0 88.2 46.8 165.5 117 208.3-12.9 4.1-25.6 8.8-38.1 14.1-51.1 21.8-97 53-136.4 92.7-39.4 39.7-70.3 85.9-91.9 137.4-22.4 53.3-33.7 109.9-33.7 168.2 0 15.5 12.5 28 28 28s28-12.5 28-28c0-207.5 167.4-376.3 373.2-376.3 68.8 0 136.1 19 194.4 55 13.1 8.2 30.4 4.1 38.5-9.1zM305 309.9c0-50.2 19.5-97.4 55-132.8 35.5-35.5 82.7-55 132.8-55 50.2 0 97.4 19.5 132.8 55 35.5 35.5 55 82.7 55 132.8s-19.5 97.4-55 132.8c-35.5 35.5-82.7 55-132.8 55-50.2 0-97.4-19.5-132.8-55-35.5-35.5-55-82.6-55-132.8zM606.2 746.4h325.1c11.3 0 21.5-6.8 25.9-17.3s1.9-22.5-6.1-30.5L844.5 592.1c-10.9-10.9-28.7-10.9-39.6 0-10.9 10.9-10.9 28.7 0 39.6l58.7 58.6H606.2c-15.5 0-28 12.5-28 28s12.6 28.1 28 28.1zM931.4 794.6H606.3c-11.3 0-21.5 6.8-25.9 17.3s-1.9 22.5 6.1 30.5l106.6 106.4c5.5 5.5 12.6 8.2 19.8 8.2 7.2 0 14.4-2.7 19.8-8.2 10.9-10.9 10.9-28.7 0-39.6L674 850.6h257.4c15.5 0 28-12.5 28-28s-12.5-28-28-28z",
1209
1199
  fill: "currentColor"
1210
1200
  }, null)])] }),
1211
- default: () => d.shotName || d.name
1201
+ default: () => d?.shotName || d?.name
1212
1202
  })] });
1213
1203
  };
1214
1204
  }
package/dist/page.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { n as useI18n } from "./use-i18n-Dx7V4KrY.js";
2
- import "./directives-DUuJW647.js";
2
+ import "./directives-qqYcWl1I.js";
3
3
  import "./use-style-DcT-1dj4.js";
4
- import { a as NRadios, g as NCheckboxes, n as DtUserDept, p as DataForm, r as DtUserRender, t as DtDeptRender } from "./components-BC8oa62b.js";
4
+ import { a as NRadios, n as DtUserDept, p as DataForm, r as DtUserRender, t as DtDeptRender, v as NCheckboxes } from "./components-B_qzc9ro.js";
5
5
  import { computed, createVNode, defineComponent, h, isVNode, mergeProps, ref, shallowRef, unref } from "vue";
6
6
  import { until } from "@vueuse/core";
7
7
  import { NButton, NCheckbox, NColorPicker, NDatePicker, NDrawer, NDrawerContent, NFlex, NInput, NInputNumber, NModal, NScrollbar, NSelect, NText, NUpload, useMessage } from "ithinkdt-ui";
@@ -66,7 +66,7 @@ var mapProps = (n) => Object.fromEntries(Object.entries(n || {}).map(([n, c]) =>
66
66
  c.onUpdateFileList?.(n), nextTick(() => f.nTriggerFormChange());
67
67
  };
68
68
  return () => {
69
- let { type: n, onUpdateFileList: u,...p } = c;
69
+ let { type: n, onUpdateFileList: u, ...p } = c;
70
70
  return createVNode(NUpload, mergeProps(p, {
71
71
  ref: _,
72
72
  customRequest: g.value,
@@ -74,7 +74,7 @@ var mapProps = (n) => Object.fromEntries(Object.entries(n || {}).map(([n, c]) =>
74
74
  accept: p.accept ?? n === "image" ? "image/*" : void 0,
75
75
  "onUpdate:fileList": v
76
76
  }), {
77
- default: () => {
77
+ default: n === "image" ? void 0 : () => {
78
78
  let n;
79
79
  return createVNode(NButton, {
80
80
  disabled: f.mergedDisabledRef.value,
@@ -86,9 +86,9 @@ var mapProps = (n) => Object.fromEntries(Object.entries(n || {}).map(([n, c]) =>
86
86
  };
87
87
  }
88
88
  });
89
- function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersByDept: p, getUsersByUsername: m, uploadFile: g, getFileInfos: v }) {
89
+ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: u, getDeptsByCode: f, getUsersByDept: m, getUsersByUsername: g, uploadFile: v, getFileInfos: y }) {
90
90
  return {
91
- input: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f,...p }) => f ? createVNode(NText, {
91
+ input: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f, ...p }) => f ? createVNode(NText, {
92
92
  depth: 2,
93
93
  style: "line-height: 1.25"
94
94
  }, { default: () => [l ?? ""] }) : (c = mapProps(c), h(NInput, {
@@ -98,7 +98,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
98
98
  value: l,
99
99
  "onUpdate:value": u
100
100
  }, n)),
101
- number: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f,...p }) => f ? createVNode(NText, {
101
+ number: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f, ...p }) => f ? createVNode(NText, {
102
102
  depth: 2,
103
103
  style: "line-height: 1.25"
104
104
  }, { default: () => [l ?? ""] }) : (c = mapProps(c), h(NInputNumber, {
@@ -110,8 +110,8 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
110
110
  }, n)),
111
111
  select: () => {
112
112
  let n, c;
113
- return ({ slots: l, props: u }, { modelValue: d, "onUpdate:modelValue": f, required: p, readonly: m,...g }) => {
114
- let { dictType: v, options: y,...b } = mapProps(u);
113
+ return ({ slots: l, props: u }, { modelValue: d, "onUpdate:modelValue": f, required: p, readonly: m, ...g }) => {
114
+ let { dictType: v, options: y, ...b } = mapProps(u);
115
115
  if (y ? c = y : n !== v && (n = v, !c && n && (c = useDict(n))), m) if (b.multiple) {
116
116
  let n;
117
117
  return createVNode(NText, {
@@ -119,7 +119,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
119
119
  style: "line-height: 1.25"
120
120
  }, _isSlot(n = (d?.map((n) => c?.find((c) => c[b.valueField || "value"] === n)) ?? []).map((n, c, l) => {
121
121
  let u = n ? b.renderLabel ? b.renderLabel(n) ?? "" : n[b.labelField || "label"] ?? "" : d[c] ?? "";
122
- return createVNode("span", { key: n[b.valueField || "value"] }, [u, c < l.length - 1 ? ", " : ""]);
122
+ return createVNode("span", { key: n ? n[b.valueField || "value"] : d[c] ?? "" }, [u, c < l.length - 1 ? ", " : ""]);
123
123
  })) ? n : { default: () => [n] });
124
124
  } else {
125
125
  let n = c?.find((n) => n[b.valueField || "value"] === d);
@@ -139,7 +139,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
139
139
  }, l);
140
140
  };
141
141
  },
142
- checkbox: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f,...p }) => {
142
+ checkbox: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f, ...p }) => {
143
143
  if (c = mapProps(c), f) {
144
144
  let u;
145
145
  return u = l === (c.checkedValue ?? !0) ? n?.checked ? n.checked() : createVNode(NCheckbox, { checked: !0 }, null) : n?.unchecked ? n.unchecked() : createVNode(NCheckbox, { disabled: !0 }, null), createVNode(NText, {
@@ -156,30 +156,30 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
156
156
  },
157
157
  checkboxes: () => {
158
158
  let n, c;
159
- return ({ props: u }, { modelValue: d, required: f, readonly: p,...m }) => {
160
- let { dictType: g, options: v,...y } = mapProps(u);
161
- if (v ? c = v : n !== g && (n = g, !c && n && (c = useDict(n))), p) {
159
+ return ({ props: l }, { modelValue: u, required: d, readonly: f, ...m }) => {
160
+ let { dictType: g, options: v, ...y } = mapProps(l);
161
+ if (v ? c = v : n !== g && (n = g, !c && n && (c = useDict(n))), f) {
162
162
  let n;
163
163
  return createVNode(NText, {
164
164
  depth: 2,
165
165
  style: "line-height: 2.4"
166
- }, _isSlot(n = (d?.map((n) => c?.find((c) => c[y.valueField || "value"] === n)) ?? []).map((n, c, l) => {
167
- let u = n ? n[y.labelField ?? "label"] ?? "" : d[c] ?? "";
168
- return createVNode("span", { key: n[y.valueField ?? "value"] }, [u, c < l.length - 1 ? ", " : ""]);
166
+ }, _isSlot(n = (u?.map((n) => c?.find((c) => c[y.valueField || "value"] === n)) ?? []).map((n, c, l) => {
167
+ let d = n ? n[y.labelField ?? "label"] ?? "" : u[c] ?? "";
168
+ return createVNode("span", { key: n ? n[y.valueField ?? "value"] : u[c] ?? "" }, [d, c < l.length - 1 ? ", " : ""]);
169
169
  })) ? n : { default: () => [n] });
170
170
  }
171
171
  return h(NCheckboxes, {
172
172
  ...y,
173
173
  ...m,
174
174
  options: c,
175
- modelValue: d
175
+ modelValue: u
176
176
  });
177
177
  };
178
178
  },
179
179
  radios: () => {
180
180
  let n, l;
181
- return ({ props: u }, { modelValue: d, required: f, readonly: p,...m }) => {
182
- let { dictType: g, options: v,...y } = mapProps(u);
181
+ return ({ props: u }, { modelValue: d, required: f, readonly: p, ...m }) => {
182
+ let { dictType: g, options: v, ...y } = mapProps(u);
183
183
  if (v ? l = v : n !== g && (n = g, !l && n && (l = useDict(n))), p) {
184
184
  let n = l?.find((n) => n[y.valueField ?? "value"] === d);
185
185
  return createVNode(NText, {
@@ -195,8 +195,8 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
195
195
  });
196
196
  };
197
197
  },
198
- datepicker: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f,...p }) => {
199
- let { type: m = "date", format: g = m.startsWith("datetime") ? "yyyy-MM-dd HH:mm:ss" : "yyyy-MM-dd",...v } = mapProps(c);
198
+ datepicker: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f, ...p }) => {
199
+ let { type: m = "date", format: g = m.startsWith("datetime") ? "yyyy-MM-dd HH:mm:ss" : "yyyy-MM-dd", ...v } = mapProps(c);
200
200
  return f ? m.endsWith("range") ? createVNode(NText, {
201
201
  depth: 2,
202
202
  style: "line-height: 1.25"
@@ -204,6 +204,8 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
204
204
  depth: 2,
205
205
  style: "line-height: 1.25"
206
206
  }, { default: () => [l ? format(l, g) : ""] }) : h(NDatePicker, {
207
+ actions: null,
208
+ updateValueOnClose: !0,
207
209
  clearable: !0,
208
210
  ...v,
209
211
  ...p,
@@ -213,7 +215,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
213
215
  "onUpdate:value": u
214
216
  }, n);
215
217
  },
216
- file: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f,...p }) => {
218
+ file: () => ({ slots: n, props: c }, { modelValue: l, "onUpdate:modelValue": u, required: d, readonly: f, ...p }) => {
217
219
  if (c = mapProps(c), f) {
218
220
  let n;
219
221
  return console.warn("[file] 原则上此组建不应该显示在详情中"), fileList.value.length === 0 ? void 0 : createVNode(NFlex, {
@@ -231,7 +233,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
231
233
  ...c,
232
234
  ...p,
233
235
  defaultUpload: !1,
234
- uploadFile: g,
236
+ uploadFile: v,
235
237
  fileList: l,
236
238
  onUpdateFileList: u
237
239
  }, n);
@@ -241,7 +243,7 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
241
243
  let c = ++d;
242
244
  u.value = n.map((n) => l.get(n)).filter(Boolean);
243
245
  let f = n.filter((n) => !l.has(n));
244
- Promise.resolve(f.length > 0 ? v(f) : []).then((f) => {
246
+ Promise.resolve(f.length > 0 ? y(f) : []).then((f) => {
245
247
  if (c === d) {
246
248
  u.value = n.map((n) => l.get(n) || f.find((c) => c.id === n)), l.clear();
247
249
  for (let n of u.value) l.set(n.id, n);
@@ -249,30 +251,32 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
249
251
  });
250
252
  }, p;
251
253
  return {
252
- renderer: ({ slots: d, props: m }, { modelValue: v, "onUpdate:modelValue": y, required: b, readonly: S,...C }) => {
254
+ renderer: ({ slots: d, props: m }, { modelValue: g, "onUpdate:modelValue": y, required: b, readonly: S, ...C }) => {
253
255
  let w = mapProps(m);
254
- if (p = w.ref ??= shallowRef(), n !== v && (n = v, f(v?.split(",") ?? [])), S) {
256
+ if (p = w.ref ??= shallowRef(), n !== g && (n = g, f(g?.split(",") ?? [])), S) {
255
257
  let n;
256
258
  return u.value.length === 0 ? void 0 : createVNode(NFlex, {
257
259
  gap: "8",
258
- vertical: !0
260
+ vertical: !0,
261
+ style: "padding: 6px 0"
259
262
  }, _isSlot(n = u.value.map((n) => createVNode("a", {
260
263
  key: n.id,
261
264
  href: n.url,
262
265
  target: "_blank",
263
266
  rel: "noreferrer",
264
267
  title: n.name,
265
- style: "max-width: 100px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; display: inline-block"
268
+ download: n.name,
269
+ style: "max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; display: inline-block"
266
270
  }, [n.name]))) ? n : { default: () => [n] });
267
271
  }
268
272
  return h(SimpleUpload, {
269
273
  ...w,
270
274
  ...C,
271
- uploadFile: g,
275
+ uploadFile: v,
272
276
  fileList: u.value,
273
277
  onUpdateFileList: (n = []) => {
274
278
  l.clear();
275
- for (let u of n) u.file.fileId && c.set(u.id, u.file.fileId), u.file.fileId ? l.set(u.file.fileId, u) : l.set(u.id, u);
279
+ for (let u of n) u.file?.fileId && c.set(u.id, u.file.fileId), u.file?.fileId ? l.set(u.file.fileId, u) : l.set(u.id, u);
276
280
  u.value = n, y(u.value.map((n) => c.get(n.id) || n.id).join(",") || null);
277
281
  }
278
282
  }, d);
@@ -283,37 +287,37 @@ function createPageFormHelper({ getUserGroups: n, getUsersByGroup: d, getUsersBy
283
287
  };
284
288
  },
285
289
  user: () => {
286
- let c;
287
- return ({ slots: l, props: g }, { modelValue: v, "onUpdate:modelValue": y, required: b, readonly: S,...C }) => {
288
- let w = mapProps(g);
289
- return c || (c = shallowRef([]), m().then((n) => {
290
+ let c, p, v;
291
+ return ({ slots: y, props: b }, { modelValue: S, "onUpdate:modelValue": C, required: w, readonly: T, ...E }) => {
292
+ let D = mapProps(b);
293
+ return c || (c = shallowRef([]), p = shallowRef([]), v = shallowRef([]), g().then((n) => {
290
294
  c.value = n;
291
295
  }), n().then((n) => {
292
- (void 0).value = n;
293
- }), getDeptsByCode().then((n) => {
294
- (void 0).value = n;
295
- })), S ? createVNode(DtUserRender, {
296
- value: v,
297
- multiple: w.multiple,
298
- getUsersByUsername: m
296
+ p.value = n;
297
+ }), f().then((n) => {
298
+ v.value = n;
299
+ })), T ? createVNode(DtUserRender, {
300
+ value: S,
301
+ multiple: D.multiple,
302
+ getUsersByUsername: g
299
303
  }, null) : h(DtUserDept, {
300
304
  type: "user",
301
305
  users: c.value,
302
- depts: (void 0).value,
303
- groups: (void 0).value,
304
- getUsersByDept: p,
305
- getUsersByGroup: d,
306
- ...w,
307
- ...C,
308
- modelValue: v,
309
- "onUpdate:modelValue": y
310
- }, l);
306
+ depts: v.value,
307
+ groups: p.value,
308
+ getUsersByDept: m,
309
+ getUsersByGroup: u,
310
+ ...D,
311
+ ...E,
312
+ modelValue: S,
313
+ "onUpdate:modelValue": C
314
+ }, y);
311
315
  };
312
316
  }
313
317
  };
314
318
  }
315
319
  function createPageTableHelper({ getDeptsByCode: n, getUsersByUsername: c, getFileInfos: l, previewFileUrl: u }) {
316
- let d = (n) => () => (c, l, u, d) => {
320
+ let p = (n) => () => (c, l, u, d) => {
317
321
  if (c != null) return format(c, d.formatter ?? n);
318
322
  }, m = (n = {}) => createVNode("svg", mergeProps({
319
323
  xmlns: "http://www.w3.org/2000/svg",
@@ -327,8 +331,8 @@ function createPageTableHelper({ getDeptsByCode: n, getUsersByUsername: c, getFi
327
331
  fill: "currentColor"
328
332
  }, null)]);
329
333
  return {
330
- date: d("yyyy-MM-dd"),
331
- datetime: d("yyyy-MM-dd HH:mm:ss"),
334
+ date: p("yyyy-MM-dd"),
335
+ datetime: p("yyyy-MM-dd HH:mm:ss"),
332
336
  dict: () => {
333
337
  let n, c, l;
334
338
  return (u, d, f, p) => {
@@ -408,25 +412,31 @@ function createPageTableHelper({ getDeptsByCode: n, getUsersByUsername: c, getFi
408
412
  getDeptsByCode: n
409
413
  }, null);
410
414
  },
411
- user: () => (n, l, u, d) => {
415
+ user: () => (n, l, u, f) => {
412
416
  if (n) return createVNode(DtUserRender, {
413
417
  value: n,
414
- multiple: d?.multiple,
418
+ multiple: f?.multiple,
415
419
  getUsersByUsername: c
416
420
  }, null);
417
421
  }
418
422
  };
419
423
  }
420
424
  function createFormHelper() {
421
- return () => ({ items: n, model: c, handleSubmit: l, reset: u, validation: f, readonly: p, inModal: m, showColon: g }) => createVNode(DataForm, {
425
+ return () => ({ items: n, model: c, handleSubmit: l, reset: d, validation: f, readonly: p, inModal: m, showFeedback: g, showColon: _, labelWidth: v, labelAlign: y, labelPlacement: b, showRequireMark: x, requireMarkPlacement: C }) => createVNode(DataForm, {
422
426
  readonly: p,
423
427
  model: c,
424
428
  items: n,
425
429
  validation: f,
426
- showColon: unref(g) ?? !0,
430
+ showColon: unref(_) ?? !0,
431
+ labelWidth: unref(v),
432
+ labelAlign: unref(y),
433
+ labelPlacement: unref(b),
434
+ showRequireMark: unref(x),
435
+ requireMarkPlacement: unref(C),
436
+ showFeedback: unref(g) ?? !0,
427
437
  showAction: !1,
428
438
  onSubmit: l,
429
- onRest: u,
439
+ onRest: d,
430
440
  style: m ? "padding-right: 2rem; padding-top: 1rem" : void 0
431
441
  }, null);
432
442
  }
@@ -436,7 +446,7 @@ function createModalHelper() {
436
446
  display: "flex",
437
447
  flexDirection: "column"
438
448
  }, l = { content: !0 };
439
- return () => ({ type: u = "dialog", visible: d, title: f, content: p, footer: m, placement: g, resizable: _, draggable: v, closeOnEsc: b, closable: x, showMask: S, maskClosable: C, width: T, height: E, style: D, onClose: O, onCancel: k, onConfirm: A, onAfterClose: j, onAfterOpen: M, confirmText: N, confirmDisabled: P, confirmLoading: F, cancelText: I, cancelDisabled: L, cancelLoading: R, nativeScrollbar: z,...B }) => {
449
+ return () => ({ type: u = "dialog", visible: d, title: f, content: p, footer: m, placement: g, resizable: _, draggable: v, closeOnEsc: b, closable: x, showMask: S, maskClosable: C, width: T, height: E, style: D, onClose: O, onCancel: k, onConfirm: A, onAfterClose: j, onAfterOpen: M, confirmText: N, confirmDisabled: P, confirmLoading: F, cancelText: I, cancelDisabled: L, cancelLoading: R, nativeScrollbar: z, ...B }) => {
440
450
  let V = m ? () => m : m === null ? null : () => createVNode(NFlex, {
441
451
  justify: "end",
442
452
  gap: "16"
@@ -481,7 +491,7 @@ function createModalHelper() {
481
491
  action: V
482
492
  });
483
493
  }
484
- let { bodyContentClass: H, bodyContentStyle: U,...W } = B;
494
+ let { bodyContentClass: H, bodyContentStyle: U, ...W } = B;
485
495
  return createVNode(NDrawer, mergeProps({
486
496
  show: d,
487
497
  trapFocus: !1,