@spacego/fe-components 0.1.1 → 0.2.0

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 (205) hide show
  1. package/README.md +37 -37
  2. package/lib/_virtual/Resizable.js +4 -0
  3. package/lib/_virtual/ResizableBox.js +4 -0
  4. package/lib/_virtual/index.js +5 -0
  5. package/lib/_virtual/index2.js +4 -0
  6. package/lib/_virtual/index3.js +4 -0
  7. package/lib/_virtual/index4.js +4 -0
  8. package/lib/_virtual/propTypes.js +4 -0
  9. package/lib/_virtual/react-is.development.js +4 -0
  10. package/lib/_virtual/react-is.production.min.js +4 -0
  11. package/lib/_virtual/utils.js +4 -0
  12. package/lib/fe-auto-complete/index.js +6 -0
  13. package/lib/fe-button/index.js +27 -0
  14. package/lib/fe-cascader/index.js +19 -0
  15. package/lib/fe-checkbox/index.js +6 -0
  16. package/lib/fe-checkbox-group/index.js +6 -0
  17. package/lib/fe-date-picker/index.js +19 -0
  18. package/lib/fe-description-render/index.js +43 -0
  19. package/lib/fe-descriptions/index.js +6 -0
  20. package/lib/fe-empty/index.js +6 -0
  21. package/lib/fe-error-block/index.js +6 -0
  22. package/lib/fe-form/fe-form/index.js +133 -0
  23. package/lib/fe-form/fe-form-auto-complete/index.js +57 -0
  24. package/lib/fe-form/fe-form-btn-group/index.js +29 -0
  25. package/lib/fe-form/fe-form-cascader/index.js +25 -0
  26. package/lib/fe-form/fe-form-checkbox-group/index.js +21 -0
  27. package/lib/fe-form/fe-form-date-picker/index.js +75 -0
  28. package/lib/fe-form/fe-form-date-range-picker/index.js +99 -0
  29. package/lib/fe-form/fe-form-input/index.js +53 -0
  30. package/lib/fe-form/fe-form-input-input/index.js +63 -0
  31. package/lib/fe-form/fe-form-input-number/index.js +43 -0
  32. package/lib/fe-form/fe-form-item/index.js +46 -0
  33. package/lib/fe-form/fe-form-label/index.js +20 -0
  34. package/lib/fe-form/fe-form-radio/index.js +21 -0
  35. package/lib/fe-form/fe-form-render/index.js +33 -0
  36. package/lib/fe-form/fe-form-rich-text/index.js +25 -0
  37. package/lib/fe-form/fe-form-select/index.js +93 -0
  38. package/lib/fe-form/fe-form-switch/index.js +21 -0
  39. package/lib/fe-form/fe-form-text/index.js +20 -0
  40. package/lib/fe-form/fe-form-text-area/index.js +24 -0
  41. package/lib/fe-form/fe-form-time-picker/index.js +21 -0
  42. package/lib/fe-form/fe-form-upload/index.js +63 -0
  43. package/lib/fe-form/utils/index.js +28 -0
  44. package/lib/fe-input/index.js +32 -0
  45. package/lib/fe-input-number/index.js +19 -0
  46. package/lib/fe-layouts/auth-layout/index.js +35 -17
  47. package/lib/fe-layouts/basics-layout/index.js +2 -2
  48. package/lib/fe-layouts/layout.js +34 -16
  49. package/lib/fe-link/index.js +23 -0
  50. package/lib/fe-map/index.js +263 -0
  51. package/lib/fe-modal/index.js +85 -0
  52. package/lib/fe-pagination/index.js +6 -0
  53. package/lib/fe-panel/fe-panel-toolbar.js +40 -0
  54. package/lib/fe-panel/index.js +49 -0
  55. package/lib/fe-panel/use-panel-context.js +9 -0
  56. package/lib/fe-permission/index.js +12 -0
  57. package/lib/fe-permission-provider/index.js +29 -0
  58. package/lib/fe-radio/index.js +11 -0
  59. package/lib/fe-radio-group/index.js +6 -0
  60. package/lib/fe-rich-text/index.js +293 -0
  61. package/lib/fe-select/index.js +24 -0
  62. package/lib/fe-switch/index.js +6 -0
  63. package/lib/fe-table/fe-edit-table/index.js +39 -0
  64. package/lib/fe-table/fe-edit-table-cell/index.js +63 -0
  65. package/lib/fe-table/fe-head-title/index.js +9 -0
  66. package/lib/fe-table/fe-normal-table/index.js +192 -0
  67. package/lib/fe-table/fe-sub-table/index.js +74 -0
  68. package/lib/fe-table/fe-table/index.js +7 -0
  69. package/lib/fe-table/fe-table-alert/index.js +42 -0
  70. package/lib/fe-table/fe-table-link/index.js +87 -0
  71. package/lib/fe-table/fe-table-render/index.js +56 -0
  72. package/lib/fe-table/fe-table-setting/index.js +165 -0
  73. package/lib/fe-table/fe-table-toolbar/index.js +63 -0
  74. package/lib/fe-table/fe-table-utils/index.js +157 -0
  75. package/lib/fe-table/type/table.d.js +4 -0
  76. package/lib/fe-table/use-edit-table/index.js +151 -0
  77. package/lib/fe-table/use-pagination/index.js +59 -0
  78. package/lib/fe-table/use-sub-table/index.js +23 -0
  79. package/lib/fe-table/use-table/index.js +177 -0
  80. package/lib/fe-table/use-table-columns/index.js +53 -0
  81. package/lib/fe-table/use-table-form-context/index.js +14 -0
  82. package/lib/fe-table/use-table-selection/index.js +53 -0
  83. package/lib/fe-text-area/index.js +21 -0
  84. package/lib/fe-time-picker/index.js +19 -0
  85. package/lib/fe-upload/index.js +182 -0
  86. package/lib/fe-upload/upload.constant.js +91 -0
  87. package/lib/fe-upload-atomic/index.js +6 -0
  88. package/lib/fe-upload-crop/index.js +207 -0
  89. package/lib/hooks/{use-auth.hook.js → use-auth.hook/index.js} +3 -3
  90. package/lib/hooks/use-form/index.js +38 -0
  91. package/lib/hooks/use-permission.hook/index.js +9 -0
  92. package/lib/index.css +7 -1
  93. package/lib/index.js +161 -42
  94. package/lib/node_modules/.pnpm/@dnd-kit_accessibility@3.1.1_react@18.3.1/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +56 -0
  95. package/lib/node_modules/.pnpm/@dnd-kit_core@6.3.1_nnrd3gsncyragczmpvfhocinkq/node_modules/@dnd-kit/core/dist/core.esm.js +2344 -0
  96. package/lib/node_modules/.pnpm/@dnd-kit_modifiers@9.0.0_55ztycxty3xzw7t4rzpvix55vq/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +13 -0
  97. package/lib/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_55ztycxty3xzw7t4rzpvix55vq/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +439 -0
  98. package/lib/node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@18.3.1/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +235 -0
  99. package/lib/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js +54 -0
  100. package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.js +54 -0
  101. package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.js +52 -0
  102. package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.js +329 -0
  103. package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +17 -0
  104. package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js +10 -0
  105. package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.js +7 -0
  106. package/lib/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js +95 -0
  107. package/lib/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js +78 -0
  108. package/lib/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +10 -0
  109. package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/Resizable.js +233 -0
  110. package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/ResizableBox.js +164 -0
  111. package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/propTypes.js +113 -0
  112. package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/utils.js +56 -0
  113. package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/index.js +12 -0
  114. package/lib/store/modules/layout-config.store.js +83 -65
  115. package/lib/store/modules/theme.store.js +36 -18
  116. package/lib/types/fe-auto-complete/index.d.ts +2 -0
  117. package/lib/types/fe-button/index.d.ts +16 -0
  118. package/lib/types/fe-cascader/index.d.ts +7 -0
  119. package/lib/types/fe-checkbox/index.d.ts +6 -0
  120. package/lib/types/fe-checkbox-group/index.d.ts +7 -0
  121. package/lib/types/fe-date-picker/index.d.ts +3 -0
  122. package/lib/types/fe-description-render/index.d.ts +31 -0
  123. package/lib/types/fe-descriptions/index.d.ts +2 -0
  124. package/lib/types/fe-empty/index.d.ts +2 -0
  125. package/lib/types/fe-error-block/index.d.ts +6 -0
  126. package/lib/types/fe-form/fe-form/index.d.ts +356 -0
  127. package/lib/types/fe-form/fe-form-auto-complete/index.d.ts +3 -0
  128. package/lib/types/fe-form/fe-form-btn-group/index.d.ts +3 -0
  129. package/lib/types/fe-form/fe-form-cascader/index.d.ts +3 -0
  130. package/lib/types/fe-form/fe-form-checkbox-group/index.d.ts +3 -0
  131. package/lib/types/fe-form/fe-form-date-picker/index.d.ts +3 -0
  132. package/lib/types/fe-form/fe-form-date-range-picker/index.d.ts +3 -0
  133. package/lib/types/fe-form/fe-form-input/index.d.ts +3 -0
  134. package/lib/types/fe-form/fe-form-input-input/index.d.ts +3 -0
  135. package/lib/types/fe-form/fe-form-input-number/index.d.ts +3 -0
  136. package/lib/types/fe-form/fe-form-item/index.d.ts +70 -0
  137. package/lib/types/fe-form/fe-form-label/index.d.ts +45 -0
  138. package/lib/types/fe-form/fe-form-radio/index.d.ts +3 -0
  139. package/lib/types/fe-form/fe-form-render/index.d.ts +3 -0
  140. package/lib/types/fe-form/fe-form-rich-text/index.d.ts +3 -0
  141. package/lib/types/fe-form/fe-form-select/index.d.ts +3 -0
  142. package/lib/types/fe-form/fe-form-switch/index.d.ts +3 -0
  143. package/lib/types/fe-form/fe-form-text/index.d.ts +3 -0
  144. package/lib/types/fe-form/fe-form-text-area/index.d.ts +3 -0
  145. package/lib/types/fe-form/fe-form-time-picker/index.d.ts +3 -0
  146. package/lib/types/fe-form/fe-form-upload/index.d.ts +3 -0
  147. package/lib/types/fe-form/index.d.ts +26 -0
  148. package/lib/types/fe-form/utils/index.d.ts +24 -0
  149. package/lib/types/fe-input/index.d.ts +12 -0
  150. package/lib/types/fe-input-number/index.d.ts +2 -0
  151. package/lib/types/fe-layouts/context/global-context.d.ts +240 -238
  152. package/lib/types/fe-link/index.d.ts +6 -0
  153. package/lib/types/fe-map/index.d.ts +73 -0
  154. package/lib/types/fe-modal/index.d.ts +20 -0
  155. package/lib/types/fe-pagination/index.d.ts +2 -0
  156. package/lib/types/fe-panel/fe-panel-toolbar.d.ts +3 -0
  157. package/lib/types/fe-panel/index.d.ts +61 -0
  158. package/lib/types/fe-panel/panel-toolbar.d.ts +4 -0
  159. package/lib/types/fe-panel/use-panel-context.d.ts +6 -0
  160. package/lib/types/fe-permission/index.d.ts +10 -0
  161. package/lib/types/fe-permission-provider/index.d.ts +8 -0
  162. package/lib/types/fe-radio/index.d.ts +2 -0
  163. package/lib/types/fe-radio-group/index.d.ts +2 -0
  164. package/lib/types/fe-rich-text/index.d.ts +167 -0
  165. package/lib/types/fe-select/index.d.ts +8 -0
  166. package/lib/types/fe-switch/index.d.ts +2 -0
  167. package/lib/types/fe-table/fe-edit-table/index.d.ts +3 -0
  168. package/lib/types/fe-table/fe-edit-table-cell/index.d.ts +16 -0
  169. package/lib/types/fe-table/fe-head-title/index.d.ts +6 -0
  170. package/lib/types/fe-table/fe-normal-table/index.d.ts +3 -0
  171. package/lib/types/fe-table/fe-sub-table/index.d.ts +3 -0
  172. package/lib/types/fe-table/fe-table/index.d.ts +3 -0
  173. package/lib/types/fe-table/fe-table-alert/index.d.ts +13 -0
  174. package/lib/types/fe-table/fe-table-link/index.d.ts +12 -0
  175. package/lib/types/fe-table/fe-table-render/index.d.ts +13 -0
  176. package/lib/types/fe-table/fe-table-setting/index.d.ts +22 -0
  177. package/lib/types/fe-table/fe-table-toolbar/index.d.ts +18 -0
  178. package/lib/types/fe-table/fe-table-utils/index.d.ts +193 -0
  179. package/lib/types/fe-table/index.d.ts +6 -0
  180. package/lib/types/fe-table/type/table-context.d.ts +60 -0
  181. package/lib/types/fe-table/type/table.d.ts +797 -0
  182. package/lib/types/fe-table/use-edit-table/index.d.ts +6 -0
  183. package/lib/types/fe-table/use-pagination/index.d.ts +3 -0
  184. package/lib/types/fe-table/use-sub-table/index.d.ts +8 -0
  185. package/lib/types/fe-table/use-table/index.d.ts +3 -0
  186. package/lib/types/fe-table/use-table-columns/index.d.ts +47 -0
  187. package/lib/types/fe-table/use-table-form-context/index.d.ts +10 -0
  188. package/lib/types/fe-table/use-table-selection/index.d.ts +46 -0
  189. package/lib/types/fe-text-area/index.d.ts +4 -0
  190. package/lib/types/fe-time-picker/index.d.ts +3 -0
  191. package/lib/types/fe-upload/index.d.ts +85 -0
  192. package/lib/types/fe-upload/upload.constant.d.ts +39 -0
  193. package/lib/types/fe-upload-atomic/index.d.ts +2 -0
  194. package/lib/types/fe-upload-crop/index.d.ts +10 -0
  195. package/lib/types/hooks/index.d.ts +1 -0
  196. package/lib/types/hooks/use-descriptions/index.d.ts +3 -0
  197. package/lib/types/hooks/use-form/index.d.ts +16 -0
  198. package/lib/types/hooks/use-permission.hook/index.d.ts +10 -0
  199. package/lib/types/index.d.ts +32 -0
  200. package/lib/types/typings/index.d.ts +98 -59
  201. package/lib/types/typings/shims-axios.d.ts +38 -38
  202. package/package.json +79 -69
  203. /package/lib/hooks/{use-nprogress.hook.js → use-nprogress.hook/index.js} +0 -0
  204. /package/lib/types/hooks/{use-auth.hook.d.ts → use-auth.hook/index.d.ts} +0 -0
  205. /package/lib/types/hooks/{use-nprogress.hook.d.ts → use-nprogress.hook/index.d.ts} +0 -0
