shineout 3.7.1-beta.5 → 3.7.1-beta.6

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/cjs/index.js CHANGED
@@ -522,5 +522,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
522
522
  // 此文件由脚本自动生成,请勿直接修改。
523
523
  // This file was generated automatically by a script. Please do not modify it directly.
524
524
  var _default = exports.default = {
525
- version: '3.7.1-beta.5'
525
+ version: '3.7.1-beta.6'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12227,7 +12227,7 @@ var handleStyle = function handleStyle(style) {
12227
12227
  };
12228
12228
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12229
12229
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12230
- /* harmony default export */ var version = ('3.7.1-beta.5');
12230
+ /* harmony default export */ var version = ('3.7.1-beta.6');
12231
12231
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12232
12232
 
12233
12233
 
@@ -50099,85 +50099,6 @@ var useForm = function useForm(props) {
50099
50099
  removeLock: false
50100
50100
  }),
50101
50101
  context = _React$useRef.current;
50102
- var update = function update(name) {
50103
- var _context$flowMap$glob;
50104
- if (!name) {
50105
- Object.keys(context.updateMap).forEach(function (key) {
50106
- var _context$updateMap$ke;
50107
- (_context$updateMap$ke = context.updateMap[key]) === null || _context$updateMap$ke === void 0 || _context$updateMap$ke.forEach(function (update) {
50108
- update(context.value, context.errors, context.serverErrors);
50109
- });
50110
- });
50111
- Object.keys(context.flowMap).forEach(function (key) {
50112
- context.flowMap[key].forEach(function (update) {
50113
- update();
50114
- });
50115
- });
50116
- } else {
50117
- var names = isArray(name) ? name : [name];
50118
- names.forEach(function (key) {
50119
- var _context$flowMap$key;
50120
- // 外部直接设置user.name这种格式的,但是又没有显性的声明user.name绑定的表单元素;
50121
- // 这里需要手动触发,否则会导致Input输入过程中光标跳到末尾的异常
50122
- if (!context.updateMap[key]) {
50123
- var _context$updateMap$pa;
50124
- var parentKey = key.split('.')[0];
50125
- (_context$updateMap$pa = context.updateMap[parentKey]) === null || _context$updateMap$pa === void 0 || _context$updateMap$pa.forEach(function (update) {
50126
- update(context.value, context.errors, context.serverErrors);
50127
- });
50128
- } else {
50129
- var _context$updateMap$ke2;
50130
- (_context$updateMap$ke2 = context.updateMap[key]) === null || _context$updateMap$ke2 === void 0 || _context$updateMap$ke2.forEach(function (update) {
50131
- update(context.value, context.errors, context.serverErrors);
50132
- });
50133
- }
50134
- (_context$flowMap$key = context.flowMap[key]) === null || _context$flowMap$key === void 0 || _context$flowMap$key.forEach(function (update) {
50135
- update();
50136
- });
50137
- });
50138
- }
50139
- (_context$flowMap$glob = context.flowMap[globalKey]) === null || _context$flowMap$glob === void 0 || _context$flowMap$glob.forEach(function (update) {
50140
- update();
50141
- });
50142
- };
50143
- var updateFieldsets = use_persist_fn(function (name) {
50144
- var na = "".concat(name, "[");
50145
- var no = "".concat(name, ".");
50146
- context.names.forEach(function (key) {
50147
- if (key.startsWith(na) || key.startsWith(no)) {
50148
- update(key);
50149
- }
50150
- });
50151
- });
50152
- var handleSubmitError = function handleSubmitError(err) {
50153
- onError === null || onError === void 0 || onError(err);
50154
- if (!props.scrollToError) return;
50155
- setTimeout(function () {
50156
- var _props$formElRef$curr;
50157
- var selector = "[".concat(getDataAttributeName('status'), "=\"error\"]");
50158
- var el = (_props$formElRef$curr = props.formElRef.current) === null || _props$formElRef$curr === void 0 ? void 0 : _props$formElRef$curr.querySelector(selector);
50159
- if (el) {
50160
- el.scrollIntoView();
50161
- var focusableSelectors = 'textarea, input,[tabindex]:not([tabindex="-1"])';
50162
- var focusEl = el.querySelector(focusableSelectors);
50163
- if (focusEl && focusEl.focus) focusEl.focus();
50164
- }
50165
- if (typeof scrollToError === 'number' && scrollToError !== 0) {
50166
- var scrollEl = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent();
50167
- if (scrollEl) {
50168
- scrollEl.scrollTop -= scrollToError;
50169
- } else {
50170
- docScroll.top -= scrollToError;
50171
- }
50172
- }
50173
- });
50174
- };
50175
- var onChange = use_persist_fn(function (change) {
50176
- var _props$onChange;
50177
- var newValue = typeof change === 'function' ? utils_immer_produce(context.value, change) : change;
50178
- context.value = newValue;
50179
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, context.value);
50180
- });
50181
50102
  var getValue = use_persist_fn(function (name) {
50182
50103
  if (name) {
50183
50104
  return deepGet(context.value, name);
@@ -50260,6 +50181,88 @@ var useForm = function useForm(props) {
50260
50181
  }
50261
50182
  });
50262
50183
  });
