@ithinkdt/ui 4.0.0-38 → 4.0.0-400

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 (60) hide show
  1. package/auto-imports.js +1 -1
  2. package/dist/components-B_qzc9ro.js +1736 -0
  3. package/dist/components.js +5 -0
  4. package/dist/directives-qqYcWl1I.js +194 -0
  5. package/dist/directives.js +3 -0
  6. package/dist/index.js +1212 -0
  7. package/dist/page.js +519 -0
  8. package/dist/use-i18n-Dx7V4KrY.js +6 -0
  9. package/dist/use-style-DcT-1dj4.js +29 -0
  10. package/dist/use-style.js +2 -0
  11. package/{src → esm}/components.d.ts +56 -15
  12. package/esm/components.js +1 -0
  13. package/esm/directives.js +1 -0
  14. package/esm/index.js +1 -0
  15. package/{src → esm}/page.d.ts +2 -2
  16. package/esm/page.js +1 -0
  17. package/esm/use-style.js +1 -0
  18. package/package.json +29 -26
  19. package/unocss-preset.d.ts +5 -0
  20. package/unocss-preset.js +163 -0
  21. package/src/components/Checkboxes.jsx +0 -130
  22. package/src/components/DataActions.jsx +0 -105
  23. package/src/components/DataCustom.jsx +0 -187
  24. package/src/components/DataFilter.jsx +0 -119
  25. package/src/components/DataForm.jsx +0 -264
  26. package/src/components/DataLocaleInput.jsx +0 -121
  27. package/src/components/DataPagination.jsx +0 -62
  28. package/src/components/DataSelection.jsx +0 -57
  29. package/src/components/DataTable.jsx +0 -302
  30. package/src/components/Radios.jsx +0 -134
  31. package/src/components/UserDept.jsx +0 -643
  32. package/src/components/assets.jsx +0 -274
  33. package/src/components/index.js +0 -11
  34. package/src/design/Account.jsx +0 -154
  35. package/src/design/Appearance.jsx +0 -89
  36. package/src/design/Breadcrumb.jsx +0 -67
  37. package/src/design/Fullscreen.jsx +0 -65
  38. package/src/design/Language.jsx +0 -45
  39. package/src/design/Layout.jsx +0 -241
  40. package/src/design/Logo.jsx +0 -92
  41. package/src/design/Menu.jsx +0 -133
  42. package/src/design/MultiTabs.jsx +0 -501
  43. package/src/design/Notification.jsx +0 -311
  44. package/src/design/Tenant.jsx +0 -88
  45. package/src/design/common.jsx +0 -21
  46. package/src/design/index.js +0 -11
  47. package/src/directives/index.js +0 -2
  48. package/src/directives/spin.js +0 -181
  49. package/src/directives/tooltip.jsx +0 -121
  50. package/src/index.js +0 -18
  51. package/src/page.jsx +0 -740
  52. package/src/use-i18n.js +0 -8
  53. package/src/use-style.js +0 -58
  54. package/src/utils.js +0 -20
  55. package/unocss.d.ts +0 -5
  56. package/unocss.js +0 -94
  57. /package/{src → esm}/design.d.ts +0 -0
  58. /package/{src → esm}/directives.d.ts +0 -0
  59. /package/{src → esm}/index.d.ts +0 -0
  60. /package/{src → esm}/use-style.d.ts +0 -0