@@ -0,0 +1,28 @@
1
+ const a = (e) => ({
2
+ label: e.label,
3
+ // 标签
4
+ labelLeft: e.labelLeft,
5
+ labelRight: e.labelRight,
6
+ labelAlign: e.labelAlign,
7
+ labelWidth: e.labelWidth,
8
+ // 标签宽度
9
+ showAdd: e.showAdd,
10
+ // 是否显示新增按钮
11
+ onAddClick: e.onAddClick,
12
+ // 点击新增按钮
13
+ showHint: e.showHint,
14
+ // 是否显示右侧提示
15
+ hintText: e.hintText,
16
+ // 提示文案
17
+ needLabel: e.needLabel
18
+ // 是否需要展示label
19
+ }), d = (e, l) => ({
20
+ validateTrigger: e.validateTrigger,
21
+ // 表单规则触发方式
22
+ valueType: e.valueType ?? (l == null ? void 0 : l.valueType)
23
+ // 表单值类型
24
+ });
25
+ export {
26
+ d as getFormItemProps,
27
+ a as getLabelProps
28
+ };
@@ -0,0 +1,32 @@
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { Input as i } from "antd";
3
+ import { useMemo as o } from "react";
4
+ const s = (e) => {
5
+ e = { ...e }, e.isShowTitle = e.isShowTitle ?? !0;
6
+ const n = (t) => {
7
+ e.onChange && e.onChange(t.target.value);
8
+ }, a = (t) => {
9
+ t.target.value = String(t.target.value).trim(), e.onChange && e.onChange(t.target.value), e.onBlur && e.onBlur(t);
10
+ }, r = o(() => {
11
+ if (!e.isShowTitle) return;
12
+ const t = String(e.value || e.placeholder);
13
+ if (t && t.length >= 6)
14
+ return t;
15
+ }, [e.value, e.placeholder, e.isShowTitle]), l = o(() => {
16
+ const t = { ...e };
17
+ return delete t.isShowTitle, delete t.passwordAttr, t;
18
+ }, [e]), h = () => /* @__PURE__ */ u(
19
+ i.Password,
20
+ {
21
+ ...l,
22
+ ...e.passwordAttr ?? {},
23
+ value: e.value,
24
+ onChange: n,
25
+ onBlur: a
26
+ }
27
+ ), d = () => /* @__PURE__ */ u(i, { title: r, ...l, value: e.value, onChange: n, onBlur: a });
28
+ return e.type === "password" ? h() : d();
29
+ };
30
+ export {
31
+ s as default
32
+ };
@@ -0,0 +1,19 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { InputNumber as u } from "antd";
3
+ const m = (e) => {
4
+ const n = (t) => {
5
+ e.onChange && e.onChange(t);
6
+ };
7
+ return /* @__PURE__ */ a(
8
+ u,
9
+ {
10
+ style: { ...e.style || {}, width: "100%" },
11
+ ...e,
12
+ value: e.value,
13
+ onChange: n
14
+ }
15
+ );
16
+ };
17
+ export {
18
+ m as default
19
+ };
@@ -14,16 +14,34 @@ import { useThemeStore as M } from "../../store/modules/theme.store.js";
14
14
  import { THEME_COLORS as j } from "../../config/theme.js";
