shineout 3.7.1-beta.4 → 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 +1 -1
- package/dist/shineout.js +106 -81
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/dist/shineout.min.js.map +1 -1
- package/esm/index.js +1 -1
- package/package.json +5 -5
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.
|
|
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.
|
|
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
|
|
|
@@ -31017,6 +31017,20 @@ var usePositionStyle = function usePositionStyle(config) {
|
|
|
31017
31017
|
var popupElSize = useCheckElementSize(popupElRef, {
|
|
31018
31018
|
enable: show
|
|
31019
31019
|
});
|
|
31020
|
+
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
31021
|
+
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
31022
|
+
popupElWidth = _useState4[0],
|
|
31023
|
+
setPopupElWidth = _useState4[1];
|
|
31024
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
|
|
31025
|
+
if (!show || !popupElRef.current) return;
|
|
31026
|
+
if (popupElRef.current) {
|
|
31027
|
+
// 二次打开弹出层时,元素被之前的动画设置了display: none,重新获取元素尺寸时,需要立即设置display: block
|
|
31028
|
+
if (popupElRef.current.style.display === 'none') {
|
|
31029
|
+
popupElRef.current.style.display = 'block';
|
|
31030
|
+
}
|
|
31031
|
+
setPopupElWidth(popupElRef.current.getBoundingClientRect().width);
|
|
31032
|
+
}
|
|
31033
|
+
}, [show, popupElRef.current]);
|
|
31020
31034
|
var adjustPosition = function adjustPosition(position) {
|
|
31021
31035
|
var winHeight = docSize.height;
|
|
31022
31036
|
if (!verticalPosition.includes(position)) return position;
|
|
@@ -31043,6 +31057,14 @@ var usePositionStyle = function usePositionStyle(config) {
|
|
|
31043
31057
|
newPosition = newPosition.replace('left', 'right');
|
|
31044
31058
|
}
|
|
31045
31059
|
}
|
|
31060
|
+
} else {
|
|
31061
|
+
// absolute 场景下,右侧溢出判断需要考虑弹出层元素的尺寸
|
|
31062
|
+
var _position$split = position.split('-'),
|
|
31063
|
+
_position$split2 = slicedToArray_default()(_position$split, 2),
|
|
31064
|
+
_horizontalPosition = _position$split2[1];
|
|
31065
|
+
if (_horizontalPosition === 'left' && context.parentRect.left + (popupElWidth || context.popUpWidth) > docSize.width) {
|
|
31066
|
+
newPosition = newPosition.replace('left', 'right');
|
|
31067
|
+
}
|
|
31046
31068
|
}
|
|
31047
31069
|
return newPosition;
|
|
31048
31070
|
};
|
|
@@ -50077,85 +50099,6 @@ var useForm = function useForm(props) {
|
|
|
50077
50099
|
removeLock: false
|
|
50078
50100
|
}),
|
|
50079
50101
|
context = _React$useRef.current;
|
|
50080
|
-
var update = function update(name) {
|
|
50081
|
-
var _context$flowMap$glob;
|
|
50082
|
-
if (!name) {
|
|
50083
|
-
Object.keys(context.updateMap).forEach(function (key) {
|
|
50084
|
-
var _context$updateMap$ke;
|
|
50085
|
-
(_context$updateMap$ke = context.updateMap[key]) === null || _context$updateMap$ke === void 0 || _context$updateMap$ke.forEach(function (update) {
|
|
50086
|
-
update(context.value, context.errors, context.serverErrors);
|
|
50087
|
-
});
|
|
50088
|
-
});
|
|
50089
|
-
Object.keys(context.flowMap).forEach(function (key) {
|
|
50090
|
-
context.flowMap[key].forEach(function (update) {
|
|
50091
|
-
update();
|
|
50092
|
-
});
|
|
50093
|
-
});
|
|
50094
|
-
} else {
|
|
50095
|
-
var names = isArray(name) ? name : [name];
|
|
50096
|
-
names.forEach(function (key) {
|
|
50097
|
-
var _context$flowMap$key;
|
|
50098
|
-
// 外部直接设置user.name这种格式的,但是又没有显性的声明user.name绑定的表单元素;
|
|
50099
|
-
// 这里需要手动触发,否则会导致Input输入过程中光标跳到末尾的异常
|
|
50100
|
-
if (!context.updateMap[key]) {
|
|
50101
|
-
var _context$updateMap$pa;
|
|
50102
|
-
var parentKey = key.split('.')[0];
|
|
50103
|
-
(_context$updateMap$pa = context.updateMap[parentKey]) === null || _context$updateMap$pa === void 0 || _context$updateMap$pa.forEach(function (update) {
|
|
50104
|
-
update(context.value, context.errors, context.serverErrors);
|
|
50105
|
-
});
|
|
50106
|
-
} else {
|
|
50107
|
-
var _context$updateMap$ke2;
|
|
50108
|
-
(_context$updateMap$ke2 = context.updateMap[key]) === null || _context$updateMap$ke2 === void 0 || _context$updateMap$ke2.forEach(function (update) {
|
|
50109
|
-
update(context.value, context.errors, context.serverErrors);
|
|
50110
|
-
});
|
|
50111
|
-
}
|
|
50112
|
-
(_context$flowMap$key = context.flowMap[key]) === null || _context$flowMap$key === void 0 || _context$flowMap$key.forEach(function (update) {
|
|
50113
|
-
update();
|
|
50114
|
-
});
|
|
50115
|
-
});
|
|
50116
|
-
}
|
|
50117
|
-
(_context$flowMap$glob = context.flowMap[globalKey]) === null || _context$flowMap$glob === void 0 || _context$flowMap$glob.forEach(function (update) {
|
|
50118
|
-
update();
|
|
50119
|
-
});
|
|
50120
|
-
};
|
|
50121
|
-
var updateFieldsets = use_persist_fn(function (name) {
|
|
50122
|
-
var na = "".concat(name, "[");
|
|
50123
|
-
var no = "".concat(name, ".");
|
|
50124
|
-
context.names.forEach(function (key) {
|
|
50125
|
-
if (key.startsWith(na) || key.startsWith(no)) {
|
|
50126
|
-
update(key);
|
|
50127
|
-
}
|
|
50128
|
-
});
|
|
50129
|
-
});
|
|
50130
|
-
var handleSubmitError = function handleSubmitError(err) {
|
|
50131
|
-
onError === null || onError === void 0 || onError(err);
|
|
50132
|
-
if (!props.scrollToError) return;
|
|
50133
|
-
setTimeout(function () {
|
|
50134
|
-
var _props$formElRef$curr;
|
|
50135
|
-
var selector = "[".concat(getDataAttributeName('status'), "=\"error\"]");
|
|
50136
|
-
var el = (_props$formElRef$curr = props.formElRef.current) === null || _props$formElRef$curr === void 0 ? void 0 : _props$formElRef$curr.querySelector(selector);
|
|
50137
|
-
if (el) {
|
|
50138
|
-
el.scrollIntoView();
|
|
50139
|
-
var focusableSelectors = 'textarea, input,[tabindex]:not([tabindex="-1"])';
|
|
50140
|
-
var focusEl = el.querySelector(focusableSelectors);
|
|
50141
|
-
if (focusEl && focusEl.focus) focusEl.focus();
|
|
50142
|
-
}
|
|
50143
|
-
if (typeof scrollToError === 'number' && scrollToError !== 0) {
|
|
50144
|
-
var scrollEl = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent();
|
|
50145
|
-
if (scrollEl) {
|
|
50146
|
-
scrollEl.scrollTop -= scrollToError;
|
|
50147
|
-
} else {
|
|
50148
|
-
docScroll.top -= scrollToError;
|
|
50149
|
-
}
|
|
50150
|
-
}
|
|
50151
|
-
});
|
|
50152
|
-
};
|
|
50153
|
-
var onChange = use_persist_fn(function (change) {
|
|
50154
|
-
var _props$onChange;
|
|
50155
|
-
var newValue = typeof change === 'function' ? utils_immer_produce(context.value, change) : change;
|
|
50156
|
-
context.value = newValue;
|
|
50157
|
-
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, context.value);
|
|
50158
|
-
});
|
|
50159
50102
|
var getValue = use_persist_fn(function (name) {
|
|
50160
50103
|
if (name) {
|
|
50161
50104
|
return deepGet(context.value, name);
|
|
@@ -50238,6 +50181,88 @@ var useForm = function useForm(props) {
|
|
|
50238
50181
|
}
|
|
50239
50182
|
});
|
|
50240
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
|
+
});
|
|
50241
50266
|
var scrollToField = use_persist_fn(function (name) {
|
|
50242
50267
|
var _document;
|
|
50243
50268
|
var scrollIntoViewOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -71310,7 +71335,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
71310
71335
|
|
|
71311
71336
|
|
|
71312
71337
|
/* harmony default export */ var src_0 = ({
|
|
71313
|
-
version: '3.7.1-beta.
|
|
71338
|
+
version: '3.7.1-beta.6'
|
|
71314
71339
|
});
|
|
71315
71340
|
}();
|
|
71316
71341
|
/******/ return __webpack_exports__;
|