@spacego/fe-components 0.1.1 → 0.2.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.
Files changed (202) hide show
  1. package/lib/_virtual/Resizable.js +4 -0
  2. package/lib/_virtual/ResizableBox.js +4 -0
  3. package/lib/_virtual/index.js +5 -0
  4. package/lib/_virtual/index2.js +4 -0
  5. package/lib/_virtual/index3.js +4 -0
  6. package/lib/_virtual/index4.js +4 -0
  7. package/lib/_virtual/propTypes.js +4 -0
  8. package/lib/_virtual/react-is.development.js +4 -0
  9. package/lib/_virtual/react-is.production.min.js +4 -0
  10. package/lib/_virtual/utils.js +4 -0
  11. package/lib/fe-auto-complete/index.js +6 -0
  12. package/lib/fe-button/index.js +27 -0
  13. package/lib/fe-cascader/index.js +19 -0
  14. package/lib/fe-checkbox/index.js +6 -0
  15. package/lib/fe-checkbox-group/index.js +6 -0
  16. package/lib/fe-date-picker/index.js +19 -0
  17. package/lib/fe-description-render/index.js +43 -0
  18. package/lib/fe-descriptions/index.js +6 -0
  19. package/lib/fe-empty/index.js +6 -0
  20. package/lib/fe-error-block/index.js +6 -0
  21. package/lib/fe-form/fe-form/index.js +133 -0
  22. package/lib/fe-form/fe-form-auto-complete/index.js +57 -0
  23. package/lib/fe-form/fe-form-btn-group/index.js +29 -0
  24. package/lib/fe-form/fe-form-cascader/index.js +25 -0
  25. package/lib/fe-form/fe-form-checkbox-group/index.js +21 -0
  26. package/lib/fe-form/fe-form-date-picker/index.js +75 -0
  27. package/lib/fe-form/fe-form-date-range-picker/index.js +99 -0
  28. package/lib/fe-form/fe-form-input/index.js +53 -0
  29. package/lib/fe-form/fe-form-input-input/index.js +63 -0
  30. package/lib/fe-form/fe-form-input-number/index.js +43 -0
  31. package/lib/fe-form/fe-form-item/index.js +46 -0
  32. package/lib/fe-form/fe-form-label/index.js +20 -0
  33. package/lib/fe-form/fe-form-radio/index.js +21 -0
  34. package/lib/fe-form/fe-form-render/index.js +33 -0
  35. package/lib/fe-form/fe-form-rich-text/index.js +25 -0
  36. package/lib/fe-form/fe-form-select/index.js +93 -0
  37. package/lib/fe-form/fe-form-switch/index.js +21 -0
  38. package/lib/fe-form/fe-form-text/index.js +20 -0
  39. package/lib/fe-form/fe-form-text-area/index.js +24 -0
  40. package/lib/fe-form/fe-form-time-picker/index.js +21 -0
  41. package/lib/fe-form/fe-form-upload/index.js +63 -0
  42. package/lib/fe-form/utils/index.js +28 -0
  43. package/lib/fe-input/index.js +32 -0
  44. package/lib/fe-input-number/index.js +19 -0
  45. package/lib/fe-layouts/auth-layout/index.js +35 -17
  46. package/lib/fe-layouts/basics-layout/index.js +2 -2
  47. package/lib/fe-layouts/layout.js +34 -16
  48. package/lib/fe-link/index.js +23 -0
  49. package/lib/fe-map/index.js +263 -0
  50. package/lib/fe-modal/index.js +85 -0
  51. package/lib/fe-pagination/index.js +6 -0
  52. package/lib/fe-panel/fe-panel-toolbar.js +40 -0
  53. package/lib/fe-panel/index.js +49 -0
  54. package/lib/fe-panel/use-panel-context.js +9 -0
  55. package/lib/fe-permission/index.js +12 -0
  56. package/lib/fe-permission-provider/index.js +29 -0
  57. package/lib/fe-radio/index.js +11 -0
  58. package/lib/fe-radio-group/index.js +6 -0
  59. package/lib/fe-rich-text/index.js +293 -0
  60. package/lib/fe-select/index.js +24 -0
  61. package/lib/fe-switch/index.js +6 -0
  62. package/lib/fe-table/fe-edit-table/index.js +39 -0
  63. package/lib/fe-table/fe-edit-table-cell/index.js +63 -0
  64. package/lib/fe-table/fe-head-title/index.js +9 -0
  65. package/lib/fe-table/fe-normal-table/index.js +192 -0
  66. package/lib/fe-table/fe-sub-table/index.js +74 -0
  67. package/lib/fe-table/fe-table/index.js +7 -0
  68. package/lib/fe-table/fe-table-alert/index.js +42 -0
  69. package/lib/fe-table/fe-table-link/index.js +87 -0
  70. package/lib/fe-table/fe-table-render/index.js +56 -0
  71. package/lib/fe-table/fe-table-setting/index.js +165 -0
  72. package/lib/fe-table/fe-table-toolbar/index.js +63 -0
  73. package/lib/fe-table/fe-table-utils/index.js +157 -0
  74. package/lib/fe-table/type/table.d.js +4 -0
  75. package/lib/fe-table/use-edit-table/index.js +151 -0
  76. package/lib/fe-table/use-pagination/index.js +59 -0
  77. package/lib/fe-table/use-sub-table/index.js +23 -0
  78. package/lib/fe-table/use-table/index.js +177 -0
  79. package/lib/fe-table/use-table-columns/index.js +53 -0
  80. package/lib/fe-table/use-table-form-context/index.js +14 -0
  81. package/lib/fe-table/use-table-selection/index.js +53 -0
  82. package/lib/fe-text-area/index.js +21 -0
  83. package/lib/fe-time-picker/index.js +19 -0
  84. package/lib/fe-upload/index.js +182 -0
  85. package/lib/fe-upload/upload.constant.js +91 -0
  86. package/lib/fe-upload-atomic/index.js +6 -0
  87. package/lib/fe-upload-crop/index.js +207 -0
  88. package/lib/hooks/{use-auth.hook.js → use-auth.hook/index.js} +3 -3
  89. package/lib/hooks/use-form/index.js +38 -0
  90. package/lib/hooks/use-permission.hook/index.js +9 -0
  91. package/lib/index.css +7 -1
  92. package/lib/index.js +161 -42
  93. 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
  94. package/lib/node_modules/.pnpm/@dnd-kit_core@6.3.1_nnrd3gsncyragczmpvfhocinkq/node_modules/@dnd-kit/core/dist/core.esm.js +2344 -0
  95. package/lib/node_modules/.pnpm/@dnd-kit_modifiers@9.0.0_55ztycxty3xzw7t4rzpvix55vq/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +13 -0
  96. package/lib/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_55ztycxty3xzw7t4rzpvix55vq/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +439 -0
  97. 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
  98. package/lib/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js +54 -0
  99. package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.js +54 -0
  100. package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.js +52 -0
  101. package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.js +329 -0
  102. package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +17 -0
  103. package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js +10 -0
  104. package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.js +7 -0
  105. package/lib/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js +95 -0
  106. package/lib/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js +78 -0
  107. package/lib/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +10 -0
  108. package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/Resizable.js +233 -0
  109. package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/ResizableBox.js +164 -0
  110. package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/propTypes.js +113 -0
  111. package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/utils.js +56 -0
  112. package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/index.js +12 -0
  113. package/lib/store/modules/layout-config.store.js +83 -65
  114. package/lib/store/modules/theme.store.js +36 -18
  115. package/lib/types/fe-auto-complete/index.d.ts +2 -0
  116. package/lib/types/fe-button/index.d.ts +16 -0
  117. package/lib/types/fe-cascader/index.d.ts +7 -0
  118. package/lib/types/fe-checkbox/index.d.ts +6 -0
  119. package/lib/types/fe-checkbox-group/index.d.ts +5 -0
  120. package/lib/types/fe-date-picker/index.d.ts +3 -0
  121. package/lib/types/fe-description-render/index.d.ts +31 -0
  122. package/lib/types/fe-descriptions/index.d.ts +2 -0
  123. package/lib/types/fe-empty/index.d.ts +2 -0
  124. package/lib/types/fe-error-block/index.d.ts +6 -0
  125. package/lib/types/fe-form/fe-form/index.d.ts +354 -0
  126. package/lib/types/fe-form/fe-form-auto-complete/index.d.ts +3 -0
  127. package/lib/types/fe-form/fe-form-btn-group/index.d.ts +3 -0
  128. package/lib/types/fe-form/fe-form-cascader/index.d.ts +3 -0
  129. package/lib/types/fe-form/fe-form-checkbox-group/index.d.ts +3 -0
  130. package/lib/types/fe-form/fe-form-date-picker/index.d.ts +3 -0
  131. package/lib/types/fe-form/fe-form-date-range-picker/index.d.ts +3 -0
  132. package/lib/types/fe-form/fe-form-input/index.d.ts +3 -0
  133. package/lib/types/fe-form/fe-form-input-input/index.d.ts +3 -0
  134. package/lib/types/fe-form/fe-form-input-number/index.d.ts +3 -0
  135. package/lib/types/fe-form/fe-form-item/index.d.ts +68 -0
  136. package/lib/types/fe-form/fe-form-label/index.d.ts +43 -0
  137. package/lib/types/fe-form/fe-form-radio/index.d.ts +3 -0
  138. package/lib/types/fe-form/fe-form-render/index.d.ts +3 -0
  139. package/lib/types/fe-form/fe-form-rich-text/index.d.ts +3 -0
  140. package/lib/types/fe-form/fe-form-select/index.d.ts +3 -0
  141. package/lib/types/fe-form/fe-form-switch/index.d.ts +3 -0
  142. package/lib/types/fe-form/fe-form-text/index.d.ts +3 -0
  143. package/lib/types/fe-form/fe-form-text-area/index.d.ts +3 -0
  144. package/lib/types/fe-form/fe-form-time-picker/index.d.ts +3 -0
  145. package/lib/types/fe-form/fe-form-upload/index.d.ts +3 -0
  146. package/lib/types/fe-form/index.d.ts +26 -0
  147. package/lib/types/fe-form/utils/index.d.ts +24 -0
  148. package/lib/types/fe-input/index.d.ts +12 -0
  149. package/lib/types/fe-input-number/index.d.ts +2 -0
  150. package/lib/types/fe-link/index.d.ts +6 -0
  151. package/lib/types/fe-map/index.d.ts +73 -0
  152. package/lib/types/fe-modal/index.d.ts +20 -0
  153. package/lib/types/fe-pagination/index.d.ts +2 -0
  154. package/lib/types/fe-panel/fe-panel-toolbar.d.ts +3 -0
  155. package/lib/types/fe-panel/index.d.ts +61 -0
  156. package/lib/types/fe-panel/panel-toolbar.d.ts +4 -0
  157. package/lib/types/fe-panel/use-panel-context.d.ts +6 -0
  158. package/lib/types/fe-permission/index.d.ts +10 -0
  159. package/lib/types/fe-permission-provider/index.d.ts +8 -0
  160. package/lib/types/fe-radio/index.d.ts +2 -0
  161. package/lib/types/fe-radio-group/index.d.ts +2 -0
  162. package/lib/types/fe-rich-text/index.d.ts +167 -0
  163. package/lib/types/fe-select/index.d.ts +8 -0
  164. package/lib/types/fe-switch/index.d.ts +2 -0
  165. package/lib/types/fe-table/fe-edit-table/index.d.ts +3 -0
  166. package/lib/types/fe-table/fe-edit-table-cell/index.d.ts +16 -0
  167. package/lib/types/fe-table/fe-head-title/index.d.ts +6 -0
  168. package/lib/types/fe-table/fe-normal-table/index.d.ts +3 -0
  169. package/lib/types/fe-table/fe-sub-table/index.d.ts +3 -0
  170. package/lib/types/fe-table/fe-table/index.d.ts +3 -0
  171. package/lib/types/fe-table/fe-table-alert/index.d.ts +13 -0
  172. package/lib/types/fe-table/fe-table-link/index.d.ts +10 -0
  173. package/lib/types/fe-table/fe-table-render/index.d.ts +11 -0
  174. package/lib/types/fe-table/fe-table-setting/index.d.ts +22 -0
  175. package/lib/types/fe-table/fe-table-toolbar/index.d.ts +16 -0
  176. package/lib/types/fe-table/fe-table-utils/index.d.ts +193 -0
  177. package/lib/types/fe-table/index.d.ts +6 -0
  178. package/lib/types/fe-table/type/table-context.d.ts +60 -0
  179. package/lib/types/fe-table/type/table.d.ts +795 -0
  180. package/lib/types/fe-table/use-edit-table/index.d.ts +6 -0
  181. package/lib/types/fe-table/use-pagination/index.d.ts +3 -0
  182. package/lib/types/fe-table/use-sub-table/index.d.ts +8 -0
  183. package/lib/types/fe-table/use-table/index.d.ts +3 -0
  184. package/lib/types/fe-table/use-table-columns/index.d.ts +47 -0
  185. package/lib/types/fe-table/use-table-form-context/index.d.ts +10 -0
  186. package/lib/types/fe-table/use-table-selection/index.d.ts +46 -0
  187. package/lib/types/fe-text-area/index.d.ts +4 -0
  188. package/lib/types/fe-time-picker/index.d.ts +3 -0
  189. package/lib/types/fe-upload/index.d.ts +85 -0
  190. package/lib/types/fe-upload/upload.constant.d.ts +39 -0
  191. package/lib/types/fe-upload-atomic/index.d.ts +2 -0
  192. package/lib/types/fe-upload-crop/index.d.ts +10 -0
  193. package/lib/types/hooks/index.d.ts +1 -0
  194. package/lib/types/hooks/use-descriptions/index.d.ts +3 -0
  195. package/lib/types/hooks/use-form/index.d.ts +14 -0
  196. package/lib/types/hooks/use-permission.hook/index.d.ts +10 -0
  197. package/lib/types/index.d.ts +32 -0
  198. package/lib/types/typings/index.d.ts +39 -0
  199. package/package.json +18 -8
  200. /package/lib/hooks/{use-nprogress.hook.js → use-nprogress.hook/index.js} +0 -0
  201. /package/lib/types/hooks/{use-auth.hook.d.ts → use-auth.hook/index.d.ts} +0 -0
  202. /package/lib/types/hooks/{use-nprogress.hook.d.ts → use-nprogress.hook/index.d.ts} +0 -0
