@pisell/common 0.0.19 → 1.0.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 (279) hide show
  1. package/.fatherrc.ts +7 -0
  2. package/CHANGELOG.md +7 -0
  3. package/README.md +1 -38
  4. package/{lib/components → es}/button/index.d.ts +5 -4
  5. package/es/button/index.d.ts.map +1 -0
  6. package/es/button/index.js +33 -0
  7. package/{es/components → lib}/button/index.d.ts +5 -4
  8. package/lib/button/index.d.ts.map +1 -0
  9. package/lib/{components/avatar → button}/index.js +14 -11
  10. package/package.json +20 -77
  11. package/src/button/index.md +17 -0
  12. package/src/button/index.tsx +38 -0
  13. package/tsconfig.json +14 -0
  14. package/LICENSE +0 -21
  15. package/es/bin/pisell.js +0 -2
  16. package/es/business-components/colorInput/index.d.ts +0 -21
  17. package/es/business-components/colorInput/index.js +0 -43
  18. package/es/business-components/colorInput/index.less +0 -10
  19. package/es/business-components/index.d.ts +0 -11
  20. package/es/business-components/index.js +0 -7
  21. package/es/business-components/rechargeOption/index.d.ts +0 -36
  22. package/es/business-components/rechargeOption/index.js +0 -132
  23. package/es/business-components/rechargeOption/index.less +0 -0
  24. package/es/business-components/selectTag/index.d.ts +0 -25
  25. package/es/business-components/selectTag/index.js +0 -179
  26. package/es/business-components/selectTag/index.less +0 -22
  27. package/es/business-components/sortModal/index.d.ts +0 -30
  28. package/es/business-components/sortModal/index.js +0 -85
  29. package/es/business-components/sortModal/index.less +0 -29
  30. package/es/business-components/statistics/index.d.ts +0 -12
  31. package/es/business-components/statistics/index.js +0 -38
  32. package/es/business-components/statistics/index.less +0 -64
  33. package/es/business-components/tagModal/index.d.ts +0 -17
  34. package/es/business-components/tagModal/index.js +0 -58
  35. package/es/business-hooks/index.d.ts +0 -2
  36. package/es/business-hooks/index.js +0 -2
  37. package/es/business-hooks/useModal/index.d.ts +0 -31
  38. package/es/business-hooks/useModal/index.js +0 -91
  39. package/es/business-hooks/useModal/index.less +0 -0
  40. package/es/business-hooks/useTagModal/index.d.ts +0 -17
  41. package/es/business-hooks/useTagModal/index.js +0 -47
  42. package/es/components/ColorPicker/index.d.ts +0 -22
  43. package/es/components/ColorPicker/index.js +0 -51
  44. package/es/components/ColorPicker/index.less +0 -17
  45. package/es/components/DragSort/index.d.ts +0 -2
  46. package/es/components/DragSort/index.js +0 -68
  47. package/es/components/EditorPreview/index.d.ts +0 -5
  48. package/es/components/EditorPreview/index.js +0 -14
  49. package/es/components/EditorPreview/index.less +0 -81
  50. package/es/components/Iconfont/index.d.ts +0 -6
  51. package/es/components/Iconfont/index.js +0 -29
  52. package/es/components/Iconfont/index.less +0 -0
  53. package/es/components/agreement/Detail/index.d.ts +0 -3
  54. package/es/components/agreement/Detail/index.js +0 -77
  55. package/es/components/agreement/Detail/serve.d.ts +0 -1
  56. package/es/components/agreement/Detail/serve.js +0 -6
  57. package/es/components/agreement/index.d.ts +0 -11
  58. package/es/components/agreement/index.js +0 -45
  59. package/es/components/agreement/index.less +0 -20
  60. package/es/components/avatar/index.d.ts +0 -13
  61. package/es/components/avatar/index.js +0 -25
  62. package/es/components/button/index.js +0 -36
  63. package/es/components/card/index.d.ts +0 -5
  64. package/es/components/card/index.js +0 -16
  65. package/es/components/card/index.less +0 -9
  66. package/es/components/checkbox/index.d.ts +0 -20
  67. package/es/components/checkbox/index.js +0 -43
  68. package/es/components/configProvider/index.d.ts +0 -113
  69. package/es/components/configProvider/index.js +0 -114
  70. package/es/components/datePicker/index.d.ts +0 -9
  71. package/es/components/datePicker/index.js +0 -17
  72. package/es/components/index.d.ts +0 -30
  73. package/es/components/index.js +0 -16
  74. package/es/components/input/index.d.ts +0 -35
  75. package/es/components/input/index.js +0 -97
  76. package/es/components/inputNumber/index.d.ts +0 -9
  77. package/es/components/inputNumber/index.js +0 -17
  78. package/es/components/pagination/index.d.ts +0 -10
  79. package/es/components/pagination/index.js +0 -18
  80. package/es/components/radio/index.d.ts +0 -13
  81. package/es/components/radio/index.js +0 -28
  82. package/es/components/select/index.d.ts +0 -9
  83. package/es/components/select/index.js +0 -17
  84. package/es/components/switch/index.d.ts +0 -10
  85. package/es/components/switch/index.js +0 -18
  86. package/es/config/index.d.ts +0 -30
  87. package/es/config/index.js +0 -18
  88. package/es/config/request.d.ts +0 -7
  89. package/es/config/request.js +0 -67
  90. package/es/config/utils.d.ts +0 -0
  91. package/es/config/utils.js +0 -0
  92. package/es/hooks/index.d.ts +0 -8
  93. package/es/hooks/index.js +0 -8
  94. package/es/hooks/useCountDown/index.d.ts +0 -10
  95. package/es/hooks/useCountDown/index.js +0 -48
  96. package/es/hooks/useDocumentScroll/index.d.ts +0 -8
  97. package/es/hooks/useDocumentScroll/index.js +0 -41
  98. package/es/hooks/useDocumentScroll/index.less +0 -0
  99. package/es/hooks/useMousemove/index.d.ts +0 -8
  100. package/es/hooks/useMousemove/index.js +0 -61
  101. package/es/hooks/useResponsive/index.d.ts +0 -2
  102. package/es/hooks/useResponsive/index.js +0 -29
  103. package/es/hooks/useResponsive/index.less +0 -0
  104. package/es/hooks/useSize/index.d.ts +0 -2
  105. package/es/hooks/useSize/index.js +0 -27
  106. package/es/hooks/useSize/index.less +0 -0
  107. package/es/hooks/useStateMulti/index.d.ts +0 -2
  108. package/es/hooks/useStateMulti/index.js +0 -29
  109. package/es/hooks/useStateWithCb/index.d.ts +0 -2
  110. package/es/hooks/useStateWithCb/index.js +0 -42
  111. package/es/hooks/useTable/index.d.ts +0 -12
  112. package/es/hooks/useTable/index.js +0 -74
  113. package/es/hooks/useTable/index.less +0 -0
  114. package/es/hooks/useTableModal/index.d.ts +0 -12
  115. package/es/hooks/useTableModal/index.js +0 -25
  116. package/es/hooks/useTableModal/index.less +0 -0
  117. package/es/hooks/useUrlState/index.d.ts +0 -2
  118. package/es/hooks/useUrlState/index.js +0 -56
  119. package/es/hooks/useWebSocket/index.d.ts +0 -13
  120. package/es/hooks/useWebSocket/index.js +0 -121
  121. package/es/index.d.ts +0 -4
  122. package/es/index.js +0 -4
  123. package/es/locales/en-US.d.ts +0 -11
  124. package/es/locales/en-US.js +0 -10
  125. package/es/locales/index.d.ts +0 -1
  126. package/es/locales/index.js +0 -23
  127. package/es/locales/zh-CN.d.ts +0 -11
  128. package/es/locales/zh-CN.js +0 -10
  129. package/es/locales/zh-TW.d.ts +0 -11
  130. package/es/locales/zh-TW.js +0 -10
  131. package/es/script/constants/index.js +0 -8
  132. package/es/script/deploy.js +0 -47
  133. package/es/script/index.js +0 -40
  134. package/es/script/package.json +0 -4
  135. package/es/script/release/index.js +0 -161
  136. package/es/script/release/release.js +0 -163
  137. package/es/script/uploadCode/index.js +0 -278
  138. package/es/script/uploadCode/uploadCode.js +0 -401
  139. package/es/script/utils/index.js +0 -321
  140. package/es/utils/index.d.ts +0 -3
  141. package/es/utils/index.js +0 -3
  142. package/es/utils/otherUtils.d.ts +0 -8
  143. package/es/utils/otherUtils.js +0 -12
  144. package/es/utils/storage.d.ts +0 -30
  145. package/es/utils/storage.js +0 -70
  146. package/es/utils/typeUtils.d.ts +0 -42
  147. package/es/utils/typeUtils.js +0 -86
  148. package/lib/bin/pisell.js +0 -26
  149. package/lib/business-components/colorInput/index.d.ts +0 -21
  150. package/lib/business-components/colorInput/index.js +0 -70
  151. package/lib/business-components/colorInput/index.less +0 -10
  152. package/lib/business-components/index.d.ts +0 -11
  153. package/lib/business-components/index.js +0 -54
  154. package/lib/business-components/rechargeOption/index.d.ts +0 -36
  155. package/lib/business-components/rechargeOption/index.js +0 -112
  156. package/lib/business-components/rechargeOption/index.less +0 -0
  157. package/lib/business-components/selectTag/index.d.ts +0 -25
  158. package/lib/business-components/selectTag/index.js +0 -181
  159. package/lib/business-components/selectTag/index.less +0 -22
  160. package/lib/business-components/sortModal/index.d.ts +0 -30
  161. package/lib/business-components/sortModal/index.js +0 -100
  162. package/lib/business-components/sortModal/index.less +0 -29
  163. package/lib/business-components/statistics/index.d.ts +0 -12
  164. package/lib/business-components/statistics/index.js +0 -63
  165. package/lib/business-components/statistics/index.less +0 -64
  166. package/lib/business-components/tagModal/index.d.ts +0 -17
  167. package/lib/business-components/tagModal/index.js +0 -66
  168. package/lib/business-hooks/index.d.ts +0 -2
  169. package/lib/business-hooks/index.js +0 -42
  170. package/lib/business-hooks/useModal/index.d.ts +0 -31
  171. package/lib/business-hooks/useModal/index.js +0 -68
  172. package/lib/business-hooks/useModal/index.less +0 -0
  173. package/lib/business-hooks/useTagModal/index.d.ts +0 -17
  174. package/lib/business-hooks/useTagModal/index.js +0 -61
  175. package/lib/components/ColorPicker/index.d.ts +0 -22
  176. package/lib/components/ColorPicker/index.js +0 -80
  177. package/lib/components/ColorPicker/index.less +0 -17
  178. package/lib/components/DragSort/index.d.ts +0 -2
  179. package/lib/components/DragSort/index.js +0 -101
  180. package/lib/components/EditorPreview/index.d.ts +0 -5
  181. package/lib/components/EditorPreview/index.js +0 -37
  182. package/lib/components/EditorPreview/index.less +0 -81
  183. package/lib/components/Iconfont/index.d.ts +0 -6
  184. package/lib/components/Iconfont/index.js +0 -48
  185. package/lib/components/Iconfont/index.less +0 -0
  186. package/lib/components/agreement/Detail/index.d.ts +0 -3
  187. package/lib/components/agreement/Detail/index.js +0 -86
  188. package/lib/components/agreement/Detail/serve.d.ts +0 -1
  189. package/lib/components/agreement/Detail/serve.js +0 -30
  190. package/lib/components/agreement/index.d.ts +0 -11
  191. package/lib/components/agreement/index.js +0 -82
  192. package/lib/components/agreement/index.less +0 -20
  193. package/lib/components/avatar/index.d.ts +0 -13
  194. package/lib/components/button/index.js +0 -36
  195. package/lib/components/card/index.d.ts +0 -5
  196. package/lib/components/card/index.js +0 -42
  197. package/lib/components/card/index.less +0 -9
  198. package/lib/components/checkbox/index.d.ts +0 -20
  199. package/lib/components/checkbox/index.js +0 -36
  200. package/lib/components/configProvider/index.d.ts +0 -113
  201. package/lib/components/configProvider/index.js +0 -159
  202. package/lib/components/datePicker/index.d.ts +0 -9
  203. package/lib/components/datePicker/index.js +0 -31
  204. package/lib/components/index.d.ts +0 -30
  205. package/lib/components/index.js +0 -83
  206. package/lib/components/input/index.d.ts +0 -35
  207. package/lib/components/input/index.js +0 -53
  208. package/lib/components/inputNumber/index.d.ts +0 -9
  209. package/lib/components/inputNumber/index.js +0 -31
  210. package/lib/components/pagination/index.d.ts +0 -10
  211. package/lib/components/pagination/index.js +0 -42
  212. package/lib/components/radio/index.d.ts +0 -13
  213. package/lib/components/radio/index.js +0 -36
  214. package/lib/components/select/index.d.ts +0 -9
  215. package/lib/components/select/index.js +0 -36
  216. package/lib/components/switch/index.d.ts +0 -10
  217. package/lib/components/switch/index.js +0 -42
  218. package/lib/config/index.d.ts +0 -30
  219. package/lib/config/index.js +0 -39
  220. package/lib/config/request.d.ts +0 -7
  221. package/lib/config/request.js +0 -76
  222. package/lib/config/utils.d.ts +0 -0
  223. package/lib/config/utils.js +0 -0
  224. package/lib/hooks/index.d.ts +0 -8
  225. package/lib/hooks/index.js +0 -57
  226. package/lib/hooks/useCountDown/index.d.ts +0 -10
  227. package/lib/hooks/useCountDown/index.js +0 -57
  228. package/lib/hooks/useDocumentScroll/index.d.ts +0 -8
  229. package/lib/hooks/useDocumentScroll/index.js +0 -54
  230. package/lib/hooks/useDocumentScroll/index.less +0 -0
  231. package/lib/hooks/useMousemove/index.d.ts +0 -8
  232. package/lib/hooks/useMousemove/index.js +0 -70
  233. package/lib/hooks/useResponsive/index.d.ts +0 -2
  234. package/lib/hooks/useResponsive/index.js +0 -47
  235. package/lib/hooks/useResponsive/index.less +0 -0
  236. package/lib/hooks/useSize/index.d.ts +0 -2
  237. package/lib/hooks/useSize/index.js +0 -45
  238. package/lib/hooks/useSize/index.less +0 -0
  239. package/lib/hooks/useStateMulti/index.d.ts +0 -2
  240. package/lib/hooks/useStateMulti/index.js +0 -43
  241. package/lib/hooks/useStateWithCb/index.d.ts +0 -2
  242. package/lib/hooks/useStateWithCb/index.js +0 -53
  243. package/lib/hooks/useTable/index.d.ts +0 -12
  244. package/lib/hooks/useTable/index.js +0 -75
  245. package/lib/hooks/useTable/index.less +0 -0
  246. package/lib/hooks/useTableModal/index.d.ts +0 -12
  247. package/lib/hooks/useTableModal/index.js +0 -43
  248. package/lib/hooks/useTableModal/index.less +0 -0
  249. package/lib/hooks/useUrlState/index.d.ts +0 -2
  250. package/lib/hooks/useUrlState/index.js +0 -59
  251. package/lib/hooks/useWebSocket/index.d.ts +0 -13
  252. package/lib/hooks/useWebSocket/index.js +0 -91
  253. package/lib/index.d.ts +0 -4
  254. package/lib/index.js +0 -22
  255. package/lib/locales/en-US.d.ts +0 -11
  256. package/lib/locales/en-US.js +0 -36
  257. package/lib/locales/index.d.ts +0 -1
  258. package/lib/locales/index.js +0 -59
  259. package/lib/locales/zh-CN.d.ts +0 -11
  260. package/lib/locales/zh-CN.js +0 -36
  261. package/lib/locales/zh-TW.d.ts +0 -11
  262. package/lib/locales/zh-TW.js +0 -36
  263. package/lib/script/constants/index.js +0 -35
  264. package/lib/script/deploy.js +0 -61
  265. package/lib/script/index.js +0 -61
  266. package/lib/script/package.json +0 -4
  267. package/lib/script/release/index.js +0 -116
  268. package/lib/script/release/release.js +0 -89
  269. package/lib/script/uploadCode/index.js +0 -202
  270. package/lib/script/uploadCode/uploadCode.js +0 -208
  271. package/lib/script/utils/index.js +0 -248
  272. package/lib/utils/index.d.ts +0 -3
  273. package/lib/utils/index.js +0 -21
  274. package/lib/utils/otherUtils.d.ts +0 -8
  275. package/lib/utils/otherUtils.js +0 -31
  276. package/lib/utils/storage.d.ts +0 -30
  277. package/lib/utils/storage.js +0 -63
  278. package/lib/utils/typeUtils.d.ts +0 -42
  279. package/lib/utils/typeUtils.js +0 -75
