@go-wind/admin-core 0.1.0 → 0.1.1

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.
@@ -191,10 +191,10 @@ function he(e, t = 2) {
191
191
  function ge(e) {
192
192
  return (e / 100).toFixed(2);
193
193
  }
194
- function _e(e) {
194
+ function A(e) {
195
195
  return `${(e / 1073741824).toFixed(2)} GB`;
196
196
  }
197
- function A(e, t = 2) {
197
+ function j(e, t = 2) {
198
198
  if (e === 0) return "0 B";
199
199
  let n = 1024, r = [
200
200
  "B",
@@ -206,12 +206,12 @@ function A(e, t = 2) {
206
206
  ], i = Math.floor(Math.log(e) / Math.log(n)), a = Math.min(i, r.length - 1);
207
207
  return `${(e / n ** a).toFixed(t)} ${r[a]}`;
208
208
  }
209
- function j(e) {
209
+ function M(e) {
210
210
  if (!Array.isArray(e)) throw TypeError("输入必须是 Array 类型");
211
211
  let t = (e) => typeof e == "number" && Object.prototype.toString.call(e) === "[object Number]" && !Number.isNaN(e) && Number.isFinite(e);
212
212
  return e.filter((e) => t(e));
213
213
  }
214
- function M(e, t) {
214
+ function N(e, t) {
215
215
  if (!Array.isArray(e) || !Array.isArray(t)) return [];
216
216
  let n = /* @__PURE__ */ new Set(), r = (e) => {
217
217
  for (let t of e) t.children && t.children.length > 0 ? r(t.children) : typeof t.key == "string" && t.key !== "" && n.add(t.key);
@@ -219,14 +219,14 @@ function M(e, t) {
219
219
  return r(t), e.filter((e) => typeof e == "string" && n.has(e));
220
220
  }
221
221
  // src/utils/utils.ts
222
- function N(e) {
222
+ function P(e) {
223
223
  let t = Object.getPrototypeOf(e);
224
224
  Object.getOwnPropertyNames(t).forEach((n) => {
225
225
  let r = Object.getOwnPropertyDescriptor(t, n), i = e[n];
226
226
  typeof i == "function" && n !== "constructor" && r && !r.get && !r.set && (e[n] = i.bind(e));
227
227
  });
228
228
  }
229
- function P(e, t) {
229
+ function F(e, t) {
230
230
  if (typeof t != "string" || t.length === 0) throw Error("Path must be a non-empty string");
231
231
  let n = t.split("."), r = e;
232
232
  for (let e of n) {
@@ -235,7 +235,7 @@ function P(e, t) {
235
235
  }
236
236
  return r;
237
237
  }
238
- function F(e) {
238
+ function I(e) {
239
239
  if (typeof globalThis.structuredClone == "function") try {
240
240
  return globalThis.structuredClone(e);
241
241
  } catch {}
@@ -272,27 +272,27 @@ function F(e) {
272
272
  return n(e);
273
273
  }
274
274
  // src/utils/query.ts
275
- function I(e) {
275
+ function L(e) {
276
276
  return Object.prototype.toString.call(e) === "[object Object]";
277
277
  }
278
- function L(e) {
278
+ function R(e) {
279
279
  if (e == null || e === "") return;
280
280
  let t = typeof e;
281
281
  if (t === "number" || t === "boolean" || t === "string") return e;
282
282
  if (Array.isArray(e)) {
283
- let t = e.map((e) => L(e)).filter((e) => e !== void 0);
283
+ let t = e.map((e) => R(e)).filter((e) => e !== void 0);
284
284
  return t.length === 0 ? void 0 : t;
285
285
  }
286
- if (I(e)) {
287
- let t = Object.entries(e).map(([e, t]) => [e, L(t)]).filter(([e, t]) => t !== void 0), n = Object.fromEntries(t);
286
+ if (L(e)) {
287
+ let t = Object.entries(e).map(([e, t]) => [e, R(t)]).filter(([e, t]) => t !== void 0), n = Object.fromEntries(t);
288
288
  return Object.keys(n).length === 0 ? void 0 : n;
289
289
  }
290
290
  return e;
291
291
  }
292
- var R = (e) => Object.fromEntries(Object.entries(e).filter(([e, t]) => t != null && t !== ""));
293
- function ve(e, t = !1) {
292
+ var z = (e) => Object.fromEntries(Object.entries(e).filter(([e, t]) => t != null && t !== ""));
293
+ function _e(e, t = !1) {
294
294
  if (e == null) return;
295
- let n = R(e);
295
+ let n = z(e);
296
296
  if (n !== void 0) {
297
297
  if (Array.isArray(n)) return n.length === 0 ? void 0 : JSON.stringify(n);
298
298
  if (Object.keys(n).length !== 0) {
@@ -304,9 +304,9 @@ function ve(e, t = !1) {
304
304
  }
305
305
  }
306
306
  }
307
- function ye(e) {
307
+ function ve(e) {
308
308
  if (e == null) return;
309
- let t = R(e);
309
+ let t = z(e);
310
310
  if (Object.keys(t).length === 0) return;
311
311
  let n = [];
312
312
  for (let [e, r] of Object.entries(t)) {
@@ -345,7 +345,7 @@ function ye(e) {
345
345
  break;
346
346
  case "in":
347
347
  if (Array.isArray(r)) {
348
- let e = r.map((e) => z(e)).join(", ");
348
+ let e = r.map((e) => B(e)).join(", ");
349
349
  n.push(`${t} in [${e}]`);
350
350
  continue;
351
351
  }
@@ -353,7 +353,7 @@ function ye(e) {
353
353
  case "nin":
354
354
  case "not_in":
355
355
  if (Array.isArray(r)) {
356
- let e = r.map((e) => z(e)).join(", ");
356
+ let e = r.map((e) => B(e)).join(", ");
357
357
  n.push(`${t} not in [${e}]`);
358
358
  continue;
359
359
  }
@@ -361,52 +361,52 @@ function ye(e) {
361
361
  default: i = "=";
362
362
  }
363
363
  }
364
- let a = z(r);
364
+ let a = B(r);
365
365
  i === ":" ? n.push(`${t} : ${a}`) : n.push(`${t}${i}${a}`);
366
366
  }
367
367
  if (n.length !== 0) return n.join(" AND ");
368
368
  }
369
- function z(e) {
370
- return e == null ? "null" : typeof e == "boolean" ? e ? "true" : "false" : typeof e == "number" ? String(e) : Array.isArray(e) ? `[${e.map((e) => z(e)).join(", ")}]` : typeof e == "string" ? `"${e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"` : `"${String(e)}"`;
369
+ function B(e) {
370
+ return e == null ? "null" : typeof e == "boolean" ? e ? "true" : "false" : typeof e == "number" ? String(e) : Array.isArray(e) ? `[${e.map((e) => B(e)).join(", ")}]` : typeof e == "string" ? `"${e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"` : `"${String(e)}"`;
371
371
  }
372
- function be(e) {
372
+ function ye(e) {
373
373
  return e === void 0 && (e = ["-created_at"]), e === null && (e = ["-created_at"]), JSON.stringify(e) ?? void 0;
374
374
  }
375
- function xe(e, t) {
375
+ function be(e, t) {
376
376
  if (typeof e != "object" || !e) return e;
377
377
  let n = { ...e }, r = Array.isArray(t) ? t : [t];
378
378
  for (let e of r) Object.prototype.hasOwnProperty.call(n, e) && delete n[e];
379
379
  return n;
380
380
  }
381
381
  // src/utils/merge.ts
382
- var Se = t((e, t, n) => {
382
+ var xe = t((e, t, n) => {
383
383
  if (Array.isArray(e[t]) && Array.isArray(n)) return n;
384
384
  });
385
385
  // src/utils/window.ts
386
- function B(e, t = {}) {
386
+ function V(e, t = {}) {
387
387
  let { noopener: n = !0, noreferrer: r = !0, target: i = "_blank" } = t, a = [n && "noopener=yes", r && "noreferrer=yes"].filter(Boolean).join(",");
388
388
  window.open(e, i, a);
389
389
  }
390
- function Ce(e) {
390
+ function Se(e) {
391
391
  let { hash: t, origin: n } = location, r = e.startsWith("/") ? e : `/${e}`;
392
- B(`${n}${t ? "/#" : ""}${r}`, { target: "_blank" });
392
+ V(`${n}${t ? "/#" : ""}${r}`, { target: "_blank" });
393
393
  }
394
394
  // src/utils/nprogress.ts
395
- var V = null;
396
- async function H() {
397
- return V || (V = await import("nprogress"), V.configure({
395
+ var H = null;
396
+ async function U() {
397
+ return H || (H = await import("nprogress"), H.configure({
398
398
  showSpinner: !0,
399
399
  speed: 300
400
- }), V);
400
+ }), H);
401
401
  }
402
- async function we() {
403
- (await H())?.start();
402
+ async function Ce() {
403
+ (await U())?.start();
404
404
  }
405
- async function Te() {
406
- (await H())?.done();
405
+ async function we() {
406
+ (await U())?.done();
407
407
  }
408
408
  // src/utils/tree.ts
409
- function Ee(e, t, n) {
409
+ function Te(e, t, n) {
410
410
  let r = [], { childProps: i } = n || { childProps: "children" }, a = (e) => {
411
411
  let n = t(e);
412
412
  r.push(n);
@@ -416,56 +416,56 @@ function Ee(e, t, n) {
416
416
  for (let t of e) a(t);
417
417
  return r.filter(Boolean);
418
418
  }
419
- function De(e, t, n) {
419
+ function Ee(e, t, n) {
420
420
  let { childProps: r } = n || { childProps: "children" }, i = (e) => e.filter((e) => t(e) ? (e[r] && (e[r] = i(e[r])), !0) : !1);
421
421
  return i(e);
422
422
  }
423
- function U(e, t, n) {
423
+ function W(e, t, n) {
424
424
  let { childProps: r } = n || { childProps: "children" };
425
425
  return e.map((e) => {
426
426
  let i = t(e);
427
- return i[r] && (i[r] = U(i[r], t, n)), i;
427
+ return i[r] && (i[r] = W(i[r], t, n)), i;
428
428
  });
429
429
  }
430
430
  // src/utils/inference.ts
431
- function Oe(e) {
431
+ function De(e) {
432
432
  return e === void 0;
433
433
  }
434
- function ke(e) {
434
+ function Oe(e) {
435
435
  return typeof e == "boolean";
436
436
  }
437
- function W(e) {
437
+ function G(e) {
438
438
  return typeof e == "string";
439
439
  }
440
- function G(e) {
440
+ function K(e) {
441
441
  return typeof e == "object" && !!e;
442
442
  }
443
- function Ae(e) {
443
+ function ke(e) {
444
444
  return typeof e == "function";
445
445
  }
446
- function je(e) {
447
- return e == null ? !0 : Array.isArray(e) || W(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : G(e) ? Object.keys(e).length === 0 : !1;
446
+ function Ae(e) {
447
+ return e == null ? !0 : Array.isArray(e) || G(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : K(e) ? Object.keys(e).length === 0 : !1;
448
448
  }
449
- function Me(e) {
449
+ function je(e) {
450
450
  return e ? /^https?:\/\/.*$/.test(e) : !1;
451
451
  }
452
- function Ne(e) {
452
+ function Me(e) {
453
453
  return typeof window < "u" && e !== null && e === e.window;
454
454
  }
455
- function Pe() {
455
+ function Ne() {
456
456
  return /macintosh|mac os x/i.test(navigator.userAgent);
457
457
  }
458
- function Fe() {
458
+ function Pe() {
459
459
  return /windows|win32/i.test(navigator.userAgent);
460
460
  }
461
- function Ie(e) {
461
+ function Fe(e) {
462
462
  return typeof e == "number" && Number.isFinite(e);
463
463
  }
464
- function Le(...e) {
464
+ function Ie(...e) {
465
465
  for (let t of e) if (t != null) return t;
466
466
  }
467
467
  // ../../node_modules/.pnpm/dayjs@1.11.23/node_modules/dayjs/plugin/relativeTime.js
468
- var Re = /* @__PURE__ */ _(((e, t, n) => {
468
+ var Le = /* @__PURE__ */ _(((e, t, n) => {
469
469
  (function(n, r) {
470
470
  typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_relativeTime = r();
471
471
  })(n, (function() {
@@ -569,7 +569,7 @@ var Re = /* @__PURE__ */ _(((e, t, n) => {
569
569
  };
570
570
  };
571
571
  }));
572
- })), ze = /* @__PURE__ */ _(((e, t, n) => {
572
+ })), Re = /* @__PURE__ */ _(((e, t, n) => {
573
573
  (function(n, r) {
574
574
  typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_timezone = r();
575
575
  })(n, (function() {
@@ -650,7 +650,7 @@ var Re = /* @__PURE__ */ _(((e, t, n) => {
650
650
  };
651
651
  };
652
652
  }));
653
- })), Be = /* @__PURE__ */ _(((e, t, n) => {
653
+ })), ze = /* @__PURE__ */ _(((e, t, n) => {
654
654
  (function(n, r) {
655
655
  typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_utc = r();
656
656
  })(n, (function() {
@@ -734,28 +734,27 @@ var Re = /* @__PURE__ */ _(((e, t, n) => {
734
734
  };
735
735
  };
736
736
  }));
737
- })), Ve = /* @__PURE__ */ y(Re(), 1), He = /* @__PURE__ */ y(ze(), 1), Ue = /* @__PURE__ */ y(Be(), 1);
738
- o.extend(Ue.default), o.extend(He.default), o.extend(Ve.default);
739
- var K = o, q = "Asia/Shanghai";
740
- o.tz.setDefault(q), K.tz.setDefault(q);
741
- function J(e, t = "YYYY-MM-DD") {
737
+ })), Be = /* @__PURE__ */ y(Le(), 1), Ve = /* @__PURE__ */ y(Re(), 1), He = /* @__PURE__ */ y(ze(), 1);
738
+ o.extend(He.default), o.extend(Ve.default), o.extend(Be.default);
739
+ var q = o, J = "Asia/Shanghai";
740
+ o.tz.setDefault(J), q.tz.setDefault(J);
741
+ function Y(e, t = "YYYY-MM-DD") {
742
742
  if (e == null || e === "") return "";
743
- if (Y(e)) return K.tz(e, q).format(t);
744
743
  try {
745
- let n = K.tz(e, q);
744
+ let n = q(e).tz(J);
746
745
  return n.isValid() ? n.format(t) : "";
747
746
  } catch (t) {
748
747
  return console.error(`Error formatting date: ${t}`), e;
749
748
  }
750
749
  }
751
- function We(e) {
752
- return e == null || e === "" ? "" : J(e, "YYYY-MM-DD HH:mm:ss");
750
+ function Ue(e) {
751
+ return e == null || e === "" ? "" : Y(e, "YYYY-MM-DD HH:mm:ss");
753
752
  }
754
- function Y(e) {
753
+ function We(e) {
755
754
  return e instanceof Date;
756
755
  }
757
756
  function Ge(e) {
758
- return K.isDayjs(e);
757
+ return q.isDayjs(e);
759
758
  }
760
759
  // src/utils/letter.ts
761
760
  function Ke(e) {
@@ -954,7 +953,7 @@ var it = class {
954
953
  timeout: 1e4,
955
954
  withCredentials: !0
956
955
  }, { ...a } = t, o = r(a, i);
957
- this.instance = e.create(o), N(this);
956
+ this.instance = e.create(o), P(this);
958
957
  let s = new st(this.instance);
959
958
  this.addRequestInterceptor = s.addRequestInterceptor.bind(s), this.addResponseInterceptor = s.addResponseInterceptor.bind(s);
960
959
  let c = new ct(this);
@@ -1683,6 +1682,6 @@ var ut = class e {
1683
1682
  };
1684
1683
  }
1685
1684
  };
1686
- export { ut as PaginationQuery, Q as RequestClient, $ as SSEClient, dt as SSE_EVENT, et as StateHandler, pt as StorageManager, X as arraysEqual, C as authenticateResponseInterceptor, N as bindMethods, _e as bytesToGB, Ke as capitalizeFirstLetter, ge as centToDollar, L as cleanQueryRule, l as cloneDeep, tt as cn, te as consumeCaptchaHeaders, n as createMerge, K as dateUtil, F as deepClone, x as defaultIdGenerator, Z as diff, rt as downloadFile, ie as encryptPassword, oe as encryptPasswordEnvelope, w as errorMessageResponseInterceptor, M as extractLeafIds, j as filterNumbers, De as filterTree, A as formatBytes, he as formatCurrency, J as formatDate, We as formatDateTime, pe as formatFileSize, fe as formatGrowthRate, me as formatNumber, ce as getCharColor, S as getDefaultErrorMsg, Xe as getElementVisibleRect, Le as getFirstNonNullOrUndefined, P as getNestedValue, se as getRandomColor, Ze as getScrollbarWidth, ft as globalSSEClient, le as hexToHsl, de as hexToHslString, D as hexToRgb, k as hslToHex, ke as isBoolean, Y as isDate, Ge as isDayjsObject, je as isEmpty, Ae as isFunction, Me as isHttpUrl, Pe as isMacOs, Ie as isNumber, G as isObject, W as isString, Oe as isUndefined, Ne as isWindow, Fe as isWindowsOs, Ye as kebabToCamelCase, ye as makeFilterString, be as makeOrderBy, ve as makeQueryString, ne as makeUpdateMask, U as mapTree, i as merge, Se as mergeWithArrayOverride, Qe as needsScrollbar, xe as omit, Ce as openRouteInNewWindow, B as openWindow, R as removeNullUndefined, lt as requestApi, O as rgbToHex, ee as setCaptchaHeaders, we as startProgress, Te as stopProgress, Je as toCamelCase, ue as toHex, qe as toLowerCaseFirstLetter, Ee as traverseTreeValues, $e as triggerWindowResize };
1685
+ export { ut as PaginationQuery, Q as RequestClient, $ as SSEClient, dt as SSE_EVENT, et as StateHandler, pt as StorageManager, X as arraysEqual, C as authenticateResponseInterceptor, P as bindMethods, A as bytesToGB, Ke as capitalizeFirstLetter, ge as centToDollar, R as cleanQueryRule, l as cloneDeep, tt as cn, te as consumeCaptchaHeaders, n as createMerge, q as dateUtil, I as deepClone, x as defaultIdGenerator, Z as diff, rt as downloadFile, ie as encryptPassword, oe as encryptPasswordEnvelope, w as errorMessageResponseInterceptor, N as extractLeafIds, M as filterNumbers, Ee as filterTree, j as formatBytes, he as formatCurrency, Y as formatDate, Ue as formatDateTime, pe as formatFileSize, fe as formatGrowthRate, me as formatNumber, ce as getCharColor, S as getDefaultErrorMsg, Xe as getElementVisibleRect, Ie as getFirstNonNullOrUndefined, F as getNestedValue, se as getRandomColor, Ze as getScrollbarWidth, ft as globalSSEClient, le as hexToHsl, de as hexToHslString, D as hexToRgb, k as hslToHex, Oe as isBoolean, We as isDate, Ge as isDayjsObject, Ae as isEmpty, ke as isFunction, je as isHttpUrl, Ne as isMacOs, Fe as isNumber, K as isObject, G as isString, De as isUndefined, Me as isWindow, Pe as isWindowsOs, Ye as kebabToCamelCase, ve as makeFilterString, ye as makeOrderBy, _e as makeQueryString, ne as makeUpdateMask, W as mapTree, i as merge, xe as mergeWithArrayOverride, Qe as needsScrollbar, be as omit, Se as openRouteInNewWindow, V as openWindow, z as removeNullUndefined, lt as requestApi, O as rgbToHex, ee as setCaptchaHeaders, Ce as startProgress, we as stopProgress, Je as toCamelCase, ue as toHex, qe as toLowerCaseFirstLetter, Te as traverseTreeValues, $e as triggerWindowResize };
1687
1686
 
1688
1687
  //# sourceMappingURL=admin-core.js.map