@@ -0,0 +1,49 @@
1
+ import { jsx as r, jsxs as n, Fragment as y } from "react/jsx-runtime";
2
+ import { classnames as B } from "@spacego/turbo-utils";
3
+ import { Space as N } from "antd";
4
+ import { useState as g, useMemo as i } from "react";
5
+ import S from "./fe-panel-toolbar.js";
6
+ import _ from "./use-panel-context.js";
7
+ /* empty css */
8
+ const j = (e) => {
9
+ var o;
10
+ const { toolBarConfig: l, toolBarRender: d } = e, [m, s] = g(null), a = i(() => (l == null ? void 0 : l.filter((t) => {
11
+ var c;
12
+ return !((c = t.hidden) != null && c.call(t));
13
+ })) ?? [], [l]), h = i(() => !!e.title || !!e.toolBarRender || !!a.length, [e.title, e.toolBarRender, a]), u = i(() => {
14
+ var t;
15
+ return e.type === "search" ? "0 !important" : ((t = e.wrapperStyle) == null ? void 0 : t.paddingBottom) ?? "12px";
16
+ }, [e.type, (o = e.wrapperStyle) == null ? void 0 : o.paddingBottom]), f = () => {
17
+ let t;
18
+ return d ? t = d : a && a.length && (t = /* @__PURE__ */ r(S, { config: a })), /* @__PURE__ */ n(y, { children: [
19
+ t,
20
+ m
21
+ ] });
22
+ }, v = (t) => {
23
+ s(t);
24
+ }, x = () => /* @__PURE__ */ r("div", { className: "header", children: /* @__PURE__ */ n(N, { children: [
25
+ /* @__PURE__ */ r("div", { className: "header__title", children: e.title ?? "" }),
26
+ e.subTitle && /* @__PURE__ */ r("div", { className: "header__subTitle", children: e.subTitle })
27
+ ] }) });
28
+ return /* @__PURE__ */ r(_.Provider, { value: { renderExtraDom: v }, children: /* @__PURE__ */ n(
29
+ "div",
30
+ {
31
+ className: B("fe-panel", e.wrapperClassName),
32
+ style: {
33
+ ...e.wrapperStyle ?? {},
34
+ paddingBottom: u,
35
+ ...e != null && e.isSticky ? { position: "sticky", top: 0, left: 0, zIndex: 100 } : {}
36
+ },
37
+ children: [
38
+ h && /* @__PURE__ */ n("div", { className: "header", children: [
39
+ x(),
40
+ /* @__PURE__ */ r("div", { className: "header__operate", children: f() })
41
+ ] }),
42
+ !!e.children && /* @__PURE__ */ r("div", { className: "body", children: e.children })
43
+ ]
44
+ }
45
+ ) });
46
+ };
47
+ export {
48
+ j as default
49
+ };
@@ -0,0 +1,9 @@
1
+ import { createContext as e, useContext as t } from "react";
2
+ const o = e({
3
+ renderExtraDom: () => {
4
+ }
5
+ }), r = () => t(o);
6
+ export {
7
+ o as default,
8
+ r as usePanelContext
9
+ };
@@ -0,0 +1,12 @@
1
+ import { jsx as n, Fragment as s } from "react/jsx-runtime";
2
+ import { useMemo as r } from "react";
3
+ import { usePermission as m } from "../hooks/use-permission.hook/index.js";
4
+ const u = (i) => {
5
+ i = { ...i }, i.permission = i.permission ?? i.btnPermission;
6
+ const { btnPermissionList: e } = m();
7
+ return r(() => !i.permission || !e || e.length === 0 ? !0 : e.includes(i.permission), [e, i.permission]) ? /* @__PURE__ */ n(s, { children: i.children }) : /* @__PURE__ */ n(s, { children: i.fallback });
8
+ };
9
+ export {
10
+ u as FePermission,
11
+ u as default
12
+ };
@@ -0,0 +1,29 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { useCallback as o } from "react";
3
+ import P from "../hooks/use-permission.hook/index.js";
4
+ const l = (i) => {
5
+ i = { ...i }, i.btnPermissionList = i.btnPermissionList ?? [];
6
+ const n = o(
7
+ (e) => {
8
+ var t;
9
+ return Array.isArray(e) ? e.every((s) => {
10
+ var r;
11
+ return ((r = i.btnPermissionList) == null ? void 0 : r.includes(s)) ?? !0;
12
+ }) : ((t = i.btnPermissionList) == null ? void 0 : t.includes(e)) ?? !0;
13
+ },
14
+ [i.btnPermissionList]
15
+ );
16
+ return /* @__PURE__ */ m(
17
+ P.Provider,
18
+ {
19
+ value: {
20
+ btnPermissionList: i.btnPermissionList,
21
+ hasPermission: n
22
+ },
23
+ children: i.children
24
+ }
25
+ );
26
+ };
27
+ export {
28
+ l as default
29
+ };
@@ -0,0 +1,11 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Radio as t } from "antd";
3
+ const i = (o) => /* @__PURE__ */ r(
4
+ t,
5
+ {
6
+ ...o
7
+ }
8
+ );
9
+ export {
10
+ i as default
11
+ };
@@ -0,0 +1,6 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Radio as t } from "antd";
3
+ const e = (o) => /* @__PURE__ */ r(t.Group, { ...o });
4
+ export {
5
+ e as default
6
+ };
@@ -0,0 +1,293 @@
1
+ import { jsx as ye } from "react/jsx-runtime";
2
+ import { isEqual as I } from "lodash-es";
3
+ import te from "quill";
4
+ import { forwardRef as xe, useMemo as N, useRef as w, useState as ne, useCallback as G, useEffect as z, useImperativeHandle as Se } from "react";
5
+ /* empty css */
6
+ /* empty css */
7
+ function we(t, a = 4) {
8
+ return {
9
+ getHTML: () => t.root.innerHTML,
10
+ getDisplayHTML: () => He(t.root.innerHTML, a),
11
+ getLength: t.getLength.bind(t),
12
+ getText: t.getText.bind(t),
13
+ getContents: t.getContents.bind(t),
14
+ getSelection: t.getSelection.bind(t),
15
+ getBounds: t.getBounds.bind(t)
16
+ };
17
+ }
18
+ function re(t) {
19
+ Promise.resolve().then(t);
20
+ }
21
+ function ce() {
22
+ if (typeof navigator > "u")
23
+ return { os: "other", isMac: !1, isWindows: !1, defaultTabSize: 4 };
24
+ const t = navigator.userAgent.toLowerCase(), a = navigator.platform.toLowerCase();
25
+ let c = "other", i = 4;
26
+ return a.includes("mac") || t.includes("macintosh") || t.includes("mac os") ? (c = "mac", i = 4) : a.includes("win") || t.includes("windows") ? (c = "windows", i = 4) : t.includes("linux") && (c = "linux", i = 4), {
27
+ os: c,
28
+ isMac: c === "mac",
29
+ isWindows: c === "windows",
30
+ defaultTabSize: i
31
+ };
32
+ }
33
+ function Te() {
34
+ const t = ce();
35
+ return t.os === "linux" ? "other" : t.os;
36
+ }
37
+ function Ee(t, a = 4) {
38
+ const c = t.getSelection();
39
+ if (!c) return;
40
+ const i = " ".repeat(a);
41
+ t.clipboard.dangerouslyPasteHTML(c.index, i), t.setSelection(c.index + a);
42
+ }
43
+ function Ce(t, a = 4) {
44
+ const c = t.getSelection();
45
+ if (!c) return;
46
+ const i = t.getLine(c.index);
47
+ if (!i || !i[0]) return;
48
+ const l = i[0].domNode.textContent || "", S = c.index - i[1];
49
+ let f = 0;
50
+ for (let p = 0; p < Math.min(a, l.length) && (l[p] === " " || l[p] === " "); p++)
51
+ f++;
52
+ if (f > 0) {
53
+ t.deleteText(S, f);
54
+ const p = Math.max(S, c.index - f);
55
+ t.setSelection(p);
56
+ }
57
+ }
58
+ function Le(t) {
59
+ const a = Te();
60
+ return !!(t.key === "Tab" || a === "mac" && (t.key === "Tab" && !t.metaKey && !t.ctrlKey || t.key === "Tab" && t.altKey && !t.metaKey) || a === "windows" && t.key === "Tab" && !t.ctrlKey && !t.altKey);
61
+ }
62
+ function Me(t, a = 4) {
63
+ return typeof t != "string" ? t : t.replace(/\t/g, "&nbsp;".repeat(a)).replace(/(<p[^>]*>)(\s+)/g, (c, i, l) => i + "&nbsp;".repeat(l.length)).replace(/(<div[^>]*>)(\s+)/g, (c, i, l) => i + "&nbsp;".repeat(l.length)).replace(/^(\s+)/gm, (c, i) => "&nbsp;".repeat(i.length)).replace(/>(\s+)([^<\s])/g, (c, i, l) => ">" + "&nbsp;".repeat(i.length) + l).replace(/ {2,}/g, (c) => "&nbsp;".repeat(c.length)).replace(/\n(\s+)/g, (c, i) => `
64
+ ` + "&nbsp;".repeat(i.length));
65
+ }
66
+ function He(t, a = 4) {
67
+ return typeof t != "string" ? t : t.replace(new RegExp(`(&nbsp;){${a}}`, "g"), " ").replace(/&nbsp;/g, " ").replace(/\u00A0/g, " ").replace(/>\s+</g, "><").replace(/(<p[^>]*>)\s+/g, "$1").replace(/\s+(<\/p>)/g, "$1");
68
+ }
69
+ const se = xe((t, a) => {
70
+ const {
71
+ value: c,
72
+ defaultValue: i,
73
+ onChange: l,
74
+ onChangeSelection: S,
75
+ onFocus: f,
76
+ onBlur: p,
77
+ onKeyDown: F,
78
+ onKeyPress: ie,
79
+ onKeyUp: oe,
80
+ height: P = 300,
81
+ readOnly: A = !1,
82
+ placeholder: J = "请输入内容...",
83
+ theme: T = "snow",
84
+ formats: E,
85
+ modules: C,
86
+ bounds: L,
87
+ scrollingContainer: M,
88
+ tabIndex: Q,
89
+ tabSize: ae,
90
+ // 如果用户没有指定,将使用平台默认值
91
+ preserveWhitespace: X = !1,
92
+ style: Y,
93
+ className: ue = "",
94
+ id: le,
95
+ children: j,
96
+ uploadToolConfig: H
97
+ } = t, ge = N(() => ce(), []), h = ae ?? ge.defaultTabSize, b = w(null), n = w(null), D = w(null), [pe, de] = ne(0), [y, Z] = ne(!1), K = w(""), O = w(null), V = w(null), _ = c !== void 0, k = G((e) => e && typeof e == "object" && e.ops, []), R = G(
98
+ (e, r) => k(e) && k(r) ? I(e.ops, r.ops) : I(e, r),
99
+ [k]
100
+ ), U = {
101
+ uploadFn: H == null ? void 0 : H.uploadFn,
102
+ size: H == null ? void 0 : H.imageConfig.size,
103
+ accept: "image/png, image/gif, image/jpeg, image/bmp, image/x-icon"
104
+ }, q = (e, r) => {
105
+ const { uploadFn: o, size: s } = r;
106
+ if (e && e.size > s)
107
+ throw new Error(`上传文件大小超过:${s}B!`);
108
+ if (!(/* @__PURE__ */ new Set([
109
+ "image/jpeg",
110
+ "image/png",
111
+ "image/gif",
112
+ "image/bmp",
113
+ "image/webp",
114
+ "image/svg+xml"
115
+ ])).has(e.type))
116
+ throw new Error("上传文件类型只能为图片格式!");
117
+ return o(e);
118
+ }, fe = (e, r) => {
119
+ var o;
120
+ (o = e == null ? void 0 : e.root) == null || o.addEventListener(
121
+ "paste",
122
+ (s) => {
123
+ s.clipboardData && s.clipboardData.files && s.clipboardData.files.length && (s.preventDefault(), [].forEach.call(s.clipboardData.files, async (m) => {
124
+ var g, d, x, v;
125
+ const u = await q(m, U);
126
+ if (u != null && u.url) {
127
+ const ee = ((d = (g = r == null ? void 0 : r.current) == null ? void 0 : g.getSelection(!0)) == null ? void 0 : d.index) ?? 1;
128
+ (x = r == null ? void 0 : r.current) == null || x.insertEmbed(ee, "image", u == null ? void 0 : u.url), (v = r == null ? void 0 : r.current) == null || v.setSelection(ee + 1);
129
+ }
130
+ }));
131
+ },
132
+ !0
133
+ );
134
+ }, me = {
135
+ image: () => {
136
+ var r;
137
+ let e = (r = b == null ? void 0 : b.current) == null ? void 0 : r.querySelector("input.ql-image[type=file]");
138
+ e === null && (e = document.createElement("input"), e.setAttribute("type", "file"), e.setAttribute("name", "file"), e.setAttribute("accept", U.accept), e.classList.add("ql-image"), e.addEventListener("change", async () => {
139
+ var s, m, u, g;
140
+ const o = await q(e == null ? void 0 : e.files[0], U);
141
+ if (o != null && o.url) {
142
+ const d = ((m = (s = n == null ? void 0 : n.current) == null ? void 0 : s.getSelection(!0)) == null ? void 0 : m.index) ?? 1;
143
+ (u = n == null ? void 0 : n.current) == null || u.insertEmbed(d, "image", o == null ? void 0 : o.url), (g = n == null ? void 0 : n.current) == null || g.setSelection(d + 1);
144
+ }
145
+ })), e == null || e.click();
146
+ }
147
+ }, W = N(
148
+ () => ({
149
+ bounds: L,
150
+ formats: E,
151
+ modules: {
152
+ toolbar: {
153
+ container: [
154
+ [{ header: [1, 2, 3, 4, 5, 6, !1] }],
155
+ ["bold", "italic", "underline", "strike"],
156
+ [{ list: "ordered" }, { list: "bullet" }],
157
+ [{ align: [] }],
158
+ [{ color: [] }, { background: [] }],
159
+ ["link", "image"],
160
+ ["clean"]
161
+ ],
162
+ handlers: me
163
+ },
164
+ ...C
165
+ },
166
+ placeholder: J,
167
+ readOnly: A,
168
+ scrollingContainer: M,
169
+ tabIndex: Q,
170
+ theme: T
171
+ }),
172
+ [L, E, J, A, M, Q, T, JSON.stringify(C)]
173
+ ), B = N(
174
+ () => [L, E, C, T, M],
175
+ [L, E, C, T, M]
176
+ ), $ = w(null), he = N(
177
+ () => ({
178
+ ...Y,
179
+ height: typeof P == "number" ? `${P}px` : P,
180
+ display: "flex",
181
+ flexDirection: "column"
182
+ }),
183
+ [Y, P]
184
+ ), be = G(
185
+ (e) => {
186
+ if (Le(e) && !e.shiftKey && n.current) {
187
+ e.preventDefault(), Ee(n.current, h);
188
+ return;
189
+ }
190
+ if (e.key === "Tab" && e.shiftKey && n.current) {
191
+ e.preventDefault(), Ce(n.current, h);
192
+ return;
193
+ }
194
+ F == null || F(e);
195
+ },
196
+ [F, h]
197
+ );
198
+ return z(() => {
199
+ if (!b.current) return;
200
+ let e;
201
+ if (j)
202
+ e = new te(b.current, W);
203
+ else {
204
+ const r = document.createElement(X ? "pre" : "div");
205
+ b.current.innerHTML = "", b.current.appendChild(r), e = new te(r, W);
206
+ }
207
+ if (n.current = e, D.current = we(e, h), $.current) {
208
+ const { delta: r, selection: o } = $.current;
209
+ e.setContents(r), o && re(() => {
210
+ e.setSelection(o);
211
+ }), $.current = null;
212
+ }
213
+ return fe(e, n), Z(!0), () => {
214
+ n.current = null, D.current = null, Z(!1);
215
+ };
216
+ }, [pe, j, X, W, h]), z(() => {
217
+ if (!n.current || !y) return;
218
+ B.some((r, o) => !I(B[o], [L, E, C, T, M][o])) && ($.current = {
219
+ delta: n.current.getContents(),
220
+ selection: n.current.getSelection()
221
+ }, de((r) => r + 1));
222
+ }, [B, L, E, C, T, M, y]), z(() => {
223
+ !n.current || !y || (A ? n.current.disable() : n.current.enable());
224
+ }, [A, y]), z(() => {
225
+ if (!n.current || !y) return;
226
+ const e = _ ? c : K.current || i;
227
+ if (!R(e, K.current)) {
228
+ if (V.current && e === V.current) {
229
+ console.error("FeRichText: 你正在将onChange事件返回的delta对象作为value传回,这可能导致无限循环。请使用editor.getContents()代替。");
230
+ return;
231
+ }
232
+ K.current = e ?? "";
233
+ const r = n.current, o = r.getSelection();
234
+ if (typeof e == "string") {
235
+ const s = Me(e, h);
236
+ r.clipboard.dangerouslyPasteHTML(s);
237
+ } else
238
+ r.setContents(e);
239
+ o && re(() => {
240
+ var s;
241
+ (s = n.current) == null || s.setSelection(o);
242
+ });
243
+ }
244
+ }, [c, i, _, R, y, h]), z(() => {
245
+ const e = n.current;
246
+ if (!e || !y) return;
247
+ const r = (s, m, u) => {
248
+ if (!n.current) return;
249
+ const g = n.current, d = D.current;
250
+ if (!d) return;
251
+ const x = g.root.innerHTML;
252
+ K.current = k(K.current) ? g.getContents() : x, V.current = s, l == null || l(x, s, u, d);
253
+ }, o = (s, m, u) => {
254
+ if (!n.current || !D.current) return;
255
+ const g = D.current, d = !!s, x = !!m;
256
+ !I(s, O.current) && (O.current = s, S == null || S(s, u, g), !x && d ? f == null || f(s, u, g) : x && !d && (p == null || p(m, u, g)));
257
+ };
258
+ return e.on("text-change", r), e.on("selection-change", o), () => {
259
+ e.off("text-change", r), e.off("selection-change", o);
260
+ };
261
+ }, [y, l, S, f, p, k, h]), Se(
262
+ a,
263
+ () => ({
264
+ focus: () => {
265
+ var e;
266
+ (e = n.current) == null || e.focus();
267
+ },
268
+ blur: () => {
269
+ n.current && (O.current = null, n.current.blur());
270
+ },
271
+ getEditor: () => n.current,
272
+ getUnprivilegedEditor: () => D.current
273
+ }),
274
+ []
275
+ ), /* @__PURE__ */ ye(
276
+ "div",
277
+ {
278
+ id: le,
279
+ ref: b,
280
+ style: he,
281
+ className: `fe-editor ${ue}`,
282
+ onKeyDown: be,
283
+ onKeyPress: ie,
284
+ onKeyUp: oe,
285
+ children: j
286
+ }
287
+ );
288
+ });
289
+ se.displayName = "FeRichText";
290
+ const Ae = se;
291
+ export {
292
+ Ae as default
293
+ };
@@ -0,0 +1,24 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { Select as m, Empty as d } from "antd";
3
+ const c = (t) => {
4
+ t = { ...t }, t.minWidth = t.minWidth ?? "200px";
5
+ const a = () => {
6
+ const { minWidth: e, ...n } = t;
7
+ return n;
8
+ }, h = (e, n) => {
9
+ t.onChange && t.onChange(e, n);
10
+ };
11
+ return /* @__PURE__ */ i(
12
+ m,
13
+ {
14
+ ...a(),
15
+ value: t.value,
16
+ style: { ...t.style, minWidth: t.minWidth },
17
+ onChange: h,
18
+ notFoundContent: /* @__PURE__ */ i(d, { description: "暂无数据" })
19
+ }
20
+ );
21
+ };
22
+ export {
23
+ c as default
24
+ };
@@ -0,0 +1,6 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Switch as o } from "antd";
3
+ const m = (t) => /* @__PURE__ */ r(o, { ...t });
4
+ export {
5
+ m as default
6
+ };
@@ -0,0 +1,39 @@
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { Form as r } from "antd";
3
+ import { isEqual as o } from "lodash-es";
4
+ import { useMemo as F, useImperativeHandle as f, useEffect as V } from "react";
5
+ import c from "../fe-normal-table/index.js";
6
+ const v = (t) => {
7
+ const [a] = r.useForm(), n = t.formData, d = F(() => ({
8
+ ...a,
9
+ setFieldsValue: (e) => {
10
+ var l;
11
+ a.setFieldsValue(e), (l = t.onInternalStateChange) == null || l.call(t, { values: e, record: {} });
12
+ },
13
+ setFieldValue: (e, l) => {
14
+ var i;
15
+ a.setFieldValue(e, l), (i = t.onInternalStateChange) == null || i.call(t, { values: { [e]: l }, record: a.getFieldsValue() });
16
+ }
17
+ }), [a]), m = (e, l) => {
18
+ var i;
19
+ (i = t.onTableValueChange) == null || i.call(t, { values: e, record: l });
20
+ }, s = () => {
21
+ a.resetFields();
22
+ };
23
+ return f(t.formRef, () => ({
24
+ validate: async (e) => e ? a.validateFields([e]) : a.validateFields(),
25
+ setFieldsValue: (e) => {
26
+ d.setFieldsValue(e);
27
+ },
28
+ setFieldValue: (e, l) => {
29
+ d.setFieldValue(e, l);
30
+ },
31
+ onReload: s
32
+ })), V(() => {
33
+ const e = a.getFieldsValue();
34
+ o(e, n) || a.setFieldsValue(n);
35
+ }, [JSON.stringify(n), a, t.editTable]), /* @__PURE__ */ u(r, { form: d, onValuesChange: m, children: /* @__PURE__ */ u(c, { ...t }) });
36
+ };
37
+ export {
38
+ v as default
39
+ };
@@ -0,0 +1,63 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { memo as C } from "react";
3
+ import "@ant-design/icons";
4
+ import "../../store/modules/layout-config.store.js";
5
+ import "../../store/modules/theme.store.js";
6
+ import "react-router-dom";
7
+ import "../../fe-layouts/context/context.js";
8
+ import "nprogress";
9
+ import "../../hooks/use-permission.hook/index.js";
10
+ import "antd";
11
+ import "@spacego/turbo-utils";
12
+ /* empty css */
13
+ import "lodash-es";
14
+ import "../../fe-form/fe-form-date-range-picker/index.js";
15
+ import y from "../../fe-form/fe-form-input/index.js";
16
+ import I from "../../fe-form/fe-form-input-number/index.js";
17
+ import P from "../../fe-form/fe-form-radio/index.js";
18
+ import "../../fe-rich-text/index.js";
19
+ import R from "../../fe-form/fe-form-select/index.js";
20
+ import "../../fe-text-area/index.js";
21
+ /* empty css */
22
+ /* empty css */
23
+ /* empty css */
24
+ import "@spacego/zustand";
25
+ import "react-icons/fa6";
26
+ import "react-icons/io5";
27
+ import "react-icons/lu";
28
+ import "react-icons/md";
29
+ /* empty css */
30
+ import "../../fe-layouts/basics-layout/index.js";
31
+ /* empty css */
32
+ /* empty css */
33
+ /* empty css */
34
+ import "react-draggable";
35
+ import "../../fe-panel/use-panel-context.js";
36
+ /* empty css */
37
+ import "../../_virtual/index.js";
38
+ import "ahooks";
39
+ import "../fe-table-setting/index.js";
40
+ import { useTableFormContext as g } from "../use-table-form-context/index.js";
41
+ const ur = C((d) => {
42
+ const { editing: l, dataIndex: c, label: a, children: p, formProps: r, record: t, rowKey: e, ...u } = d, { enhanceRules: F, enhanceFormProps: f } = g();
43
+ return /* @__PURE__ */ i("td", { ...u, children: (() => {
44
+ var s;
45
+ if (!l) return p;
46
+ const h = F((r == null ? void 0 : r.rules) || [], t, e), n = {
47
+ ...f(r, t, e),
48
+ needLabel: !1,
49
+ dataIndex: c + "_" + t[e],
50
+ label: a,
51
+ rules: h
52
+ }, b = { paddingTop: "15px" }, o = (x) => /* @__PURE__ */ i("div", { style: b, children: /* @__PURE__ */ i(x, { ...n }) }), m = {
53
+ input: () => o(y),
54
+ select: () => o(R),
55
+ inputNumber: () => o(I),
56
+ radio: () => o(P)
57
+ };
58
+ return ((s = m[n.type]) == null ? void 0 : s.call(m)) || p;
59
+ })() });
60
+ });
61
+ export {
62
+ ur as default
63
+ };
@@ -0,0 +1,9 @@
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import { Space as i } from "antd";
3
+ const n = (t) => /* @__PURE__ */ e("div", { className: "fe-table-header-title", children: /* @__PURE__ */ e("div", { className: "fe-table-header-title-left", children: /* @__PURE__ */ l(i, { children: [
4
+ /* @__PURE__ */ e("span", { children: t.title }),
5
+ /* @__PURE__ */ e("span", { style: { color: "#333", fontSize: "12px", fontWeight: "normal" }, children: t.subTitle })
6
+ ] }) }) });
7
+ export {
8
+ n as default
9
+ };