shineout 3.5.4-beta.8 → 3.5.4
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.d.ts +1 -1
- package/cjs/index.js +8 -1
- package/dist/shineout.js +125 -63
- 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.d.ts +1 -1
- package/esm/index.js +2 -2
- package/package.json +5 -5
package/cjs/index.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export { default as Upload } from './upload';
|
|
|
51
51
|
export { setConfig, config, setLocale, setIcons } from '@sheinx/base';
|
|
52
52
|
export type { ConfigOption } from '@sheinx/base';
|
|
53
53
|
export { setToken, useToken } from '@sheinx/theme';
|
|
54
|
-
export { JssProvider, SheetsRegistry, setJssConfig } from '@sheinx/shineout-style';
|
|
54
|
+
export { JssProvider, SheetsRegistry, setJssConfig, scopeNormalizeStyle, } from '@sheinx/shineout-style';
|
|
55
55
|
export * as utls from './utils';
|
|
56
56
|
export * from './deprecated';
|
|
57
57
|
export * as TYPE from './type';
|
package/cjs/index.js
CHANGED
|
@@ -65,6 +65,7 @@ var _exportNames = {
|
|
|
65
65
|
JssProvider: true,
|
|
66
66
|
SheetsRegistry: true,
|
|
67
67
|
setJssConfig: true,
|
|
68
|
+
scopeNormalizeStyle: true,
|
|
68
69
|
utls: true,
|
|
69
70
|
TYPE: true
|
|
70
71
|
};
|
|
@@ -388,6 +389,12 @@ Object.defineProperty(exports, "config", {
|
|
|
388
389
|
}
|
|
389
390
|
});
|
|
390
391
|
exports.default = void 0;
|
|
392
|
+
Object.defineProperty(exports, "scopeNormalizeStyle", {
|
|
393
|
+
enumerable: true,
|
|
394
|
+
get: function get() {
|
|
395
|
+
return _shineoutStyle.scopeNormalizeStyle;
|
|
396
|
+
}
|
|
397
|
+
});
|
|
391
398
|
Object.defineProperty(exports, "setConfig", {
|
|
392
399
|
enumerable: true,
|
|
393
400
|
get: function get() {
|
|
@@ -500,5 +507,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
500
507
|
// 此文件由脚本自动生成,请勿直接修改。
|
|
501
508
|
// This file was generated automatically by a script. Please do not modify it directly.
|
|
502
509
|
var _default = exports.default = {
|
|
503
|
-
version: '3.5.4
|
|
510
|
+
version: '3.5.4'
|
|
504
511
|
};
|
package/dist/shineout.js
CHANGED
|
@@ -6378,6 +6378,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
6378
6378
|
color: function() { return /* reexport */ color; },
|
|
6379
6379
|
config: function() { return /* reexport */ src_config_config; },
|
|
6380
6380
|
"default": function() { return /* binding */ src_0; },
|
|
6381
|
+
scopeNormalizeStyle: function() { return /* reexport */ scopeNormalizeStyle; },
|
|
6381
6382
|
setConfig: function() { return /* reexport */ config_setConfig; },
|
|
6382
6383
|
setIcons: function() { return /* reexport */ setIcons; },
|
|
6383
6384
|
setJssConfig: function() { return /* reexport */ setJssConfig; },
|
|
@@ -7052,20 +7053,29 @@ var AlertIcon = function AlertIcon(props) {
|
|
|
7052
7053
|
var AlertIconMap = alert_icon_icons;
|
|
7053
7054
|
/* harmony default export */ var alert_icon = (AlertIcon);
|
|
7054
7055
|
;// CONCATENATED MODULE: ../hooks/src/utils/warning.ts
|
|
7056
|
+
var shownMessages = new Set();
|
|
7057
|
+
var shouldShowMessage = function shouldShowMessage(message) {
|
|
7058
|
+
if (shownMessages.has(message)) {
|
|
7059
|
+
return false;
|
|
7060
|
+
}
|
|
7061
|
+
shownMessages.add(message);
|
|
7062
|
+
return true;
|
|
7063
|
+
};
|
|
7055
7064
|
var deprecated = function deprecated(prop, newProp, component, extraMessage) {
|
|
7056
|
-
if (false) {}
|
|
7065
|
+
if (false) { var msg; }
|
|
7057
7066
|
};
|
|
7058
7067
|
var breakingChange = function breakingChange(message) {
|
|
7059
|
-
if (false) {}
|
|
7068
|
+
if (false) { var msg; }
|
|
7060
7069
|
};
|
|
7061
7070
|
var devWarn = function devWarn(message) {
|
|
7062
7071
|
if (false) {}
|
|
7063
7072
|
};
|
|
7064
7073
|
var conflictWarning = function conflictWarning(component, prop1, prop2) {
|
|
7065
|
-
if (false) {}
|
|
7074
|
+
if (false) { var msg; }
|
|
7066
7075
|
};
|
|
7067
7076
|
var error = function error(message) {
|
|
7068
|
-
|
|
7077
|
+
var msg = new Error("[shineout] ".concat(message));
|
|
7078
|
+
shouldShowMessage(msg.message) && console.error(msg);
|
|
7069
7079
|
};
|
|
7070
7080
|
var devUseWarning = {
|
|
7071
7081
|
error: error,
|
|
@@ -12030,7 +12040,7 @@ var handleStyle = function handleStyle(style) {
|
|
|
12030
12040
|
};
|
|
12031
12041
|
/* harmony default export */ var jss_style_handleStyle = (handleStyle);
|
|
12032
12042
|
;// CONCATENATED MODULE: ../shineout-style/src/version.ts
|
|
12033
|
-
/* harmony default export */ var version = ('3.5.4
|
|
12043
|
+
/* harmony default export */ var version = ('3.5.4');
|
|
12034
12044
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
12035
12045
|
|
|
12036
12046
|
|
|
@@ -21544,12 +21554,50 @@ var normalize_token = {
|
|
|
21544
21554
|
};
|
|
21545
21555
|
var lineHeightComputed = '20px';
|
|
21546
21556
|
var lineHeightComputed2 = '10px';
|
|
21547
|
-
var
|
|
21557
|
+
var normalizeStyle = "*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\nhtml {\n font-family: sans-serif;\n line-height: 1.15;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n}\n\narticle,\naside,\ndialog,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nnav,\nsection {\n display: block;\n}\n\nbody {\n margin: 0;\n color: ".concat(normalize_token.color, ";\n font-family: ").concat(normalize_token.fontFamily, ";\n font-size: ").concat(normalize_token.fontSize, ";\n line-height: ").concat(normalize_token.lineHeight, ";\n}\n\n\narticle,\naside,\nfooter,\nheader,\nnav,\nsection {\n display: block;\n}\n\nh1 {\n margin: 0.67em 0;\n font-size: 2em;\n}\n\nfigcaption,\nfigure,\nmain {\n display: block;\n}\n\nfigure {\n margin: 1em 40px;\n}\n\nhr {\n overflow: visible;\n height: 0;\n box-sizing: content-box;\n}\n\npre {\n font-family: \"SFMono-Regular\", Menlo, Monaco, Consolas, \"Courier New\", monospace;\n font-size: 1em;\n}\n\na {\n background-color: transparent;\n color: ").concat(normalize_token.linkColor, ";\n cursor: pointer;\n outline: none;\n text-decoration: ").concat(normalize_token.linkHoverDecoration, ";\n -webkit-text-decoration-skip: objects;\n transition: color 0.3s;\n}\n\na:active,\na:hover {\n color: ").concat(normalize_token.linkColor, ";\n outline: 0;\n text-decoration: ").concat(normalize_token.linkHoverDecoration, ";\n}\na[disabled] {\n color: ").concat(normalize_token.linkDisabledColor, ";\n cursor: not-allowed;\n pointer-events: none;\n}\n\nabbr[title] {\n border-bottom: none;\n text-decoration: underline;\n text-decoration: underline dotted;\n}\n\nb,\nstrong {\n font-weight: inherit;\n}\n\nb,\nstrong {\n font-weight: bolder;\n}\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\ndfn {\n font-style: italic;\n}\n\nmark {\n background-color: #ff0;\n color: #000;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\naudio,\nvideo {\n display: inline-block;\n}\n\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n\nimg {\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type='button']::-moz-focus-inner,\n[type='reset']::-moz-focus-inner,\n[type='submit']::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\nbutton:-moz-focusring,\n[type='button']:-moz-focusring,\n[type='reset']:-moz-focusring,\n[type='submit']:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\nlegend {\n display: table;\n max-width: 100%;\n box-sizing: border-box;\n padding: 0;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n display: inline-block;\n vertical-align: baseline;\n}\n\ntextarea {\n overflow: auto;\n}\n\n[type='checkbox'],\n[type='radio'] {\n box-sizing: border-box;\n padding: 0;\n}\n\n\n[type='number']::-webkit-inner-spin-button,\n[type='number']::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type='search'] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n\n[type='search']::-webkit-search-cancel-button,\n[type='search']::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n\n::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n}\n\n\ndetails,\nmenu {\n display: block;\n}\n\n\nsummary {\n display: list-item;\n}\n\n\ncanvas {\n display: inline-block;\n}\n\n\ntemplate {\n display: none;\n}\n\n\n[hidden] {\n display: none;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\n.h1,\n.h2,\n.h3,\n.h4,\n.h5,\n.h6 {\n color: ").concat(normalize_token.headingsColor, ";\n font-family: ").concat(normalize_token.headingsFontFamily, ";\n font-weight: ").concat(normalize_token.headingsFontWeight, ";\n line-height: ").concat(normalize_token.headingsLineHeight, ";\n}\nh1 small, h1 .small, .h1 small, .h1 .small,\nh2 small, h2 .small, .h2 small, .h2 .small,\nh3 small, h3 .small, .h3 small, .h3 .small,\nh4 small, h4 .small, .h4 small, .h4 .small,\nh5 small, h5 .small, .h5 small, .h5 .small,\nh6 small, h6 .small, .h6 small, .h6 .small {\n color: ").concat(normalize_token.headingsSmallColor, ";\n font-weight: normal;\n line-height: 1;\n}\n\n\nh1,\n.h1,\nh2,\n.h2,\nh3,\n.h3 {\n margin-top: ").concat(lineHeightComputed, ";\n margin-bottom: ").concat(lineHeightComputed2, ";\n}\n\nhi small, h1 .small, .h1 small, .h1 .small,\nh2 small, h2 .small, .h2 small, .h2 .small,\nh3 small, h3 .small, .h3 small, .h3 .small {\n font-size: 65%;\n}\n\nh4,\n.h4,\nh5,\n.h5,\nh6,\n.h6 {\n margin-top: ").concat(lineHeightComputed2, ";\n margin-bottom: ").concat(lineHeightComputed2, ";\n}\n\nh4 small, h4 .small, .h4 small, .h4 .small,\nh5 small, h5 .small, .h5 small, .h5 .small,\nh6 small, h6 .small, .h6 small, .h6 .small {\n font-size: 75%;\n}\n\np {\n margin: 0 0 ").concat(lineHeightComputed2, ";\n}");
|
|
21558
|
+
function appendNormalizeStyle(styleString, id) {
|
|
21559
|
+
var style = document.createElement('style');
|
|
21560
|
+
style.id = id;
|
|
21561
|
+
style.innerHTML = styleString;
|
|
21562
|
+
document.head.appendChild(style);
|
|
21563
|
+
}
|
|
21564
|
+
var uniqueStyleId = 'shineout-next-normalize__' + Math.random().toString(36).substring(2, 15);
|
|
21548
21565
|
if (typeof window !== 'undefined') {
|
|
21549
|
-
|
|
21550
|
-
normalize_link.innerHTML = normalize_css;
|
|
21551
|
-
document.head.appendChild(normalize_link);
|
|
21566
|
+
appendNormalizeStyle(normalizeStyle, uniqueStyleId);
|
|
21552
21567
|
}
|
|
21568
|
+
var scopeNormalizeStyle = function scopeNormalizeStyle() {
|
|
21569
|
+
var csScopePrefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '#app';
|
|
21570
|
+
var styleElement = document.getElementById(uniqueStyleId);
|
|
21571
|
+
// 移除styleElement
|
|
21572
|
+
|
|
21573
|
+
var styleSheet = styleElement === null || styleElement === void 0 ? void 0 : styleElement.sheet;
|
|
21574
|
+
var cssRules = styleSheet === null || styleSheet === void 0 ? void 0 : styleSheet.cssRules;
|
|
21575
|
+
// 遍历cssRules,给每一个selectorText添加前缀
|
|
21576
|
+
if (cssRules) {
|
|
21577
|
+
for (var i = 0; i < cssRules.length; i++) {
|
|
21578
|
+
var rule = cssRules[i];
|
|
21579
|
+
if (rule instanceof CSSStyleRule) {
|
|
21580
|
+
// 如果选择器包含了body或html,则替换,不是加前缀
|
|
21581
|
+
if (rule.selectorText.includes('body')) {
|
|
21582
|
+
rule.selectorText = rule.selectorText.replace('body', csScopePrefix);
|
|
21583
|
+
} else if (rule.selectorText.includes('html')) {
|
|
21584
|
+
rule.selectorText = rule.selectorText.replace('html', csScopePrefix);
|
|
21585
|
+
} else {
|
|
21586
|
+
var selectors = rule.selectorText.split(',');
|
|
21587
|
+
var newSelectors = selectors.map(function (selector) {
|
|
21588
|
+
return "".concat(csScopePrefix, " ").concat(selector);
|
|
21589
|
+
});
|
|
21590
|
+
rule.selectorText = newSelectors.join(',');
|
|
21591
|
+
}
|
|
21592
|
+
}
|
|
21593
|
+
}
|
|
21594
|
+
}
|
|
21595
|
+
var scopedStyleString = cssRules ? Array.from(cssRules).map(function (rule) {
|
|
21596
|
+
return rule.cssText;
|
|
21597
|
+
}).join('') : '';
|
|
21598
|
+
document.head.removeChild(styleElement);
|
|
21599
|
+
appendNormalizeStyle(scopedStyleString, uniqueStyleId);
|
|
21600
|
+
};
|
|
21553
21601
|
token_setter({
|
|
21554
21602
|
onlyExtra: true,
|
|
21555
21603
|
tokenName: 'shineout-extra',
|
|
@@ -33871,6 +33919,7 @@ var useInputFormat = function useInputFormat(props) {
|
|
|
33871
33919
|
|
|
33872
33920
|
|
|
33873
33921
|
|
|
33922
|
+
|
|
33874
33923
|
function insertPoint(name) {
|
|
33875
33924
|
var reg = /(\[\d+\])/gi;
|
|
33876
33925
|
return name.replace(reg, function (s, m, i) {
|
|
@@ -34124,12 +34173,31 @@ var removeProps = function removeProps(target, remove) {
|
|
|
34124
34173
|
}
|
|
34125
34174
|
return a;
|
|
34126
34175
|
};
|
|
34176
|
+
|
|
34177
|
+
/**
|
|
34178
|
+
* 获取数据对象的全量key路径
|
|
34179
|
+
* @param obj 数据对象
|
|
34180
|
+
* @param parentKey 父级key
|
|
34181
|
+
* @returns 全量key路径
|
|
34182
|
+
* @example
|
|
34183
|
+
* const obj = { a: { b: { c: 1 } } };
|
|
34184
|
+
* const keys = getAllKeyPaths(obj);
|
|
34185
|
+
* console.log(keys); // ['a.b.c', 'a.b', 'a']
|
|
34186
|
+
*/
|
|
34127
34187
|
var getAllKeyPaths = function getAllKeyPaths(obj) {
|
|
34128
34188
|
var parentKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
34129
34189
|
return Object.keys(obj).reduce(function (keys, key) {
|
|
34130
34190
|
var newKey = parentKey ? "".concat(parentKey, ".").concat(key) : key;
|
|
34131
34191
|
if (Array.isArray(obj[key])) {
|
|
34132
|
-
|
|
34192
|
+
var childrenKeys = obj[key].map(function (item, index) {
|
|
34193
|
+
if (item !== null && typeof_default()(item) === 'object') {
|
|
34194
|
+
return getAllKeyPaths(item, "".concat(newKey, "[").concat(index, "]"));
|
|
34195
|
+
}
|
|
34196
|
+
return null;
|
|
34197
|
+
}).filter(function (item) {
|
|
34198
|
+
return item !== null;
|
|
34199
|
+
});
|
|
34200
|
+
return keys.concat.apply(keys, toConsumableArray_default()(childrenKeys)).concat(newKey);
|
|
34133
34201
|
}
|
|
34134
34202
|
return keys.concat(obj[key] !== null && typeof_default()(obj[key]) === 'object' ? getAllKeyPaths(obj[key], newKey) : newKey);
|
|
34135
34203
|
}, []);
|
|
@@ -37238,7 +37306,7 @@ var Scroll = function Scroll(props) {
|
|
|
37238
37306
|
defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight;
|
|
37239
37307
|
var _useResize = useResize({
|
|
37240
37308
|
targetRef: containerRef,
|
|
37241
|
-
timer:
|
|
37309
|
+
timer: 100
|
|
37242
37310
|
}),
|
|
37243
37311
|
width = _useResize.width,
|
|
37244
37312
|
h = _useResize.height;
|
|
@@ -37524,10 +37592,10 @@ var VirtualList = function VirtualList(props) {
|
|
|
37524
37592
|
height: height,
|
|
37525
37593
|
scrollWidth: 0,
|
|
37526
37594
|
scrollHeight: scrollHeight,
|
|
37527
|
-
wrapperRef: wrapperRef,
|
|
37528
37595
|
childrenStyle: {
|
|
37529
37596
|
width: '100%'
|
|
37530
37597
|
},
|
|
37598
|
+
wrapperRef: wrapperRef,
|
|
37531
37599
|
onScroll: handleScroll,
|
|
37532
37600
|
onMouseMove: handleMouseMove,
|
|
37533
37601
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(Tag, {
|
|
@@ -48136,14 +48204,12 @@ function useFormInstance() {
|
|
|
48136
48204
|
;// CONCATENATED MODULE: ../base/src/form/form.tsx
|
|
48137
48205
|
|
|
48138
48206
|
|
|
48139
|
-
|
|
48140
48207
|
var form_excluded = ["jssStyle", "className", "style", "children", "formRef"];
|
|
48141
48208
|
|
|
48142
48209
|
|
|
48143
48210
|
|
|
48144
48211
|
|
|
48145
48212
|
|
|
48146
|
-
|
|
48147
48213
|
var Form = function Form(props) {
|
|
48148
48214
|
var _jssStyle$form;
|
|
48149
48215
|
var jssStyle = props.jssStyle,
|
|
@@ -48184,16 +48250,6 @@ var Form = function Form(props) {
|
|
|
48184
48250
|
type: 'withValue'
|
|
48185
48251
|
});
|
|
48186
48252
|
});
|
|
48187
|
-
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
48188
|
-
_useState2 = slicedToArray_default()(_useState, 2),
|
|
48189
|
-
renderKey = _useState2[0],
|
|
48190
|
-
setRenderKey = _useState2[1];
|
|
48191
|
-
var handleOuterSet = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (vals) {
|
|
48192
|
-
formFunc.setValue(vals);
|
|
48193
|
-
setRenderKey(function (prev) {
|
|
48194
|
-
return prev + 1;
|
|
48195
|
-
});
|
|
48196
|
-
}, [formFunc]);
|
|
48197
48253
|
var formRefObj = useLatestObj({
|
|
48198
48254
|
clearValidate: formFunc.clearValidate,
|
|
48199
48255
|
getValue: formFunc.getValue,
|
|
@@ -48203,7 +48259,7 @@ var Form = function Form(props) {
|
|
|
48203
48259
|
validateFields: validateFields,
|
|
48204
48260
|
validateFieldsWithValue: validateFieldsWithValue,
|
|
48205
48261
|
validateFieldsWithError: formFunc.validateFields,
|
|
48206
|
-
set:
|
|
48262
|
+
set: formFunc.setValue,
|
|
48207
48263
|
scrollToField: formFunc.scrollToField
|
|
48208
48264
|
});
|
|
48209
48265
|
external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(function () {
|
|
@@ -48252,17 +48308,17 @@ var Form = function Form(props) {
|
|
|
48252
48308
|
}
|
|
48253
48309
|
};
|
|
48254
48310
|
}, [formProps.onSubmit]);
|
|
48255
|
-
return /*#__PURE__*/(0,
|
|
48311
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)("form", objectSpread2_default()(objectSpread2_default()({}, removeProps(formProps, {
|
|
48256
48312
|
onSubmit: true
|
|
48257
48313
|
})), {}, {
|
|
48258
48314
|
ref: formElRef,
|
|
48259
|
-
|
|
48260
|
-
|
|
48261
|
-
|
|
48262
|
-
|
|
48263
|
-
|
|
48264
|
-
})
|
|
48265
|
-
}))
|
|
48315
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsx)(Provider, objectSpread2_default()(objectSpread2_default()({}, ProviderProps), {}, {
|
|
48316
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsx)(FormContext.Provider, {
|
|
48317
|
+
value: formRefObj,
|
|
48318
|
+
children: children
|
|
48319
|
+
})
|
|
48320
|
+
}))
|
|
48321
|
+
}));
|
|
48266
48322
|
};
|
|
48267
48323
|
/* harmony default export */ var base_src_form_form = (Form);
|
|
48268
48324
|
;// CONCATENATED MODULE: ./src/form/form.tsx
|
|
@@ -48632,14 +48688,12 @@ var useFormFieldSet = function useFormFieldSet(props) {
|
|
|
48632
48688
|
|
|
48633
48689
|
|
|
48634
48690
|
|
|
48635
|
-
|
|
48636
48691
|
var form_fieldset_produce = utils_immer_produce;
|
|
48637
48692
|
var FormFieldSet = function FormFieldSet(props) {
|
|
48638
48693
|
var children = props.children,
|
|
48639
48694
|
empty = props.empty;
|
|
48640
48695
|
var _React$useRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef({
|
|
48641
|
-
ids: []
|
|
48642
|
-
lastValues: []
|
|
48696
|
+
ids: []
|
|
48643
48697
|
}),
|
|
48644
48698
|
context = _React$useRef.current;
|
|
48645
48699
|
var formFunc = useFormFunc();
|
|
@@ -48674,9 +48728,8 @@ var FormFieldSet = function FormFieldSet(props) {
|
|
|
48674
48728
|
}
|
|
48675
48729
|
var valueArr = (formFunc === null || formFunc === void 0 ? void 0 : formFunc.getValue(name)) || [];
|
|
48676
48730
|
valueArr = Array.isArray(valueArr) ? valueArr : [valueArr];
|
|
48677
|
-
var result = [];
|
|
48678
48731
|
if (valueArr.length === 0 && valueArr && empty) {
|
|
48679
|
-
|
|
48732
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
|
|
48680
48733
|
children: empty(function (val) {
|
|
48681
48734
|
var newValue = form_fieldset_produce(valueArr, function (draft) {
|
|
48682
48735
|
draft.push(val);
|
|
@@ -48685,7 +48738,7 @@ var FormFieldSet = function FormFieldSet(props) {
|
|
|
48685
48738
|
context.ids.push(generateUUID());
|
|
48686
48739
|
formFunc === null || formFunc === void 0 || formFunc.insertError(name, 0);
|
|
48687
48740
|
})
|
|
48688
|
-
}, 'empty')
|
|
48741
|
+
}, 'empty');
|
|
48689
48742
|
}
|
|
48690
48743
|
var errorList = (Array.isArray(error) ? error : [error]).filter(Boolean);
|
|
48691
48744
|
if (context.ids.length !== valueArr.length) {
|
|
@@ -48693,11 +48746,9 @@ var FormFieldSet = function FormFieldSet(props) {
|
|
|
48693
48746
|
return generateUUID();
|
|
48694
48747
|
});
|
|
48695
48748
|
}
|
|
48696
|
-
valueArr.
|
|
48697
|
-
|
|
48698
|
-
|
|
48699
|
-
}
|
|
48700
|
-
result.push( /*#__PURE__*/(0,jsx_runtime.jsx)(Provider, {
|
|
48749
|
+
return valueArr.map(function (v, i) {
|
|
48750
|
+
var _context$ids$i;
|
|
48751
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)(Provider, {
|
|
48701
48752
|
value: {
|
|
48702
48753
|
path: "".concat(ProviderValue.path, "[").concat(i, "]"),
|
|
48703
48754
|
validateFieldSet: validateFieldSet
|
|
@@ -48743,13 +48794,7 @@ var FormFieldSet = function FormFieldSet(props) {
|
|
|
48743
48794
|
formFunc === null || formFunc === void 0 || formFunc.spliceError(name, i);
|
|
48744
48795
|
}
|
|
48745
48796
|
})
|
|
48746
|
-
}, context.ids[i]));
|
|
48747
|
-
});
|
|
48748
|
-
|
|
48749
|
-
// 更新 lastValues
|
|
48750
|
-
context.lastValues = valueArr;
|
|
48751
|
-
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
48752
|
-
children: result
|
|
48797
|
+
}, (_context$ids$i = context.ids[i]) !== null && _context$ids$i !== void 0 ? _context$ids$i : i);
|
|
48753
48798
|
});
|
|
48754
48799
|
};
|
|
48755
48800
|
/* harmony default export */ var form_fieldset = (FormFieldSet);
|
|
@@ -57265,6 +57310,7 @@ var Step = function Step(props) {
|
|
|
57265
57310
|
onChange = props.onChange;
|
|
57266
57311
|
var config = useConfig();
|
|
57267
57312
|
var styles = (jssStyle === null || jssStyle === void 0 || (_jssStyle$steps = jssStyle.steps) === null || _jssStyle$steps === void 0 ? void 0 : _jssStyle$steps.call(jssStyle)) || {};
|
|
57313
|
+
var isDisabled = typeof disabled === 'function' ? disabled(index, id) : disabled;
|
|
57268
57314
|
var getLabelPlacement = function getLabelPlacement() {
|
|
57269
57315
|
// dot 类型只支持 vertical labelPlacement
|
|
57270
57316
|
if (type === 'dot') {
|
|
@@ -57283,9 +57329,9 @@ var Step = function Step(props) {
|
|
|
57283
57329
|
};
|
|
57284
57330
|
var status = getStatus();
|
|
57285
57331
|
var labelPlacement = getLabelPlacement();
|
|
57286
|
-
var rootClass = classnames_default()(styles.step, className, styles[status], defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({}, styles.disabled,
|
|
57332
|
+
var rootClass = classnames_default()(styles.step, className, styles[status], defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({}, styles.disabled, isDisabled), styles.finish, current > index), styles.horizontalLabel, labelPlacement === 'horizontal'), styles.verticalLabel, labelPlacement === 'vertical'), styles.widthDescription, !!description));
|
|
57287
57333
|
var handleChange = function handleChange(e) {
|
|
57288
|
-
if (
|
|
57334
|
+
if (isDisabled) return;
|
|
57289
57335
|
onClick === null || onClick === void 0 || onClick(e, index, id);
|
|
57290
57336
|
onChange === null || onChange === void 0 || onChange(index);
|
|
57291
57337
|
};
|
|
@@ -57326,7 +57372,10 @@ var Step = function Step(props) {
|
|
|
57326
57372
|
var StepWidthContext = function StepWidthContext(props) {
|
|
57327
57373
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(steps_context.Consumer, {
|
|
57328
57374
|
children: function children(value) {
|
|
57329
|
-
|
|
57375
|
+
var disabled = 'disabled' in props ? props.disabled : value.disabled;
|
|
57376
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)(Step, objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, props), value), {}, {
|
|
57377
|
+
disabled: disabled
|
|
57378
|
+
}));
|
|
57330
57379
|
}
|
|
57331
57380
|
});
|
|
57332
57381
|
};
|
|
@@ -57347,6 +57396,7 @@ var Steps = function Steps(props) {
|
|
|
57347
57396
|
_props$type = props.type,
|
|
57348
57397
|
type = _props$type === void 0 ? 'default' : _props$type,
|
|
57349
57398
|
size = props.size,
|
|
57399
|
+
disabled = props.disabled,
|
|
57350
57400
|
status = props.status,
|
|
57351
57401
|
_props$direction = props.direction,
|
|
57352
57402
|
directionProp = _props$direction === void 0 ? 'horizontal' : _props$direction,
|
|
@@ -57392,6 +57442,7 @@ var Steps = function Steps(props) {
|
|
|
57392
57442
|
labelPlacement: labelPlacement,
|
|
57393
57443
|
size: size,
|
|
57394
57444
|
type: type,
|
|
57445
|
+
disabled: disabled,
|
|
57395
57446
|
onChange: onChange
|
|
57396
57447
|
},
|
|
57397
57448
|
children: renderStep()
|
|
@@ -58880,7 +58931,8 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
58880
58931
|
var scrollContainerHeight = Math.max(((_props$scrollRef$curr = props.scrollRef.current) === null || _props$scrollRef$curr === void 0 ? void 0 : _props$scrollRef$curr.clientHeight) || 0, 200);
|
|
58881
58932
|
for (var i = 0; i <= maxIndex; i++) {
|
|
58882
58933
|
context.rowSpanRows = 0;
|
|
58883
|
-
|
|
58934
|
+
var currentRowHeight = context.cachedHeight[i] || props.rowHeight;
|
|
58935
|
+
sum += currentRowHeight;
|
|
58884
58936
|
var rowSpanHeight = 0;
|
|
58885
58937
|
if (rowSpanInfo) {
|
|
58886
58938
|
var siblingsIndexs = [];
|
|
@@ -58907,6 +58959,14 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
58907
58959
|
}
|
|
58908
58960
|
if (currentIndex !== startIndex) {
|
|
58909
58961
|
setStartIndex(currentIndex);
|
|
58962
|
+
|
|
58963
|
+
// startIndex处于上方某个合并行的中间一行时,可能引起translate闪烁
|
|
58964
|
+
if (startIndex < currentIndex) {
|
|
58965
|
+
context.autoAddRows = currentIndex - startIndex;
|
|
58966
|
+
setTimeout(function () {
|
|
58967
|
+
context.autoAddRows = 0;
|
|
58968
|
+
}, 300);
|
|
58969
|
+
}
|
|
58910
58970
|
}
|
|
58911
58971
|
setTop(top);
|
|
58912
58972
|
};
|
|
@@ -60033,7 +60093,7 @@ var Tr = function Tr(props) {
|
|
|
60033
60093
|
var clickEvent = col.type === 'expand' ? function () {
|
|
60034
60094
|
props.handleExpandClick(col, props.rawData, props.rowIndex);
|
|
60035
60095
|
} : undefined;
|
|
60036
|
-
|
|
60096
|
+
var expandInstance = /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
60037
60097
|
className: classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.iconWrapper, tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.expandIconWrapper),
|
|
60038
60098
|
onClick: clickEvent,
|
|
60039
60099
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
@@ -60042,6 +60102,11 @@ var Tr = function Tr(props) {
|
|
|
60042
60102
|
children: props.expanded ? icons_config.table.Expand : icons_config.table.Collapse
|
|
60043
60103
|
})
|
|
60044
60104
|
});
|
|
60105
|
+
if (props.expandIcon && typeof props.expandIcon === 'function') {
|
|
60106
|
+
var result = props.expandIcon(props.rawData, props.rowIndex, props.expanded, expandInstance, clickEvent);
|
|
60107
|
+
return result;
|
|
60108
|
+
}
|
|
60109
|
+
return expandInstance;
|
|
60045
60110
|
}
|
|
60046
60111
|
if (col.type === 'checkbox') {
|
|
60047
60112
|
var instance = /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
@@ -60121,12 +60186,7 @@ var Tr = function Tr(props) {
|
|
|
60121
60186
|
onClick: props.onCellClick ? function () {
|
|
60122
60187
|
return handleCellClick(data[i].data, i);
|
|
60123
60188
|
} : undefined,
|
|
60124
|
-
children:
|
|
60125
|
-
style: {
|
|
60126
|
-
height: 0
|
|
60127
|
-
},
|
|
60128
|
-
children: $tdContent
|
|
60129
|
-
}) : $tdContent
|
|
60189
|
+
children: $tdContent
|
|
60130
60190
|
}, col.key);
|
|
60131
60191
|
tds.push(td);
|
|
60132
60192
|
if (data[i].colSpan) skip = data[i].colSpan - 1;
|
|
@@ -60265,6 +60325,7 @@ var Tr = function Tr(props) {
|
|
|
60265
60325
|
treeFunc: props.treeFunc,
|
|
60266
60326
|
treeExpandLevel: props.treeExpandLevel,
|
|
60267
60327
|
treeEmptyExpand: props.treeEmptyExpand,
|
|
60328
|
+
expandIcon: props.expandIcon,
|
|
60268
60329
|
treeExpandIcon: props.treeExpandIcon,
|
|
60269
60330
|
loader: props.loader,
|
|
60270
60331
|
isEmptyTree: props.isEmptyTree,
|
|
@@ -60692,6 +60753,7 @@ var emptyRef = {
|
|
|
60692
60753
|
expandKeys: props.expandKeys,
|
|
60693
60754
|
datum: datum,
|
|
60694
60755
|
treeEmptyExpand: props.treeEmptyExpand,
|
|
60756
|
+
expandIcon: props.expandIcon,
|
|
60695
60757
|
treeExpandIcon: props.treeExpandIcon,
|
|
60696
60758
|
loader: props.loader,
|
|
60697
60759
|
isEmptyTree: isEmptyTree,
|
|
@@ -67106,7 +67168,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
67106
67168
|
|
|
67107
67169
|
|
|
67108
67170
|
/* harmony default export */ var src_0 = ({
|
|
67109
|
-
version: '3.5.4
|
|
67171
|
+
version: '3.5.4'
|
|
67110
67172
|
});
|
|
67111
67173
|
}();
|
|
67112
67174
|
/******/ return __webpack_exports__;
|