@hw-component/form 0.0.6-beta-v2 → 0.0.6-beta-v3

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.
@@ -67,14 +67,13 @@ var useModifyProps = function useModifyProps(_ref) {
67
67
  var showParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
68
68
  var changeConfigData = showParams.configData,
69
69
  changeInitialValues = showParams.initialValues,
70
- changeParams = showParams.params,
70
+ _showParams$params = showParams.params,
71
+ changeParams = _showParams$params === void 0 ? {} : _showParams$params,
71
72
  changeTitle = showParams.title;
72
73
  if (!!changeConfigData) {
73
74
  setModalFormData(changeConfigData);
74
75
  }
75
- if (!!changeParams) {
76
- setFormParams(changeParams);
77
- }
76
+ setFormParams(changeParams);
78
77
  if (!!changeTitle) {
79
78
  setModalTitle(changeTitle);
80
79
  }
@@ -68,14 +68,13 @@ var useModifyProps = function useModifyProps(_ref) {
68
68
  var showParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
69
69
  var changeConfigData = showParams.configData,
70
70
  changeInitialValues = showParams.initialValues,
71
- changeParams = showParams.params,
71
+ _showParams$params = showParams.params,
72
+ changeParams = _showParams$params === void 0 ? {} : _showParams$params,
72
73
  changeTitle = showParams.title;
73
74
  if (!!changeConfigData) {
74
75
  setModalFormData(changeConfigData);
75
76
  }
76
- if (!!changeParams) {
77
- setFormParams(changeParams);
78
- }
77
+ setFormParams(changeParams);
79
78
  if (!!changeTitle) {
80
79
  setModalTitle(changeTitle);
81
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "0.0.6-beta-v2",
3
+ "version": "0.0.6-beta-v3",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,6 +26,12 @@
26
26
  "prettier --write"
27
27
  ]
28
28
  },
29
+ "browserslist": [
30
+ "> 0.5%",
31
+ "last 2 versions",
32
+ "Firefox ESR",
33
+ "not dead"
34
+ ],
29
35
  "dependencies": {
30
36
  "@ant-design/icons": "4.6.2",
31
37
  "@types/react-color": "^3.0.9",
@@ -80,11 +86,5 @@
80
86
  "webpack-dev-server": "^4.15.0",
81
87
  "webpackbar": "^5.0.2"
82
88
  },
83
- "cssPrefix": "hw",
84
- "browserslist": [
85
- "> 0.5%",
86
- "last 2 versions",
87
- "Firefox ESR",
88
- "not dead"
89
- ]
89
+ "cssPrefix": "hw"
90
90
  }
@@ -61,17 +61,20 @@ module.exports = {
61
61
  exclude: "node_modules/**",
62
62
  extensions: [".ts", ".tsx", ".js", ".jsx"],
63
63
  babelHelpers: "runtime",
64
- "presets": [
65
- [ "@babel/preset-env",{
66
- "targets":{
67
- "chrome": "58",
68
- "ie": "11",
69
- "ios":"11"
70
- },
71
- "useBuiltIns":"usage",
72
- "corejs":3,
73
- "modules":false
74
- }]
64
+ presets: [
65
+ [
66
+ "@babel/preset-env",
67
+ {
68
+ targets: {
69
+ chrome: "58",
70
+ ie: "11",
71
+ ios: "11",
72
+ },
73
+ useBuiltIns: "usage",
74
+ corejs: 3,
75
+ modules: false,
76
+ },
77
+ ],
75
78
  ],
76
79
  }),
77
80
  inject({
@@ -46,15 +46,13 @@ export const useModifyProps = ({
46
46
  const {
47
47
  configData: changeConfigData,
48
48
  initialValues: changeInitialValues,
49
- params: changeParams,
49
+ params: changeParams={},
50
50
  title: changeTitle,
51
51
  } = showParams;
52
52
  if (!!changeConfigData) {
53
53
  setModalFormData(changeConfigData);
54
54
  }
55
- if (!!changeParams) {
56
- setFormParams(changeParams);
57
- }
55
+ setFormParams(changeParams);
58
56
  if (!!changeTitle) {
59
57
  setModalTitle(changeTitle);
60
58
  }
@@ -3,11 +3,16 @@ import { Input, Popover } from "antd";
3
3
  import Picker from "./Picker";
4
4
  import { useMemo } from "react";
5
5
  import { useClassName } from "../../hooks";
6
- export default ({ value, onChange,defaultColor="rgba(0,0,0,1)", ...props }: HInputProps) => {
6
+ export default ({
7
+ value,
8
+ onChange,
9
+ defaultColor = "rgba(0,0,0,1)",
10
+ ...props
11
+ }: HInputProps) => {
7
12
  const classname = useClassName("hw-color-box");
8
- const inputVal=value?.trim();
13
+ const inputVal = value?.trim();
9
14
  const pickerValue = useMemo(() => {
10
- const matchVal=inputVal||defaultColor;
15
+ const matchVal = inputVal || defaultColor;
11
16
  if (typeof matchVal === "string") {
12
17
  if (matchVal.startsWith("#")) {
13
18
  return matchVal;
@@ -42,7 +47,10 @@ export default ({ value, onChange,defaultColor="rgba(0,0,0,1)", ...props }: HInp
42
47
  content={<Picker value={pickerValue} onChange={colorChange} />}
43
48
  placement="topLeft"
44
49
  >
45
- <div style={{ backgroundColor: inputVal||defaultColor }} className={classname} />
50
+ <div
51
+ style={{ backgroundColor: inputVal || defaultColor }}
52
+ className={classname}
53
+ />
46
54
  </Popover>
47
55
  }
48
56
  />
@@ -8,7 +8,7 @@ export interface HInputProps<V = any>
8
8
  extends Omit<InputProps, "onChange" | "value"> {
9
9
  onChange?: (value: V) => void;
10
10
  value?: V;
11
- defaultColor?:string;
11
+ defaultColor?: string;
12
12
  }
13
13
 
14
14
  interface ValueNameModal {
@@ -41,5 +41,5 @@ export const baseConfig: IFormConfigContextProps = {
41
41
  };
42
42
 
43
43
  export default {
44
- name:"name"
45
- }
44
+ name: "name",
45
+ };