@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
package/.fatherrc.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'father';
2
+
3
+ export default defineConfig({
4
+ // more father config: https://github.com/umijs/father/blob/master/docs/config.md
5
+ esm: { output: 'es' },
6
+ cjs: { output: 'lib' },
7
+ });
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @pisell/common
2
+
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 测试更新包
package/README.md CHANGED
@@ -1,40 +1,3 @@
1
1
  # @pisell/common
2
2
 
3
- [![NPM version](https://img.shields.io/npm/v/@pisell/common.svg?style=flat)](https://npmjs.org/package/@pisell/common)
4
- [![NPM downloads](http://img.shields.io/npm/dm/@pisell/common.svg?style=flat)](https://npmjs.org/package/@pisell/common)
5
-
6
- pisell
7
-
8
- ## Usage
9
-
10
- TODO
11
-
12
- ## Options
13
-
14
- TODO
15
-
16
- ## Development
17
-
18
- ```bash
19
- # install dependencies
20
- $ cnpm install
21
-
22
- # develop library by docs demo
23
- $ cnpm start
24
-
25
- # build library source code
26
- $ cnpm run build
27
-
28
- # build library source code in watch mode
29
- $ cnpm run build:watch
30
-
31
- # build docs
32
- $ cnpm run docs:build
33
-
34
- # check your project for potential problems
35
- $ cnpm run doctor
36
- ```
37
-
38
- ## LICENSE
39
-
40
- MIT
3
+ pisell使用的通用组件库
@@ -1,5 +1,5 @@
1
- import type { ButtonProps as AntButtonProps } from 'antd5';
2
- import type { ButtonGroupProps as AntButtonGroupProps } from 'antd5/es/button';
1
+ import type { ButtonProps as AntButtonProps } from 'antd';
2
+ import type { ButtonGroupProps as AntButtonGroupProps } from 'antd/es/button';
3
3
  /**
4
4
  * 后续可添加属性
5
5
  */
@@ -11,7 +11,8 @@ export declare type ButtonGroupProps = AntButtonGroupProps;
11
11
  * @constructor
12
12
  */
13
13
  declare const Button: {
14
- (props: ButtonProps): import("react/jsx-runtime").JSX.Element;
15
- Group: (props: ButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
14
+ (props: AntButtonProps): any;
15
+ Group: (props: AntButtonGroupProps) => any;
16
16
  };
17
17
  export default Button;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,IAAI,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAK9E;;GAEG;AAKH,oBAAY,WAAW,GAAG,cAAc,CAAC;AAEzC,oBAAY,gBAAgB,GAAG,mBAAmB,CAAC;AAEnD;;;;GAIG;AACH,QAAA,MAAM,MAAM;;;CAEX,CAAC;AAYF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,33 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ import { Button as AntButton } from 'antd';
3
+ import React from 'react';
4
+ var AntGroup = AntButton.Group;
5
+
6
+ /**
7
+ * 后续可添加属性
8
+ */
9
+ // export interface ButtonProps extends AntButtonProps {
10
+ // [key: string]: any
11
+ // }
12
+
13
+ /**
14
+ * 按钮组件
15
+ * @param props
16
+ * @constructor
17
+ */
18
+ var Button = function Button(props) {
19
+ return /*#__PURE__*/React.createElement(AntButton, _extends({}, props, {
20
+ type: "primary"
21
+ }));
22
+ };
23
+
24
+ /**
25
+ * 按钮组
26
+ * @param props
27
+ * @constructor
28
+ */
29
+ var Group = function Group(props) {
30
+ return /*#__PURE__*/React.createElement(AntGroup, props);
31
+ };
32
+ Button.Group = Group;
33
+ export default Button;
@@ -1,5 +1,5 @@
1
- import type { ButtonProps as AntButtonProps } from 'antd5';
2
- import type { ButtonGroupProps as AntButtonGroupProps } from 'antd5/es/button';
1
+ import type { ButtonProps as AntButtonProps } from 'antd';
2
+ import type { ButtonGroupProps as AntButtonGroupProps } from 'antd/es/button';
3
3
  /**
4
4
  * 后续可添加属性
5
5
  */
@@ -11,7 +11,8 @@ export declare type ButtonGroupProps = AntButtonGroupProps;
11
11
  * @constructor
12
12
  */
13
13
  declare const Button: {
14
- (props: ButtonProps): import("react/jsx-runtime").JSX.Element;
15
- Group: (props: ButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
14
+ (props: AntButtonProps): any;
15
+ Group: (props: AntButtonGroupProps) => any;
16
16
  };
17
17
  export default Button;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,IAAI,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAK9E;;GAEG;AAKH,oBAAY,WAAW,GAAG,cAAc,CAAC;AAEzC,oBAAY,gBAAgB,GAAG,mBAAmB,CAAC;AAEnD;;;;GAIG;AACH,QAAA,MAAM,MAAM;;;CAEX,CAAC;AAYF,eAAe,MAAM,CAAC"}
@@ -26,17 +26,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // src/components/avatar/index.tsx
30
- var avatar_exports = {};
31
- __export(avatar_exports, {
32
- default: () => avatar_default
29
+ // src/button/index.tsx
30
+ var button_exports = {};
31
+ __export(button_exports, {
32
+ default: () => button_default
33
33
  });
34
- module.exports = __toCommonJS(avatar_exports);
35
- var import_antd5 = require("antd5");
34
+ module.exports = __toCommonJS(button_exports);
35
+ var import_antd = require("antd");
36
36
  var import_react = __toESM(require("react"));
37
- var Avatar = (props) => {
38
- return /* @__PURE__ */ import_react.default.createElement(import_antd5.Avatar, { ...props });
37
+ var { Group: AntGroup } = import_antd.Button;
38
+ var Button = (props) => {
39
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { ...props, type: "primary" });
39
40
  };
40
- var avatar_default = Avatar;
41
- // Annotate the CommonJS export names for ESM import in node:
42
- 0 && (module.exports = {});
41
+ var Group = (props) => {
42
+ return /* @__PURE__ */ import_react.default.createElement(AntGroup, { ...props });
43
+ };
44
+ Button.Group = Group;
45
+ var button_default = Button;
package/package.json CHANGED
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/common",
3
- "version": "0.0.19",
4
- "description": "A collection of reusable UI components for web development",
5
- "license": "MIT",
3
+ "version": "1.0.1",
6
4
  "sideEffects": [
7
5
  "*.less"
8
6
  ],
@@ -10,35 +8,13 @@
10
8
  "module": "./es/index.js",
11
9
  "types": "./lib/index.d.ts",
12
10
  "typings": "./lib/index.d.ts",
13
- "bin": {
14
- "pisell": "es/bin/pisell.js"
15
- },
16
- "files": [
17
- "es",
18
- "lib",
19
- "package.json",
20
- "README.md"
21
- ],
22
- "scripts": {
23
- "build": "father build",
24
- "build:watch": "father dev",
25
- "dev": "dumi dev",
26
- "docs:build": "dumi build",
27
- "doctor": "father doctor",
28
- "lint": "npm run lint:es && npm run lint:css",
29
- "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
30
- "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
31
- "prepare": "husky install && dumi setup",
32
- "prepublishOnly": "father doctor && npm run build",
33
- "release": "npm run build && np --no-cleanup --any-branch --yolo --tag",
34
- "release:beta": "npm run build && np --no-cleanup --any-branch --yolo --tag=beta",
35
- "release:next": "npm run build && np --no-cleanup --any-branch --yolo --tag=next",
36
- "start": "npm run dev"
11
+ "dependencies": {
12
+ "antd": "^5.5.0",
13
+ "react": "^18.0.0",
14
+ "react-dom": "^18.0.0"
37
15
  },
38
- "commitlint": {
39
- "extends": [
40
- "@commitlint/config-conventional"
41
- ]
16
+ "devDependencies": {
17
+ "father": "^4.1.6"
42
18
  },
43
19
  "lint-staged": {
44
20
  "*.{md,json}": [
@@ -57,52 +33,19 @@
57
33
  "prettier --parser=typescript --write"
58
34
  ]
59
35
  },
60
- "dependencies": {
61
- "antd5": "npm:antd@^5.5.0",
62
- "archiver": "^5.3.1",
63
- "array-move": "^3.0.1",
64
- "dotenv": "^16.0.3",
65
- "inquirer": "^9.2.6",
66
- "react-beautiful-dnd": "^13.1.0",
67
- "react-color": "^2.19.3",
68
- "ssh2": "^1.13.0",
69
- "zx": "^7.2.2"
70
- },
71
- "devDependencies": {
72
- "@ant-design/icons": "^4.8.0",
73
- "@commitlint/cli": "^17.1.2",
74
- "@commitlint/config-conventional": "^17.1.0",
75
- "@types/react": "^18.0.0",
76
- "@types/react-dom": "^18.0.0",
77
- "@umijs/fabric": "^2.0.0",
78
- "@umijs/lint": "^4.0.0",
79
- "ahooks": "^2.10.0",
80
- "classnames": "^2.3.1",
81
- "dumi": "^2.0.2",
82
- "eslint": "^8.23.0",
83
- "father": "^4.1.0",
84
- "husky": "^8.0.1",
85
- "lint-staged": "^13.0.3",
86
- "np": "^7.7.0",
87
- "prettier": "^2.7.1",
88
- "prettier-plugin-organize-imports": "^3.0.0",
89
- "prettier-plugin-packagejson": "^2.2.18",
90
- "react": "^17.0.0",
91
- "react-dom": "^17.0.0",
92
- "stylelint": "^14.9.1",
93
- "typescript": "^4.9.5",
94
- "umi": "^3.3.9"
95
- },
96
- "peerDependencies": {
97
- "@ant-design/icons": "^4.8.0",
98
- "ahooks": "^2.10.0",
99
- "classnames": "^2.3.1",
100
- "react": ">=17.0",
101
- "react-dom": ">=17.0",
102
- "umi": "^3.3.9"
103
- },
104
36
  "publishConfig": {
105
37
  "access": "public"
106
38
  },
107
- "authors": []
108
- }
39
+ "scripts": {
40
+ "build": "father build",
41
+ "dev": "father dev",
42
+ "docs:build": "dumi build",
43
+ "doctor": "father doctor",
44
+ "lint": "npm run lint:es && npm run lint:css",
45
+ "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
46
+ "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
47
+ "lowcode:build": "build-scripts build --config ./build.lowcode.js",
48
+ "lowcode:dev": "build-scripts start --config ./build.lowcode.js",
49
+ "start": "npm run dev"
50
+ }
51
+ }
@@ -0,0 +1,17 @@
1
+ # Button
2
+
3
+ Button 组件
4
+
5
+ ```jsx
6
+ /**
7
+ * title: 自定义展示
8
+ * description: -`children`可以传递自定义展示内容
9
+ * background: '#f6f7f9'
10
+ */
11
+ import { Button, ConfigProvider } from '@pisell/common';
12
+ import { useState } from 'react';
13
+
14
+ export default () => {
15
+ return <Button type="primary">自定义内容</Button>;
16
+ };
17
+ ```
@@ -0,0 +1,38 @@
1
+ import type { ButtonProps as AntButtonProps } from 'antd';
2
+ import { Button as AntButton } from 'antd';
3
+ import type { ButtonGroupProps as AntButtonGroupProps } from 'antd/es/button';
4
+ import React from 'react';
5
+
6
+ const { Group: AntGroup } = AntButton;
7
+
8
+ /**
9
+ * 后续可添加属性
10
+ */
11
+ // export interface ButtonProps extends AntButtonProps {
12
+ // [key: string]: any
13
+ // }
14
+
15
+ export type ButtonProps = AntButtonProps;
16
+
17
+ export type ButtonGroupProps = AntButtonGroupProps;
18
+
19
+ /**
20
+ * 按钮组件
21
+ * @param props
22
+ * @constructor
23
+ */
24
+ const Button = (props: ButtonProps) => {
25
+ return <AntButton {...props} />;
26
+ };
27
+
28
+ /**
29
+ * 按钮组
30
+ * @param props
31
+ * @constructor
32
+ */
33
+ const Group = (props: ButtonGroupProps) => {
34
+ return <AntGroup {...props} />;
35
+ };
36
+
37
+ Button.Group = Group;
38
+ export default Button;
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "strict": true,
4
+ "declaration": true,
5
+ "skipLibCheck": true,
6
+ "esModuleInterop": true,
7
+ "jsx": "react",
8
+ "baseUrl": "./",
9
+ "paths": {
10
+ "@": ["src/*"]
11
+ }
12
+ },
13
+ "include": ["src"]
14
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/es/bin/pisell.js DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import("../../es/script/index.js");
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- export interface ColorInputProps {
4
- /**
5
- * @description 颜色值
6
- * @default ""
7
- */
8
- value: string;
9
- /**
10
- * @description 当颜色值改变触发
11
- * @default () => void
12
- */
13
- onChange: (val: string) => void;
14
- /**
15
- * @description 色块大小
16
- * @default 30
17
- */
18
- colorBlockSize?: number;
19
- }
20
- declare const ColorInput: React.FC<ColorInputProps>;
21
- export default ColorInput;
@@ -1,43 +0,0 @@
1
- import { Input } from 'antd5';
2
- import React from 'react';
3
- import { ColorPicker } from "../../components";
4
- import "./index.less";
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- import { jsxs as _jsxs } from "react/jsx-runtime";
7
- var prefix = 'pisell-';
8
- var ColorInput = function ColorInput(props) {
9
- var _props$value = props.value,
10
- value = _props$value === void 0 ? '' : _props$value,
11
- _onChange = props.onChange,
12
- _props$colorBlockSize = props.colorBlockSize,
13
- colorBlockSize = _props$colorBlockSize === void 0 ? 30 : _props$colorBlockSize;
14
- return /*#__PURE__*/_jsxs("div", {
15
- className: "".concat(prefix, "color-input-wrap"),
16
- children: [/*#__PURE__*/_jsx(ColorPicker, {
17
- onChange: _onChange,
18
- value: value,
19
- children: /*#__PURE__*/_jsx("div", {
20
- style: {
21
- backgroundColor: value,
22
- width: colorBlockSize,
23
- height: colorBlockSize
24
- },
25
- className: "".concat(prefix, "color-block")
26
- })
27
- }), /*#__PURE__*/_jsx(Input, {
28
- value: value.replace('#', ''),
29
- prefix: '#',
30
- style: {
31
- width: 120
32
- },
33
- onChange: function onChange(e) {
34
- var reg = /^([0-9a-fA-F]{0,6})$/;
35
- if (!reg.test(e.target.value)) {
36
- return;
37
- }
38
- _onChange("#".concat(e.target.value));
39
- }
40
- })]
41
- });
42
- };
43
- export default ColorInput;
@@ -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,7 +0,0 @@
1
- // export { default as Address } from './address';
2
- export { default as ColorInput } from "./colorInput";
3
- export { default as RechargeOption } from "./rechargeOption";
4
- export { default as SelectTag } from "./selectTag";
5
- export { default as SortModal } from "./sortModal";
6
- export { default as Statistics } from "./statistics";
7
- export { default as TagModal } from "./tagModal";
@@ -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,132 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import { DeleteOutlined } from '@ant-design/icons';
8
- import { Button, Col, Form, Input, Row } from 'antd5';
9
- import React, { useCallback, useImperativeHandle, useMemo, useRef } from 'react';
10
- import { getUniqueId, isFunction } from "../../utils";
11
- import { getText } from "../../locales";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { jsxs as _jsxs } from "react/jsx-runtime";
14
- import { Fragment as _Fragment } from "react/jsx-runtime";
15
- /**
16
- * 类充值选项组件
17
- * @param props
18
- * @constructor
19
- */
20
- var RechargeOption = function RechargeOption(props) {
21
- var name = props.name,
22
- _props$isShowEditButt = props.isShowEditButton,
23
- isShowEditButton = _props$isShowEditButt === void 0 ? false : _props$isShowEditButt,
24
- columnOption = props.columnOption,
25
- addBtnText = props.addBtnText,
26
- editBtnText = props.editBtnText,
27
- onEditClick = props.onEditClick,
28
- rechargeOptionRef = props.rechargeOptionRef;
29
- var sortModalRef = useRef(null);
30
- var genDefaultData = useCallback(function (others) {
31
- return columnOption.reduce(function (acc, cur) {
32
- return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, cur.field, ''));
33
- }, _objectSpread({
34
- key: getUniqueId()
35
- }, others));
36
- }, [columnOption]);
37
- var initValue = useMemo(function () {
38
- return genDefaultData({
39
- id: 0
40
- });
41
- }, [columnOption]);
42
- useImperativeHandle(rechargeOptionRef, function () {
43
- return {
44
- openSortModal: function openSortModal() {
45
- var _sortModalRef$current;
46
- (_sortModalRef$current = sortModalRef.current) === null || _sortModalRef$current === void 0 ? void 0 : _sortModalRef$current.showModal();
47
- }
48
- };
49
- });
50
-
51
- // const handleSortModalOk = useCallback(
52
- // (list: any[]) => {
53
- // form.setFieldsValue({
54
- // [name as string]: list,
55
- // });
56
- // sortModalRef.current?.hideModal();
57
- // },
58
- // [name]
59
- // );
60
-
61
- return /*#__PURE__*/_jsx("div", {
62
- children: /*#__PURE__*/_jsxs("div", {
63
- children: [/*#__PURE__*/_jsx(Row, {
64
- gutter: 10,
65
- style: {
66
- marginBottom: '10px'
67
- },
68
- children: columnOption.map(function (item) {
69
- return /*#__PURE__*/_jsx(Col, {
70
- span: item.span,
71
- children: item.label
72
- }, item.label);
73
- })
74
- }), /*#__PURE__*/_jsx(Form.List, {
75
- name: name,
76
- initialValue: [initValue],
77
- children: function children(fields, _ref) {
78
- var add = _ref.add,
79
- remove = _ref.remove;
80
- return /*#__PURE__*/_jsxs(_Fragment, {
81
- children: [fields.map(function (bundle, i) {
82
- return /*#__PURE__*/_jsx(Form.Item, {
83
- noStyle: true,
84
- children: /*#__PURE__*/_jsxs(Row, {
85
- gutter: 10,
86
- children: [columnOption.map(function (item) {
87
- return /*#__PURE__*/_jsx(Col, {
88
- span: item.span,
89
- children: /*#__PURE__*/_jsx(Form.Item, {
90
- name: [bundle.name, item.field],
91
- rules: item.rules,
92
- children: /*#__PURE__*/_jsx(Input, {
93
- style: {
94
- width: '100%'
95
- }
96
- })
97
- })
98
- }, item.label);
99
- }), isShowEditButton && /*#__PURE__*/_jsx(Col, {
100
- span: 3,
101
- children: /*#__PURE__*/_jsx(Button, {
102
- onClick: function onClick() {
103
- isFunction(onEditClick) && onEditClick(bundle);
104
- },
105
- children: editBtnText || getText('pisell-design.recharge.option.button.edit')
106
- })
107
- }), /*#__PURE__*/_jsx(Col, {
108
- span: 2,
109
- children: i !== 0 && /*#__PURE__*/_jsx(Button, {
110
- icon: /*#__PURE__*/_jsx(DeleteOutlined, {}),
111
- onClick: function onClick() {
112
- remove(bundle.name);
113
- }
114
- })
115
- })]
116
- })
117
- }, bundle.key);
118
- }), /*#__PURE__*/_jsx(Button, {
119
- onClick: function onClick() {
120
- add(genDefaultData({
121
- id: fields.length + 1
122
- }));
123
- },
124
- children: addBtnText || getText('pisell-design.recharge.option.button.add')
125
- })]
126
- });
127
- }
128
- })]
129
- })
130
- });
131
- };
132
- export default RechargeOption;
File without changes