@@ -0,0 +1,5 @@
1
+ import "./use-i18n-Dx7V4KrY.js";
2
+ import "./directives-qqYcWl1I.js";
3
+ import "./use-style-DcT-1dj4.js";
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 };
@@ -0,0 +1,194 @@
1
+ import { g as useStyle, i as cM, n as cB, r as cE, t as c } from "./use-style-DcT-1dj4.js";
2
+ import { Fragment, createVNode, defineComponent, h, nextTick, reactive, ref, shallowRef, toRef, watch } from "vue";
3
+ import { promiseTimeout, useEventListener } from "@vueuse/core";
4
+ import { NTooltip } from "ithinkdt-ui";
5
+ import { nanoid } from "nanoid";
6
+ import { debounce, throttle } from "@ithinkdt/common/fn";
7
+ import { useElementIntersectionRect } from "@ithinkdt/common/composables";
8
+ import { string2dom } from "@ithinkdt/common/dom";
9
+ var Tooltip = /* @__PURE__ */ Symbol("tooltip-dir"), current = /* @__PURE__ */ shallowRef(), _update, _current;
10
+ const TooltipDirectiveProvider = /* @__PURE__ */ defineComponent({
11
+ name: "TooltipDirectiveProvider",
12
+ props: { delay: {
13
+ type: Number,
14
+ default: 180
15
+ } },
16
+ setup(d) {
17
+ let M = shallowRef(), N = reactive({
18
+ show: !1,
19
+ tip: void 0,
20
+ placement: "top",
21
+ x: 0,
22
+ y: 0
23
+ });
24
+ _update = async () => {
25
+ if (!current.value) return;
26
+ d.delay > 0 && await promiseTimeout(d.delay);
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) => [
36
+ "top",
37
+ "right",
38
+ "left",
39
+ "bottom"
40
+ ].find((M) => d.startsWith(M))) ?? "top", N.placement.split("-")[0]) {
41
+ case "top":
42
+ N.x = d.left + d.width / 2, N.y = d.top;
43
+ break;
44
+ case "right":
45
+ N.x = d.left + d.width, N.y = d.top + d.height / 2;
46
+ break;
47
+ case "left":
48
+ N.x = d.left, N.y = d.top + d.height / 2;
49
+ break;
50
+ case "bottom":
51
+ N.x = d.left + d.width / 2, N.y = d.bottom;
52
+ break;
53
+ }
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);
61
+ }, { capture: !0 }), () => createVNode(NTooltip, {
62
+ trigger: "manual",
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?.()])] });
76
+ }
77
+ });
78
+ var _listener = (d) => {
79
+ _current = void 0, current.value = d.target, _update?.();
80
+ };
81
+ const vTooltip = {
82
+ mounted(d, M) {
83
+ d[Tooltip] = {
84
+ binding: M,
85
+ tip: M.value
86
+ }, d.addEventListener("mouseenter", _listener);
87
+ },
88
+ updated(d, M) {
89
+ d[Tooltip].binding = M, d[Tooltip].tip = M.value, _update();
90
+ },
91
+ beforeUnmount(d) {
92
+ d[Tooltip] && d.removeEventListener("mouseenter", _listener), current.value === d && (current.value = void 0), delete d[Tooltip];
93
+ }
94
+ };
95
+ var clsPrefix, isDark, style = /* @__PURE__ */ c([c(({ props: d }) => `:where(${d.bPrefix}spin-host)`, { position: "relative" }), cB("spin-directive", {
96
+ zIndex: "999999",
97
+ position: "absolute",
98
+ color: "var(--color-primary)",
99
+ display: "flex",
100
+ flexDirection: "column",
101
+ justifyContent: "center",
102
+ alignItems: "center",
103
+ gap: "4px",
104
+ willChange: "background-color",
105
+ backgroundColor: "rgb(var(--host-bg, 255 255 255) / 0)",
106
+ transition: "background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
107
+ }, [
108
+ cE("tip, icon", {
109
+ willChange: "opacity",
110
+ opacity: "0",
111
+ transition: "opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
112
+ }),
113
+ cE("tip:empty", { display: "none" }),
114
+ cM("spining", { backgroundColor: "rgb(var(--host-bg, 255 255 255) / 0.5)" }, [cE("tip, icon", { opacity: "1" })])
115
+ ])]);
116
+ const SpinDirectiveProvider = /* @__PURE__ */ defineComponent({
117
+ name: "SpinDirectiveProvider",
118
+ props: { dark: Boolean },
119
+ setup(M) {
120
+ return clsPrefix = useStyle("-spin-directive", style), isDark = toRef(M, "dark"), () => h(Fragment);
121
+ }
122
+ });
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");
127
+ };
128
+ const vSpin = {
129
+ beforeMount(d) {
130
+ if (d.classList.add(`${clsPrefix.value}-spin-host`), d[Spin]) return;
131
+ let M = ref(!1), N = string2dom(`
132
+ <div class="${clsPrefix.value}-spin-directive">
133
+ <svg class="${clsPrefix.value}-spin-directive__icon" width="32" height="32" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
134
+ <g>
135
+ <animateTransform attributeName="transform" type="rotate" values="0 100 100;270 100 100" begin="0s" dur="1.6s" fill="freeze" repeatCount="indefinite"></animateTransform>
136
+ <circle fill="none" stroke="currentColor" stroke-width="18" stroke-linecap="round" cx="100" cy="100" r="92" stroke-dasharray="567" stroke-dashoffset="1848">
137
+ <animateTransform attributeName="transform" type="rotate" values="0 100 100;135 100 100;450 100 100" begin="0s" dur="1.6s" fill="freeze" repeatCount="indefinite"></animateTransform>
138
+ <animate attributeName="stroke-dashoffset" values="567;142;567" begin="0s" dur="1.6s" fill="freeze" repeatCount="indefinite"></animate>
139
+ </circle>
140
+ </g>
141
+ </svg>
142
+ <div class="${clsPrefix.value}-spin-directive__tip"></div>
143
+ </div>
144
+ `.trim()), P, { stop: F, update: I } = useElementIntersectionRect(d, (d) => {
145
+ P = d, Object.assign(N.style, {
146
+ left: 0,
147
+ top: 0,
148
+ width: P.width + "px",
149
+ height: P.height + "px"
150
+ });
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`);
154
+ });
155
+ else {
156
+ N.classList.remove(`${clsPrefix.value}-spin-directive--spining`);
157
+ let d = () => {
158
+ N.remove(), M && clearTimeout(M), M = null, N.removeEventListener("transitioncancel", d), N.removeEventListener("transitionend", d);
159
+ };
160
+ N.addEventListener("transitioncancel", d), N.addEventListener("transitionend", d);
161
+ let M = setTimeout(d, 300);
162
+ }
163
+ }, 30));
164
+ d[Spin] = {
165
+ loading: M,
166
+ spinEl: N,
167
+ updateTip: () => {
168
+ let M = N.querySelector(`.${clsPrefix.value}-spin-directive__tip`);
169
+ M.textContent = d.dataset.spinTip;
170
+ },
171
+ stop: () => {
172
+ F(), R();
173
+ }
174
+ };
175
+ },
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") {
180
+ d[Spin].updateTip();
181
+ return;
182
+ }
183
+ })).observe(d, {
184
+ attributes: !0,
185
+ attributeFilter: ["data-spin-tip"]
186
+ });
187
+ });
188
+ },
189
+ updated: updateLoading,
190
+ beforeUnmount(d) {
191
+ d[Spin].loading.value = !1, d[Spin].stop(), d[Spin].observer?.disconnect(), delete d[Spin];
192
+ }
193
+ };
194
+ export { vTooltip as i, vSpin as n, TooltipDirectiveProvider as r, SpinDirectiveProvider as t };
@@ -0,0 +1,3 @@
1
+ import { i as vTooltip, n as vSpin, r as TooltipDirectiveProvider, t as SpinDirectiveProvider } from "./directives-qqYcWl1I.js";
2
+ import "./use-style-DcT-1dj4.js";
3
+ export { SpinDirectiveProvider, TooltipDirectiveProvider, vSpin, vTooltip };