@hw-component/form 0.0.3-beta-v4 → 0.0.3-beta-v6
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.
- package/es/DialogForm/DrawerForm/Footer.d.ts +1 -2
- package/es/DialogForm/DrawerForm/Title.d.ts +0 -1
- package/es/DialogForm/DrawerForm/index.d.ts +0 -1
- package/es/DialogForm/ModalForm.d.ts +0 -1
- package/es/DialogForm/ModalForm.js +3 -3
- package/es/DialogForm/hooks.d.ts +1 -1
- package/es/DialogForm/hooks.js +3 -3
- package/es/Form/FormItem/BasicItem.d.ts +2 -2
- package/es/Form/FormItem/BasicItem.js +19 -15
- package/es/Form/FormItem/RegularFormItem.d.ts +2 -3
- package/es/Form/FormItem/UpFormItem.d.ts +2 -3
- package/es/Form/FormItem/hooks.d.ts +2 -4
- package/es/Form/FormItem/index.d.ts +2 -3
- package/es/Form/InitSet.d.ts +0 -1
- package/es/Form/config.d.ts +5 -5
- package/es/Form/config.js +10 -10
- package/es/Form/hooks/index.d.ts +1 -0
- package/es/Form/hooks/index.js +20 -3
- package/es/Form/hooks/useDefaultRender.d.ts +3 -0
- package/es/Form/hooks/useDefaultRender.js +49 -0
- package/es/Form/hooks/useInitConfigData.d.ts +2 -2
- package/es/Form/hooks/useInitConfigData.js +26 -45
- package/es/Form/index.d.ts +0 -1
- package/es/Form/modal.d.ts +20 -13
- package/es/Input/ColorInput/Picker.d.ts +3 -0
- package/es/Input/ColorInput/Picker.js +22 -0
- package/es/Input/ColorInput/data.d.ts +1 -0
- package/es/Input/ColorInput/data.js +5 -0
- package/es/Input/ColorInput/index.d.ts +3 -0
- package/es/Input/ColorInput/index.js +76 -0
- package/es/Input/InputNumber.d.ts +0 -1
- package/es/Input/index.d.ts +0 -1
- package/es/Input/modal.d.ts +4 -1
- package/es/PageHandler/ErrorComponent.d.ts +0 -1
- package/es/PageHandler/LoadingComponent.d.ts +0 -1
- package/es/RadioGroup/index.d.ts +0 -1
- package/es/Select/components/NoFindItem.d.ts +0 -1
- package/es/Select/components/NotFoundContent.d.ts +0 -1
- package/es/Select/defaultConfig.d.ts +0 -1
- package/es/Select/hooks/changeHooks.js +4 -0
- package/es/Select/index.d.ts +0 -1
- package/es/Submit/index.d.ts +0 -1
- package/es/TDPicker/TimePicker.d.ts +0 -1
- package/es/TDPicker/index.d.ts +3 -3
- package/es/TDPicker/index.js +6 -5
- package/es/TextArea/index.d.ts +0 -1
- package/es/Upload/Btn.d.ts +0 -1
- package/es/Upload/MediaTypeEle/TypeEle.d.ts +0 -1
- package/es/Upload/MediaTypeEle/index.d.ts +0 -1
- package/es/Upload/Preview/index.d.ts +0 -1
- package/es/Upload/UrlUpload/index.d.ts +0 -1
- package/es/config.js +2 -1
- package/es/index.css +9 -0
- package/es/index.d.ts +3 -2
- package/es/index.js +19 -18
- package/es/modal.d.ts +5 -4
- package/lib/DialogForm/DrawerForm/Footer.d.ts +1 -2
- package/lib/DialogForm/DrawerForm/Title.d.ts +0 -1
- package/lib/DialogForm/DrawerForm/index.d.ts +0 -1
- package/lib/DialogForm/ModalForm.d.ts +0 -1
- package/lib/DialogForm/ModalForm.js +3 -3
- package/lib/DialogForm/hooks.d.ts +1 -1
- package/lib/DialogForm/hooks.js +3 -3
- package/lib/Form/FormItem/BasicItem.d.ts +2 -2
- package/lib/Form/FormItem/BasicItem.js +21 -17
- package/lib/Form/FormItem/RegularFormItem.d.ts +2 -3
- package/lib/Form/FormItem/UpFormItem.d.ts +2 -3
- package/lib/Form/FormItem/hooks.d.ts +2 -4
- package/lib/Form/FormItem/index.d.ts +2 -3
- package/lib/Form/InitSet.d.ts +0 -1
- package/lib/Form/config.d.ts +5 -5
- package/lib/Form/config.js +6 -6
- package/lib/Form/hooks/index.d.ts +1 -0
- package/lib/Form/hooks/index.js +20 -2
- package/lib/Form/hooks/useDefaultRender.d.ts +3 -0
- package/lib/Form/hooks/useDefaultRender.js +50 -0
- package/lib/Form/hooks/useInitConfigData.d.ts +2 -2
- package/lib/Form/hooks/useInitConfigData.js +24 -43
- package/lib/Form/index.d.ts +0 -1
- package/lib/Form/modal.d.ts +20 -13
- package/lib/Input/ColorInput/Picker.d.ts +3 -0
- package/lib/Input/ColorInput/Picker.js +25 -0
- package/lib/Input/ColorInput/data.d.ts +1 -0
- package/lib/Input/ColorInput/data.js +6 -0
- package/lib/Input/ColorInput/index.d.ts +3 -0
- package/lib/Input/ColorInput/index.js +79 -0
- package/lib/Input/InputNumber.d.ts +0 -1
- package/lib/Input/index.d.ts +0 -1
- package/lib/Input/modal.d.ts +4 -1
- package/lib/PageHandler/ErrorComponent.d.ts +0 -1
- package/lib/PageHandler/LoadingComponent.d.ts +0 -1
- package/lib/RadioGroup/index.d.ts +0 -1
- package/lib/Select/components/NoFindItem.d.ts +0 -1
- package/lib/Select/components/NotFoundContent.d.ts +0 -1
- package/lib/Select/defaultConfig.d.ts +0 -1
- package/lib/Select/hooks/changeHooks.js +4 -0
- package/lib/Select/index.d.ts +0 -1
- package/lib/Submit/index.d.ts +0 -1
- package/lib/TDPicker/TimePicker.d.ts +0 -1
- package/lib/TDPicker/index.d.ts +3 -3
- package/lib/TDPicker/index.js +6 -5
- package/lib/TextArea/index.d.ts +0 -1
- package/lib/Upload/Btn.d.ts +0 -1
- package/lib/Upload/MediaTypeEle/TypeEle.d.ts +0 -1
- package/lib/Upload/MediaTypeEle/index.d.ts +0 -1
- package/lib/Upload/Preview/index.d.ts +0 -1
- package/lib/Upload/UrlUpload/index.d.ts +0 -1
- package/lib/config.js +2 -1
- package/lib/index.css +9 -0
- package/lib/index.d.ts +3 -2
- package/lib/index.js +4 -2
- package/lib/modal.d.ts +5 -4
- package/package.json +5 -3
- package/src/components/DialogForm/DrawerForm/Footer.tsx +5 -9
- package/src/components/DialogForm/DrawerForm/index.tsx +5 -5
- package/src/components/DialogForm/ModalForm.tsx +16 -11
- package/src/components/DialogForm/hooks.ts +12 -12
- package/src/components/DialogForm/modal.ts +2 -2
- package/src/components/Form/FormItem/BasicItem.tsx +22 -16
- package/src/components/Form/FormItem/RegularFormItem.tsx +2 -2
- package/src/components/Form/FormItem/UpFormItem.tsx +2 -2
- package/src/components/Form/FormItem/hooks.tsx +2 -6
- package/src/components/Form/FormItem/index.tsx +2 -2
- package/src/components/Form/config.ts +7 -5
- package/src/components/Form/hooks/index.ts +16 -9
- package/src/components/Form/hooks/useDefaultRender.tsx +42 -0
- package/src/components/Form/hooks/useHForm.ts +2 -2
- package/src/components/Form/hooks/useInitConfigData.tsx +44 -35
- package/src/components/Form/modal.ts +28 -17
- package/src/components/Input/ColorInput/Picker.tsx +18 -0
- package/src/components/Input/ColorInput/data.ts +102 -0
- package/src/components/Input/ColorInput/index.less +10 -0
- package/src/components/Input/ColorInput/index.tsx +48 -0
- package/src/components/Input/modal.ts +5 -2
- package/src/components/Select/hooks/changeHooks.tsx +4 -0
- package/src/components/TDPicker/RangePicker.tsx +1 -1
- package/src/components/TDPicker/index.tsx +6 -9
- package/src/components/config.ts +1 -0
- package/src/components/index.tsx +2 -1
- package/src/components/modal.ts +5 -3
- package/src/components/styles/index.less +1 -0
- package/src/pages/Form/index.tsx +16 -1
- package/src/pages/Input/index.tsx +2 -0
- package/src/pages/ModalForm/index.tsx +9 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const presetColors: string[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
var presetColors = ["#fff1f0", "#ffccc7", "#ffa39e", "#ff7875", "#ff4d4f", "#f5222d", "#cf1322", "#a8071a", "#820014", "#5c0011", "#fff7e6", "#ffe7ba", "#ffd591", "#ffc069", "#ffa940", "#fa8c16", "#d46b08", "#ad4e00", "#873800", "#612500", "#feffe6", "#ffffb8", "#fffb8f", "#fff566", "#ffec3d", "#fadb14", "#d4b106", "#ad8b00", "#876800", "#614700", "#f6ffed", "#d9f7be", "#b7eb8f", "#95de64", "#73d13d", "#52c41a", "#389e0d", "#237804", "#135200", "#092b00", "#e6fffb", "#b5f5ec", "#87e8de", "#5cdbd3", "#36cfc9", "#13c2c2", "#08979c", "#006d75", "#00474f", "#002329", "#e6f7ff", "#bae7ff", "#91d5ff", "#69c0ff", "#40a9ff", "#1890ff", "#096dd9", "#0050b3", "#003a8c", "#002766", "#f0f5ff", "#d6e4ff", "#adc6ff", "#85a5ff", "#597ef7", "#2f54eb", "#1d39c4", "#10239e", "#061178", "#030852", "#f9f0ff", "#efdbff", "#d3adf7", "#b37feb", "#9254de", "#722ed1", "#531dab", "#391085", "#22075e", "#120338", "#fff0f6", "#ffd6e7", "#ffadd2", "#ff85c0", "#f759ab", "#eb2f96", "#c41d7f", "#9e1068", "#780650", "#520339", "#ffffff", "#fafafa", "#f5f5f5", "#f0f0f0", "#d9d9d9", "#bfbfbf", "#8c8c8c", "#595959", "#434343", "#262626"];
|
|
3
|
+
|
|
4
|
+
export { presetColors };
|
|
5
|
+
// powered by hdj
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// welcome to hoo hoo hoo
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import _WeakMap from '@babel/runtime-corejs3/core-js/weak-map';
|
|
4
|
+
import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js/instance/reduce';
|
|
5
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js/object/keys';
|
|
6
|
+
import _Object$create from '@babel/runtime-corejs3/core-js/object/create';
|
|
7
|
+
import _Symbol$replace from '@babel/runtime-corejs3/core-js/symbol/replace';
|
|
8
|
+
import _Array$isArray from '@babel/runtime-corejs3/core-js/array/is-array';
|
|
9
|
+
import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js/instance/slice';
|
|
10
|
+
import _typeof from '@babel/runtime-corejs3/helpers/typeof';
|
|
11
|
+
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
12
|
+
import _inherits from '@babel/runtime-corejs3/helpers/inherits';
|
|
13
|
+
import _setPrototypeOf from '@babel/runtime-corejs3/helpers/setPrototypeOf';
|
|
14
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
15
|
+
import _startsWithInstanceProperty from '@babel/runtime-corejs3/core-js/instance/starts-with';
|
|
16
|
+
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js/instance/concat';
|
|
17
|
+
import { Input, Popover } from 'antd';
|
|
18
|
+
import Picker from './Picker.js';
|
|
19
|
+
import { useClassName } from '../../hooks/index.js';
|
|
20
|
+
|
|
21
|
+
var _excluded = ["value", "onChange"];
|
|
22
|
+
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, void 0, groups); }; var _super = RegExp.prototype, _groups = new _WeakMap(); function BabelRegExp(re, flags, groups) { var _this = new RegExp(re, flags); return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype); } function buildGroups(result, re) { var _context4; var g = _groups.get(re); return _reduceInstanceProperty(_context4 = _Object$keys(g)).call(_context4, function (groups, name) { var i = g[name]; if ("number" == typeof i) groups[name] = result[i];else { for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) k++; groups[name] = result[i[k]]; } return groups; }, _Object$create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) { result.groups = buildGroups(result, this); var indices = result.indices; indices && (indices.groups = buildGroups(indices, this)); } return result; }, BabelRegExp.prototype[_Symbol$replace] = function (str, substitution) { if ("string" == typeof substitution) { var groups = _groups.get(this); return _super[_Symbol$replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { var group = groups[name]; return "$" + (_Array$isArray(group) ? group.join("$") : group); })); } if ("function" == typeof substitution) { var _this = this; return _super[_Symbol$replace].call(this, str, function () { var args = arguments; return "object" != _typeof(args[args.length - 1]) && (args = _sliceInstanceProperty([]).call(args)).push(buildGroups(args, _this)), substitution.apply(this, args); }); } return _super[_Symbol$replace].call(this, str, substitution); }, _wrapRegExp.apply(this, arguments); }
|
|
23
|
+
var ColorInput = (function (_ref) {
|
|
24
|
+
var value = _ref.value,
|
|
25
|
+
onChange = _ref.onChange,
|
|
26
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
27
|
+
var classname = useClassName("hw-color-box");
|
|
28
|
+
var pickerValue = useMemo(function () {
|
|
29
|
+
if (typeof value === "string") {
|
|
30
|
+
var _result$groups;
|
|
31
|
+
if (_startsWithInstanceProperty(value).call(value, "#")) {
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
var rgbaRegular = /*#__PURE__*/_wrapRegExp(/(?<=(rgba\())(.*?)(?=(\)))/, {
|
|
35
|
+
rgba: 2
|
|
36
|
+
});
|
|
37
|
+
var result = value.match(rgbaRegular);
|
|
38
|
+
if (result !== null && result !== void 0 && (_result$groups = result.groups) !== null && _result$groups !== void 0 && _result$groups.rgba) {
|
|
39
|
+
var rgbas = result.groups.rgba.split(",");
|
|
40
|
+
return {
|
|
41
|
+
r: Number(rgbas[0]),
|
|
42
|
+
g: Number(rgbas[1]),
|
|
43
|
+
b: Number(rgbas[2]),
|
|
44
|
+
a: Number(rgbas[3])
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return "";
|
|
49
|
+
}, [value]);
|
|
50
|
+
var colorChange = function colorChange(val) {
|
|
51
|
+
var _context, _context2, _context3;
|
|
52
|
+
var rgb = val.rgb;
|
|
53
|
+
var text = _concatInstanceProperty(_context = _concatInstanceProperty(_context2 = _concatInstanceProperty(_context3 = "rgba(".concat(rgb.r, ",")).call(_context3, rgb.g, ",")).call(_context2, rgb.b, ",")).call(_context, rgb.a, ")");
|
|
54
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(text);
|
|
55
|
+
};
|
|
56
|
+
return /*#__PURE__*/React.createElement(Input, _extends({}, props, {
|
|
57
|
+
value: value,
|
|
58
|
+
onChange: onChange,
|
|
59
|
+
suffix: /*#__PURE__*/React.createElement(Popover, {
|
|
60
|
+
trigger: "click",
|
|
61
|
+
content: /*#__PURE__*/React.createElement(Picker, {
|
|
62
|
+
value: pickerValue,
|
|
63
|
+
onChange: colorChange
|
|
64
|
+
}),
|
|
65
|
+
placement: "topLeft"
|
|
66
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
style: {
|
|
68
|
+
backgroundColor: value
|
|
69
|
+
},
|
|
70
|
+
className: classname
|
|
71
|
+
}))
|
|
72
|
+
}));
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export { ColorInput as default };
|
|
76
|
+
// powered by hdj
|
package/es/Input/index.d.ts
CHANGED
package/es/Input/modal.d.ts
CHANGED
|
@@ -4,7 +4,10 @@ import type { SelectInputType } from "./SelectInput";
|
|
|
4
4
|
import type { PromiseFnResult } from "../modal";
|
|
5
5
|
import type { addFormatItemModal } from "../Form/modal";
|
|
6
6
|
import type { AddDispatchListenerFn } from "../Form/modal";
|
|
7
|
-
export
|
|
7
|
+
export interface HInputProps<V = any> extends Omit<InputProps, "onChange" | "value"> {
|
|
8
|
+
onChange?: (value: V) => void;
|
|
9
|
+
value?: V;
|
|
10
|
+
}
|
|
8
11
|
interface ValueNameModal {
|
|
9
12
|
input?: string;
|
|
10
13
|
select?: string;
|
package/es/RadioGroup/index.d.ts
CHANGED
|
@@ -178,6 +178,10 @@ var useValueChange = function useValueChange(params) {
|
|
|
178
178
|
onChange(newChangeVal, subItemOps);
|
|
179
179
|
};
|
|
180
180
|
useEffect(function () {
|
|
181
|
+
if (mode === "tags") {
|
|
182
|
+
setVal(value);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
181
185
|
if (options && value) {
|
|
182
186
|
setVal(function (oldVale) {
|
|
183
187
|
return matchNotFind(params, oldVale);
|
package/es/Select/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { HSelectProps } from "./modal";
|
|
3
2
|
declare const _default: ({ style, mode, options, modeConfig, value, onChange, fieldNames: propsFieldNames, request, manual, optionLabelProp, filterProvider, optionFilterProp, serviceSearch, onSearch: propsOnSearch, filterOption, showSearch, labelInValue, noMatchItemRender, allSelect, ...props }: HSelectProps) => JSX.Element;
|
|
4
3
|
export default _default;
|
package/es/Submit/index.d.ts
CHANGED
package/es/TDPicker/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { HDatePickerProps } from "./modal";
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare const Index: React.FC<HDatePickerProps>;
|
|
4
|
+
export default Index;
|
package/es/TDPicker/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
4
3
|
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
5
4
|
import { DatePicker } from 'antd';
|
|
6
5
|
import { useTimeVal, useTimeChange } from './hooks.js';
|
|
6
|
+
import React from 'react';
|
|
7
7
|
|
|
8
8
|
var _excluded = ["value", "onChange", "showTime", "format"];
|
|
9
|
-
var
|
|
9
|
+
var Picker = DatePicker;
|
|
10
|
+
var Index = function Index(_ref) {
|
|
10
11
|
var value = _ref.value,
|
|
11
12
|
onChange = _ref.onChange,
|
|
12
13
|
_ref$showTime = _ref.showTime,
|
|
@@ -22,12 +23,12 @@ var HDatePicker = (function (_ref) {
|
|
|
22
23
|
format: format,
|
|
23
24
|
onChange: onChange
|
|
24
25
|
});
|
|
25
|
-
return /*#__PURE__*/React.createElement(
|
|
26
|
+
return /*#__PURE__*/React.createElement(Picker, _extends({
|
|
26
27
|
value: timeVal,
|
|
27
28
|
onChange: change,
|
|
28
29
|
showTime: showTime
|
|
29
30
|
}, props));
|
|
30
|
-
}
|
|
31
|
+
};
|
|
31
32
|
|
|
32
|
-
export {
|
|
33
|
+
export { Index as default };
|
|
33
34
|
// powered by hdj
|
package/es/TextArea/index.d.ts
CHANGED
package/es/Upload/Btn.d.ts
CHANGED
package/es/config.js
CHANGED
package/es/index.css
CHANGED
package/es/index.d.ts
CHANGED
|
@@ -4,8 +4,9 @@ export { default as HForm } from "./Form";
|
|
|
4
4
|
export { default as useHForm } from "./Form/hooks/useHForm";
|
|
5
5
|
export { useHDialogForm } from "./DialogForm/hooks";
|
|
6
6
|
export { default as HFormConnect } from "./Form/HFormConnect";
|
|
7
|
+
export { default as HFormConfigProvider } from "./Form/Context/FormConfigProvider";
|
|
7
8
|
export declare const HSelect: ({ style, mode, options, modeConfig, value, onChange, fieldNames: propsFieldNames, request, manual, optionLabelProp, filterProvider, optionFilterProp, serviceSearch, onSearch: propsOnSearch, filterOption, showSearch, labelInValue, noMatchItemRender, allSelect, ...props }: import("./Select/modal").HSelectProps) => JSX.Element;
|
|
8
|
-
export declare const HInput: ({ ...props }: import("
|
|
9
|
+
export declare const HInput: ({ ...props }: import("./Input/modal").HInputProps<any>) => JSX.Element;
|
|
9
10
|
export declare const HSelectInput: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
10
11
|
export declare const HUpload: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
11
12
|
export declare const HUrlUpload: ({ placeholder, value, onChange, mediaType, ...props }: import("./Upload/modal").IUrlUploadProps) => JSX.Element;
|
|
@@ -19,7 +20,7 @@ export declare const HRadioGroup: ({ value, options, onChange, fieldNames: props
|
|
|
19
20
|
export declare const HTimePicker: ({ value, format, onChange, ...props }: import("./TDPicker/modal").HTimePickerProps) => JSX.Element;
|
|
20
21
|
export declare const HInputNumber: ({ style, ...props }: import("antd").InputNumberProps<string | number>) => JSX.Element;
|
|
21
22
|
export declare const HPageHandler: import("react").FC<import("./PageHandler/modal").IHPageHandler<any>>;
|
|
22
|
-
export declare const HFormConfigProvider: import("react").FC<import("./Form/modal").IFormConfigContextProps>;
|
|
23
23
|
export declare const HTextArea: ({ autoSize, ...props }: import("antd/es/input").TextAreaProps) => JSX.Element;
|
|
24
|
+
export declare const HColorInput: ({ value, onChange, ...props }: import("./Input/modal").HInputProps<any>) => JSX.Element;
|
|
24
25
|
export declare const HModalForm: ({ visible, title, onCancel, configData, infoRequest, request, afterClose, dialogForm, initialValues, onFinish, params, onOk, ...props }: import("./DialogForm/modal").DialogFormProps<any, any>) => JSX.Element;
|
|
25
26
|
export declare const HDrawerForm: ({ visible, title, onCancel, configData, infoRequest, request, afterClose, dialogForm, closable, initialValues, labelWidth, onOk, onFinish, size, form, footer, params, ...props }: import("./DialogForm/modal").DialogFormProps<any, any>) => JSX.Element;
|
package/es/index.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
2
|
+
import componentConfig from './Form/config.js';
|
|
3
3
|
import Index from './PageHandler/index.js';
|
|
4
4
|
export { default as HForm } from './Form/index.js';
|
|
5
5
|
export { default as useHForm } from './Form/hooks/useHForm.js';
|
|
6
6
|
export { useHDialogForm } from './DialogForm/hooks.js';
|
|
7
7
|
export { default as HFormConnect } from './Form/HFormConnect.js';
|
|
8
|
+
export { default as HFormConfigProvider } from './Form/Context/FormConfigProvider.js';
|
|
8
9
|
import ModalForm from './DialogForm/ModalForm.js';
|
|
9
10
|
import DrawerForm from './DialogForm/DrawerForm/index.js';
|
|
10
11
|
|
|
11
|
-
var HSelect =
|
|
12
|
-
var HInput =
|
|
13
|
-
var HSelectInput =
|
|
14
|
-
var HUpload =
|
|
15
|
-
var HUrlUpload =
|
|
16
|
-
var HButtonInput =
|
|
17
|
-
var HCheckBox =
|
|
18
|
-
var HSwitch =
|
|
19
|
-
var HCheckboxGroup =
|
|
20
|
-
var HDatePicker =
|
|
21
|
-
var HRangePicker =
|
|
22
|
-
var HRadioGroup =
|
|
23
|
-
var HTimePicker =
|
|
24
|
-
var HInputNumber =
|
|
12
|
+
var HSelect = componentConfig.select;
|
|
13
|
+
var HInput = componentConfig.input;
|
|
14
|
+
var HSelectInput = componentConfig.selectInput;
|
|
15
|
+
var HUpload = componentConfig.upload;
|
|
16
|
+
var HUrlUpload = componentConfig.urlUpload;
|
|
17
|
+
var HButtonInput = componentConfig.buttonInput;
|
|
18
|
+
var HCheckBox = componentConfig.checkBox;
|
|
19
|
+
var HSwitch = componentConfig["switch"];
|
|
20
|
+
var HCheckboxGroup = componentConfig.checkboxGroup;
|
|
21
|
+
var HDatePicker = componentConfig.datePicker;
|
|
22
|
+
var HRangePicker = componentConfig.rangePicker.Component;
|
|
23
|
+
var HRadioGroup = componentConfig.radioGroup;
|
|
24
|
+
var HTimePicker = componentConfig.timePicker;
|
|
25
|
+
var HInputNumber = componentConfig.inputNumber;
|
|
25
26
|
var HPageHandler = Index;
|
|
26
|
-
var
|
|
27
|
-
var
|
|
27
|
+
var HTextArea = componentConfig.textArea;
|
|
28
|
+
var HColorInput = componentConfig.colorInput;
|
|
28
29
|
var HModalForm = ModalForm;
|
|
29
30
|
var HDrawerForm = DrawerForm;
|
|
30
31
|
|
|
31
|
-
export { HButtonInput, HCheckBox, HCheckboxGroup, HDatePicker, HDrawerForm,
|
|
32
|
+
export { HButtonInput, HCheckBox, HCheckboxGroup, HColorInput, HDatePicker, HDrawerForm, HInput, HInputNumber, HModalForm, HPageHandler, HRadioGroup, HRangePicker, HSelect, HSelectInput, HSwitch, HTextArea, HTimePicker, HUpload, HUrlUpload };
|
|
32
33
|
// powered by hdj
|
package/es/modal.d.ts
CHANGED
|
@@ -7,9 +7,10 @@ export interface ValueSwitchMapModal {
|
|
|
7
7
|
open?: any;
|
|
8
8
|
close?: any;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
export interface DataFnProvider<P = any, R = any> {
|
|
11
|
+
(name: P): R;
|
|
12
|
+
}
|
|
11
13
|
export interface DateRangePickerValueMapModal {
|
|
12
|
-
start?: string |
|
|
13
|
-
end?: string |
|
|
14
|
+
start?: string | DataFnProvider<string, string>;
|
|
15
|
+
end?: string | DataFnProvider<string, string>;
|
|
14
16
|
}
|
|
15
|
-
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
interface IProps {
|
|
3
2
|
onOk?: VoidFunction;
|
|
4
3
|
onCancel?: VoidFunction;
|
|
5
4
|
confirmLoading?: boolean;
|
|
6
5
|
}
|
|
7
|
-
declare const _default: ({ onCancel, onOk, confirmLoading
|
|
6
|
+
declare const _default: ({ onCancel, onOk, confirmLoading }: IProps) => JSX.Element;
|
|
8
7
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { DialogFormProps } from "../modal";
|
|
3
2
|
declare const _default: ({ visible, title, onCancel, configData, infoRequest, request, afterClose, dialogForm, closable, initialValues, labelWidth, onOk, onFinish, size, form, footer, params, ...props }: DialogFormProps) => JSX.Element;
|
|
4
3
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { DialogFormProps } from "./modal";
|
|
3
2
|
declare const _default: ({ visible, title, onCancel, configData, infoRequest, request, afterClose, dialogForm, initialValues, onFinish, params, onOk, ...props }: DialogFormProps) => JSX.Element;
|
|
4
3
|
export default _default;
|
|
@@ -68,16 +68,16 @@ var ModalForm = (function (_ref) {
|
|
|
68
68
|
configData: modalFormData,
|
|
69
69
|
initialValues: initValue,
|
|
70
70
|
onFinish: /*#__PURE__*/function () {
|
|
71
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(values,
|
|
71
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(values, outParams) {
|
|
72
72
|
var result, close;
|
|
73
73
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
74
74
|
while (1) switch (_context.prev = _context.next) {
|
|
75
75
|
case 0:
|
|
76
76
|
_context.next = 2;
|
|
77
|
-
return run(values,
|
|
77
|
+
return run(values, outParams);
|
|
78
78
|
case 2:
|
|
79
79
|
result = _context.sent;
|
|
80
|
-
close = onOk === null || onOk === void 0 ? void 0 : onOk(result,
|
|
80
|
+
close = onOk === null || onOk === void 0 ? void 0 : onOk(result, outParams);
|
|
81
81
|
if (!(close === false)) {
|
|
82
82
|
_context.next = 6;
|
|
83
83
|
break;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { DialogFormProps, HDialogFormInstance, ModifyPropsModal } from "./modal";
|
|
3
|
-
export declare const useModifyProps: ({ visible, configData, initialValues, dialogForm, afterClose, params }: ModifyPropsModal) => {
|
|
3
|
+
export declare const useModifyProps: ({ visible, configData, initialValues, dialogForm, afterClose, params, }: ModifyPropsModal) => {
|
|
4
4
|
modalFormData: import("../Form/modal").HItemProps[];
|
|
5
5
|
modalVisible: boolean | undefined;
|
|
6
6
|
setModalVisible: import("react").Dispatch<import("react").SetStateAction<boolean | undefined>>;
|
package/lib/DialogForm/hooks.js
CHANGED
|
@@ -62,12 +62,12 @@ var useModifyProps = function useModifyProps(_ref) {
|
|
|
62
62
|
var showParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
63
63
|
var changeConfigData = showParams.configData,
|
|
64
64
|
changeInitialValues = showParams.initialValues,
|
|
65
|
-
|
|
65
|
+
changeParams = showParams.params;
|
|
66
66
|
if (!!changeConfigData) {
|
|
67
67
|
setModalFormData(changeConfigData);
|
|
68
68
|
}
|
|
69
|
-
if (!!
|
|
70
|
-
setFormParams(
|
|
69
|
+
if (!!changeParams) {
|
|
70
|
+
setFormParams(changeParams);
|
|
71
71
|
}
|
|
72
72
|
setInitValue(changeInitialValues);
|
|
73
73
|
setModalVisible(true);
|
|
@@ -8,9 +8,11 @@ var Label = require('../Label.js');
|
|
|
8
8
|
var antd = require('antd');
|
|
9
9
|
var React = require('react');
|
|
10
10
|
var Helper = require('./Helper.js');
|
|
11
|
-
var index$
|
|
11
|
+
var index$2 = require('../../hooks/index.js');
|
|
12
12
|
var hooks = require('./hooks.js');
|
|
13
13
|
var index = require('../Context/index.js');
|
|
14
|
+
var useDefaultRender = require('../hooks/useDefaultRender.js');
|
|
15
|
+
var index$1 = require('../hooks/index.js');
|
|
14
16
|
|
|
15
17
|
var _excluded = ["hover", "labelWidth", "required", "colon", "label", "itemProps", "children", "helper", "hide", "render"];
|
|
16
18
|
var Content = function Content(_ref) {
|
|
@@ -18,7 +20,7 @@ var Content = function Content(_ref) {
|
|
|
18
20
|
helper = _ref.helper,
|
|
19
21
|
value = _ref.value,
|
|
20
22
|
onChange = _ref.onChange;
|
|
21
|
-
var className = index$
|
|
23
|
+
var className = index$2.useClassName("hw-form-base-item");
|
|
22
24
|
var relChild = children && /*#__PURE__*/React.cloneElement(children, {
|
|
23
25
|
value: value,
|
|
24
26
|
onChange: onChange
|
|
@@ -35,21 +37,23 @@ var Content = function Content(_ref) {
|
|
|
35
37
|
helper: helper
|
|
36
38
|
}));
|
|
37
39
|
};
|
|
38
|
-
var Index = function Index(
|
|
39
|
-
var hover =
|
|
40
|
-
labelWidth =
|
|
41
|
-
required =
|
|
42
|
-
|
|
43
|
-
colon =
|
|
44
|
-
label =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var helper =
|
|
48
|
-
hide =
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
var Index = function Index(props) {
|
|
41
|
+
var hover = props.hover,
|
|
42
|
+
labelWidth = props.labelWidth,
|
|
43
|
+
required = props.required,
|
|
44
|
+
_props$colon = props.colon,
|
|
45
|
+
colon = _props$colon === void 0 ? true : _props$colon,
|
|
46
|
+
label = props.label;
|
|
47
|
+
props.itemProps;
|
|
48
|
+
props.children;
|
|
49
|
+
var helper = props.helper,
|
|
50
|
+
hide = props.hide;
|
|
51
|
+
props.render;
|
|
52
|
+
var oProps = _objectWithoutProperties(props, _excluded);
|
|
51
53
|
var _useFormContext = index.useFormContext(),
|
|
52
54
|
form = _useFormContext.form;
|
|
55
|
+
var defaultComponent = index$1.useDefaultComponents();
|
|
56
|
+
var defaultRender = useDefaultRender.useDefaultRender(props, defaultComponent);
|
|
53
57
|
var hideItem = hooks.useHide({
|
|
54
58
|
hide: hide,
|
|
55
59
|
form: form
|
|
@@ -64,12 +68,12 @@ var Index = function Index(_ref2) {
|
|
|
64
68
|
required: required,
|
|
65
69
|
colon: colon
|
|
66
70
|
}, label)
|
|
67
|
-
},
|
|
71
|
+
}, oProps, {
|
|
68
72
|
colon: false,
|
|
69
73
|
required: false
|
|
70
74
|
}), /*#__PURE__*/React.createElement(Content, {
|
|
71
75
|
helper: helper
|
|
72
|
-
},
|
|
76
|
+
}, defaultRender(form)));
|
|
73
77
|
};
|
|
74
78
|
|
|
75
79
|
exports.default = Index;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const _default: (props: FormItemWithRender) => JSX.Element;
|
|
1
|
+
import type { HItemProps } from "../modal";
|
|
2
|
+
declare const _default: (props: HItemProps) => JSX.Element;
|
|
4
3
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const _default: ({ shouldUpdate, dependencies, hide, ...props }: FormItemWithRender) => JSX.Element;
|
|
1
|
+
import type { HFormItemProps } from "../modal";
|
|
2
|
+
declare const _default: ({ shouldUpdate, dependencies, hide, ...props }: HFormItemProps) => JSX.Element;
|
|
4
3
|
export default _default;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { HItemProps } from "@/components/Form/modal";
|
|
4
|
-
export declare const useFormItemDomControl: ({ shouldUpdate, hide, dependencies, }: FormItemWithRender) => ({ shouldUpdate, dependencies, hide, ...props }: FormItemWithRender) => JSX.Element;
|
|
1
|
+
import type { HFormInstance, HItemProps } from "../modal";
|
|
2
|
+
export declare const useFormItemDomControl: ({ shouldUpdate, hide, dependencies, }: HItemProps) => ({ shouldUpdate, dependencies, hide, ...props }: import("../modal").HFormItemProps) => JSX.Element;
|
|
5
3
|
interface UseHideUpItemModal extends Omit<HItemProps, "name"> {
|
|
6
4
|
form: HFormInstance;
|
|
7
5
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const _default: (props: FormItemWithRender) => JSX.Element;
|
|
1
|
+
import type { HItemProps } from "../modal";
|
|
2
|
+
declare const _default: (props: HItemProps) => JSX.Element;
|
|
4
3
|
export default _default;
|
package/lib/Form/InitSet.d.ts
CHANGED
package/lib/Form/config.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const placeholderConfig: {
|
|
|
3
3
|
inputType: string[];
|
|
4
4
|
selectType: string[];
|
|
5
5
|
};
|
|
6
|
-
declare const
|
|
6
|
+
declare const componentConfig: {
|
|
7
7
|
select: ({ style, mode, options, modeConfig, value, onChange, fieldNames: propsFieldNames, request, manual, optionLabelProp, filterProvider, optionFilterProp, serviceSearch, onSearch: propsOnSearch, filterOption, showSearch, labelInValue, noMatchItemRender, allSelect, ...props }: import("../Select/modal").HSelectProps) => JSX.Element;
|
|
8
8
|
inputNumber: ({ style, ...props }: import("antd").InputNumberProps<string | number>) => JSX.Element;
|
|
9
9
|
selectInput: import("react").ForwardRefExoticComponent<import("./modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
@@ -12,18 +12,18 @@ declare const _default: {
|
|
|
12
12
|
checkBox: import("react").FC<import("../CheckboxGroup/modal").HCheckboxProps>;
|
|
13
13
|
radioGroup: ({ value, options, onChange, fieldNames: propsFieldNames, ...props }: import("../RadioGroup").HRadioGroupProps) => JSX.Element;
|
|
14
14
|
switch: import("react").FC<import("../Switch").HSwitchProps>;
|
|
15
|
-
datePicker: (
|
|
15
|
+
datePicker: import("react").FC<import("../TDPicker/modal").HDatePickerProps>;
|
|
16
16
|
rangePicker: {
|
|
17
17
|
Component: import("react").ForwardRefExoticComponent<import("./modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
18
18
|
placeholder: ({ label }: import("./modal").HItemProps) => string[];
|
|
19
19
|
requiredErrMsg: ({ label }: import("./modal").HItemProps) => string;
|
|
20
20
|
};
|
|
21
21
|
timePicker: ({ value, format, onChange, ...props }: import("../TDPicker/modal").HTimePickerProps) => JSX.Element;
|
|
22
|
-
input: ({ ...props }: import("
|
|
22
|
+
input: ({ ...props }: import("../Input/modal").HInputProps<any>) => JSX.Element;
|
|
23
23
|
upload: import("react").ForwardRefExoticComponent<import("./modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
24
24
|
urlUpload: ({ placeholder, value, onChange, mediaType, ...props }: import("../Upload/modal").IUrlUploadProps) => JSX.Element;
|
|
25
25
|
submit: ({ text, type, form, loading, ...props }: import("../Submit").ISubmitProps) => JSX.Element;
|
|
26
|
-
formConfigProvider: import("react").FC<import("./modal").IFormConfigContextProps>;
|
|
27
26
|
textArea: ({ autoSize, ...props }: import("antd/es/input").TextAreaProps) => JSX.Element;
|
|
27
|
+
colorInput: ({ value, onChange, ...props }: import("../Input/modal").HInputProps<any>) => JSX.Element;
|
|
28
28
|
};
|
|
29
|
-
export default
|
|
29
|
+
export default componentConfig;
|