react-toolkits 0.0.2 → 0.0.4
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +12 -0
- package/dist/index.css +3 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +9 -12
- package/dist/index.esm.js +40 -43
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -3
- package/src/components/FormModal/hooks.tsx +2 -3
- package/src/components/FormModal/index.tsx +11 -12
- package/src/hooks/use-permission.tsx +10 -7
- package/src/layouts/Layout.tsx +7 -23
- package/src/layouts/NavBar.tsx +25 -37
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> react-toolkits@0.0.
|
|
2
|
+
> react-toolkits@0.0.4 build /home/runner/work/everythingflow/everythingflow/packages/react-toolkits
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mDTS[39m Build start
|
|
13
13
|
[32mESM[39m [1mdist/512_orange_nobackground-L6MFCL6M.png [22m[32m9.49 KB[39m
|
|
14
|
-
[32mESM[39m [1mdist/index.css [22m[32m4.
|
|
15
|
-
[32mESM[39m [1mdist/index.css.map [22m[32m7.
|
|
16
|
-
[32mESM[39m [1mdist/index.esm.js [22m[
|
|
17
|
-
[32mESM[39m [1mdist/index.esm.js.map [22m[
|
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m ⚡️ Build success in
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m7.
|
|
14
|
+
[32mESM[39m [1mdist/index.css [22m[32m4.51 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/index.css.map [22m[32m7.65 KB[39m
|
|
16
|
+
[32mESM[39m [1mdist/index.esm.js [22m[32m115.88 KB[39m
|
|
17
|
+
[32mESM[39m [1mdist/index.esm.js.map [22m[32m160.69 KB[39m
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 1388ms
|
|
19
|
+
[32mDTS[39m ⚡️ Build success in 7304ms
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m7.40 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.css
CHANGED
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/styles/index.css"],"sourcesContent":["@import \"antd/dist/reset.css\";\n\n*, ::before, ::after{\n\n --tw-border-spacing-x: 0;\n\n --tw-border-spacing-y: 0;\n\n --tw-translate-x: 0;\n\n --tw-translate-y: 0;\n\n --tw-rotate: 0;\n\n --tw-skew-x: 0;\n\n --tw-skew-y: 0;\n\n --tw-scale-x: 1;\n\n --tw-scale-y: 1;\n\n --tw-pan-x: ;\n\n --tw-pan-y: ;\n\n --tw-pinch-zoom: ;\n\n --tw-scroll-snap-strictness: proximity;\n\n --tw-gradient-from-position: ;\n\n --tw-gradient-via-position: ;\n\n --tw-gradient-to-position: ;\n\n --tw-ordinal: ;\n\n --tw-slashed-zero: ;\n\n --tw-numeric-figure: ;\n\n --tw-numeric-spacing: ;\n\n --tw-numeric-fraction: ;\n\n --tw-ring-inset: ;\n\n --tw-ring-offset-width: 0px;\n\n --tw-ring-offset-color: #fff;\n\n --tw-ring-color: rgb(59 130 246 / 0.5);\n\n --tw-ring-offset-shadow: 0 0 #0000;\n\n --tw-ring-shadow: 0 0 #0000;\n\n --tw-shadow: 0 0 #0000;\n\n --tw-shadow-colored: 0 0 #0000;\n\n --tw-blur: ;\n\n --tw-brightness: ;\n\n --tw-contrast: ;\n\n --tw-grayscale: ;\n\n --tw-hue-rotate: ;\n\n --tw-invert: ;\n\n --tw-saturate: ;\n\n --tw-sepia: ;\n\n --tw-drop-shadow: ;\n\n --tw-backdrop-blur: ;\n\n --tw-backdrop-brightness: ;\n\n --tw-backdrop-contrast: ;\n\n --tw-backdrop-grayscale: ;\n\n --tw-backdrop-hue-rotate: ;\n\n --tw-backdrop-invert: ;\n\n --tw-backdrop-opacity: ;\n\n --tw-backdrop-saturate: ;\n\n --tw-backdrop-sepia: \n}\n\n::backdrop{\n\n --tw-border-spacing-x: 0;\n\n --tw-border-spacing-y: 0;\n\n --tw-translate-x: 0;\n\n --tw-translate-y: 0;\n\n --tw-rotate: 0;\n\n --tw-skew-x: 0;\n\n --tw-skew-y: 0;\n\n --tw-scale-x: 1;\n\n --tw-scale-y: 1;\n\n --tw-pan-x: ;\n\n --tw-pan-y: ;\n\n --tw-pinch-zoom: ;\n\n --tw-scroll-snap-strictness: proximity;\n\n --tw-gradient-from-position: ;\n\n --tw-gradient-via-position: ;\n\n --tw-gradient-to-position: ;\n\n --tw-ordinal: ;\n\n --tw-slashed-zero: ;\n\n --tw-numeric-figure: ;\n\n --tw-numeric-spacing: ;\n\n --tw-numeric-fraction: ;\n\n --tw-ring-inset: ;\n\n --tw-ring-offset-width: 0px;\n\n --tw-ring-offset-color: #fff;\n\n --tw-ring-color: rgb(59 130 246 / 0.5);\n\n --tw-ring-offset-shadow: 0 0 #0000;\n\n --tw-ring-shadow: 0 0 #0000;\n\n --tw-shadow: 0 0 #0000;\n\n --tw-shadow-colored: 0 0 #0000;\n\n --tw-blur: ;\n\n --tw-brightness: ;\n\n --tw-contrast: ;\n\n --tw-grayscale: ;\n\n --tw-hue-rotate: ;\n\n --tw-invert: ;\n\n --tw-saturate: ;\n\n --tw-sepia: ;\n\n --tw-drop-shadow: ;\n\n --tw-backdrop-blur: ;\n\n --tw-backdrop-brightness: ;\n\n --tw-backdrop-contrast: ;\n\n --tw-backdrop-grayscale: ;\n\n --tw-backdrop-hue-rotate: ;\n\n --tw-backdrop-invert: ;\n\n --tw-backdrop-opacity: ;\n\n --tw-backdrop-saturate: ;\n\n --tw-backdrop-sepia: \n}\n.container{\n\n width: 100%\n}\n@media (min-width: 640px){\n\n .container{\n\n max-width: 640px\n }\n}\n@media (min-width: 768px){\n\n .container{\n\n max-width: 768px\n }\n}\n@media (min-width: 1024px){\n\n .container{\n\n max-width: 1024px\n }\n}\n@media (min-width: 1280px){\n\n .container{\n\n max-width: 1280px\n }\n}\n@media (min-width: 1536px){\n\n .container{\n\n max-width: 1536px\n }\n}\n.fixed{\n\n position: fixed\n}\n.absolute{\n\n position: absolute\n}\n.relative{\n\n position: relative\n}\n.-top-12{\n\n top: -3rem\n}\n.left-0{\n\n left: 0px\n}\n.right-0{\n\n right: 0px\n}\n.top-1\\/2{\n\n top: 50%\n}\n.mb-6{\n\n margin-bottom: 1.5rem\n}\n.ml-2{\n\n margin-left: 0.5rem\n}\n.ml-64{\n\n margin-left: 16rem\n}\n.inline{\n\n display: inline\n}\n.flex{\n\n display: flex\n}\n.hidden{\n\n display: none\n}\n.h-screen{\n\n height: 100vh\n}\n.w-8{\n\n width: 2rem\n}\n.w-full{\n\n width: 100%\n}\n.-translate-y-1\\/2{\n\n --tw-translate-y: -50%;\n\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))\n}\n.transform{\n\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))\n}\n.items-end{\n\n align-items: flex-end\n}\n.items-center{\n\n align-items: center\n}\n.justify-end{\n\n justify-content: flex-end\n}\n.justify-center{\n\n justify-content: center\n}\n.overflow-auto{\n\n overflow: auto\n}\n.bg-gray-50{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(249 250 251 / var(--tw-bg-opacity))\n}\n.p-6{\n\n padding: 1.5rem\n}\n.px-6{\n\n padding-left: 1.5rem;\n\n padding-right: 1.5rem\n}\n.py-4{\n\n padding-top: 1rem;\n\n padding-bottom: 1rem\n}\n.text-center{\n\n text-align: center\n}\n.text-lg{\n\n font-size: 1.125rem;\n\n line-height: 1.75rem\n}\n.font-bold{\n\n font-weight: 700\n}\n.filter{\n\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)\n}\n"],"mappings":";;;AAEA;AAAG;AAAU;AAET,yBAAuB;AAEvB,yBAAuB;AAEvB,oBAAkB;AAElB,oBAAkB;AAElB,eAAa;AAEb,eAAa;AAEb,eAAa;AAEb,gBAAc;AAEd,gBAAc;AAEd;AAEA;AAEA;AAEA,+BAA6B;AAE7B;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA,0BAAwB;AAExB,0BAAwB;AAExB,mBAAiB,IAAI,GAAG,IAAI,IAAI,EAAE;AAElC,2BAAyB,EAAE,EAAE;AAE7B,oBAAkB,EAAE,EAAE;AAEtB,eAAa,EAAE,EAAE;AAEjB,uBAAqB,EAAE,EAAE;AAEzB;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AACJ;AAEA;AAEI,yBAAuB;AAEvB,yBAAuB;AAEvB,oBAAkB;AAElB,oBAAkB;AAElB,eAAa;AAEb,eAAa;AAEb,eAAa;AAEb,gBAAc;AAEd,gBAAc;AAEd;AAEA;AAEA;AAEA,+BAA6B;AAE7B;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA,0BAAwB;AAExB,0BAAwB;AAExB,mBAAiB,IAAI,GAAG,IAAI,IAAI,EAAE;AAElC,2BAAyB,EAAE,EAAE;AAE7B,oBAAkB,EAAE,EAAE;AAEtB,eAAa,EAAE,EAAE;AAEjB,uBAAqB,EAAE,EAAE;AAEzB;AAEA;AAEA;AAEA;AAEA;AAEA;A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AC;AAEG,eAAa;AACjB;AACA,CAAC;AAEG,mBAAiB;AACrB;AACA,CAAC;AAEG,mBAAiB;AACrB;AACA,CAAC;AAEG,YAAU;AACd;AACA,CAAC;AAEG,mBAAiB;AAEjB,oBAAkB,IAAI,IAAI,IAAI,IAAI,EAAE,IAAI;AAC5C;AACA,CAAC;AAEG,WAAS;AACb;AACA,CAAC;AAEG,gBAAc;AAEd,iBAAe;AACnB;AACA,CAAC;AAEG,eAAa;AAEb,kBAAgB;AACpB;AACA,CAAC;AAEG,cAAY;AAChB;AACA,CAAC;AAEG,aAAW;AAEX,eAAa;AACjB;AACA,CAAC;AAEG,eAAa;AACjB;AACA,CAAC;AAEG,UAAQ,IAAI,WAAW,IAAI,iBAAiB,IAAI,eAAe,IAAI,gBAAgB,IAAI,iBAAiB,IAAI,aAAa,IAAI,eAAe,IAAI,YAAY,IAAI;AACpK;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/styles/index.css"],"sourcesContent":["@import \"antd/dist/reset.css\";\n\n*, ::before, ::after{\n\n --tw-border-spacing-x: 0;\n\n --tw-border-spacing-y: 0;\n\n --tw-translate-x: 0;\n\n --tw-translate-y: 0;\n\n --tw-rotate: 0;\n\n --tw-skew-x: 0;\n\n --tw-skew-y: 0;\n\n --tw-scale-x: 1;\n\n --tw-scale-y: 1;\n\n --tw-pan-x: ;\n\n --tw-pan-y: ;\n\n --tw-pinch-zoom: ;\n\n --tw-scroll-snap-strictness: proximity;\n\n --tw-gradient-from-position: ;\n\n --tw-gradient-via-position: ;\n\n --tw-gradient-to-position: ;\n\n --tw-ordinal: ;\n\n --tw-slashed-zero: ;\n\n --tw-numeric-figure: ;\n\n --tw-numeric-spacing: ;\n\n --tw-numeric-fraction: ;\n\n --tw-ring-inset: ;\n\n --tw-ring-offset-width: 0px;\n\n --tw-ring-offset-color: #fff;\n\n --tw-ring-color: rgb(59 130 246 / 0.5);\n\n --tw-ring-offset-shadow: 0 0 #0000;\n\n --tw-ring-shadow: 0 0 #0000;\n\n --tw-shadow: 0 0 #0000;\n\n --tw-shadow-colored: 0 0 #0000;\n\n --tw-blur: ;\n\n --tw-brightness: ;\n\n --tw-contrast: ;\n\n --tw-grayscale: ;\n\n --tw-hue-rotate: ;\n\n --tw-invert: ;\n\n --tw-saturate: ;\n\n --tw-sepia: ;\n\n --tw-drop-shadow: ;\n\n --tw-backdrop-blur: ;\n\n --tw-backdrop-brightness: ;\n\n --tw-backdrop-contrast: ;\n\n --tw-backdrop-grayscale: ;\n\n --tw-backdrop-hue-rotate: ;\n\n --tw-backdrop-invert: ;\n\n --tw-backdrop-opacity: ;\n\n --tw-backdrop-saturate: ;\n\n --tw-backdrop-sepia: \n}\n\n::backdrop{\n\n --tw-border-spacing-x: 0;\n\n --tw-border-spacing-y: 0;\n\n --tw-translate-x: 0;\n\n --tw-translate-y: 0;\n\n --tw-rotate: 0;\n\n --tw-skew-x: 0;\n\n --tw-skew-y: 0;\n\n --tw-scale-x: 1;\n\n --tw-scale-y: 1;\n\n --tw-pan-x: ;\n\n --tw-pan-y: ;\n\n --tw-pinch-zoom: ;\n\n --tw-scroll-snap-strictness: proximity;\n\n --tw-gradient-from-position: ;\n\n --tw-gradient-via-position: ;\n\n --tw-gradient-to-position: ;\n\n --tw-ordinal: ;\n\n --tw-slashed-zero: ;\n\n --tw-numeric-figure: ;\n\n --tw-numeric-spacing: ;\n\n --tw-numeric-fraction: ;\n\n --tw-ring-inset: ;\n\n --tw-ring-offset-width: 0px;\n\n --tw-ring-offset-color: #fff;\n\n --tw-ring-color: rgb(59 130 246 / 0.5);\n\n --tw-ring-offset-shadow: 0 0 #0000;\n\n --tw-ring-shadow: 0 0 #0000;\n\n --tw-shadow: 0 0 #0000;\n\n --tw-shadow-colored: 0 0 #0000;\n\n --tw-blur: ;\n\n --tw-brightness: ;\n\n --tw-contrast: ;\n\n --tw-grayscale: ;\n\n --tw-hue-rotate: ;\n\n --tw-invert: ;\n\n --tw-saturate: ;\n\n --tw-sepia: ;\n\n --tw-drop-shadow: ;\n\n --tw-backdrop-blur: ;\n\n --tw-backdrop-brightness: ;\n\n --tw-backdrop-contrast: ;\n\n --tw-backdrop-grayscale: ;\n\n --tw-backdrop-hue-rotate: ;\n\n --tw-backdrop-invert: ;\n\n --tw-backdrop-opacity: ;\n\n --tw-backdrop-saturate: ;\n\n --tw-backdrop-sepia: \n}\n.container{\n\n width: 100%\n}\n@media (min-width: 640px){\n\n .container{\n\n max-width: 640px\n }\n}\n@media (min-width: 768px){\n\n .container{\n\n max-width: 768px\n }\n}\n@media (min-width: 1024px){\n\n .container{\n\n max-width: 1024px\n }\n}\n@media (min-width: 1280px){\n\n .container{\n\n max-width: 1280px\n }\n}\n@media (min-width: 1536px){\n\n .container{\n\n max-width: 1536px\n }\n}\n.fixed{\n\n position: fixed\n}\n.absolute{\n\n position: absolute\n}\n.relative{\n\n position: relative\n}\n.-top-12{\n\n top: -3rem\n}\n.left-0{\n\n left: 0px\n}\n.right-0{\n\n right: 0px\n}\n.top-1\\/2{\n\n top: 50%\n}\n.mb-6{\n\n margin-bottom: 1.5rem\n}\n.ml-2{\n\n margin-left: 0.5rem\n}\n.ml-64{\n\n margin-left: 16rem\n}\n.inline{\n\n display: inline\n}\n.flex{\n\n display: flex\n}\n.hidden{\n\n display: none\n}\n.h-8{\n\n height: 2rem\n}\n.h-screen{\n\n height: 100vh\n}\n.w-8{\n\n width: 2rem\n}\n.w-full{\n\n width: 100%\n}\n.-translate-y-1\\/2{\n\n --tw-translate-y: -50%;\n\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))\n}\n.transform{\n\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))\n}\n.items-end{\n\n align-items: flex-end\n}\n.items-center{\n\n align-items: center\n}\n.justify-end{\n\n justify-content: flex-end\n}\n.justify-center{\n\n justify-content: center\n}\n.overflow-auto{\n\n overflow: auto\n}\n.bg-gray-50{\n\n --tw-bg-opacity: 1;\n\n background-color: rgb(249 250 251 / var(--tw-bg-opacity))\n}\n.p-6{\n\n padding: 1.5rem\n}\n.px-6{\n\n padding-left: 1.5rem;\n\n padding-right: 1.5rem\n}\n.py-4{\n\n padding-top: 1rem;\n\n padding-bottom: 1rem\n}\n.text-center{\n\n text-align: center\n}\n.text-lg{\n\n font-size: 1.125rem;\n\n line-height: 1.75rem\n}\n.font-bold{\n\n font-weight: 700\n}\n.filter{\n\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)\n}\n"],"mappings":";;;AAEA;AAAG;AAAU;AAET,yBAAuB;AAEvB,yBAAuB;AAEvB,oBAAkB;AAElB,oBAAkB;AAElB,eAAa;AAEb,eAAa;AAEb,eAAa;AAEb,gBAAc;AAEd,gBAAc;AAEd;AAEA;AAEA;AAEA,+BAA6B;AAE7B;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA,0BAAwB;AAExB,0BAAwB;AAExB,mBAAiB,IAAI,GAAG,IAAI,IAAI,EAAE;AAElC,2BAAyB,EAAE,EAAE;AAE7B,oBAAkB,EAAE,EAAE;AAEtB,eAAa,EAAE,EAAE;AAEjB,uBAAqB,EAAE,EAAE;AAEzB;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AACJ;AAEA;AAEI,yBAAuB;AAEvB,yBAAuB;AAEvB,oBAAkB;AAElB,oBAAkB;AAElB,eAAa;AAEb,eAAa;AAEb,eAAa;AAEb,gBAAc;AAEd,gBAAc;AAEd;AAEA;AAEA;A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U,IAAI,iBAAiB,EAAE,IAAI,mBAAmB,OAAO,IAAI,cAAc,MAAM,IAAI,cAAc,MAAM,IAAI,cAAc,OAAO,IAAI,eAAe,OAAO,IAAI;AACrL;AACA,CAAC;AAEG,aAAW,UAAU,IAAI,iBAAiB,EAAE,IAAI,mBAAmB,OAAO,IAAI,cAAc,MAAM,IAAI,cAAc,MAAM,IAAI,cAAc,OAAO,IAAI,eAAe,OAAO,IAAI;AACrL;AACA,CAAC;AAEG,eAAa;AACjB;AACA,CAAC;AAEG,eAAa;AACjB;AACA,CAAC;AAEG,mBAAiB;AACrB;AACA,CAAC;AAEG,mBAAiB;AACrB;AACA,CAAC;AAEG,YAAU;AACd;AACA,CAAC;AAEG,mBAAiB;AAEjB,oBAAkB,IAAI,IAAI,IAAI,IAAI,EAAE,IAAI;AAC5C;AACA,CAAC;AAEG,WAAS;AACb;AACA,CAAC;AAEG,gBAAc;AAEd,iBAAe;AACnB;AACA,CAAC;AAEG,eAAa;AAEb,kBAAgB;AACpB;AACA,CAAC;AAEG,cAAY;AAChB;AACA,CAAC;AAEG,aAAW;AAEX,eAAa;AACjB;AACA,CAAC;AAEG,eAAa;AACjB;AACA,CAAC;AAEG,UAAQ,IAAI,WAAW,IAAI,iBAAiB,IAAI,eAAe,IAAI,gBAAgB,IAAI,iBAAiB,IAAI,aAAa,IAAI,eAAe,IAAI,YAAY,IAAI;AACpK;","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { FC, PropsWithChildren, ForwardedRef, ReactNode } from 'react';
|
|
2
|
+
import { FC, PropsWithChildren, ForwardedRef, ReactElement, ReactNode } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { FormProps, FormInstance, ModalProps, ButtonProps } from 'antd';
|
|
5
5
|
import { Merge } from 'ts-essentials';
|
|
@@ -34,24 +34,23 @@ type RenderChildren<T> = (props: {
|
|
|
34
34
|
type ChildrenType<T> = RenderChildren<T> | JSX.Element | JSX.Element[];
|
|
35
35
|
type RecursivePartial<T> = T extends object ? {
|
|
36
36
|
[P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object ? RecursivePartial<T[P]> : T[P];
|
|
37
|
-
} :
|
|
37
|
+
} : unknown;
|
|
38
38
|
interface FormModalProps<T> extends Pick<ModalProps, 'width' | 'title' | 'open' | 'afterClose' | 'bodyStyle' | 'maskClosable'>, Pick<FormProps, 'labelCol' | 'layout' | 'colon'> {
|
|
39
39
|
children?: ChildrenType<T>;
|
|
40
40
|
footer?: ModalProps['footer'];
|
|
41
41
|
closeFn?: VoidFunction;
|
|
42
42
|
initialValues?: RecursivePartial<T>;
|
|
43
|
-
onConfirm?: (values: T) => void
|
|
43
|
+
onConfirm?: (values: T) => Promise<void>;
|
|
44
44
|
}
|
|
45
45
|
interface FormModalRef<T = object> {
|
|
46
46
|
setFieldsValue: (values: RecursivePartial<T>) => void;
|
|
47
47
|
}
|
|
48
48
|
declare const FormModal: <T extends object>(props: FormModalProps<T> & {
|
|
49
49
|
ref?: ForwardedRef<FormModalRef<T>> | undefined;
|
|
50
|
-
}) =>
|
|
50
|
+
}) => ReactElement;
|
|
51
51
|
|
|
52
|
-
type UseFormModalProps<T> = Merge<Omit<FormModalProps<T>, 'open' | 'onCancel' | 'closeFn' | 'children'
|
|
52
|
+
type UseFormModalProps<T> = Merge<Omit<FormModalProps<T>, 'open' | 'onCancel' | 'closeFn' | 'children'>, {
|
|
53
53
|
content: FormModalProps<T>['children'];
|
|
54
|
-
onConfirm?: (values: T) => void;
|
|
55
54
|
}>;
|
|
56
55
|
declare function useFormModal<T extends object>(props: UseFormModalProps<T>): {
|
|
57
56
|
Modal: react.ReactPortal;
|
|
@@ -73,14 +72,12 @@ interface PermissionButtonProps extends Omit<ButtonProps, 'disabled'> {
|
|
|
73
72
|
}
|
|
74
73
|
declare const PermissionButton: FC<PropsWithChildren<PermissionButtonProps>>;
|
|
75
74
|
|
|
76
|
-
type MenuItemType2 = Merge<
|
|
75
|
+
type MenuItemType2 = Merge<MenuItemType, {
|
|
77
76
|
code /** 权限编号 **/?: string;
|
|
78
77
|
route /** 前端路由地址 **/?: string;
|
|
79
|
-
icon?: string;
|
|
80
78
|
}>;
|
|
81
|
-
type SubMenuType2 = Merge<
|
|
79
|
+
type SubMenuType2 = Merge<SubMenuType, {
|
|
82
80
|
children?: ItemType2[];
|
|
83
|
-
icon?: string;
|
|
84
81
|
}>;
|
|
85
82
|
type MenuItemGroupType2 = Merge<MenuItemGroupType, {
|
|
86
83
|
children?: ItemType2[];
|
|
@@ -115,7 +112,7 @@ declare function useFetcher(): <T = unknown>(config: AxiosRequestConfig) => Prom
|
|
|
115
112
|
interface PermissionCheckResult {
|
|
116
113
|
[k: string]: boolean;
|
|
117
114
|
}
|
|
118
|
-
declare function usePermissions(codes:
|
|
115
|
+
declare function usePermissions(codes: string[]): {
|
|
119
116
|
data: Record<string, boolean> | undefined;
|
|
120
117
|
isLoading: boolean;
|
|
121
118
|
};
|
|
@@ -186,6 +183,6 @@ interface LayoutProps {
|
|
|
186
183
|
items: ItemType2[];
|
|
187
184
|
header?: ReactNode;
|
|
188
185
|
}
|
|
189
|
-
declare const Layout: FC<LayoutProps
|
|
186
|
+
declare const Layout: FC<PropsWithChildren<LayoutProps>>;
|
|
190
187
|
|
|
191
188
|
export { DynamicTags, DynamicTagsProps, FetcherError, FilterForm, FilterFormProps, FormModal, FormModalProps, FormModalRef, Highlight, HighlightTextsProps, ItemType2, Layout, LayoutProps, Login, MenuState, NavBarProps, PermissionButton, PermissionButtonProps, PermissionCheckResult, QueryList, QueryListKey, QueryListProps, QueryTriggerState, TokenState, UseFormModalProps, routes as permission, useFetcher, useFormModal, useMenuStore, usePermission, usePermissions, useQueryTriggerStore, useTokenStore };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Icon__default, { AliyunOutlined, UserAddOutlined, UsergroupAddOutlined, PlusOutlined } from '@ant-design/icons';
|
|
1
|
+
import { AliyunOutlined, UserAddOutlined, UsergroupAddOutlined, PlusOutlined } from '@ant-design/icons';
|
|
3
2
|
import { App, Spin, Row, Col, Card, Alert, Divider, Space, Button, theme, Layout as Layout$1, Tag, Form, Input, Breadcrumb, Skeleton, Descriptions, Typography, Modal, Tooltip, Result, Table, Select, Menu, Collapse, Checkbox } from 'antd';
|
|
4
|
-
import { lazy, useState, useRef, useCallback, useMemo, useEffect,
|
|
3
|
+
import { lazy, useState, useRef, useCallback, useMemo, useEffect, forwardRef, useId, useImperativeHandle } from 'react';
|
|
5
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
5
|
import { createPortal, flushSync } from 'react-dom';
|
|
7
6
|
import { createRoot } from 'react-dom/client';
|
|
8
7
|
import { create } from 'zustand';
|
|
9
8
|
import { persist } from 'zustand/middleware';
|
|
10
9
|
import axios from 'axios';
|
|
11
|
-
import { useNavigate, useSearchParams, Navigate, Link,
|
|
10
|
+
import { useNavigate, useSearchParams, Navigate, Link, useParams, useLocation } from 'react-router-dom';
|
|
12
11
|
import useSWRImmutable from 'swr/immutable';
|
|
13
12
|
import useSWRMutation2 from 'swr/mutation';
|
|
14
13
|
import useSWR from 'swr';
|
|
@@ -354,7 +353,7 @@ function useFormModal(props) {
|
|
|
354
353
|
setOpen(false);
|
|
355
354
|
}, []);
|
|
356
355
|
const Modal2 = useMemo(() => {
|
|
357
|
-
return /* @__PURE__ */ jsx(FormModal_default, __spreadProps(__spreadValues({}, restProps), { open, closeFn: closeModal, title, onConfirm, children: content }));
|
|
356
|
+
return /* @__PURE__ */ jsx(FormModal_default, __spreadProps(__spreadValues({ ref: formRef }, restProps), { open, closeFn: closeModal, title, onConfirm, children: content }));
|
|
358
357
|
}, [title, content, restProps, open, closeModal, onConfirm]);
|
|
359
358
|
return {
|
|
360
359
|
Modal: createPortal(Modal2, document.body),
|
|
@@ -558,14 +557,14 @@ var init_use_fetcher = __esm({
|
|
|
558
557
|
function usePermissions(codes) {
|
|
559
558
|
const fetcher = useFetcher();
|
|
560
559
|
const { data, isLoading } = useSWRImmutable(
|
|
561
|
-
|
|
560
|
+
codes.length > 0 ? {
|
|
562
561
|
method: "POST",
|
|
563
562
|
url: "/api/usystem/user/check",
|
|
564
|
-
data: { permissions:
|
|
563
|
+
data: { permissions: codes }
|
|
565
564
|
} : null,
|
|
566
565
|
(config) => fetcher(config).then((res) => {
|
|
567
566
|
if (res.has_all) {
|
|
568
|
-
return
|
|
567
|
+
return codes.reduce(
|
|
569
568
|
(acc, curr) => {
|
|
570
569
|
acc[curr] = true;
|
|
571
570
|
return acc;
|
|
@@ -573,20 +572,23 @@ function usePermissions(codes) {
|
|
|
573
572
|
{}
|
|
574
573
|
);
|
|
575
574
|
}
|
|
576
|
-
return
|
|
575
|
+
return codes.reduce(
|
|
577
576
|
(acc, curr) => {
|
|
578
|
-
acc[curr
|
|
577
|
+
acc[curr] = res[curr];
|
|
579
578
|
return acc;
|
|
580
579
|
},
|
|
581
580
|
{}
|
|
582
581
|
);
|
|
583
|
-
})
|
|
582
|
+
}),
|
|
583
|
+
{
|
|
584
|
+
shouldRetryOnError: false
|
|
585
|
+
}
|
|
584
586
|
);
|
|
585
587
|
return { data, isLoading };
|
|
586
588
|
}
|
|
587
589
|
function usePermission(code) {
|
|
588
590
|
var _a;
|
|
589
|
-
const { data, isLoading } = usePermissions(code ?
|
|
591
|
+
const { data, isLoading } = usePermissions(code ? [code] : []);
|
|
590
592
|
if (!code) {
|
|
591
593
|
return {
|
|
592
594
|
accessible: true,
|
|
@@ -2987,6 +2989,7 @@ init_esm_shims();
|
|
|
2987
2989
|
|
|
2988
2990
|
// src/layouts/NavBar.tsx
|
|
2989
2991
|
init_esm_shims();
|
|
2992
|
+
init_hooks2();
|
|
2990
2993
|
init_stores();
|
|
2991
2994
|
var withLink = (label, route) => {
|
|
2992
2995
|
if (!label) {
|
|
@@ -2997,7 +3000,7 @@ var withLink = (label, route) => {
|
|
|
2997
3000
|
}
|
|
2998
3001
|
return label;
|
|
2999
3002
|
};
|
|
3000
|
-
function transformItems(items) {
|
|
3003
|
+
function transformItems(items, permissions) {
|
|
3001
3004
|
const result = [];
|
|
3002
3005
|
for (let i = 0; i < items.length; i++) {
|
|
3003
3006
|
if (items[i] === null) {
|
|
@@ -3005,19 +3008,17 @@ function transformItems(items) {
|
|
|
3005
3008
|
} else if (items[i].type === "divider") {
|
|
3006
3009
|
result[i] = __spreadValues({}, items[i]);
|
|
3007
3010
|
} else {
|
|
3008
|
-
const iconName = items[i].icon;
|
|
3009
3011
|
if (items[i].children) {
|
|
3010
3012
|
const _a = items[i], { children } = _a, restProps = __objRest(_a, ["children"]);
|
|
3011
3013
|
result[i] = __spreadProps(__spreadValues({}, restProps), {
|
|
3012
|
-
children: transformItems(children != null ? children : [])
|
|
3013
|
-
icon: iconName ? /* @__PURE__ */ jsx(Icon__default, { component: Icon[iconName] }) : null
|
|
3014
|
+
children: transformItems(children != null ? children : [], permissions)
|
|
3014
3015
|
});
|
|
3015
3016
|
} else {
|
|
3016
3017
|
const _b = items[i], { route, label, code } = _b, restProps = __objRest(_b, ["route", "label", "code"]);
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
}) ;
|
|
3018
|
+
const isPass = !code || !permissions || permissions[code];
|
|
3019
|
+
result[i] = isPass ? __spreadProps(__spreadValues({}, restProps), {
|
|
3020
|
+
label: withLink(label, route)
|
|
3021
|
+
}) : null;
|
|
3021
3022
|
}
|
|
3022
3023
|
}
|
|
3023
3024
|
}
|
|
@@ -3039,10 +3040,9 @@ var NavBar = (props) => {
|
|
|
3039
3040
|
const { items } = props;
|
|
3040
3041
|
const location = useLocation();
|
|
3041
3042
|
const flattenItems = useMemo(() => flatItems(items != null ? items : []), [items]);
|
|
3042
|
-
const
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
}, [items]);
|
|
3043
|
+
const codes = flattenItems.map((item) => item.code).filter(Boolean);
|
|
3044
|
+
const { data: permissions, isLoading } = usePermissions(codes);
|
|
3045
|
+
const internalItems = useMemo(() => transformItems(items != null ? items : [], permissions), [items, permissions]);
|
|
3046
3046
|
const openKeys = useMenuStore((state) => state.openKeys);
|
|
3047
3047
|
const selectedKeys = useMenuStore((state) => state.selectedKeys);
|
|
3048
3048
|
const setOpenKeys = useMenuStore((state) => state.setOpenKeys);
|
|
@@ -3066,6 +3066,19 @@ var NavBar = (props) => {
|
|
|
3066
3066
|
setOpenKeys(keypath);
|
|
3067
3067
|
}
|
|
3068
3068
|
}, [flattenItems, location, setOpenKeys, setSelectedKeys]);
|
|
3069
|
+
if (isLoading) {
|
|
3070
|
+
return /* @__PURE__ */ jsx(
|
|
3071
|
+
Spin,
|
|
3072
|
+
{
|
|
3073
|
+
style: {
|
|
3074
|
+
display: "flex",
|
|
3075
|
+
justifyContent: "center",
|
|
3076
|
+
alignItems: "center",
|
|
3077
|
+
height: "calc(100vh - 64px)"
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
);
|
|
3081
|
+
}
|
|
3069
3082
|
return /* @__PURE__ */ jsx(
|
|
3070
3083
|
Menu,
|
|
3071
3084
|
{
|
|
@@ -3081,7 +3094,7 @@ var NavBar = (props) => {
|
|
|
3081
3094
|
var NavBar_default = NavBar;
|
|
3082
3095
|
var { Header, Sider, Content } = Layout$1;
|
|
3083
3096
|
var Layout = (props) => {
|
|
3084
|
-
const { title, items, header } = props;
|
|
3097
|
+
const { title, items, header, children } = props;
|
|
3085
3098
|
const {
|
|
3086
3099
|
token: { colorBgContainer, colorBorder }
|
|
3087
3100
|
} = theme.useToken();
|
|
@@ -3104,7 +3117,7 @@ var Layout = (props) => {
|
|
|
3104
3117
|
theme: "light",
|
|
3105
3118
|
children: [
|
|
3106
3119
|
/* @__PURE__ */ jsxs("div", { className: "flex items-end px-6 py-4", children: [
|
|
3107
|
-
/* @__PURE__ */ jsx("img", { src: logo, alt: "logo", className: "w-8" }),
|
|
3120
|
+
/* @__PURE__ */ jsx("img", { src: logo, alt: "logo", className: "w-8 h-8" }),
|
|
3108
3121
|
/* @__PURE__ */ jsx(Link, { className: "font-bold text-lg ml-2", to: "/", children: title })
|
|
3109
3122
|
] }),
|
|
3110
3123
|
/* @__PURE__ */ jsx(NavBar_default, { items })
|
|
@@ -3125,23 +3138,7 @@ var Layout = (props) => {
|
|
|
3125
3138
|
children: header
|
|
3126
3139
|
}
|
|
3127
3140
|
),
|
|
3128
|
-
/* @__PURE__ */ jsx(Content, { className: "p-6 overflow-auto bg-gray-50", children
|
|
3129
|
-
Suspense,
|
|
3130
|
-
{
|
|
3131
|
-
fallback: /* @__PURE__ */ jsx(
|
|
3132
|
-
Spin,
|
|
3133
|
-
{
|
|
3134
|
-
style: {
|
|
3135
|
-
display: "flex",
|
|
3136
|
-
justifyContent: "center",
|
|
3137
|
-
alignItems: "center",
|
|
3138
|
-
height: "50vh"
|
|
3139
|
-
}
|
|
3140
|
-
}
|
|
3141
|
-
),
|
|
3142
|
-
children: /* @__PURE__ */ jsx(Outlet, {})
|
|
3143
|
-
}
|
|
3144
|
-
) })
|
|
3141
|
+
/* @__PURE__ */ jsx(Content, { className: "p-6 overflow-auto bg-gray-50", children })
|
|
3145
3142
|
] })
|
|
3146
3143
|
] });
|
|
3147
3144
|
};
|