@starasia/admin 14.0.0 → 14.0.2

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),r=require("@tanstack/react-router"),S={useLocation:()=>{const e=r.useLocation();return{pathname:e.pathname,search:e.searchStr??"",hash:e.hash??"",state:e.state}},useParams:()=>r.useParams({strict:!1}),useSearchParams:()=>{const e=r.useNavigate(),a=r.useLocation().searchStr??"",o=new URLSearchParams(a);return[o,(c,s)=>{const n=typeof c=="function"?c(new URLSearchParams(o)):c,i=n instanceof URLSearchParams?n:new URLSearchParams(n),u={};i.forEach((h,m)=>{u[m]=h}),e({to:".",search:u,replace:s==null?void 0:s.replace})}]},useNavigate:()=>{const e=r.useNavigate();return(t,a)=>{if(typeof t=="number"){window.history.go(t);return}e({to:t,replace:a==null?void 0:a.replace})}},Link:({to:e,children:t,...a})=>l.createElement(r.Link,{to:e,...a},t),Outlet:r.Outlet};exports.tanstackAdapter=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),r=require("@tanstack/react-router"),P={useLocation:()=>{const e=r.useLocation();return{pathname:e.pathname,search:e.searchStr??"",hash:e.hash??"",state:e.state}},useParams:()=>r.useParams({strict:!1}),useSearchParams:()=>{const e=r.useNavigate(),a=r.useLocation().searchStr??"",u=c.useMemo(()=>new URLSearchParams(a),[a]),i=c.useCallback((s,n)=>{const o=typeof s=="function"?s(new URLSearchParams(a)):s,l=o instanceof URLSearchParams?o:new URLSearchParams(o),h={};l.forEach((m,S)=>{h[S]=m}),e({to:".",search:h,replace:n==null?void 0:n.replace})},[e,a]);return c.useMemo(()=>[u,i],[u,i])},useNavigate:()=>{const e=r.useNavigate();return(t,a)=>{if(typeof t=="number"){window.history.go(t);return}e({to:t,replace:a==null?void 0:a.replace})}},Link:({to:e,children:t,...a})=>c.createElement(r.Link,{to:e,...a},t),Outlet:r.Outlet};exports.tanstackAdapter=P;
@@ -1,8 +1,8 @@
1
- import P from "react";
2
- import { Outlet as S, Link as f, useNavigate as o, useLocation as i, useParams as L } from "@tanstack/react-router";
3
- const R = {
1
+ import S, { useMemo as i, useCallback as L } from "react";
2
+ import { Outlet as g, Link as p, useNavigate as m, useLocation as u, useParams as w } from "@tanstack/react-router";
3
+ const v = {
4
4
  useLocation: () => {
5
- const a = i();
5
+ const a = u();
6
6
  return {
7
7
  pathname: a.pathname,
8
8
  search: a.searchStr ?? "",
@@ -10,22 +10,31 @@ const R = {
10
10
  state: a.state
11
11
  };
12
12
  },
13
- useParams: () => L({ strict: !1 }),
13
+ useParams: () => w({ strict: !1 }),
14
14
  useSearchParams: () => {
15
- const a = o(), e = i().searchStr ?? "", n = new URLSearchParams(e);
16
- return [n, (t, c) => {
17
- const s = typeof t == "function" ? t(new URLSearchParams(n)) : t, m = s instanceof URLSearchParams ? s : new URLSearchParams(s), h = {};
18
- m.forEach((u, l) => {
19
- h[l] = u;
20
- }), a({
21
- to: ".",
22
- search: h,
23
- replace: c == null ? void 0 : c.replace
24
- });
25
- }];
15
+ const a = m(), e = u().searchStr ?? "", n = i(
16
+ () => new URLSearchParams(e),
17
+ [e]
18
+ ), o = L(
19
+ (c, t) => {
20
+ const s = typeof c == "function" ? c(new URLSearchParams(e)) : c, l = s instanceof URLSearchParams ? s : new URLSearchParams(s), h = {};
21
+ l.forEach((f, P) => {
22
+ h[P] = f;
23
+ }), a({
24
+ to: ".",
25
+ search: h,
26
+ replace: t == null ? void 0 : t.replace
27
+ });
28
+ },
29
+ [a, e]
30
+ );
31
+ return i(
32
+ () => [n, o],
33
+ [n, o]
34
+ );
26
35
  },
27
36
  useNavigate: () => {
28
- const a = o();
37
+ const a = m();
29
38
  return (r, e) => {
30
39
  if (typeof r == "number") {
31
40
  window.history.go(r);
@@ -34,9 +43,9 @@ const R = {
34
43
  a({ to: r, replace: e == null ? void 0 : e.replace });
35
44
  };
36
45
  },
37
- Link: ({ to: a, children: r, ...e }) => P.createElement(f, { to: a, ...e }, r),
38
- Outlet: S
46
+ Link: ({ to: a, children: r, ...e }) => S.createElement(p, { to: a, ...e }, r),
47
+ Outlet: g
39
48
  };
40
49
  export {
41
- R as tanstackAdapter
50
+ v as tanstackAdapter
42
51
  };