15
15
  import { useGlobal as O } from "../context/context.js";
16
16
  import "nprogress";
17
- /* empty css */
18
- import "../basics-layout/index.js";
17
+ import "../../hooks/use-permission.hook/index.js";
19
18
  import "antd";
20
19
  import "@spacego/turbo-utils";
20
+ /* empty css */
21
+ import "lodash-es";
22
+ import "../../fe-form/fe-form-date-range-picker/index.js";
23
+ import "../../fe-rich-text/index.js";
24
+ import "../../fe-text-area/index.js";
25
+ /* empty css */
26
+ /* empty css */
27
+ /* empty css */
28
+ /* empty css */
29
+ import "../basics-layout/index.js";
30
+ /* empty css */
21
31
  /* empty css */
22
- function Z() {
23
- const { appName: n, logo: c, description: m, descriptionDetail: f, copyright: a } = O(), { theme: s, themeColor: d, TOGGLE_THEME: h, SET_THEME_COLOR: x } = M(N(["theme", "themeColor", "TOGGLE_THEME", "SET_THEME_COLOR"])), [o, i] = b(!1), p = (r) => {
24
- const l = r.currentTarget.getBoundingClientRect(), u = l.left + l.width / 2, g = l.top + l.height / 2;
32
+ /* empty css */
33
+ import "react-draggable";
34
+ import "../../fe-panel/use-panel-context.js";
35
+ /* empty css */
36
+ import "../../_virtual/index.js";
37
+ import "../../fe-table/fe-edit-table-cell/index.js";
38
+ import "ahooks";
39
+ import "../../fe-table/fe-table-setting/index.js";
40
+ function ge() {
41
+ const { appName: m, logo: n, description: c, descriptionDetail: p, copyright: a } = O(), { theme: s, themeColor: f, TOGGLE_THEME: d, SET_THEME_COLOR: h } = M(N(["theme", "themeColor", "TOGGLE_THEME", "SET_THEME_COLOR"])), [l, i] = b(!1), x = (r) => {
42
+ const o = r.currentTarget.getBoundingClientRect(), u = o.left + o.width / 2, g = o.top + o.height / 2;
25
43
  L(s === "light" ? "dark" : "light", u, g).then(() => {
26
- h();
44
+ d();
27
45
  });
28
46
  };
29
47
  return /* @__PURE__ */ t("div", { className: "flex min-h-full flex-1 select-none overflow-x-hidden", children: [
@@ -37,10 +55,10 @@ function Z() {
37
55
  {
38
56
  className: "flex overflow-hidden items-center gap-3 whitespace-nowrap origin-right",
39
57
  style: {
40
- width: o ? "224px" : "0",
58
+ width: l ? "224px" : "0",
41
59
  // 7个颜色(20px) + 6个gap(12px) = 140 + 72 = 212px
42
- transform: `scaleX(${o ? 1 : 0})`,
43
- opacity: o ? 1 : 0,
60
+ transform: `scaleX(${l ? 1 : 0})`,
61
+ opacity: l ? 1 : 0,
44
62
  transition: "transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
45
63
  },
46
64
  onMouseEnter: () => i(!0),
@@ -50,8 +68,8 @@ function Z() {
50
68
  {
51
69
  className: "w-5 h-5 rounded-full flex items-center justify-center cursor-pointer hover-scale-animation shrink-0",
52
70
  style: { backgroundColor: r },
53
- onClick: () => x(r),
54
- children: d === r && /* @__PURE__ */ e(y, { className: "size-[10px] text-white" })
71
+ onClick: () => h(r),
72
+ children: f === r && /* @__PURE__ */ e(y, { className: "size-[10px] text-white" })
55
73
  },
56
74
  r
57
75
  ))
@@ -67,21 +85,21 @@ function Z() {
67
85
  children: /* @__PURE__ */ e(k, { className: "h-[16px] w-[16px] text-(--color-primary)" })
68
86
  }
69
87
  ),
70
- /* @__PURE__ */ e("div", { className: "w-8 h-8 flex items-center justify-center cursor-pointer hover-scale-animation", onClick: p, children: s === "dark" ? /* @__PURE__ */ e(T, { className: "h-[18px] w-[18px]" }) : /* @__PURE__ */ e(w, { className: "h-[18px] w-[18px]" }) })
88
+ /* @__PURE__ */ e("div", { className: "w-8 h-8 flex items-center justify-center cursor-pointer hover-scale-animation", onClick: x, children: s === "dark" ? /* @__PURE__ */ e(T, { className: "h-[18px] w-[18px]" }) : /* @__PURE__ */ e(w, { className: "h-[18px] w-[18px]" }) })
71
89
  ] })
72
90
  ]
73
91
  }
74
92
  ),
