@hw-component/form 1.5.6 → 1.5.8
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/Form/hooks/useHForm.js +8 -5
- package/es/Select/hooks/norHooks.d.ts +1 -1
- package/es/Select/hooks/norHooks.js +3 -2
- package/lib/Form/hooks/useHForm.js +8 -5
- package/lib/Select/hooks/norHooks.d.ts +1 -1
- package/lib/Select/hooks/norHooks.js +3 -2
- package/package.json +1 -1
- package/src/components/Form/hooks/useHForm.ts +4 -3
- package/src/components/Select/hooks/norHooks.ts +2 -1
|
@@ -11,6 +11,7 @@ import 'core-js/modules/es.promise.js';
|
|
|
11
11
|
import 'core-js/modules/es.object.keys.js';
|
|
12
12
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
|
13
13
|
import 'core-js/modules/es.reflect.delete-property.js';
|
|
14
|
+
import 'core-js/modules/es.array.slice.js';
|
|
14
15
|
import 'core-js/modules/es.function.name.js';
|
|
15
16
|
import 'core-js/modules/es.array.concat.js';
|
|
16
17
|
import 'core-js/modules/es.array.map.js';
|
|
@@ -100,10 +101,12 @@ var useHForm = (function () {
|
|
|
100
101
|
});
|
|
101
102
|
return newValue;
|
|
102
103
|
},
|
|
103
|
-
dispatch: function dispatch(
|
|
104
|
-
for (var _len = arguments.length, args = new Array(_len
|
|
105
|
-
args[_key
|
|
104
|
+
dispatch: function dispatch() {
|
|
105
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
106
|
+
args[_key] = arguments[_key];
|
|
106
107
|
}
|
|
108
|
+
var action = args[0],
|
|
109
|
+
dispatchArgs = args.slice(1);
|
|
107
110
|
var key = action.key,
|
|
108
111
|
name = action.name;
|
|
109
112
|
var items = dispatchSourceData[key];
|
|
@@ -114,13 +117,13 @@ var useHForm = (function () {
|
|
|
114
117
|
defaultFn = items.defaultFn;
|
|
115
118
|
if (name) {
|
|
116
119
|
var _keysFn$name;
|
|
117
|
-
return (_keysFn$name = keysFn[name]) === null || _keysFn$name === void 0 ? void 0 : _keysFn$name.call.apply(_keysFn$name, [keysFn].concat(
|
|
120
|
+
return (_keysFn$name = keysFn[name]) === null || _keysFn$name === void 0 ? void 0 : _keysFn$name.call.apply(_keysFn$name, [keysFn].concat(_toConsumableArray(dispatchArgs)));
|
|
118
121
|
}
|
|
119
122
|
var fnArrays = Object.keys(keysFn).map(function (itemKey) {
|
|
120
123
|
return keysFn[itemKey];
|
|
121
124
|
});
|
|
122
125
|
[].concat(_toConsumableArray(fnArrays), _toConsumableArray(defaultFn)).forEach(function (fn) {
|
|
123
|
-
fn.apply(void 0,
|
|
126
|
+
fn.apply(void 0, _toConsumableArray(dispatchArgs));
|
|
124
127
|
});
|
|
125
128
|
},
|
|
126
129
|
addDispatchListener: function addDispatchListener(action, fn) {
|
|
@@ -10,7 +10,7 @@ export declare const useOptionReq: ({ manual, request, options, serviceSearch, s
|
|
|
10
10
|
data: OptionType[] | undefined;
|
|
11
11
|
onSearch: ((value: string) => void) | undefined;
|
|
12
12
|
mathShowSearch: boolean | undefined;
|
|
13
|
-
reload: (
|
|
13
|
+
reload: (reloadParams?: ParamsModal) => void | Promise<OptionType[] | undefined>;
|
|
14
14
|
};
|
|
15
15
|
export declare const useFilterOption: ({ filterOption, serviceSearch, }: PartialHSelectProps) => boolean | import("rc-select/lib/Select").FilterFunc<import("rc-select/lib/Select").DefaultOptionType> | undefined;
|
|
16
16
|
export {};
|
|
@@ -66,8 +66,9 @@ var useOptionReq = function useOptionReq(_ref) {
|
|
|
66
66
|
run = _useRequest.run,
|
|
67
67
|
loading = _useRequest.loading,
|
|
68
68
|
error = _useRequest.error;
|
|
69
|
-
var reload = function reload(
|
|
70
|
-
var
|
|
69
|
+
var reload = function reload(reloadParams) {
|
|
70
|
+
var _ref3 = reloadParams || {},
|
|
71
|
+
changeOpts = _ref3.options,
|
|
71
72
|
params = _ref3.params;
|
|
72
73
|
if (changeOpts) {
|
|
73
74
|
return setData(changeOpts);
|
|
@@ -14,6 +14,7 @@ require('core-js/modules/es.promise.js');
|
|
|
14
14
|
require('core-js/modules/es.object.keys.js');
|
|
15
15
|
require('core-js/modules/web.dom-collections.for-each.js');
|
|
16
16
|
require('core-js/modules/es.reflect.delete-property.js');
|
|
17
|
+
require('core-js/modules/es.array.slice.js');
|
|
17
18
|
require('core-js/modules/es.function.name.js');
|
|
18
19
|
require('core-js/modules/es.array.concat.js');
|
|
19
20
|
require('core-js/modules/es.array.map.js');
|
|
@@ -103,10 +104,12 @@ var useHForm = (function () {
|
|
|
103
104
|
});
|
|
104
105
|
return newValue;
|
|
105
106
|
},
|
|
106
|
-
dispatch: function dispatch(
|
|
107
|
-
for (var _len = arguments.length, args = new Array(_len
|
|
108
|
-
args[_key
|
|
107
|
+
dispatch: function dispatch() {
|
|
108
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
109
|
+
args[_key] = arguments[_key];
|
|
109
110
|
}
|
|
111
|
+
var action = args[0],
|
|
112
|
+
dispatchArgs = args.slice(1);
|
|
110
113
|
var key = action.key,
|
|
111
114
|
name = action.name;
|
|
112
115
|
var items = dispatchSourceData[key];
|
|
@@ -117,13 +120,13 @@ var useHForm = (function () {
|
|
|
117
120
|
defaultFn = items.defaultFn;
|
|
118
121
|
if (name) {
|
|
119
122
|
var _keysFn$name;
|
|
120
|
-
return (_keysFn$name = keysFn[name]) === null || _keysFn$name === void 0 ? void 0 : _keysFn$name.call.apply(_keysFn$name, [keysFn].concat(
|
|
123
|
+
return (_keysFn$name = keysFn[name]) === null || _keysFn$name === void 0 ? void 0 : _keysFn$name.call.apply(_keysFn$name, [keysFn].concat(_toConsumableArray(dispatchArgs)));
|
|
121
124
|
}
|
|
122
125
|
var fnArrays = Object.keys(keysFn).map(function (itemKey) {
|
|
123
126
|
return keysFn[itemKey];
|
|
124
127
|
});
|
|
125
128
|
[].concat(_toConsumableArray(fnArrays), _toConsumableArray(defaultFn)).forEach(function (fn) {
|
|
126
|
-
fn.apply(void 0,
|
|
129
|
+
fn.apply(void 0, _toConsumableArray(dispatchArgs));
|
|
127
130
|
});
|
|
128
131
|
},
|
|
129
132
|
addDispatchListener: function addDispatchListener(action, fn) {
|
|
@@ -10,7 +10,7 @@ export declare const useOptionReq: ({ manual, request, options, serviceSearch, s
|
|
|
10
10
|
data: OptionType[] | undefined;
|
|
11
11
|
onSearch: ((value: string) => void) | undefined;
|
|
12
12
|
mathShowSearch: boolean | undefined;
|
|
13
|
-
reload: (
|
|
13
|
+
reload: (reloadParams?: ParamsModal) => void | Promise<OptionType[] | undefined>;
|
|
14
14
|
};
|
|
15
15
|
export declare const useFilterOption: ({ filterOption, serviceSearch, }: PartialHSelectProps) => boolean | import("rc-select/lib/Select").FilterFunc<import("rc-select/lib/Select").DefaultOptionType> | undefined;
|
|
16
16
|
export {};
|
|
@@ -67,8 +67,9 @@ var useOptionReq = function useOptionReq(_ref) {
|
|
|
67
67
|
run = _useRequest.run,
|
|
68
68
|
loading = _useRequest.loading,
|
|
69
69
|
error = _useRequest.error;
|
|
70
|
-
var reload = function reload(
|
|
71
|
-
var
|
|
70
|
+
var reload = function reload(reloadParams) {
|
|
71
|
+
var _ref3 = reloadParams || {},
|
|
72
|
+
changeOpts = _ref3.options,
|
|
72
73
|
params = _ref3.params;
|
|
73
74
|
if (changeOpts) {
|
|
74
75
|
return setData(changeOpts);
|
package/package.json
CHANGED
|
@@ -85,7 +85,8 @@ export default () => {
|
|
|
85
85
|
});
|
|
86
86
|
return newValue;
|
|
87
87
|
}, //转化方法
|
|
88
|
-
dispatch(
|
|
88
|
+
dispatch(...args) {
|
|
89
|
+
const [action,...dispatchArgs]=args;
|
|
89
90
|
const { key, name } = action;
|
|
90
91
|
const items = dispatchSourceData[key];
|
|
91
92
|
if (!items) {
|
|
@@ -93,13 +94,13 @@ export default () => {
|
|
|
93
94
|
}
|
|
94
95
|
const { keysFn, defaultFn } = items;
|
|
95
96
|
if (name) {
|
|
96
|
-
return keysFn[name]?.(...
|
|
97
|
+
return keysFn[name]?.(...dispatchArgs);
|
|
97
98
|
}
|
|
98
99
|
const fnArrays = Object.keys(keysFn).map((itemKey) => {
|
|
99
100
|
return keysFn[itemKey];
|
|
100
101
|
}); //不存在name就合并
|
|
101
102
|
[...fnArrays, ...defaultFn].forEach((fn) => {
|
|
102
|
-
fn(...
|
|
103
|
+
fn(...dispatchArgs);
|
|
103
104
|
});
|
|
104
105
|
},
|
|
105
106
|
addDispatchListener(action, fn) {
|
|
@@ -42,7 +42,8 @@ export const useOptionReq = ({
|
|
|
42
42
|
},
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
|
-
const reload = (
|
|
45
|
+
const reload = (reloadParams?: ParamsModal) => {
|
|
46
|
+
const { options: changeOpts, params }=reloadParams||{};
|
|
46
47
|
if (changeOpts) {
|
|
47
48
|
return setData(changeOpts);
|
|
48
49
|
}
|