@ahooksjs/use-form-table
Advanced tools
Comparing version 0.2.12 to 0.2.13-alpha.0
@@ -0,1 +1,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; } | ||
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; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
@@ -21,5 +25,17 @@ | ||
ctx.params = _objectSpread(_objectSpread(_objectSpread({}, ctx.params), values), payload); | ||
var _ref = payload || {}, | ||
current = _ref.current, | ||
pageSize = _ref.pageSize, | ||
formPayload = _objectWithoutProperties(_ref, ["current", "pageSize"]); | ||
/** | ||
* 为什么会有这个 IS_FORM_DATA_SUBMITTED 判断呢? | ||
* 主要是因为如果 reset 的时候,formState 数据还是老的数据,没有清空 | ||
* 会导致下一个 query 出现问题。 | ||
*/ | ||
stateMap.set({ | ||
formState: !meta[IS_FORM_DATA_SUBMITTED] ? formState : { | ||
values: payload | ||
values: formPayload | ||
} | ||
@@ -26,0 +42,0 @@ }); |
@@ -13,3 +13,3 @@ var _pipeCheckerMap; | ||
var checkIsFormPipe = function checkIsFormPipe(meta) { | ||
return [methods.ON_FORM_SUBMIT, methods.ON_FORM_MOUNT, methods.ON_FORM_SUBMIT, methods.TO_RESET_FORM, methods.ON_REFRESH_DEPS].includes(meta.queryFrom); | ||
return [methods.ON_FORM_SUBMIT, methods.ON_FORM_MOUNT, methods.ON_FORM_SUBMIT, methods.TO_RESET_FORM, methods.ON_FORM_RESET, methods.ON_REFRESH_DEPS].includes(meta.queryFrom); | ||
}; | ||
@@ -16,0 +16,0 @@ |
@@ -9,7 +9,5 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
import { PAYLOAD_SYMBOL } from '@ahooksjs/use-table'; | ||
import { IS_FORM_DATA_SUBMITTED } from '../symbol'; | ||
var tablePipe = function tablePipe(ctx) { | ||
var meta = ctx.meta, | ||
store = ctx.store, | ||
var store = ctx.store, | ||
payload = ctx[PAYLOAD_SYMBOL]; | ||
@@ -23,7 +21,2 @@ var stateMap = store.stateMap; | ||
ctx.params = _objectSpread(_objectSpread(_objectSpread({}, ctx.params), values), payload); | ||
stateMap.set({ | ||
formState: !meta[IS_FORM_DATA_SUBMITTED] ? formState : { | ||
values: payload | ||
} | ||
}); | ||
return ctx; | ||
@@ -30,0 +23,0 @@ }; |
@@ -12,2 +12,6 @@ "use strict"; | ||
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; } | ||
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; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
@@ -29,5 +33,17 @@ | ||
ctx.params = _objectSpread(_objectSpread(_objectSpread({}, ctx.params), values), payload); | ||
var _ref = payload || {}, | ||
current = _ref.current, | ||
pageSize = _ref.pageSize, | ||
formPayload = _objectWithoutProperties(_ref, ["current", "pageSize"]); | ||
/** | ||
* 为什么会有这个 IS_FORM_DATA_SUBMITTED 判断呢? | ||
* 主要是因为如果 reset 的时候,formState 数据还是老的数据,没有清空 | ||
* 会导致下一个 query 出现问题。 | ||
*/ | ||
stateMap.set({ | ||
formState: !meta[_symbol.IS_FORM_DATA_SUBMITTED] ? formState : { | ||
values: payload | ||
values: formPayload | ||
} | ||
@@ -34,0 +50,0 @@ }); |
@@ -27,3 +27,3 @@ "use strict"; | ||
var checkIsFormPipe = function checkIsFormPipe(meta) { | ||
return [_config.methods.ON_FORM_SUBMIT, _config.methods.ON_FORM_MOUNT, _config.methods.ON_FORM_SUBMIT, _config.methods.TO_RESET_FORM, _config.methods.ON_REFRESH_DEPS].includes(meta.queryFrom); | ||
return [_config.methods.ON_FORM_SUBMIT, _config.methods.ON_FORM_MOUNT, _config.methods.ON_FORM_SUBMIT, _config.methods.TO_RESET_FORM, _config.methods.ON_FORM_RESET, _config.methods.ON_REFRESH_DEPS].includes(meta.queryFrom); | ||
}; | ||
@@ -30,0 +30,0 @@ |
@@ -10,4 +10,2 @@ "use strict"; | ||
var _symbol = require("../symbol"); | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
@@ -20,4 +18,3 @@ | ||
var tablePipe = function tablePipe(ctx) { | ||
var meta = ctx.meta, | ||
store = ctx.store, | ||
var store = ctx.store, | ||
payload = ctx[_useTable.PAYLOAD_SYMBOL]; | ||
@@ -31,7 +28,2 @@ var stateMap = store.stateMap; | ||
ctx.params = _objectSpread(_objectSpread(_objectSpread({}, ctx.params), values), payload); | ||
stateMap.set({ | ||
formState: !meta[_symbol.IS_FORM_DATA_SUBMITTED] ? formState : { | ||
values: payload | ||
} | ||
}); | ||
return ctx; | ||
@@ -38,0 +30,0 @@ }; |
{ | ||
"name": "@ahooksjs/use-form-table", | ||
"version": "0.2.12", | ||
"version": "0.2.13-alpha.0", | ||
"scripts": { | ||
@@ -22,3 +22,3 @@ "build:tsc": "tsc --project tsconfig.build.json --declarationDir ./lib && tsc --project tsconfig.build.json --declarationDir ./es" | ||
"dependencies": { | ||
"@ahooksjs/use-table": "^0.2.12", | ||
"@ahooksjs/use-table": "^0.2.13-alpha.0", | ||
"@formily/react-schema-renderer": "^1.2.9", | ||
@@ -28,3 +28,3 @@ "moment": "^2.27.0", | ||
}, | ||
"gitHead": "1828a3ab20d78ec35290a32020467bca45f3527f" | ||
"gitHead": "f6e065c108ab0ffeeb40657656751252ce5684db" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41416
592