50184
+ var update = function update(name) {
50185
+ var _context$flowMap$glob;
50186
+ if (!name) {
50187
+ Object.keys(context.updateMap).forEach(function (key) {
50188
+ var _context$updateMap$ke;
50189
+ (_context$updateMap$ke = context.updateMap[key]) === null || _context$updateMap$ke === void 0 || _context$updateMap$ke.forEach(function (update) {
50190
+ update(context.value, context.errors, context.serverErrors);
50191
+ if (context.errors[key]) {
50192
+ validateFields(key).catch(function () {});
50193
+ }
50194
+ });
50195
+ });
50196
+ Object.keys(context.flowMap).forEach(function (key) {
50197
+ context.flowMap[key].forEach(function (update) {
50198
+ update();
50199
+ });
50200
+ });
50201
+ } else {
50202
+ var names = isArray(name) ? name : [name];
50203
+ names.forEach(function (key) {
50204
+ var _context$flowMap$key;
50205
+ // 外部直接设置user.name这种格式的,但是又没有显性的声明user.name绑定的表单元素;
50206
+ // 这里需要手动触发,否则会导致Input输入过程中光标跳到末尾的异常
50207
+ if (!context.updateMap[key]) {
50208
+ var _context$updateMap$pa;
50209
+ var parentKey = key.split('.')[0];
50210
+ (_context$updateMap$pa = context.updateMap[parentKey]) === null || _context$updateMap$pa === void 0 || _context$updateMap$pa.forEach(function (update) {
50211
+ update(context.value, context.errors, context.serverErrors);
50212
+ });
50213
+ } else {
50214
+ var _context$updateMap$ke2;
50215
+ (_context$updateMap$ke2 = context.updateMap[key]) === null || _context$updateMap$ke2 === void 0 || _context$updateMap$ke2.forEach(function (update) {
50216
+ update(context.value, context.errors, context.serverErrors);
50217
+ });
50218
+ }
50219
+ (_context$flowMap$key = context.flowMap[key]) === null || _context$flowMap$key === void 0 || _context$flowMap$key.forEach(function (update) {
50220
+ update();
50221
+ });
50222
+ });
50223
+ }
50224
+ (_context$flowMap$glob = context.flowMap[globalKey]) === null || _context$flowMap$glob === void 0 || _context$flowMap$glob.forEach(function (update) {
50225
+ update();
50226
+ });
50227
+ };
50228
+ var updateFieldsets = use_persist_fn(function (name) {
50229
+ var na = "".concat(name, "[");
50230
+ var no = "".concat(name, ".");
50231
+ context.names.forEach(function (key) {
50232
+ if (key.startsWith(na) || key.startsWith(no)) {
50233
+ update(key);
50234
+ }
50235
+ });
50236
+ });
50237
+ var handleSubmitError = function handleSubmitError(err) {
50238
+ onError === null || onError === void 0 || onError(err);
50239
+ if (!props.scrollToError) return;
50240
+ setTimeout(function () {
50241
+ var _props$formElRef$curr;
50242
+ var selector = "[".concat(getDataAttributeName('status'), "=\"error\"]");
50243
+ var el = (_props$formElRef$curr = props.formElRef.current) === null || _props$formElRef$curr === void 0 ? void 0 : _props$formElRef$curr.querySelector(selector);
50244
+ if (el) {
50245
+ el.scrollIntoView();
50246
+ var focusableSelectors = 'textarea, input,[tabindex]:not([tabindex="-1"])';
50247
+ var focusEl = el.querySelector(focusableSelectors);
50248
+ if (focusEl && focusEl.focus) focusEl.focus();
50249
+ }
50250
+ if (typeof scrollToError === 'number' && scrollToError !== 0) {
50251
+ var scrollEl = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent();
50252
+ if (scrollEl) {
50253
+ scrollEl.scrollTop -= scrollToError;
50254
+ } else {
50255
+ docScroll.top -= scrollToError;
50256
+ }
50257
+ }
50258
+ });
50259
+ };
50260
+ var onChange = use_persist_fn(function (change) {
50261
+ var _props$onChange;
50262
+ var newValue = typeof change === 'function' ? utils_immer_produce(context.value, change) : change;
50263
+ context.value = newValue;
50264
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, context.value);
50265
+ });
50263
50266
  var scrollToField = use_persist_fn(function (name) {
50264
50267
  var _document;
50265
50268
  var scrollIntoViewOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -71332,7 +71335,7 @@ var upload_interface = __webpack_require__(8821);
71332
71335
 
71333
71336
 
71334
71337
  /* harmony default export */ var src_0 = ({
71335
- version: '3.7.1-beta.5'
71338
+ version: '3.7.1-beta.6'
71336
71339
  });
71337
71340
  }();
71338
71341
  /******/ return __webpack_exports__;