@@ -1,70 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/business-components/colorInput/index.tsx
30
- var colorInput_exports = {};
31
- __export(colorInput_exports, {
32
- default: () => colorInput_default
33
- });
34
- module.exports = __toCommonJS(colorInput_exports);
35
- var import_antd5 = require("antd5");
36
- var import_react = __toESM(require("react"));
37
- var import_components = require("../../components");
38
- var import_index = require("./index.less");
39
- var prefix = "pisell-";
40
- var ColorInput = (props) => {
41
- const { value = "", onChange, colorBlockSize = 30 } = props;
42
- return /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}color-input-wrap` }, /* @__PURE__ */ import_react.default.createElement(import_components.ColorPicker, { onChange, value }, /* @__PURE__ */ import_react.default.createElement(
43
- "div",
44
- {
45
- style: {
46
- backgroundColor: value,
47
- width: colorBlockSize,
48
- height: colorBlockSize
49
- },
50
- className: `${prefix}color-block`
51
- }
52
- )), /* @__PURE__ */ import_react.default.createElement(
53
- import_antd5.Input,
54
- {
55
- value: value.replace("#", ""),
56
- prefix: "#",
57
- style: { width: 120 },
58
- onChange: (e) => {
59
- const reg = /^([0-9a-fA-F]{0,6})$/;
60
- if (!reg.test(e.target.value)) {
61
- return;
62
- }
63
- onChange(`#${e.target.value}`);
64
- }
65
- }
66
- ));
67
- };
68
- var colorInput_default = ColorInput;
69
- // Annotate the CommonJS export names for ESM import in node:
70
- 0 && (module.exports = {});
@@ -1,10 +0,0 @@
1
- .pisell-color-input-wrap {
2
- display: flex;
3
- align-items: center;
4
- .pisell-color-block {
5
- width: 30px;
6
- height: 30px;
7
- margin-right: 10px;
8
- border-radius: 4px;
9
- }
10
- }
@@ -1,11 +0,0 @@
1
- export { default as ColorInput } from './colorInput';
2
- export type { ColorInputProps } from './colorInput';
3
- export { default as RechargeOption } from './rechargeOption';
4
- export type { RechargeOptionProps } from './rechargeOption';
5
- export { default as SelectTag } from './selectTag';
6
- export type { SelectTagProps } from './selectTag';
7
- export { default as SortModal } from './sortModal';
8
- export type { SortModalProps } from './sortModal';
9
- export { default as Statistics } from './statistics';
10
- export { default as TagModal } from './tagModal';
11
- export type { TagModalProps } from './tagModal';
@@ -1,54 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/business-components/index.ts
30
- var business_components_exports = {};
31
- __export(business_components_exports, {
32
- ColorInput: () => import_colorInput.default,
33
- RechargeOption: () => import_rechargeOption.default,
34
- SelectTag: () => import_selectTag.default,
35
- SortModal: () => import_sortModal.default,
36
- Statistics: () => import_statistics.default,
37
- TagModal: () => import_tagModal.default
38
- });
39
- module.exports = __toCommonJS(business_components_exports);
40
- var import_colorInput = __toESM(require("./colorInput"));
41
- var import_rechargeOption = __toESM(require("./rechargeOption"));
42
- var import_selectTag = __toESM(require("./selectTag"));
43
- var import_sortModal = __toESM(require("./sortModal"));
44
- var import_statistics = __toESM(require("./statistics"));
45
- var import_tagModal = __toESM(require("./tagModal"));
46
- // Annotate the CommonJS export names for ESM import in node:
47
- 0 && (module.exports = {
48
- ColorInput,
49
- RechargeOption,
50
- SelectTag,
51
- SortModal,
52
- Statistics,
53
- TagModal
54
- });
@@ -1,36 +0,0 @@
1
- import type { ColProps } from 'antd5/lib/col';
2
- import type { FormItemProps } from 'antd5/lib/form/FormItem';
3
- import type { FormListFieldData, FormListProps } from 'antd5/lib/form/FormList';
4
- import React from 'react';
5
- import type { SortModalProps } from '../sortModal';
6
- import type { FormInstance } from 'antd5/es/form/hooks/useForm';
7
- export interface RechargeOptionProps {
8
- name: FormListProps['name'];
9
- /** 是否展示编辑按钮 */
10
- isShowEditButton?: boolean;
11
- /** 添加按钮文案 */
12
- addBtnText?: string;
13
- /** 编辑按钮文案 */
14
- editBtnText?: string;
15
- /** 列配置 */
16
- columnOption: {
17
- label: string;
18
- span: ColProps['span'];
19
- field: string;
20
- rules: FormItemProps['rules'];
21
- }[];
22
- /** 编辑按钮事件 */
23
- onEditClick?: (bundle: FormListFieldData) => void;
24
- rechargeOptionRef?: React.MutableRefObject<{
25
- openSortModal: () => void;
26
- } | undefined>;
27
- sortModalProps?: Partial<Omit<SortModalProps<Record<string, any>>, 'ref'>>;
28
- form: FormInstance;
29
- }
30
- /**
31
- * 类充值选项组件
32
- * @param props
33
- * @constructor
34
- */
35
- declare const RechargeOption: React.FC<RechargeOptionProps>;
36
- export default RechargeOption;
@@ -1,112 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/business-components/rechargeOption/index.tsx
30
- var rechargeOption_exports = {};
31
- __export(rechargeOption_exports, {
32
- default: () => rechargeOption_default
33
- });
34
- module.exports = __toCommonJS(rechargeOption_exports);
35
- var import_icons = require("@ant-design/icons");
36
- var import_antd5 = require("antd5");
37
- var import_react = __toESM(require("react"));
38
- var import_utils = require("../../utils");
39
- var import_locales = require("../../locales");
40
- var RechargeOption = (props) => {
41
- const {
42
- name,
43
- isShowEditButton = false,
44
- columnOption,
45
- addBtnText,
46
- editBtnText,
47
- onEditClick,
48
- rechargeOptionRef
49
- // sortModalProps,
50
- // form,
51
- } = props;
52
- const sortModalRef = (0, import_react.useRef)(null);
53
- const genDefaultData = (0, import_react.useCallback)(
54
- (others) => {
55
- return columnOption.reduce((acc, cur) => ({ ...acc, [cur.field]: "" }), {
56
- key: (0, import_utils.getUniqueId)(),
57
- ...others
58
- });
59
- },
60
- [columnOption]
61
- );
62
- const initValue = (0, import_react.useMemo)(() => genDefaultData({ id: 0 }), [columnOption]);
63
- (0, import_react.useImperativeHandle)(rechargeOptionRef, () => ({
64
- openSortModal: () => {
65
- var _a;
66
- (_a = sortModalRef.current) == null ? void 0 : _a.showModal();
67
- }
68
- }));
69
- return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_antd5.Row, { gutter: 10, style: { marginBottom: "10px" } }, columnOption.map((item) => {
70
- return /* @__PURE__ */ import_react.default.createElement(import_antd5.Col, { span: item.span, key: item.label }, item.label);
71
- })), /* @__PURE__ */ import_react.default.createElement(import_antd5.Form.List, { name, initialValue: [initValue] }, (fields, { add, remove }) => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, fields.map((bundle, i) => {
72
- return /* @__PURE__ */ import_react.default.createElement(import_antd5.Form.Item, { key: bundle.key, noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_antd5.Row, { gutter: 10 }, columnOption.map((item) => {
73
- return /* @__PURE__ */ import_react.default.createElement(import_antd5.Col, { span: item.span, key: item.label }, /* @__PURE__ */ import_react.default.createElement(
74
- import_antd5.Form.Item,
75
- {
76
- name: [bundle.name, item.field],
77
- rules: item.rules
78
- },
79
- /* @__PURE__ */ import_react.default.createElement(import_antd5.Input, { style: { width: "100%" } })
80
- ));
81
- }), isShowEditButton && /* @__PURE__ */ import_react.default.createElement(import_antd5.Col, { span: 3 }, /* @__PURE__ */ import_react.default.createElement(
82
- import_antd5.Button,
83
- {
84
- onClick: () => {
85
- (0, import_utils.isFunction)(onEditClick) && onEditClick(bundle);
86
- }
87
- },
88
- editBtnText || (0, import_locales.getText)(
89
- "pisell-design.recharge.option.button.edit"
90
- )
91
- )), /* @__PURE__ */ import_react.default.createElement(import_antd5.Col, { span: 2 }, i !== 0 && /* @__PURE__ */ import_react.default.createElement(
92
- import_antd5.Button,
93
- {
94
- icon: /* @__PURE__ */ import_react.default.createElement(import_icons.DeleteOutlined, null),
95
- onClick: () => {
96
- remove(bundle.name);
97
- }
98
- }
99
- ))));
100
- }), /* @__PURE__ */ import_react.default.createElement(
101
- import_antd5.Button,
102
- {
103
- onClick: () => {
104
- add(genDefaultData({ id: fields.length + 1 }));
105
- }
106
- },
107
- addBtnText || (0, import_locales.getText)("pisell-design.recharge.option.button.add")
108
- )))));
109
- };
110
- var rechargeOption_default = RechargeOption;
111
- // Annotate the CommonJS export names for ESM import in node:
112
- 0 && (module.exports = {});
File without changes
@@ -1,25 +0,0 @@
1
- import type { SelectProps } from 'antd5';
2
- import React from 'react';
3
- import './index.less';
4
- declare type BaseValue = string | number;
5
- declare type ColorValue = {
6
- color: string;
7
- value: BaseValue;
8
- label: string;
9
- };
10
- declare type Value = BaseValue | ColorValue;
11
- export interface SelectTagProps<T> extends Omit<SelectProps, 'options'> {
12
- selectTagRef?: React.MutableRefObject<{
13
- showModal: () => void;
14
- hideModal: () => void;
15
- }>;
16
- value?: T[];
17
- onChange?: (value: T[]) => void;
18
- isColorSelect?: boolean;
19
- options: {
20
- value: BaseValue;
21
- label: string;
22
- }[];
23
- }
24
- declare const SelectTag: <T extends Value>(props: SelectTagProps<T>) => import("react/jsx-runtime").JSX.Element;
25
- export default SelectTag;
@@ -1,181 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/business-components/selectTag/index.tsx
30
- var selectTag_exports = {};
31
- __export(selectTag_exports, {
32
- default: () => selectTag_default
33
- });
34
- module.exports = __toCommonJS(selectTag_exports);
35
- var import_antd5 = require("antd5");
36
- var import_react = __toESM(require("react"));
37
- var import_business_hooks = require("../../business-hooks");
38
- var import_DragSort = __toESM(require("../../components/DragSort"));
39
- var import_Iconfont = __toESM(require("../../components/Iconfont"));
40
- var import_locales = require("../../locales");
41
- var import_utils = require("../../utils");
42
- var import_colorInput = __toESM(require("../colorInput"));
43
- var import_index = require("./index.less");
44
- var defaultColor = "#000";
45
- var prefix = "pisell-";
46
- var SelectTag = (props) => {
47
- const { selectTagRef, value, onChange, options, isColorSelect } = props;
48
- const tagValue = (0, import_react.useMemo)(() => {
49
- if (!(0, import_utils.isArr)(value)) {
50
- return [];
51
- }
52
- if (value.every((item) => (0, import_utils.isString)(item) || (0, import_utils.isNumber)(item))) {
53
- return value;
54
- }
55
- return value.map((item) => item.value);
56
- }, [value]);
57
- const valueColorMap = (0, import_react.useMemo)(() => {
58
- if (!isColorSelect || !(0, import_utils.isArr)(value)) {
59
- return {};
60
- }
61
- return value.reduce(
62
- (pre, cur) => ({ ...pre, [cur.value]: cur.color }),
63
- {}
64
- );
65
- }, [value, options]);
66
- const valueLabelMap = (0, import_react.useMemo)(
67
- () => options.reduce((pre, cur) => ({ ...pre, [cur.value]: cur.label }), {}),
68
- [options]
69
- );
70
- const handleTagChange = (0, import_react.useCallback)(
71
- (val) => {
72
- if (isColorSelect) {
73
- const _value = val.map((item) => {
74
- return {
75
- color: valueColorMap[item] || defaultColor,
76
- value: item
77
- };
78
- });
79
- (0, import_utils.isFunction)(onChange) && onChange(_value);
80
- return;
81
- }
82
- (0, import_utils.isFunction)(onChange) && onChange(val);
83
- },
84
- [isColorSelect, onChange, valueColorMap]
85
- );
86
- const { content, hideModal, showModal } = (0, import_business_hooks.useTagModal)({
87
- value: tagValue,
88
- onChange: handleTagChange,
89
- data: options,
90
- onOk: () => {
91
- hideModal();
92
- },
93
- title: (0, import_locales.getText)("pisell-design.select.tag.modal.title"),
94
- onCancel: () => {
95
- hideModal();
96
- }
97
- });
98
- (0, import_react.useImperativeHandle)(selectTagRef, () => ({
99
- showModal,
100
- hideModal
101
- }));
102
- const tagRender = (props2) => {
103
- const { label, value: value2, closable, onClose } = props2;
104
- const onPreventMouseDown = (event) => {
105
- event.preventDefault();
106
- event.stopPropagation();
107
- };
108
- return /* @__PURE__ */ import_react.default.createElement(
109
- import_antd5.Tag,
110
- {
111
- onMouseDown: onPreventMouseDown,
112
- closable,
113
- onClose,
114
- className: `${prefix}select-tag`,
115
- style: { color: valueColorMap[value2] || defaultColor }
116
- },
117
- label
118
- );
119
- };
120
- const handleSelectChange = (0, import_react.useCallback)(
121
- (val) => {
122
- let newVal = val;
123
- if (isColorSelect) {
124
- newVal = val.map((item) => ({
125
- value: item,
126
- color: valueColorMap[item] || defaultColor
127
- }));
128
- }
129
- (0, import_utils.isFunction)(onChange) && onChange(newVal);
130
- },
131
- [isColorSelect, valueColorMap]
132
- );
133
- const selectValue = (0, import_react.useMemo)(() => {
134
- if (!(0, import_utils.isArr)(value)) {
135
- return [];
136
- }
137
- if (value.every((item) => (0, import_utils.isString)(item) || (0, import_utils.isNumber)(item))) {
138
- return value;
139
- }
140
- if (isColorSelect) {
141
- return value.map((item) => item.value);
142
- }
143
- }, [value, isColorSelect]);
144
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
145
- import_antd5.Select,
146
- {
147
- ...props,
148
- value: selectValue,
149
- mode: "tags",
150
- options,
151
- onChange: handleSelectChange,
152
- tagRender
153
- }
154
- ), isColorSelect && /* @__PURE__ */ import_react.default.createElement(
155
- import_DragSort.default,
156
- {
157
- list: value || [],
158
- droppableId: "addressSort",
159
- draggableIdKey: "value",
160
- onChange: (_list) => {
161
- (0, import_utils.isFunction)(onChange) && onChange(_list);
162
- }
163
- },
164
- (item, index) => {
165
- return /* @__PURE__ */ import_react.default.createElement("div", { key: item.value, className: `${prefix}sort-item` }, /* @__PURE__ */ import_react.default.createElement(import_Iconfont.default, { type: "icon-drag", className: `${prefix}icon` }), /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}sort-content` }, /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}tag-content` }, valueLabelMap[item.value])), /* @__PURE__ */ import_react.default.createElement(
166
- import_colorInput.default,
167
- {
168
- value: item.color,
169
- onChange: (val) => {
170
- const _value = value ? [...value] : [];
171
- _value[index].color = val;
172
- (0, import_utils.isFunction)(onChange) && onChange(_value);
173
- }
174
- }
175
- ));
176
- }
177
- ), content);
178
- };
179
- var selectTag_default = SelectTag;
180
- // Annotate the CommonJS export names for ESM import in node:
181
- 0 && (module.exports = {});
@@ -1,22 +0,0 @@
1
- .pisell-sort-item {
2
- display: flex;
3
- align-items: center;
4
- height: 50px;
5
- margin-top: 12px;
6
- line-height: 40px;
7
- background-color: #f0f0f0;
8
- .pisell-sort-content {
9
- margin-right: 10px;
10
- }
11
- .pisell-icon {
12
- color: #999;
13
- font-size: 20px;
14
- }
15
- }
16
-
17
- .pisell-select-tag {
18
- margin: 0 3px 3px 0;
19
- padding: 2px 8px;
20
- font-size: 14px;
21
- border-radius: 6px;
22
- }
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import type { useModalProps } from '../../business-hooks/useModal';
3
- import './index.less';
4
- export interface SortModalProps<T> {
5
- /** 排序数据 */
6
- items: T[];
7
- /** 弹窗标题 */
8
- title: useModalProps['title'];
9
- /** 自定义渲染内容 */
10
- renderContent?: (items: T[], content: React.ReactNode) => React.ReactNode;
11
- /** 自定义渲染排序项 */
12
- renderSortItem?: (item: T, index: number) => React.ReactNode;
13
- /** 是否展示序号 */
14
- isShowIndex?: boolean;
15
- /** 字段展示配置 */
16
- field: {
17
- id: keyof T;
18
- name: keyof T;
19
- key: keyof T;
20
- };
21
- /** 确认事件 返回调整后的顺序 */
22
- onOk?: (list: T[]) => void;
23
- /** 弹窗ref 可外部唤起弹窗 */
24
- sortModalRef?: React.Ref<{
25
- showModal: () => void;
26
- hideModal: () => void;
27
- }>;
28
- }
29
- declare const SortModal: <T extends Record<string, any>>(props: SortModalProps<T>) => import("react/jsx-runtime").JSX.Element;
30
- export default SortModal;
@@ -1,100 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/business-components/sortModal/index.tsx
30
- var sortModal_exports = {};
31
- __export(sortModal_exports, {
32
- default: () => sortModal_default
33
- });
34
- module.exports = __toCommonJS(sortModal_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_utils = require("../../utils");
37
- var import_useModal = __toESM(require("../../business-hooks/useModal"));
38
- var import_components = require("../../components");
39
- var import_index = require("./index.less");
40
- var prefix = "pisell-";
41
- var SortModal = (props) => {
42
- const {
43
- title,
44
- items,
45
- renderSortItem,
46
- field,
47
- isShowIndex,
48
- onOk,
49
- sortModalRef,
50
- renderContent
51
- } = props;
52
- const [sortItems, setSortItems] = (0, import_react.useState)(items);
53
- (0, import_react.useEffect)(() => {
54
- setSortItems(items);
55
- }, [items]);
56
- const RenderSortItem = (0, import_react.useCallback)(
57
- (item, index) => {
58
- return /* @__PURE__ */ import_react.default.createElement("div", { key: item[field.key], className: `${prefix}sort-item` }, /* @__PURE__ */ import_react.default.createElement(import_components.IconFont, { type: "icon-drag", className: `${prefix}item` }), /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}sort-content` }, isShowIndex && index + 1, /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}tag-content` }, item[field.name])));
59
- },
60
- [props]
61
- );
62
- const ModalContent = (0, import_react.useMemo)(() => {
63
- const content2 = /* @__PURE__ */ import_react.default.createElement(
64
- import_components.DragSort,
65
- {
66
- list: sortItems,
67
- droppableId: "addressSort",
68
- draggableIdKey: field.id,
69
- className: `${prefix}sort-list`,
70
- onChange: (_list) => {
71
- setSortItems(_list);
72
- }
73
- },
74
- (0, import_utils.isFunction)(renderSortItem) ? renderSortItem : RenderSortItem
75
- );
76
- if ((0, import_utils.isFunction)(renderContent)) {
77
- return renderContent(sortItems, content2);
78
- }
79
- if (renderContent) {
80
- return renderContent;
81
- }
82
- return content2;
83
- }, [sortItems, renderSortItem, RenderSortItem, renderContent]);
84
- const handleOk = (0, import_react.useCallback)(() => {
85
- (0, import_utils.isFunction)(onOk) && onOk(sortItems);
86
- }, [onOk, sortItems]);
87
- const { content, hideModal, visible, showModal } = (0, import_useModal.default)({
88
- children: ModalContent,
89
- title,
90
- onOk: handleOk
91
- });
92
- (0, import_react.useImperativeHandle)(sortModalRef, () => ({
93
- showModal,
94
- hideModal
95
- }));
96
- return content;
97
- };
98
- var sortModal_default = SortModal;
99
- // Annotate the CommonJS export names for ESM import in node:
100
- 0 && (module.exports = {});