75
93
  /* @__PURE__ */ e("div", { className: "absolute left-0 top-0 z-10 flex flex-1", children: /* @__PURE__ */ e("div", { className: "text-foreground lg:text-foreground ml-4 mt-4 flex flex-1 items-center sm:left-6 sm:top-6", children: /* @__PURE__ */ t("div", { className: "m-0 text-xl font-medium flex items-center gap-2 text-[#333] dark:text-[#f2f2f2]", children: [
76
- c,
77
- n
94
+ n,
95
+ m
78
96
  ] }) }) }),
79
97
  /* @__PURE__ */ e("div", { className: "relative hidden w-0 flex-1 lg:block", children: /* @__PURE__ */ t("div", { className: "bg-background-deep absolute inset-0 h-full w-full dark:bg-[#070709]!", children: [
80
98
  /* @__PURE__ */ e("div", { className: "login-background absolute left-0 top-0 size-full" }),
81
99
  /* @__PURE__ */ t("div", { className: "flex flex-col items-center justify-center mr-20 h-full -enter-x", children: [
82
100
  /* @__PURE__ */ e(C, { className: "animate-float h-64 w-2/5" }),
83
- /* @__PURE__ */ e("div", { className: "text-1xl mt-6 font-sans lg:text-2xl text-[#333] dark:text-[#f2f2f2]", children: m }),
84
- /* @__PURE__ */ e("div", { className: "mt-2 text-[#323639] dark:text-[#a1a1aa]", children: f })
101
+ /* @__PURE__ */ e("div", { className: "text-1xl mt-6 font-sans lg:text-2xl text-[#333] dark:text-[#f2f2f2]", children: c }),
102
+ /* @__PURE__ */ e("div", { className: "mt-2 text-[#323639] dark:text-[#a1a1aa]", children: p })
85
103
  ] })
86
104
  ] }) }),
