@jnrs/vue-core 1.2.22 → 1.2.23

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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # 发版日志
2
+
3
+ ## [1.2.23] - 2026-07-08
4
+
5
+ ### Fixed
6
+
7
+ - `JnTable` 组件修复列表中存在 switch 组件时 MouseSelection 失效的问题
8
+
9
+ ## [1.2.22] - 2026-07-01
10
+
11
+ ### Features
12
+
13
+ - `JnImportAndExport` 组件优化错误信息提示
@@ -6,7 +6,7 @@ import { u as qt, a as Yt, L as Zt, M as Wt, C as $t } from "../index-DRbGqK4D.j
6
6
  import { Back as _t, Right as ea, DArrowRight as ta, ZoomOut as aa, ZoomIn as na, Switch as la, RefreshLeft as ia, Refresh as oa, Download as Fe, Delete as Me, Upload as ra } from "@element-plus/icons-vue";
7
7
  import { downloadByUrl as Ct, downloadByBlob as Re, objectToFormData as sa } from "@jnrs/shared";
8
8
  import { useI18n as ua } from "vue-i18n";
9
- import { i as Ce, b as se, r as M, a as J, f as ca, S as ge, u as Aa, c as da, d as fa } from "../useMouseSelection-DU3qQWIm.js";
9
+ import { i as Ce, b as se, r as M, a as J, f as ca, S as ge, u as Aa, c as da, d as fa } from "../useMouseSelection-DRaVfdZU.js";
10
10
  const ga = { class: "jn_globalSetting_item" }, ma = { class: "jn_globalSetting_item" }, va = { class: "jn_globalSetting_item" }, ha = { class: "jn_globalSetting_item" }, Ia = /* @__PURE__ */ x({
11
11
  __name: "GlobalSetting",
12
12
  setup(e, { expose: t }) {
@@ -1,4 +1,4 @@
1
- import { c as _, u as j } from "../useMouseSelection-DU3qQWIm.js";
1
+ import { c as _, u as j } from "../useMouseSelection-DRaVfdZU.js";
2
2
  import { ref as p, onDeactivated as J, onActivated as x, onUnmounted as D } from "vue";
3
3
  import { ElMessage as v } from "element-plus";
4
4
  function H(w) {
@@ -0,0 +1,206 @@
1
+ import { ref as P, onActivated as L, onDeactivated as _, onMounted as q, onUnmounted as D } from "vue";
2
+ var N = typeof global == "object" && global && global.Object === Object && global, W = typeof self == "object" && self && self.Object === Object && self, A = N || W || Function("return this")(), S = A.Symbol, H = Object.prototype, F = H.hasOwnProperty, G = H.toString, h = S ? S.toStringTag : void 0;
3
+ function U(e) {
4
+ var t = F.call(e, h), c = e[h];
5
+ try {
6
+ e[h] = void 0;
7
+ var o = !0;
8
+ } catch {
9
+ }
10
+ var n = G.call(e);
11
+ return o && (t ? e[h] = c : delete e[h]), n;
12
+ }
13
+ var z = Object.prototype, X = z.toString;
14
+ function Y(e) {
15
+ return X.call(e);
16
+ }
17
+ var J = "[object Null]", K = "[object Undefined]", I = S ? S.toStringTag : void 0;
18
+ function Q(e) {
19
+ return e == null ? e === void 0 ? K : J : I && I in Object(e) ? U(e) : Y(e);
20
+ }
21
+ function V(e) {
22
+ return e != null && typeof e == "object";
23
+ }
24
+ var Z = "[object Symbol]";
25
+ function ee(e) {
26
+ return typeof e == "symbol" || V(e) && Q(e) == Z;
27
+ }
28
+ var te = /\s/;
29
+ function ne(e) {
30
+ for (var t = e.length; t-- && te.test(e.charAt(t)); )
31
+ ;
32
+ return t;
33
+ }
34
+ var ie = /^\s+/;
35
+ function oe(e) {
36
+ return e && e.slice(0, ne(e) + 1).replace(ie, "");
37
+ }
38
+ function j(e) {
39
+ var t = typeof e;
40
+ return e != null && (t == "object" || t == "function");
41
+ }
42
+ var R = NaN, re = /^[-+]0x[0-9a-f]+$/i, ce = /^0b[01]+$/i, se = /^0o[0-7]+$/i, ae = parseInt;
43
+ function k(e) {
44
+ if (typeof e == "number")
45
+ return e;
46
+ if (ee(e))
47
+ return R;
48
+ if (j(e)) {
49
+ var t = typeof e.valueOf == "function" ? e.valueOf() : e;
50
+ e = j(t) ? t + "" : t;
51
+ }
52
+ if (typeof e != "string")
53
+ return e === 0 ? e : +e;
54
+ e = oe(e);
55
+ var c = ce.test(e);
56
+ return c || se.test(e) ? ae(e.slice(2), c ? 2 : 8) : re.test(e) ? R : +e;
57
+ }
58
+ var w = function() {
59
+ return A.Date.now();
60
+ }, de = "Expected a function", ue = Math.max, fe = Math.min;
61
+ function le(e, t, c) {
62
+ var o, n, i, u, s, a, b = 0, x = !1, d = !1, f = !0;
63
+ if (typeof e != "function")
64
+ throw new TypeError(de);
65
+ t = k(t) || 0, j(c) && (x = !!c.leading, d = "maxWait" in c, i = d ? ue(k(c.maxWait) || 0, t) : i, f = "trailing" in c ? !!c.trailing : f);
66
+ function l(r) {
67
+ var g = o, y = n;
68
+ return o = n = void 0, b = r, u = e.apply(y, g), u;
69
+ }
70
+ function m(r) {
71
+ return b = r, s = setTimeout(v, t), x ? l(r) : u;
72
+ }
73
+ function p(r) {
74
+ var g = r - a, y = r - b, O = t - g;
75
+ return d ? fe(O, i - y) : O;
76
+ }
77
+ function M(r) {
78
+ var g = r - a, y = r - b;
79
+ return a === void 0 || g >= t || g < 0 || d && y >= i;
80
+ }
81
+ function v() {
82
+ var r = w();
83
+ if (M(r))
84
+ return E(r);
85
+ s = setTimeout(v, p(r));
86
+ }
87
+ function E(r) {
88
+ return s = void 0, f && o ? l(r) : (o = n = void 0, u);
89
+ }
90
+ function $() {
91
+ s !== void 0 && clearTimeout(s), b = 0, o = a = n = s = void 0;
92
+ }
93
+ function C() {
94
+ return s === void 0 ? u : E(w());
95
+ }
96
+ function T() {
97
+ var r = w(), g = M(r);
98
+ if (o = arguments, n = this, a = r, g) {
99
+ if (s === void 0)
100
+ return m(a);
101
+ if (d)
102
+ return clearTimeout(s), s = setTimeout(v, t), l(a);
103
+ }
104
+ return s === void 0 && (s = setTimeout(v, t)), u;
105
+ }
106
+ return T.cancel = $, T.flush = C, T;
107
+ }
108
+ const me = 40, ge = 40;
109
+ function he({
110
+ className: e = "el-table",
111
+ bottomGap: t = me + ge
112
+ } = {}) {
113
+ const c = P(500), o = le(
114
+ () => {
115
+ const n = document.querySelector(`.${e}`);
116
+ if (n) {
117
+ const i = n.getBoundingClientRect(), u = window.innerHeight, s = i.top + t, a = u - s;
118
+ c.value = a > 100 ? a : 100;
119
+ }
120
+ },
121
+ 300,
122
+ { leading: !1 }
123
+ );
124
+ return L(() => {
125
+ o(), window.addEventListener("resize", o);
126
+ }), _(() => {
127
+ window.removeEventListener("resize", o);
128
+ }), { maxHeight: c };
129
+ }
130
+ function pe({
131
+ containerClass: e = "jn_table",
132
+ rowClass: t = "el-table__row",
133
+ callback: c = be
134
+ } = {}) {
135
+ let o = !1, n = { x: 0, y: 0 }, i = { x: 0, y: 0 };
136
+ q(() => {
137
+ window.addEventListener("mouseup", a);
138
+ }), D(() => {
139
+ window.removeEventListener("mouseup", a), B();
140
+ }), L(() => {
141
+ window.addEventListener("mouseup", a);
142
+ }), _(() => {
143
+ window.removeEventListener("mouseup", a), B();
144
+ });
145
+ const u = (d) => {
146
+ window.addEventListener("mousemove", s), o = !1, n = { x: d.clientX, y: d.clientY }, i = { ...n }, xe();
147
+ }, s = (d) => {
148
+ i = { x: d.clientX, y: d.clientY }, Math.abs(i.x - n.x) > 5 && Math.abs(i.y - n.y) > 24 && (o = !0), o && b(), x();
149
+ }, a = () => {
150
+ window.removeEventListener("mousemove", s), o && (o = !1), x();
151
+ }, b = () => {
152
+ const f = document.querySelector(`.${e}`)?.querySelectorAll(`.${t}`);
153
+ if (!f)
154
+ return !1;
155
+ f.forEach((l) => {
156
+ const m = l.getBoundingClientRect();
157
+ m.right > Math.min(n.x, i.x) && m.left < Math.max(n.x, i.x) && m.bottom > Math.min(n.y, i.y) && m.top < Math.max(n.y, i.y) && c && c(l);
158
+ });
159
+ }, x = () => {
160
+ const d = document.querySelector(".useMouseSelection_fixedRectBox");
161
+ if (d) {
162
+ const f = Math.min(n.x, i.x) + "px", l = Math.min(n.y, i.y) + "px", m = Math.abs(i.x - n.x) + "px", p = Math.abs(i.y - n.y) + "px";
163
+ Object.assign(d.style, {
164
+ display: o ? "block" : "none",
165
+ left: f,
166
+ top: l,
167
+ width: m,
168
+ height: p
169
+ });
170
+ }
171
+ };
172
+ return {
173
+ handleMouseDown: u
174
+ };
175
+ }
176
+ const be = (e) => {
177
+ const t = e.querySelector(".el-checkbox input[type='checkbox']");
178
+ t && !t.checked && t.click(), window.getSelection()?.removeAllRanges();
179
+ }, xe = () => {
180
+ if (!document.querySelector(".useMouseSelection_fixedRectBox")) {
181
+ const t = document.createElement("div");
182
+ t.className = "useMouseSelection_fixedRectBox", Object.assign(t.style, {
183
+ display: "none",
184
+ position: "fixed",
185
+ "z-index": 100,
186
+ border: "2px dashed #409eff",
187
+ "background-color": "rgba(64, 158, 255, 0.2)",
188
+ "pointer-events": "none",
189
+ "will-change": "transform"
190
+ }), document.body.appendChild(t);
191
+ }
192
+ }, B = () => {
193
+ const e = document.querySelector(".useMouseSelection_fixedRectBox");
194
+ e && document.body.removeChild(e);
195
+ };
196
+ export {
197
+ S,
198
+ V as a,
199
+ Q as b,
200
+ pe as c,
201
+ le as d,
202
+ N as f,
203
+ j as i,
204
+ A as r,
205
+ he as u
206
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jnrs/vue-core",
3
- "version": "1.2.22",
3
+ "version": "1.2.23",
4
4
  "description": "巨能前端工程化开发,Vue 专用核心功能包。",
5
5
  "keywords": [
6
6
  "jnrs",
@@ -22,6 +22,7 @@
22
22
  "dist",
23
23
  "README.md",
24
24
  "AGENTS.md",
25
+ "CHANGELOG.md",
25
26
  "LICENSE"
26
27
  ],
27
28
  "exports": {
@@ -59,7 +60,7 @@
59
60
  "vue": "^3.5.22",
60
61
  "vue-i18n": "^11.2.8",
61
62
  "vue-router": "^4.5.1",
62
- "@jnrs/shared": "1.1.28"
63
+ "@jnrs/shared": "1.1.29"
63
64
  },
64
65
  "devDependencies": {
65
66
  "@vitejs/plugin-vue": "^6.0.1",
@@ -1,207 +0,0 @@
1
- import { ref as P, onActivated as L, onDeactivated as B, onMounted as q, onUnmounted as D } from "vue";
2
- var N = typeof global == "object" && global && global.Object === Object && global, C = typeof self == "object" && self && self.Object === Object && self, $ = N || C || Function("return this")(), T = $.Symbol, H = Object.prototype, W = H.hasOwnProperty, F = H.toString, h = T ? T.toStringTag : void 0;
3
- function G(e) {
4
- var t = W.call(e, h), c = e[h];
5
- try {
6
- e[h] = void 0;
7
- var i = !0;
8
- } catch {
9
- }
10
- var n = F.call(e);
11
- return i && (t ? e[h] = c : delete e[h]), n;
12
- }
13
- var U = Object.prototype, z = U.toString;
14
- function X(e) {
15
- return z.call(e);
16
- }
17
- var Y = "[object Null]", J = "[object Undefined]", I = T ? T.toStringTag : void 0;
18
- function K(e) {
19
- return e == null ? e === void 0 ? J : Y : I && I in Object(e) ? G(e) : X(e);
20
- }
21
- function Q(e) {
22
- return e != null && typeof e == "object";
23
- }
24
- var V = "[object Symbol]";
25
- function Z(e) {
26
- return typeof e == "symbol" || Q(e) && K(e) == V;
27
- }
28
- var ee = /\s/;
29
- function te(e) {
30
- for (var t = e.length; t-- && ee.test(e.charAt(t)); )
31
- ;
32
- return t;
33
- }
34
- var ne = /^\s+/;
35
- function ie(e) {
36
- return e && e.slice(0, te(e) + 1).replace(ne, "");
37
- }
38
- function M(e) {
39
- var t = typeof e;
40
- return e != null && (t == "object" || t == "function");
41
- }
42
- var R = NaN, oe = /^[-+]0x[0-9a-f]+$/i, re = /^0b[01]+$/i, ce = /^0o[0-7]+$/i, se = parseInt;
43
- function k(e) {
44
- if (typeof e == "number")
45
- return e;
46
- if (Z(e))
47
- return R;
48
- if (M(e)) {
49
- var t = typeof e.valueOf == "function" ? e.valueOf() : e;
50
- e = M(t) ? t + "" : t;
51
- }
52
- if (typeof e != "string")
53
- return e === 0 ? e : +e;
54
- e = ie(e);
55
- var c = re.test(e);
56
- return c || ce.test(e) ? se(e.slice(2), c ? 2 : 8) : oe.test(e) ? R : +e;
57
- }
58
- var j = function() {
59
- return $.Date.now();
60
- }, ae = "Expected a function", ue = Math.max, fe = Math.min;
61
- function de(e, t, c) {
62
- var i, n, o, f, s, a, b = 0, y = !1, u = !1, d = !0;
63
- if (typeof e != "function")
64
- throw new TypeError(ae);
65
- t = k(t) || 0, M(c) && (y = !!c.leading, u = "maxWait" in c, o = u ? ue(k(c.maxWait) || 0, t) : o, d = "trailing" in c ? !!c.trailing : d);
66
- function l(r) {
67
- var g = i, x = n;
68
- return i = n = void 0, b = r, f = e.apply(x, g), f;
69
- }
70
- function m(r) {
71
- return b = r, s = setTimeout(S, t), y ? l(r) : f;
72
- }
73
- function p(r) {
74
- var g = r - a, x = r - b, E = t - g;
75
- return u ? fe(E, o - x) : E;
76
- }
77
- function v(r) {
78
- var g = r - a, x = r - b;
79
- return a === void 0 || g >= t || g < 0 || u && x >= o;
80
- }
81
- function S() {
82
- var r = j();
83
- if (v(r))
84
- return O(r);
85
- s = setTimeout(S, p(r));
86
- }
87
- function O(r) {
88
- return s = void 0, d && i ? l(r) : (i = n = void 0, f);
89
- }
90
- function _() {
91
- s !== void 0 && clearTimeout(s), b = 0, i = a = n = s = void 0;
92
- }
93
- function A() {
94
- return s === void 0 ? f : O(j());
95
- }
96
- function w() {
97
- var r = j(), g = v(r);
98
- if (i = arguments, n = this, a = r, g) {
99
- if (s === void 0)
100
- return m(a);
101
- if (u)
102
- return clearTimeout(s), s = setTimeout(S, t), l(a);
103
- }
104
- return s === void 0 && (s = setTimeout(S, t)), f;
105
- }
106
- return w.cancel = _, w.flush = A, w;
107
- }
108
- const le = 40, me = 40;
109
- function xe({
110
- className: e = "el-table",
111
- bottomGap: t = le + me
112
- } = {}) {
113
- const c = P(500), i = de(
114
- () => {
115
- const n = document.querySelector(`.${e}`);
116
- if (n) {
117
- const o = n.getBoundingClientRect(), f = window.innerHeight, s = o.top + t, a = f - s;
118
- c.value = a > 100 ? a : 100;
119
- }
120
- },
121
- 300,
122
- { leading: !1 }
123
- );
124
- return L(() => {
125
- i(), window.addEventListener("resize", i);
126
- }), B(() => {
127
- window.removeEventListener("resize", i);
128
- }), { maxHeight: c };
129
- }
130
- function he({
131
- containerClass: e = "jn_table",
132
- rowClass: t = "el-table__row",
133
- callback: c = ge
134
- } = {}) {
135
- let i = !1, n = { x: 0, y: 0 }, o = { x: 0, y: 0 };
136
- q(() => {
137
- window.addEventListener("mouseup", a);
138
- }), D(() => {
139
- window.removeEventListener("mouseup", a);
140
- }), L(() => {
141
- window.addEventListener("mouseup", a);
142
- }), B(() => {
143
- window.removeEventListener("mouseup", a);
144
- });
145
- const f = (u) => {
146
- window.addEventListener("mousemove", s), i = !1, n = { x: u.clientX, y: u.clientY }, o = { ...n };
147
- }, s = (u) => {
148
- o = { x: u.clientX, y: u.clientY }, Math.abs(o.x - n.x) > 5 && Math.abs(o.y - n.y) > 25 && (i = !0), i && b(), y();
149
- }, a = () => {
150
- window.removeEventListener("mousemove", s), i && (i = !1), y();
151
- }, b = () => {
152
- const d = document.querySelector(`.${e}`)?.querySelectorAll(`.${t}`);
153
- if (!d)
154
- return !1;
155
- d.forEach((l) => {
156
- const m = l.getBoundingClientRect();
157
- m.right > Math.min(n.x, o.x) && m.left < Math.max(n.x, o.x) && m.bottom > Math.min(n.y, o.y) && m.top < Math.max(n.y, o.y) && c && c(l);
158
- });
159
- }, y = () => {
160
- const u = document.querySelector(".useMouseSelection_fixedRectBox");
161
- if (u) {
162
- const d = Math.min(n.x, o.x) + "px", l = Math.min(n.y, o.y) + "px", m = Math.abs(o.x - n.x) + "px", p = Math.abs(o.y - n.y) + "px";
163
- Object.assign(u.style, {
164
- display: i ? "block" : "none",
165
- left: d,
166
- top: l,
167
- width: m,
168
- height: p
169
- });
170
- const v = document.querySelector(`.${e}`);
171
- Object.assign(v.style, {
172
- "user-select": i ? "none" : "auto"
173
- });
174
- }
175
- };
176
- return be(), {
177
- handleMouseDown: f
178
- };
179
- }
180
- const ge = (e) => {
181
- const t = e.querySelector("input[type='checkbox']");
182
- t && !t.checked && t.click();
183
- }, be = () => {
184
- if (!document.querySelector(".useMouseSelection_fixedRectBox")) {
185
- const t = document.createElement("div");
186
- t.className = "useMouseSelection_fixedRectBox", Object.assign(t.style, {
187
- display: "none",
188
- position: "fixed",
189
- "z-index": 100,
190
- border: "2px dashed #409eff",
191
- "background-color": "rgba(64, 158, 255, 0.2)",
192
- "pointer-events": "none",
193
- "will-change": "transform"
194
- }), document.body.appendChild(t);
195
- }
196
- };
197
- export {
198
- T as S,
199
- Q as a,
200
- K as b,
201
- he as c,
202
- de as d,
203
- N as f,
204
- M as i,
205
- $ as r,
206
- xe as u
207
- };