venus-design 0.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 (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +43 -0
  3. package/dist/CheckBoxInput/index.d.ts +3 -0
  4. package/dist/CheckBoxInput/index.js +77 -0
  5. package/dist/Config/api.d.ts +38 -0
  6. package/dist/Config/api.js +432 -0
  7. package/dist/Config/constants.d.ts +23 -0
  8. package/dist/Config/constants.js +29 -0
  9. package/dist/Config/proxy.d.ts +165 -0
  10. package/dist/Config/proxy.js +234 -0
  11. package/dist/Config/request.d.ts +5 -0
  12. package/dist/Config/request.js +261 -0
  13. package/dist/Config/storage.d.ts +18 -0
  14. package/dist/Config/storage.js +108 -0
  15. package/dist/Config/utils.d.ts +32 -0
  16. package/dist/Config/utils.js +245 -0
  17. package/dist/DownLoad/index.d.ts +48 -0
  18. package/dist/DownLoad/index.js +246 -0
  19. package/dist/DownLoadFile/index.d.ts +48 -0
  20. package/dist/DownLoadFile/index.js +232 -0
  21. package/dist/NotificationManager/index.d.ts +6 -0
  22. package/dist/NotificationManager/index.js +48 -0
  23. package/dist/NumberPercent/index.d.ts +11 -0
  24. package/dist/NumberPercent/index.js +49 -0
  25. package/dist/NumberPercent/styles.less +18 -0
  26. package/dist/NumberUnits/index.d.ts +5 -0
  27. package/dist/NumberUnits/index.js +55 -0
  28. package/dist/NumberUnits/styles.less +18 -0
  29. package/dist/ProForm/index.d.ts +122 -0
  30. package/dist/ProForm/index.js +868 -0
  31. package/dist/ProForm/styles.less +59 -0
  32. package/dist/RadioAndInput/index.d.ts +3 -0
  33. package/dist/RadioAndInput/index.js +95 -0
  34. package/dist/Search/index.d.ts +3 -0
  35. package/dist/Search/index.js +111 -0
  36. package/dist/TreeSelect/index.d.ts +17 -0
  37. package/dist/TreeSelect/index.js +117 -0
  38. package/dist/Upload/index.d.ts +3 -0
  39. package/dist/Upload/index.js +145 -0
  40. package/dist/Upload/styles.less +46 -0
  41. package/dist/UploadImage/index.d.ts +3 -0
  42. package/dist/UploadImage/index.js +99 -0
  43. package/dist/VenusUpload/index.d.ts +12 -0
  44. package/dist/VenusUpload/index.js +72 -0
  45. package/dist/VenusUpload/services.d.ts +1 -0
  46. package/dist/VenusUpload/services.js +10 -0
  47. package/dist/common.less +48 -0
  48. package/dist/index.d.ts +18 -0
  49. package/dist/index.js +18 -0
  50. package/package.json +97 -0
@@ -0,0 +1,49 @@
1
+ import "antd/es/input-number/style";
2
+ import _InputNumber from "antd/es/input-number";
3
+ var _excluded = ["value", "unitName", "unit"];
4
+ 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); }
5
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
6
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
7
+ import React from 'react';
8
+ import * as s from "./styles.less";
9
+ var NumberUnits = function NumberUnits(props) {
10
+ var value = props.value,
11
+ unitName = props.unitName,
12
+ unit = props.unit,
13
+ others = _objectWithoutProperties(props, _excluded);
14
+ var unitObj = unitConfig.percent;
15
+ var onChange = function onChange(val) {
16
+ if (props.onChange) {
17
+ props.onChange(unitObj ? unitObj.set(val) : val);
18
+ }
19
+ };
20
+ return /*#__PURE__*/React.createElement("div", {
21
+ className: s.numberContainer
22
+ }, /*#__PURE__*/React.createElement(_InputNumber, _extends({}, others, {
23
+ value: unitObj ? unitObj.get(value) : value,
24
+ onChange: onChange
25
+ })), /*#__PURE__*/React.createElement("span", {
26
+ className: s.unit
27
+ }, " %"));
28
+ };
29
+ export var unitConfig = {
30
+ percent: {
31
+ name: '%',
32
+ get: function get(num) {
33
+ if (!num) return num;
34
+ if (isNaN(num)) return num;
35
+ return (num * 100).toFixed(2);
36
+ },
37
+ set: function set(num) {
38
+ if (!num) return num;
39
+ if (isNaN(num)) return num;
40
+ return Number((num / 100).toFixed(2));
41
+ }
42
+ }
43
+ };
44
+ export var formateDetail = function formateDetail(unit, number) {
45
+ if (!number || isNaN(number)) return number;
46
+ var unitObj = unitConfig.percent;
47
+ return unitObj ? unitObj.get(number) + ' ' + '%' : number;
48
+ };
49
+ export default NumberUnits;
@@ -0,0 +1,18 @@
1
+ @import '@/common.less';
2
+
3
+ .numberContainer{
4
+ position: relative;
5
+ display: flex;
6
+ align-items: center;
7
+ :global(.ant-input-number-handler-wrap){
8
+ display: none;
9
+ }
10
+ :global(.ant-input-number-handler){
11
+ display: none;
12
+ }
13
+ .unit{
14
+ position: absolute;
15
+ right: 5px;
16
+ color: @textSupplyColor;
17
+ }
18
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ declare const NumberUnits: (props: any) => React.JSX.Element;
3
+ export declare const unitConfig: any;
4
+ export declare const formateDetail: (unit: string, number: number, unitName: string) => string | number;
5
+ export default NumberUnits;
@@ -0,0 +1,55 @@
1
+ import "antd/es/input-number/style";
2
+ import _InputNumber from "antd/es/input-number";
3
+ var _excluded = ["value", "unitName", "unit"];
4
+ 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); }
5
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
6
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
7
+ import React from 'react';
8
+ import * as s from "./styles.less";
9
+ var NumberUnits = function NumberUnits(props) {
10
+ var value = props.value,
11
+ unitName = props.unitName,
12
+ unit = props.unit,
13
+ others = _objectWithoutProperties(props, _excluded);
14
+ var unitObj = unitConfig[unit];
15
+ var renderUnit = function renderUnit() {
16
+ if (typeof unitName === 'function') {
17
+ return unitName();
18
+ }
19
+ return unitName;
20
+ };
21
+ var onChange = function onChange(val) {
22
+ if (props.onChange) {
23
+ props.onChange(unitObj ? unitObj.set(val) : val);
24
+ }
25
+ };
26
+ return /*#__PURE__*/React.createElement("div", {
27
+ className: s.numberContainer
28
+ }, /*#__PURE__*/React.createElement(_InputNumber, _extends({}, others, {
29
+ value: unitObj ? unitObj.get(value) : value,
30
+ onChange: onChange
31
+ })), /*#__PURE__*/React.createElement("span", {
32
+ className: s.unit
33
+ }, " ", renderUnit()));
34
+ };
35
+ export var unitConfig = {
36
+ million: {
37
+ name: '万',
38
+ get: function get(num) {
39
+ if (!num) return num;
40
+ if (isNaN(num)) return num;
41
+ return (num / 10000).toFixed(2);
42
+ },
43
+ set: function set(num) {
44
+ if (!num) return num;
45
+ if (isNaN(num)) return num;
46
+ return Number((num * 10000).toFixed(2));
47
+ }
48
+ }
49
+ };
50
+ export var formateDetail = function formateDetail(unit, number, unitName) {
51
+ if (!number || isNaN(number)) return number;
52
+ var unitObj = unitConfig[unit];
53
+ return unitObj ? unitObj.get(number) + ' ' + unitName : number;
54
+ };
55
+ export default NumberUnits;
@@ -0,0 +1,18 @@
1
+ @import '~@/common';
2
+
3
+ .numberContainer{
4
+ position: relative;
5
+ display: flex;
6
+ align-items: center;
7
+ :global(.ant-input-number-handler-wrap){
8
+ display: none;
9
+ }
10
+ :global(.ant-input-number-handler){
11
+ display: none;
12
+ }
13
+ .unit{
14
+ position: absolute;
15
+ right: 5px;
16
+ color: @textSupplyColor;
17
+ }
18
+ }
@@ -0,0 +1,122 @@
1
+ import React from 'react';
2
+ declare const ProForm: {
3
+ (props: any): React.JSX.Element;
4
+ Group: (props: any) => React.JSX.Element;
5
+ Item: (props: any) => React.JSX.Element;
6
+ };
7
+ export declare const FormGroup: (props: any) => React.JSX.Element;
8
+ export declare const FormItem: (props: any) => React.JSX.Element;
9
+ export declare const FormItem2: (props: any) => React.JSX.Element;
10
+ export declare const FormItemSE: (props: any) => React.JSX.Element;
11
+ export declare const FormItemCust: (props: any) => React.JSX.Element;
12
+ export declare const FormDependency: (props: any) => React.JSX.Element;
13
+ export declare const FormText: (props: any) => React.JSX.Element;
14
+ export declare const FormText2: (props: any) => React.JSX.Element;
15
+ export declare const FormTextER: (props: any) => React.JSX.Element;
16
+ export declare const FormTextCust: (props: any) => React.JSX.Element;
17
+ export declare const FormTextarea: (props: any) => React.JSX.Element;
18
+ export declare const FormSelect: (props: any) => React.JSX.Element;
19
+ export declare const FormSelect2: (props: any) => React.JSX.Element;
20
+ export declare const FormSelectER: (props: any) => React.JSX.Element;
21
+ export declare const FormRadioGroup: (props: any) => React.JSX.Element;
22
+ export declare const FormNumber: (props: any) => React.JSX.Element;
23
+ export declare const FormNumberPercent: (props: any) => React.JSX.Element;
24
+ export declare const FormNumberUnit: (props: any) => React.JSX.Element;
25
+ export declare const FormDatePicker: (props: any) => React.JSX.Element;
26
+ export declare const FormDatePickerDesign: (props: any) => React.JSX.Element;
27
+ export declare const FormUpload: (props: any) => React.JSX.Element;
28
+ export declare const FormSearch: (props: any) => React.JSX.Element;
29
+ export declare const FormTreeSelect: (props: any) => React.JSX.Element;
30
+ /**
31
+ * 可以定义宽度的下拉
32
+ * @param props
33
+ * @returns
34
+ */
35
+ export declare const VenusFormSelect: (props: any) => React.JSX.Element;
36
+ /**
37
+ * 可以定义宽度的文本
38
+ * @param props
39
+ * @returns
40
+ */
41
+ export declare const VenusFormText: (props: any) => React.JSX.Element;
42
+ /**
43
+ * 选择时间
44
+ * @param props
45
+ * @returns
46
+ */
47
+ export declare const VenusFormDatePicker: (props: any) => React.JSX.Element;
48
+ /**
49
+ * 单选按钮
50
+ * @param props
51
+ * @returns
52
+ */
53
+ export declare const VenusFormRadioGroup: (props: any) => React.JSX.Element;
54
+ /**
55
+ * 多选按钮+输入框
56
+ */
57
+ export declare const VenusFormCheckBoxInputGroup: (props: any) => React.JSX.Element;
58
+ /**
59
+ * 多选按钮
60
+ */
61
+ export declare const VenusFormCheckBoxGroup: (props: any) => React.JSX.Element;
62
+ /**
63
+ * 文本域
64
+ * @param props
65
+ * @returns
66
+ */
67
+ export declare const VenusFormTextarea: (props: any) => React.JSX.Element;
68
+ /**
69
+ * 数字输入
70
+ * @param props
71
+ * @returns
72
+ */
73
+ export declare const VenusFormNumber: (props: any) => React.JSX.Element;
74
+ /**
75
+ * 上传图片组件
76
+ * @param props
77
+ * @returns
78
+ */
79
+ export declare const VenusFormUploadImage: (props: any) => React.JSX.Element;
80
+ /**
81
+ * 带后缀数字输入框
82
+ * @param props
83
+ * @returns
84
+ */
85
+ export declare const VenusFormNumberUnit: (props: any) => React.JSX.Element;
86
+ /**
87
+ * 小数转为百分比数字输入框
88
+ * @param props
89
+ * @returns
90
+ */
91
+ export declare const VenusFormNumberPercent: (props: any) => React.JSX.Element;
92
+ /**
93
+ * 上传组件
94
+ * @param props
95
+ * @returns
96
+ */
97
+ export declare const VenusFormUpload: (props: any) => React.JSX.Element;
98
+ /**
99
+ * 树型下拉
100
+ * @param props
101
+ * @returns
102
+ */
103
+ export declare const VenusFormTreeSelect: (props: any) => React.JSX.Element;
104
+ /**
105
+ *
106
+ * @param props
107
+ * @returns
108
+ */
109
+ export declare const VenusFormSearch: (props: any) => React.JSX.Element;
110
+ /**
111
+ *
112
+ * @param props
113
+ * @returns
114
+ */
115
+ export declare const VenusFormSwitch: (props: any) => React.JSX.Element;
116
+ /**
117
+ * 上传组件
118
+ * @param props
119
+ * @returns
120
+ */
121
+ export declare const VenusFormUploadPro: (props: any) => React.JSX.Element;
122
+ export default ProForm;