87
105
  /* @__PURE__ */ t("div", { className: "login-side flex flex-col items-center justify-center relative px-6 py-10 lg:flex-initial lg:px-8 min-h-full w-2/5 flex-1 dark:bg-[#14161a]", children: [
@@ -94,5 +112,5 @@ function Z() {
94
112
  ] });
95
113
  }
96
114
  export {
97
- Z as default
115
+ ge as default
98
116
  };
@@ -3,8 +3,9 @@ import { useSelector as y } from "@spacego/zustand";
3
3
  import { Layout as g, Spin as Z } from "antd";
4
4
  import { useMemo as d, useEffect as $ } from "react";
5
5
  import { useLocation as ee, useNavigate as te, Outlet as oe } from "react-router-dom";
6
- import { useAuth as ne } from "../../hooks/use-auth.hook.js";
6
+ import { useAuth as ne } from "../../hooks/use-auth.hook/index.js";
7
7
  import "nprogress";
8
+ import "../../hooks/use-permission.hook/index.js";
8
9
  import { useLayoutConfigStore as re } from "../../store/modules/layout-config.store.js";
9
10
  import { useThemeStore as ae } from "../../store/modules/theme.store.js";
10
11
  import { useGlobal as se } from "../context/context.js";
@@ -12,7 +13,6 @@ import ie from "./components/basics-layout/header.js";
12
13
  import le from "./components/basics-layout/sidebar.js";
13
14
  import ce from "./components/basics-layout/tabs.js";
14
15
  import { findRouteByPath as b, findMenuParentKeys as ue, buildRouteMap as fe, findParentRoutes as de, findMenuByKey as me } from "./components/utils/index.js";
15
- /* empty css */
16
16
  /* empty css */
17
17
  const { Content: he } = g;
18
18
  function Ke() {
@@ -1,54 +1,72 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { useSelector as i } from "@spacego/zustand";
3
- import { theme as n, ConfigProvider as c, Spin as u } from "antd";
3
+ import { theme as p, ConfigProvider as c, Spin as u } from "antd";
4
4
  import { useMemo as g } from "react";
5
5
  import "@ant-design/icons";
6
6
  import { getRealTheme as d } from "../utils/theme.js";
7
7
  import { useLayoutConfigStore as C } from "../store/modules/layout-config.store.js";
8
8
  import { useThemeStore as y } from "../store/modules/theme.store.js";
9
- import p from "../config/theme.js";
9
+ import n from "../config/theme.js";
10
10
  import "react-router-dom";
11
11
  import "./context/context.js";
12
12
  import k from "./context/global-context.provider.js";
13
- import { useNProgress as L } from "../hooks/use-nprogress.hook.js";
13
+ import { useNProgress as L } from "../hooks/use-nprogress.hook/index.js";
14
+ import "../hooks/use-permission.hook/index.js";
15
+ import "@spacego/turbo-utils";
16
+ /* empty css */
17
+ import "lodash-es";
18
+ import "../fe-form/fe-form-date-range-picker/index.js";
19
+ import "../fe-rich-text/index.js";
20
+ import "../fe-text-area/index.js";
21
+ /* empty css */
22
+ /* empty css */
23
+ /* empty css */
14
24
  import M from "./auth-layout/index.js";
15
25
  import T from "./basics-layout/index.js";
16
26
  import b from "./blank-layout/index.js";
17
- import "@spacego/turbo-utils";
27
+ /* empty css */
18
28
  /* empty css */
19
- function I(a) {
20
- const { layoutType: e, ...s } = a, { loadingConfig: l } = C(i(["loadingConfig"])), { theme: r, themeColor: t } = y(i(["theme", "themeColor"]));
29
+ /* empty css */
30
+ import "react-draggable";
31
+ import "../fe-panel/use-panel-context.js";
32
+ /* empty css */
33
+ import "../_virtual/index.js";
34
+ import "../fe-table/fe-edit-table-cell/index.js";
35
+ import "ahooks";
36
+ import "../fe-table/fe-table-setting/index.js";
37
+ function no(a) {
38
+ const { layoutType: r, ...s } = a, { loadingConfig: l } = C(i(["loadingConfig"])), { theme: t, themeColor: m } = y(i(["theme", "themeColor"]));
21
39
  L();
22
40
  const f = g(() => {
23
- const h = d(r);
41
+ const h = d(t);
24
42
  return {
25
43
  cssVar: {
26
44
  prefix: "ant"
27
45
  },
28
46
  // 启用 CSS 变量模式,生成 --ant-color-primary 等变量
29
- algorithm: h === "dark" ? n.darkAlgorithm : n.defaultAlgorithm,
47
+ algorithm: h === "dark" ? p.darkAlgorithm : p.defaultAlgorithm,
30
48
  token: {
31
- colorPrimary: t,
32
- ...p.token
49
+ colorPrimary: m,
50
+ ...n.token
33
51
  },
34
52
  components: {
35
- ...p.components
53
+ ...n.components
36
54
  }
37
55
  };
38
- }, [r, t]), m = (/* @__PURE__ */ new Map([
56
+ }, [t, m]), e = (/* @__PURE__ */ new Map([
39
57
  ["blank", b],
40
58
  ["basic", T],
41
59
  ["auth", M]
42
- ])).get(e);
60
+ ])).get(r);
43
61
  return /* @__PURE__ */ o(c, { theme: f, children: /* @__PURE__ */ o(k, { ...s, children: /* @__PURE__ */ o(
44
62
  u,
45
63
  {
46
- spinning: l.show && e !== "basic",
64
+ spinning: l.show && r !== "basic",
47
65
  wrapperClassName: "spin-wrapper-full",
48
- children: m && /* @__PURE__ */ o(m, {}, e)
66
+ children: e && /* @__PURE__ */ o(e, {}, r)
49
67
  }
50
68
  ) }) });
51
69
  }
