@nutui/nutui-react 2.0.16 → 2.0.17-beta.1
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/CHANGELOG.md +15 -0
- package/dist/esm/Audio.js +1 -2
- package/dist/esm/Avatar.js +1 -1
- package/dist/esm/Form/style/style.css +1 -1
- package/dist/esm/Form.js +51 -3
- package/dist/esm/FormItem/style/style.css +1 -1
- package/dist/esm/InputNumber.js +2 -2
- package/dist/esm/Picker.js +4 -6
- package/dist/esm/Table.js +4 -4
- package/dist/esm/VirtualList.js +3 -4
- package/dist/esm/cascader2.js +3 -3
- package/dist/esm/formitem2.js +29 -9
- package/dist/esm/types/src/packages/cascader/cascader.d.ts +2 -1
- package/dist/esm/types/src/packages/cascader/cascader.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/form/types.d.ts +1 -0
- package/dist/esm/types/src/packages/formitem/formitem.d.ts +1 -0
- package/dist/esm/types/src/packages/formitem/formitem.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/table/types.d.ts +1 -1
- package/dist/esm/types/src/packages/toast/toast.taro.d.ts +3 -6
- package/dist/esm/types/src/packages/virtuallist/utils.d.ts +1 -1
- package/dist/esm/types/src/utils/get-rect-by-taro.d.ts +12 -0
- package/dist/esm/types/src/utils/use-client-rect.d.ts +3 -9
- package/dist/esm/types/src/utils/use-uuid.d.ts +1 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/tr-TR.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.es.js +120 -37
- package/dist/nutui.react.umd.js +120 -37
- package/dist/packages/form/form.scss +9 -1
- package/dist/packages/formitem/formitem.scss +0 -11
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/types/packages/cascader/cascader.d.ts +2 -1
- package/dist/types/packages/form/types.d.ts +1 -0
- package/dist/types/packages/formitem/formitem.d.ts +5 -0
- package/dist/types/packages/table/types.d.ts +1 -1
- package/dist/types/packages/virtuallist/utils.d.ts +1 -1
- package/dist/types/utils/use-client-rect.d.ts +3 -9
- package/package.json +1 -1
package/dist/nutui.react.umd.js
CHANGED
|
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9
9
|
return value;
|
|
10
10
|
};
|
|
11
11
|
/*!
|
|
12
|
-
* @nutui/nutui-react v2.0.
|
|
12
|
+
* @nutui/nutui-react v2.0.17 Wed Sep 13 2023 17:08:08 GMT+0800 (中国标准时间)
|
|
13
13
|
* (c) 2023 @jdf2e.
|
|
14
14
|
* Released under the MIT License.
|
|
15
15
|
*/
|
|
@@ -12760,6 +12760,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
12760
12760
|
activeColor,
|
|
12761
12761
|
activeIcon,
|
|
12762
12762
|
popup,
|
|
12763
|
+
popupProps = {},
|
|
12763
12764
|
visible,
|
|
12764
12765
|
options: options2,
|
|
12765
12766
|
value,
|
|
@@ -13055,6 +13056,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
13055
13056
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, popup ? /* @__PURE__ */ React.createElement(
|
|
13056
13057
|
Popup,
|
|
13057
13058
|
{
|
|
13059
|
+
...popupProps,
|
|
13058
13060
|
visible,
|
|
13059
13061
|
position: "bottom",
|
|
13060
13062
|
round: true,
|
|
@@ -14606,7 +14608,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14606
14608
|
}
|
|
14607
14609
|
return false;
|
|
14608
14610
|
};
|
|
14609
|
-
const setTransform = (
|
|
14611
|
+
const setTransform = (type2, deg, time = DEFAULT_DURATION, translateY = 0) => {
|
|
14610
14612
|
let nTime = time;
|
|
14611
14613
|
if (type2 !== "end") {
|
|
14612
14614
|
nTime = 0;
|
|
@@ -14626,7 +14628,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14626
14628
|
}
|
|
14627
14629
|
const endMove = Math.round(updateMove / lineSpacing) * lineSpacing;
|
|
14628
14630
|
const deg = `${(Math.abs(Math.round(endMove / lineSpacing)) + 1) * rotation}deg`;
|
|
14629
|
-
setTransform(
|
|
14631
|
+
setTransform(type2, deg, time, endMove);
|
|
14630
14632
|
setCurrIndex(Math.abs(Math.round(endMove / lineSpacing)) + 1);
|
|
14631
14633
|
} else {
|
|
14632
14634
|
let deg = 0;
|
|
@@ -14635,7 +14637,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14635
14637
|
const minDeg = 0;
|
|
14636
14638
|
deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
|
|
14637
14639
|
if (minDeg < deg && deg < maxDeg) {
|
|
14638
|
-
setTransform(
|
|
14640
|
+
setTransform("", `${deg}deg`, void 0, updateMove);
|
|
14639
14641
|
setCurrIndex(Math.abs(Math.round(updateMove / lineSpacing)) + 1);
|
|
14640
14642
|
}
|
|
14641
14643
|
}
|
|
@@ -14869,9 +14871,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14869
14871
|
while (columnOptions && columnOptions.children) {
|
|
14870
14872
|
const options22 = columnOptions.children;
|
|
14871
14873
|
const value = values[columnIndex2];
|
|
14872
|
-
let index = options22.findIndex(
|
|
14873
|
-
(columnItem) => columnItem.value === value
|
|
14874
|
-
);
|
|
14874
|
+
let index = options22.findIndex((columnItem) => columnItem.value === value);
|
|
14875
14875
|
if (index === -1)
|
|
14876
14876
|
index = 0;
|
|
14877
14877
|
columnOptions = columnOptions.children[index];
|
|
@@ -16423,7 +16423,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16423
16423
|
__publicField(this, "fieldEntities", []);
|
|
16424
16424
|
// 校验成功或失败的回调,onFinish、onFinishFailed
|
|
16425
16425
|
__publicField(this, "callbacks", {});
|
|
16426
|
-
__publicField(this, "errors",
|
|
16426
|
+
__publicField(this, "errors", {});
|
|
16427
16427
|
/**
|
|
16428
16428
|
* 注册组件实例
|
|
16429
16429
|
* @param field
|
|
@@ -16445,6 +16445,19 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16445
16445
|
var _a2;
|
|
16446
16446
|
return (_a2 = this.store) == null ? void 0 : _a2[name];
|
|
16447
16447
|
});
|
|
16448
|
+
/**
|
|
16449
|
+
* 获取全部字段
|
|
16450
|
+
*/
|
|
16451
|
+
__publicField(this, "getFieldsValue", (name) => {
|
|
16452
|
+
if (typeof name === "boolean") {
|
|
16453
|
+
return JSON.parse(JSON.stringify(this.store));
|
|
16454
|
+
}
|
|
16455
|
+
const fieldsValue = {};
|
|
16456
|
+
name.forEach((field) => {
|
|
16457
|
+
fieldsValue[field] = this.getFieldValue(field);
|
|
16458
|
+
});
|
|
16459
|
+
return fieldsValue;
|
|
16460
|
+
});
|
|
16448
16461
|
/**
|
|
16449
16462
|
* 设置 form 的初始值,之后在 reset 的时候使用
|
|
16450
16463
|
* @param values
|
|
@@ -16502,13 +16515,45 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16502
16515
|
validator.validate({ [name]: (_a2 = this.store) == null ? void 0 : _a2[name] }, (errors) => {
|
|
16503
16516
|
if (errors) {
|
|
16504
16517
|
err.push(...errors);
|
|
16505
|
-
this.errors
|
|
16518
|
+
this.errors[name] = errors;
|
|
16506
16519
|
}
|
|
16507
16520
|
entity.onStoreChange("validate");
|
|
16508
16521
|
});
|
|
16509
16522
|
});
|
|
16510
16523
|
return err;
|
|
16511
16524
|
});
|
|
16525
|
+
__publicField(this, "validateFields", (nameList) => {
|
|
16526
|
+
if (!nameList || nameList.length === 0) {
|
|
16527
|
+
this.validate();
|
|
16528
|
+
return;
|
|
16529
|
+
}
|
|
16530
|
+
this.fieldEntities.filter(({ props: { name } }) => {
|
|
16531
|
+
return nameList.includes(name);
|
|
16532
|
+
}).forEach((entity) => {
|
|
16533
|
+
var _a2;
|
|
16534
|
+
const { name, rules: rules2 = [] } = entity.props;
|
|
16535
|
+
const descriptor = {};
|
|
16536
|
+
if (rules2.length) {
|
|
16537
|
+
if (rules2.length > 1) {
|
|
16538
|
+
descriptor[name] = [];
|
|
16539
|
+
rules2.forEach((v) => {
|
|
16540
|
+
descriptor[name].push(v);
|
|
16541
|
+
});
|
|
16542
|
+
} else {
|
|
16543
|
+
descriptor[name] = rules2[0];
|
|
16544
|
+
}
|
|
16545
|
+
}
|
|
16546
|
+
const validator = new Schema(descriptor);
|
|
16547
|
+
validator.messages();
|
|
16548
|
+
validator.validate({ [name]: (_a2 = this.store) == null ? void 0 : _a2[name] }, (errors) => {
|
|
16549
|
+
this.errors[name] = [];
|
|
16550
|
+
if (errors) {
|
|
16551
|
+
this.errors[name] = errors;
|
|
16552
|
+
}
|
|
16553
|
+
entity.onStoreChange("validate");
|
|
16554
|
+
});
|
|
16555
|
+
});
|
|
16556
|
+
});
|
|
16512
16557
|
__publicField(this, "submit", () => {
|
|
16513
16558
|
var _a2, _b, _c, _d;
|
|
16514
16559
|
const errors = this.validate();
|
|
@@ -16525,12 +16570,17 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16525
16570
|
entity.onStoreChange("reset");
|
|
16526
16571
|
});
|
|
16527
16572
|
});
|
|
16573
|
+
__publicField(this, "dispatch", ({ name }) => {
|
|
16574
|
+
this.validateFields([name]);
|
|
16575
|
+
});
|
|
16528
16576
|
__publicField(this, "getForm", () => {
|
|
16529
16577
|
return {
|
|
16578
|
+
dispatch: this.dispatch,
|
|
16530
16579
|
setInitialValues: this.setInitialValues,
|
|
16531
16580
|
setCallback: this.setCallback,
|
|
16532
16581
|
registerField: this.registerField,
|
|
16533
16582
|
getFieldValue: this.getFieldValue,
|
|
16583
|
+
getFieldsValue: this.getFieldsValue,
|
|
16534
16584
|
setFieldsValue: this.setFieldsValue,
|
|
16535
16585
|
resetFields: this.resetFields,
|
|
16536
16586
|
submit: this.submit,
|
|
@@ -16652,7 +16702,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16652
16702
|
name: "",
|
|
16653
16703
|
label: "",
|
|
16654
16704
|
rules: [{ required: false, message: "" }],
|
|
16655
|
-
errorMessageAlign: "left"
|
|
16705
|
+
errorMessageAlign: "left",
|
|
16706
|
+
validateTrigger: "onChange"
|
|
16656
16707
|
};
|
|
16657
16708
|
class FormItem extends React.Component {
|
|
16658
16709
|
constructor(props) {
|
|
@@ -16662,7 +16713,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16662
16713
|
// children添加value属性和onChange事件
|
|
16663
16714
|
__publicField(this, "getControlled", (children) => {
|
|
16664
16715
|
var _a2;
|
|
16665
|
-
const { setFieldsValue, getFieldValue } = this.context;
|
|
16716
|
+
const { setFieldsValue, getFieldValue, dispatch } = this.context;
|
|
16666
16717
|
const { name = "" } = this.props;
|
|
16667
16718
|
if ((_a2 = children == null ? void 0 : children.props) == null ? void 0 : _a2.defaultValue) {
|
|
16668
16719
|
console.warn("通过 initialValue 设置初始值");
|
|
@@ -16683,6 +16734,24 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16683
16734
|
setFieldsValue({ [name]: next });
|
|
16684
16735
|
}
|
|
16685
16736
|
};
|
|
16737
|
+
const { validateTrigger } = this.props;
|
|
16738
|
+
let validateTriggers = [this.props.trigger || "onChange"];
|
|
16739
|
+
if (validateTrigger) {
|
|
16740
|
+
validateTriggers = typeof validateTrigger === "string" ? [...validateTriggers, validateTrigger] : [...validateTriggers, ...validateTrigger];
|
|
16741
|
+
validateTriggers.forEach((trigger) => {
|
|
16742
|
+
const originTrigger = controlled[trigger];
|
|
16743
|
+
controlled[trigger] = (...args) => {
|
|
16744
|
+
if (originTrigger) {
|
|
16745
|
+
originTrigger(...args);
|
|
16746
|
+
}
|
|
16747
|
+
if (this.props.rules && this.props.rules.length) {
|
|
16748
|
+
dispatch({
|
|
16749
|
+
name: this.props.name
|
|
16750
|
+
});
|
|
16751
|
+
}
|
|
16752
|
+
};
|
|
16753
|
+
});
|
|
16754
|
+
}
|
|
16686
16755
|
if (isForwardRefComponent(children)) {
|
|
16687
16756
|
controlled.ref = (componentInstance) => {
|
|
16688
16757
|
const originRef = children.ref;
|
|
@@ -16712,16 +16781,22 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16712
16781
|
}
|
|
16713
16782
|
});
|
|
16714
16783
|
__publicField(this, "renderLayout", (childNode) => {
|
|
16715
|
-
|
|
16716
|
-
|
|
16784
|
+
const {
|
|
16785
|
+
label,
|
|
16786
|
+
name,
|
|
16787
|
+
required: required2,
|
|
16788
|
+
rules: rules2,
|
|
16789
|
+
className,
|
|
16790
|
+
style,
|
|
16791
|
+
errorMessageAlign
|
|
16792
|
+
} = {
|
|
16717
16793
|
...defaultProps$V,
|
|
16718
16794
|
...this.props
|
|
16719
16795
|
};
|
|
16720
|
-
const
|
|
16721
|
-
|
|
16722
|
-
}));
|
|
16796
|
+
const requiredInRules = rules2 == null ? void 0 : rules2.some((rule) => rule.required);
|
|
16797
|
+
const item = name ? this.context.errors[name] : [];
|
|
16723
16798
|
const { starPosition } = this.context;
|
|
16724
|
-
const renderStar = required2 && /* @__PURE__ */ React.createElement("i", { className: "required" });
|
|
16799
|
+
const renderStar = (required2 || requiredInRules) && /* @__PURE__ */ React.createElement("i", { className: "required" });
|
|
16725
16800
|
const renderLabel = /* @__PURE__ */ React.createElement(React.Fragment, null, starPosition === "left" ? renderStar : null, label, starPosition === "right" ? renderStar : null);
|
|
16726
16801
|
return /* @__PURE__ */ React.createElement(
|
|
16727
16802
|
Cell,
|
|
@@ -16731,7 +16806,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16731
16806
|
onClick: (e) => this.props.onClick && this.props.onClick(e, this.componentRef)
|
|
16732
16807
|
},
|
|
16733
16808
|
label ? /* @__PURE__ */ React.createElement("div", { className: "nut-cell__title nut-form-item__label" }, renderLabel) : null,
|
|
16734
|
-
/* @__PURE__ */ React.createElement("div", { className: "nut-cell__value nut-form-item__body" }, /* @__PURE__ */ React.createElement("div", { className: "nut-form-item__body__slots" }, childNode), item.length > 0 && /* @__PURE__ */ React.createElement(
|
|
16809
|
+
/* @__PURE__ */ React.createElement("div", { className: "nut-cell__value nut-form-item__body" }, /* @__PURE__ */ React.createElement("div", { className: "nut-form-item__body__slots" }, childNode), item && item.length > 0 && /* @__PURE__ */ React.createElement(
|
|
16735
16810
|
"div",
|
|
16736
16811
|
{
|
|
16737
16812
|
className: "nut-form-item__body__tips",
|
|
@@ -17119,7 +17194,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17119
17194
|
};
|
|
17120
17195
|
const changeFormatValue = (e) => {
|
|
17121
17196
|
const input = e.target.value;
|
|
17122
|
-
const numReg =
|
|
17197
|
+
const numReg = /^[0-9]*$/;
|
|
17123
17198
|
const numValue = input.replace(/[^0-9|.]/gi, "");
|
|
17124
17199
|
if (formatter) {
|
|
17125
17200
|
if (!numReg.test(input[0]) && numValue) {
|
|
@@ -17138,7 +17213,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17138
17213
|
};
|
|
17139
17214
|
const burFormatValue = (e) => {
|
|
17140
17215
|
const input = e.target.value;
|
|
17141
|
-
const numReg =
|
|
17216
|
+
const numReg = /^[0-9]*$/;
|
|
17142
17217
|
const numValue = input.replace(/[^0-9|.]/gi, "");
|
|
17143
17218
|
if (formatter) {
|
|
17144
17219
|
if (formatter(numValue) === input) {
|
|
@@ -18722,7 +18797,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18722
18797
|
}));
|
|
18723
18798
|
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2} ${className}`, style, ...rest }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__inner`, ref: wrapRef }, /* @__PURE__ */ React.createElement(React.Fragment, null, isCanvasSupported ? /* @__PURE__ */ React.createElement("canvas", { ref: canvasRef, height: canvasHeight, width: canvasWidth }) : unsupported ? /* @__PURE__ */ React.createElement(React.Fragment, null, unsupported) : /* @__PURE__ */ React.createElement("p", { className: `${classPrefix2}__unsupport` }, locale.signature.unsupported))));
|
|
18724
18799
|
};
|
|
18725
|
-
const Signature = React.forwardRef(
|
|
18800
|
+
const Signature = React.forwardRef(
|
|
18801
|
+
InternalSignature
|
|
18802
|
+
);
|
|
18726
18803
|
Signature.defaultProps = defaultProps$J;
|
|
18727
18804
|
Signature.displayName = "NutSignature";
|
|
18728
18805
|
const defaultProps$I = {
|
|
@@ -20499,10 +20576,13 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20499
20576
|
if (childCount <= 1)
|
|
20500
20577
|
return;
|
|
20501
20578
|
stopAutoPlay();
|
|
20502
|
-
swiperRef.current.autoplayTimer = setTimeout(
|
|
20503
|
-
|
|
20504
|
-
|
|
20505
|
-
|
|
20579
|
+
swiperRef.current.autoplayTimer = setTimeout(
|
|
20580
|
+
() => {
|
|
20581
|
+
next();
|
|
20582
|
+
autoplay();
|
|
20583
|
+
},
|
|
20584
|
+
Number(duration) + 100 * speed
|
|
20585
|
+
);
|
|
20506
20586
|
};
|
|
20507
20587
|
const move = ({ pace = 0, offset: offset2 = 0 }) => {
|
|
20508
20588
|
if (childCount <= 1)
|
|
@@ -21405,7 +21485,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21405
21485
|
...icon.props,
|
|
21406
21486
|
className: `${icon.props.className || ""} icon`
|
|
21407
21487
|
}) : null, children && /* @__PURE__ */ React.createElement("span", { className: "text" }, children), !src && !icon && !children && /* @__PURE__ */ React.createElement(k$2, { className: "icon" })),
|
|
21408
|
-
showMax && /* @__PURE__ */ React.createElement("div", { className: "text" }, ((_l = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _l.maxContent) ? (_m = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _m.maxContent : `+ ${avatarIndex - ((_n = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _n.max)}`)
|
|
21488
|
+
showMax && /* @__PURE__ */ React.createElement("div", { className: "text" }, ((_l = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _l.maxContent) ? (_m = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _m.maxContent : `+ ${avatarIndex - Number(((_n = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _n.max) || 0)}`)
|
|
21409
21489
|
));
|
|
21410
21490
|
};
|
|
21411
21491
|
Avatar.defaultProps = defaultProps$u;
|
|
@@ -22070,10 +22150,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22070
22150
|
handPlaying: false
|
|
22071
22151
|
});
|
|
22072
22152
|
const classPrefix2 = "nut-audio";
|
|
22073
|
-
const warn = console.warn;
|
|
22074
22153
|
const handleEnded = (e) => {
|
|
22075
22154
|
if (props.loop) {
|
|
22076
|
-
warn(locale.audio.tips || "onPlayEnd事件在loop=false时才会触发");
|
|
22155
|
+
console.warn(locale.audio.tips || "onPlayEnd事件在loop=false时才会触发");
|
|
22077
22156
|
} else {
|
|
22078
22157
|
props.onEnd && props.onEnd(e);
|
|
22079
22158
|
}
|
|
@@ -22786,7 +22865,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22786
22865
|
)
|
|
22787
22866
|
);
|
|
22788
22867
|
};
|
|
22789
|
-
const CountDown = React.forwardRef(
|
|
22868
|
+
const CountDown = React.forwardRef(
|
|
22869
|
+
InternalCountDown
|
|
22870
|
+
);
|
|
22790
22871
|
CountDown.defaultProps = defaultProps$k;
|
|
22791
22872
|
CountDown.displayName = "NutCountDown";
|
|
22792
22873
|
const useIsomorphicLayoutEffect = canUseDom ? React.useLayoutEffect : React.useEffect;
|
|
@@ -24123,8 +24204,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24123
24204
|
return [columns2.key, columns2.render];
|
|
24124
24205
|
});
|
|
24125
24206
|
};
|
|
24126
|
-
const renderBodyTds = (item) => {
|
|
24127
|
-
return sortDataItem().map(([value, render2]
|
|
24207
|
+
const renderBodyTds = (item, rowIndex) => {
|
|
24208
|
+
return sortDataItem().map(([value, render2]) => {
|
|
24128
24209
|
return /* @__PURE__ */ React.createElement(
|
|
24129
24210
|
"span",
|
|
24130
24211
|
{
|
|
@@ -24134,13 +24215,13 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24134
24215
|
),
|
|
24135
24216
|
key: value
|
|
24136
24217
|
},
|
|
24137
|
-
typeof item[value] === "function" || typeof render2 === "function" ? /* @__PURE__ */ React.createElement("div", null, render2 ? render2(item) : item[value](item)) : item[value]
|
|
24218
|
+
typeof item[value] === "function" || typeof render2 === "function" ? /* @__PURE__ */ React.createElement("div", null, render2 ? render2(item, rowIndex) : item[value](item)) : item[value]
|
|
24138
24219
|
);
|
|
24139
24220
|
});
|
|
24140
24221
|
};
|
|
24141
24222
|
const renderBoyTrs = () => {
|
|
24142
24223
|
return curData.map((item, index) => {
|
|
24143
|
-
return /* @__PURE__ */ React.createElement("div", { className: bodyClassPrefix, key: index }, renderBodyTds(item));
|
|
24224
|
+
return /* @__PURE__ */ React.createElement("div", { className: bodyClassPrefix, key: index }, renderBodyTds(item, index));
|
|
24144
24225
|
});
|
|
24145
24226
|
};
|
|
24146
24227
|
return /* @__PURE__ */ React.createElement("div", { className: cls, style, ...rest }, /* @__PURE__ */ React.createElement(
|
|
@@ -24450,7 +24531,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24450
24531
|
}
|
|
24451
24532
|
return size;
|
|
24452
24533
|
};
|
|
24453
|
-
const binarySearch = (positionsList, value = 0
|
|
24534
|
+
const binarySearch = (positionsList, horizontal, value = 0) => {
|
|
24454
24535
|
let start2 = 0;
|
|
24455
24536
|
let end = positionsList.length - 1;
|
|
24456
24537
|
let tempIndex = null;
|
|
@@ -24626,7 +24707,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24626
24707
|
const scroll = React.useCallback(() => {
|
|
24627
24708
|
requestAnimationFrame((e) => {
|
|
24628
24709
|
const scrollSize = getElement()[scrollKey];
|
|
24629
|
-
const startIndex = binarySearch(positions,
|
|
24710
|
+
const startIndex = binarySearch(positions, horizontal, scrollSize);
|
|
24630
24711
|
const overStart = startIndex - overscan > -1 ? startIndex - overscan : 0;
|
|
24631
24712
|
if (!itemEqual) {
|
|
24632
24713
|
updateTotalSize();
|
|
@@ -24806,7 +24887,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24806
24887
|
};
|
|
24807
24888
|
return /* @__PURE__ */ React.createElement("div", { className: classes, ref: barrageBody, ...restProps }, /* @__PURE__ */ React.createElement("div", { ref: barrageContainer, className: "bContainer" }));
|
|
24808
24889
|
};
|
|
24809
|
-
const Barrage = React.forwardRef(
|
|
24890
|
+
const Barrage = React.forwardRef(
|
|
24891
|
+
InternalBarrage
|
|
24892
|
+
);
|
|
24810
24893
|
Barrage.defaultProps = defaultProps$5;
|
|
24811
24894
|
Barrage.displayName = "NutBarrage";
|
|
24812
24895
|
const defaultProps$4 = {
|
|
@@ -25086,7 +25169,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
25086
25169
|
return console.warn(`传入的值:${num}不是一个数字`);
|
|
25087
25170
|
}
|
|
25088
25171
|
num = parseFloat(num);
|
|
25089
|
-
const numPow =
|
|
25172
|
+
const numPow = 10 ** digit;
|
|
25090
25173
|
return (Math.round((num + Number.EPSILON) * numPow) / numPow).toFixed(digit);
|
|
25091
25174
|
};
|
|
25092
25175
|
const calcStyle = (() => {
|
|
@@ -7,10 +7,18 @@
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.form-layout-left .nut-form-item__label {
|
|
10
|
+
position: relative;
|
|
10
11
|
text-align: left;
|
|
11
12
|
font-size: 14px;
|
|
12
|
-
padding-
|
|
13
|
+
padding-left: 12px;
|
|
13
14
|
white-space: nowrap;
|
|
15
|
+
|
|
16
|
+
.required {
|
|
17
|
+
display: block;
|
|
18
|
+
line-height: 1.5;
|
|
19
|
+
position: absolute;
|
|
20
|
+
left: 0.1em;
|
|
21
|
+
}
|
|
14
22
|
}
|
|
15
23
|
|
|
16
24
|
.form-layout-top .nut-form-item {
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
.nut-form-item {
|
|
2
2
|
display: flex;
|
|
3
3
|
|
|
4
|
-
&::before {
|
|
5
|
-
position: absolute;
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
content: ' ';
|
|
8
|
-
pointer-events: none;
|
|
9
|
-
right: 16px;
|
|
10
|
-
bottom: 0;
|
|
11
|
-
left: 16px;
|
|
12
|
-
transform: scaleX(0);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
4
|
&.error {
|
|
16
5
|
&.line {
|
|
17
6
|
&::before {
|