52
70
  export {
53
- I as default
71
+ no as default
54
72
  };
@@ -0,0 +1,23 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { classnames as a } from "@spacego/turbo-utils";
3
+ import { FePermission as c } from "../fe-permission/index.js";
4
+ /* empty css */
5
+ const f = (e) => {
6
+ var i;
7
+ const t = (l) => {
8
+ l.stopPropagation(), !e.disabled && e.onClick && e.onClick(l);
9
+ };
10
+ return /* @__PURE__ */ n(c, { ...e, children: /* @__PURE__ */ n(
11
+ "span",
12
+ {
13
+ ...e,
14
+ className: a("fe-link", e.className),
15
+ onClick: t,
16
+ style: { ...e.style, color: e.disabled ? "#bfbfbf" : (i = e.style) == null ? void 0 : i.color },
17
+ children: e.children
18
+ }
19
+ ) });
20
+ };
21
+ export {
22
+ f as default
23
+ };
@@ -0,0 +1,263 @@
1
+ import { jsx as d, jsxs as $ } from "react/jsx-runtime";
2
+ import { Select as A, Empty as O, Input as X, message as Y } from "antd";
3
+ import { useState as P, useRef as x, useEffect as Z } from "react";
4
+ import ee from "../fe-error-block/index.js";
5
+ /* empty css */
6
+ const re = (v) => {
7
+ const l = window.AMap, [M, j] = P(null), [z, F] = P(), h = x(null), f = x(null), b = x([]), [G, p] = P({
8
+ provinceValue: [],
9
+ cityValue: [],
10
+ districtValue: [],
11
+ streetValue: [],
12
+ provinceOptions: [],
13
+ cityOptions: [],
14
+ districtOptions: [],
15
+ streetOptions: []
16
+ }), {
17
+ provinceOptions: K,
18
+ cityOptions: _,
19
+ districtOptions: B,
20
+ streetOptions: R,
21
+ provinceValue: w,
22
+ cityValue: y,
23
+ districtValue: C,
24
+ streetValue: q
25
+ } = G, V = x(/* @__PURE__ */ new Map()), H = () => {
26
+ if (!document.getElementById("fe-map-container")) {
27
+ console.error("dom is not exist!");
28
+ return;
29
+ }
30
+ const { addressPoi: e = [] } = v, t = new l.Map("fe-map-container", { resizeEnable: !0 });
31
+ h.current = t, t.setDefaultCursor("pointer"), l.plugin(["AMap.PlaceSearch", "AMap.AutoComplete", "AMap.Geocoder", "AMap.DistrictSearch"], function() {
32
+ J(), Q(e), T();
33
+ });
34
+ }, I = ({ name: e, address: t }) => new l.InfoWindow({
35
+ anchor: "top-center",
36
+ content: `<div class="infoWindow"><div class='addressContent'>地址名称:${e}</div><div class='addressContent'>地址详情:${t}</div></div>`
37
+ }), J = () => {
38
+ const e = h.current, t = new l.AutoComplete({ input: "tip-input" }), o = new l.PlaceSearch({ map: e });
39
+ t.on("select", r);
40
+ function r(c) {
41
+ console.log(c), o.setCity(c.poi.adcode), o.search(c.poi.name, (i, n) => {
42
+ var s;
43
+ for (let a = 0; a < ((s = n == null ? void 0 : n.poiList.pois) == null ? void 0 : s.length); a++) {
44
+ const u = n.poiList.pois[a];
45
+ N(u, (m) => {
46
+ const g = new l.Marker({
47
+ map: e,
48
+ position: [u.location.lng, u.location.lat],
49
+ icon: "https://pictures.guanggujinxin.com/common/poi-marker-red.png",
50
+ offset: new l.Pixel(-25, -65),
51
+ zIndex: 999
52
+ }), L = I({ name: u.name, address: m });
53
+ g.on("click", function() {
54
+ k(u), L.open(e, g.getPosition());
55
+ }), (c.poi.name === n.poiList.pois[a].name || a === 0) && (L.open(e, g.getPosition()), e.setCenter(g.getPosition()), k(u));
56
+ });
57
+ }
58
+ });
59
+ }
60
+ }, Q = (e = []) => {
61
+ const t = h.current;
62
+ Array.isArray(e) && e.length > 0 && (f.current = new l.Marker({
63
+ position: e,
64
+ icon: "https://pictures.guanggujinxin.com/common/poi-marker-default.png",
65
+ offset: new l.Pixel(-13, -30)
66
+ }), f.current.setMap(t), t.setCenter(e)), t.on("click", function(o) {
67
+ W(o, t);
68
+ });
69
+ }, W = (e, t) => {
70
+ console.log(e, 122);
71
+ const o = new l.Geocoder({ city: "全国" }), r = [e.lnglat.getLng(), e.lnglat.getLat()];
72
+ f.current && (f.current.setMap(null), f.current = null), f.current = new l.Marker({
73
+ icon: "https://pictures.guanggujinxin.com/common/poi-marker-default.png",
74
+ offset: new l.Pixel(-24, -57),
75
+ position: r
76
+ }), o.getAddress(r, function(c, i) {
77
+ const n = I({
78
+ name: i.regeocode.addressComponent.township,
79
+ address: i.regeocode.formattedAddress
80
+ });
81
+ n.open(t, f.current.getPosition()), c === "complete" && i.info === "OK" ? E(i == null ? void 0 : i.regeocode, r) : (n.close(), Y.warning("暂不支持该地区"));
82
+ }), f.current.setMap(t);
83
+ }, T = () => {
84
+ const e = {
85
+ subdistrict: 1,
86
+ //返回下一级行政区
87
+ showbiz: !1
88
+ //最后一级返回街道信息
89
+ }, t = new l.DistrictSearch(e);
90
+ j(t), t.search("中国", function(o, r) {
91
+ if (o === "complete") {
92
+ const c = r.districtList[0].districtList.map((i) => ({ value: i.adcode, label: i.name, ...i }));
93
+ p((i) => ({ ...i, provinceOptions: c })), D(r.districtList[0]);
94
+ }
95
+ });
96
+ };
97
+ function D(e, t) {
98
+ const o = h.current, r = e.boundaries, c = e.districtList;
99
+ if (r) {
100
+ for (let i = 0, n = r.length; i < n; i++) {
101
+ const s = new l.Polygon({
102
+ map: o,
103
+ strokeWeight: 1,
104
+ strokeColor: "#0091ea",
105
+ fillColor: "#80d8ff",
106
+ fillOpacity: 0.2,
107
+ path: r[i]
108
+ });
109
+ s.on("click", function(a) {
110
+ W(a, o);
111
+ }), b.current.push(s);
112
+ }
113
+ o.setFitView();
114
+ }
115
+ if (t === "province") {
116
+ const i = c.map((n) => ({ value: n.adcode, label: n.name, ...n }));
117
+ p((n) => ({ ...n, cityOptions: i }));
118
+ } else if (t === "city") {
119
+ const i = c.map((n) => ({ value: n.adcode, label: n.name, ...n }));
120
+ p((n) => ({ ...n, districtOptions: i }));
121
+ } else if (t === "district") {
122
+ const i = c.map((n) => ({ value: n.adcode + "_" + n.name, label: n.name, ...n }));
123
+ p((n) => ({ ...n, streetOptions: i }));
124
+ }
125
+ }
126
+ const S = (e, t, o) => {
127
+ var r, c, i, n;
128
+ console.log(e, t, o);
129
+ for (let s = 0, a = (r = b.current) == null ? void 0 : r.length; s < a; s++)
130
+ (n = (i = (c = b.current) == null ? void 0 : c[s]) == null ? void 0 : i.setMap) == null || n.call(i, null);
131
+ if (o === "province" ? p((s) => ({ ...s, provinceValue: e, cityValue: [], districtValue: [] })) : o === "city" ? p((s) => ({ ...s, cityValue: e, districtValue: [] })) : o === "district" && p((s) => ({ ...s, districtValue: e, streetValue: [] })), !e) {
132
+ o === "province" ? p((s) => ({
133
+ ...s,
134
+ cityOptions: [],
135
+ districtOptions: [],
136
+ streetOptions: [],
137
+ streetValue: [],
138
+ cityValue: [],
139
+ districtValue: []
140
+ })) : o === "city" ? p((s) => ({
141
+ ...s,
142
+ districtOptions: [],
143
+ districtValue: [],
144
+ streetOptions: [],
145
+ streetValue: []
146
+ })) : o === "district" && p((s) => ({ ...s, streetOptions: [], streetValue: [] }));
147
+ return;
148
+ }
149
+ M.setLevel(t.level), M.setExtensions("all"), M.search(t.adcode, function(s, a) {
150
+ s === "complete" && D(a.districtList[0], t.level);
151
+ });
152
+ }, U = async (e, t) => {
153
+ p((o) => ({ ...o, streetValue: e })), h.current.setCenter(t.center);
154
+ }, k = (e) => {
155
+ console.log(e);
156
+ const { pname: t, cityname: o, adname: r, longitude: c, latitude: i, location: n } = e, s = { province: t, city: o, district: r };
157
+ N(e, (a) => {
158
+ E({ addressComponent: s, formattedAddress: a }, [c || n.lng, i || n.lat]);
159
+ });
160
+ }, E = (e, t) => {
161
+ v.onSelectLocation && v.onSelectLocation(e, t);
162
+ }, N = (e, t) => {
163
+ const { location: o } = e;
164
+ if (!o) {
165
+ const a = `${e.pname || ""}${e.cityname || ""}${e.adname || ""}${e.address || ""}`;
166
+ t(a);
167
+ return;
168
+ }
169
+ let r, c;
170
+ if (typeof o == "string") {
171
+ const a = o.split(",");
172
+ r = parseFloat(a[0]), c = parseFloat(a[1]);
173
+ } else if (Array.isArray(o))
174
+ r = o[0], c = o[1];
175
+ else if (o.lng !== void 0 && o.lat !== void 0)
176
+ r = o.lng, c = o.lat;
177
+ else {
178
+ const a = e.address || `${e.pname || ""}${e.cityname || ""}${e.adname || ""}`;
179
+ t(a);
180
+ return;
181
+ }
182
+ const i = `${r}_${c}`;
183
+ if (V.current.has(i)) {
184
+ t(V.current.get(i));
185
+ return;
186
+ }
187
+ const n = new l.Geocoder({ city: "全国" }), s = [r, c];
188
+ n.getAddress(s, function(a, u) {
189
+ if (a === "complete" && u.info === "OK") {
190
+ const m = u.regeocode.formattedAddress;
191
+ V.current.set(i, m), t(m);
192
+ } else {
193
+ console.warn("逆地理编码失败,使用备选方案", a);
194
+ const m = e.address || `${e.pname || ""}${e.cityname || ""}${e.adname || ""}`;
195
+ t(m);
196
+ }
197
+ });
198
+ };
199
+ return Z(() => {
200
+ l ? (H(), F(void 0)) : F("地图AMap加载失败");
201
+ }, [l]), /* @__PURE__ */ d(ee, { message: z, children: /* @__PURE__ */ d("div", { id: "fe-map-box", children: /* @__PURE__ */ $("div", { id: "map-box", children: [
202
+ /* @__PURE__ */ $("div", { className: "search-box", children: [
203
+ /* @__PURE__ */ $("div", { className: "search-box-left", children: [
204
+ /* @__PURE__ */ d("div", { className: "input-item", children: /* @__PURE__ */ d(
205
+ A,
206
+ {
207
+ id: "province",
208
+ placeholder: "请选择省",
209
+ allowClear: !0,
210
+ value: w,
211
+ options: K,
212
+ notFoundContent: /* @__PURE__ */ d(O, { description: "没有数据" }),
213
+ onChange: (e, t) => S(e, t, "province")
214
+ }
215
+ ) }),
216
+ /* @__PURE__ */ d("div", { className: "input-item", children: /* @__PURE__ */ d(
217
+ A,
218
+ {
219
+ id: "city",
220
+ allowClear: !0,
221
+ placeholder: "请选择市",
222
+ value: y,
223
+ options: _,
224
+ disabled: !(w != null && w.length),
225
+ notFoundContent: /* @__PURE__ */ d(O, { description: "没有数据" }),
226
+ onChange: (e, t) => S(e, t, "city")
227
+ }
228
+ ) }),
229
+ /* @__PURE__ */ d("div", { className: "input-item", children: /* @__PURE__ */ d(
230
+ A,
231
+ {
232
+ id: "district",
233
+ allowClear: !0,
234
+ placeholder: "请选择区",
235
+ value: C,
236
+ options: B,
237
+ disabled: !(y != null && y.length),
238
+ notFoundContent: /* @__PURE__ */ d(O, { description: "没有数据" }),
239
+ onChange: (e, t) => S(e, t, "district")
240
+ }
241
+ ) }),
242
+ v.showStreet && /* @__PURE__ */ d("div", { className: "input-item", children: /* @__PURE__ */ d(
243
+ A,
244
+ {
245
+ id: "street",
246
+ allowClear: !0,
247
+ placeholder: "请选择街道",
248
+ value: q,
249
+ options: R,
250
+ disabled: !(C != null && C.length),
251
+ notFoundContent: /* @__PURE__ */ d(O, { description: "没有数据" }),
252
+ onChange: (e, t) => U(e, t)
253
+ }
254
+ ) })
255
+ ] }),
256
+ /* @__PURE__ */ d("div", { className: "search-box-right", children: /* @__PURE__ */ d(X, { id: "tip-input", type: "text", placeholder: "请输入关键词搜索" }) })
257
+ ] }),
258
+ /* @__PURE__ */ d("div", { id: "fe-map-container" })
259
+ ] }) }) });
260
+ };
261
+ export {
262
+ re as default
263
+ };
@@ -0,0 +1,85 @@
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { Modal as p } from "antd";
3
+ import { debounce as y } from "lodash-es";
4
+ import { useState as a, useRef as R } from "react";
5
+ import v from "react-draggable";
6
+ const M = (e) => {
7
+ const [l, s] = a(!0), [f, u] = a({ left: 0, top: 0, bottom: 0, right: 0 }), r = R(null), m = {
8
+ header: {
9
+ padding: "12px 24px",
10
+ borderBottom: "none",
11
+ borderRadius: "12px 12px 0 0"
12
+ },
13
+ body: {
14
+ padding: "24px",
15
+ borderTop: "1px solid #f0f0f0"
16
+ },
17
+ mask: {
18
+ background: "rgba(0, 0, 0, 0.45)"
19
+ },
20
+ content: {
21
+ borderRadius: "12px",
22
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
23
+ padding: "0"
24
+ },
25
+ footer: {
26
+ borderTop: "1px solid #f0f0f0",
27
+ padding: "16px 24px",
28
+ textAlign: "right"
29
+ }
30
+ }, x = y((t) => {
31
+ e.onOk && e.onOk(t);
32
+ }, 1e3), b = (t) => {
33
+ e.setIsVisible(!1), e.onClose && e.onClose(t);
34
+ }, g = (t, o) => {
35
+ var c;
36
+ const { clientWidth: i, clientHeight: h } = window.document.documentElement, n = (c = r.current) == null ? void 0 : c.getBoundingClientRect();
37
+ n && u({
38
+ left: -n.left + o.x,
39
+ right: i - (n.right - o.x),
40
+ top: -n.top + o.y,
41
+ bottom: h - (n.bottom - o.y)
42
+ });
43
+ };
44
+ return /* @__PURE__ */ d(
45
+ p,
46
+ {
47
+ open: e.isVisible,
48
+ onCancel: b,
49
+ onOk: x,
50
+ centered: !0,
51
+ destroyOnHidden: !0,
52
+ okText: "确认",
53
+ cancelText: "取消",
54
+ styles: m,
55
+ ...e,
56
+ title: /* @__PURE__ */ d(
57
+ "div",
58
+ {
59
+ style: { width: "100%", cursor: "move" },
60
+ onMouseOver: () => {
61
+ l && s(!1);
62
+ },
63
+ onMouseOut: () => {
64
+ s(!0);
65
+ },
66
+ children: e.title
67
+ }
68
+ ),
69
+ modalRender: (t) => /* @__PURE__ */ d(
70
+ v,
71
+ {
72
+ disabled: l,
73
+ bounds: f,
74
+ nodeRef: r,
75
+ onStart: (o, i) => g(o, i),
76
+ children: /* @__PURE__ */ d("div", { ref: r, children: t })
77
+ }
78
+ ),
79
+ children: /* @__PURE__ */ d("div", { style: { overflowY: "auto", maxHeight: "550px", ...e.bodyStyle || {} }, children: e.children })
80
+ }
81
+ );
82
+ };
83
+ export {
84
+ M as default
85
+ };
@@ -0,0 +1,6 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Pagination as r } from "antd";
3
+ const n = (o) => /* @__PURE__ */ t(r, { ...o });
4
+ export {
5
+ n as default
6
+ };