@nutui/nutui-react-taro 2.0.16 → 2.0.17
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/Address.js +2 -2
- package/dist/esm/Audio.js +3 -3
- package/dist/esm/Avatar.js +1 -1
- package/dist/esm/Cascader.js +1 -1
- package/dist/esm/DatePicker.js +3 -3
- package/dist/esm/Ellipsis.js +2 -2
- package/dist/esm/Form/style/style.css +1 -1
- package/dist/esm/Form.js +53 -3
- package/dist/esm/FormItem/style/style.css +1 -1
- package/dist/esm/FormItem.js +1 -1
- package/dist/esm/InputNumber.js +1 -1
- package/dist/esm/Menu.js +3 -3
- package/dist/esm/MenuItem.js +2 -2
- package/dist/esm/NoticeBar.js +3 -2
- package/dist/esm/Picker.js +2 -2
- package/dist/esm/Popover.js +2 -2
- package/dist/esm/PullToRefresh.js +1 -1
- package/dist/esm/Range.js +3 -2
- package/dist/esm/Skeleton.js +2 -2
- package/dist/esm/Sticky.js +2 -2
- package/dist/esm/Swipe.js +2 -2
- package/dist/esm/Table.js +1 -1
- package/dist/esm/Toast.js +2 -1
- package/dist/esm/Tour.js +3 -3
- package/dist/esm/TrendArrow.js +1 -1
- package/dist/esm/VirtualList.js +1 -1
- package/dist/esm/{address.taro-6d420871.js → address.taro-319deb0d.js} +1 -1
- package/dist/esm/{audio.taro-ef39c1d9.js → audio.taro-f0ec6410.js} +2 -3
- package/dist/esm/{avatar.taro-47abbb9f.js → avatar.taro-0e574535.js} +1 -1
- package/dist/esm/{cascader.taro-01ffbfb1.js → cascader.taro-8d41895a.js} +2 -1
- package/dist/esm/{datepicker.taro-288d64bb.js → datepicker.taro-4da6a538.js} +1 -1
- package/dist/esm/{ellipsis.taro-21b13b31.js → ellipsis.taro-cd36ab2d.js} +4 -4
- package/dist/esm/{formitem.taro-bb63ac0a.js → formitem.taro-d69dce1e.js} +28 -10
- package/dist/esm/{use-client-rect-2bb6c562.js → get-rect-by-taro-fe02fe2b.js} +21 -3
- package/dist/esm/{inputnumber.taro-2f6f30d7.js → inputnumber.taro-d2fc26bd.js} +2 -2
- package/dist/esm/{menu.taro-4cde3e7f.js → menu.taro-0727ce5f.js} +1 -1
- package/dist/esm/{menuitem.taro-8a60a655.js → menuitem.taro-a4d83b53.js} +1 -1
- package/dist/esm/{noticebar.taro-d95c13b6.js → noticebar.taro-4e1d882b.js} +2 -2
- package/dist/esm/nutui-react.es.js +24 -24
- package/dist/esm/{picker.taro-0770a67f.js → picker.taro-47d1c716.js} +4 -4
- package/dist/esm/{popover.taro-7a482b85.js → popover.taro-43e96169.js} +1 -1
- package/dist/esm/{pulltorefresh.taro-d35571e8.js → pulltorefresh.taro-f3ab76c2.js} +4 -6
- package/dist/esm/{range.taro-fbbf5522.js → range.taro-4028c748.js} +1 -1
- package/dist/esm/{skeleton.taro-1896ff37.js → skeleton.taro-1f829d87.js} +1 -1
- package/dist/esm/{sticky.taro-2d78a04e.js → sticky.taro-dbacaf76.js} +1 -1
- package/dist/esm/{swipe.taro-2fa2479c.js → swipe.taro-385eece1.js} +1 -1
- package/dist/esm/{table.taro-072907bf.js → table.taro-a7dcb564.js} +5 -5
- package/dist/esm/{toast.taro-44ebc833.js → toast.taro-50ee73e6.js} +30 -19
- package/dist/esm/{tour.taro-3299d7a2.js → tour.taro-5185292f.js} +1 -1
- package/dist/esm/{trendarrow.taro-53d6e250.js → trendarrow.taro-e6b635ae.js} +1 -1
- 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/esm/{virtuallist.taro-e552d954.js → virtuallist.taro-c75a4e71.js} +2 -2
- 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 +187 -78
- package/dist/nutui.react.umd.js +186 -77
- 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.taro.d.ts +2 -1
- package/dist/types/packages/form/types.d.ts +1 -0
- package/dist/types/packages/formitem/formitem.taro.d.ts +5 -0
- package/dist/types/packages/table/types.d.ts +1 -1
- package/dist/types/packages/toast/toast.taro.d.ts +3 -6
- package/dist/types/packages/virtuallist/utils.d.ts +1 -1
- package/dist/types/utils/get-rect-by-taro.d.ts +12 -0
- package/dist/types/utils/use-client-rect.d.ts +3 -9
- package/package.json +1 -1
package/dist/nutui.react.umd.js
CHANGED
|
@@ -8,7 +8,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8
8
|
return value;
|
|
9
9
|
};
|
|
10
10
|
/*!
|
|
11
|
-
* @nutui/nutui-react-taro v2.0.
|
|
11
|
+
* @nutui/nutui-react-taro v2.0.17 Wed Sep 13 2023 17:17:51 GMT+0800 (中国标准时间)
|
|
12
12
|
* (c) 2023 @jdf2e.
|
|
13
13
|
* Released under the MIT License.
|
|
14
14
|
*/
|
|
@@ -5475,6 +5475,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5475
5475
|
stop.current = true;
|
|
5476
5476
|
};
|
|
5477
5477
|
}
|
|
5478
|
+
const inBrowser = typeof document !== "undefined" && !!document.scripts;
|
|
5478
5479
|
function isWindow(val) {
|
|
5479
5480
|
return val === window;
|
|
5480
5481
|
}
|
|
@@ -5504,12 +5505,28 @@ var __publicField = (obj, key, value) => {
|
|
|
5504
5505
|
height: 0
|
|
5505
5506
|
};
|
|
5506
5507
|
};
|
|
5508
|
+
function makeRect(width, height) {
|
|
5509
|
+
return {
|
|
5510
|
+
top: 0,
|
|
5511
|
+
left: 0,
|
|
5512
|
+
right: width,
|
|
5513
|
+
bottom: height,
|
|
5514
|
+
width,
|
|
5515
|
+
height
|
|
5516
|
+
};
|
|
5517
|
+
}
|
|
5507
5518
|
const getRectByTaro = async (element) => {
|
|
5508
5519
|
if (element) {
|
|
5509
|
-
|
|
5510
|
-
|
|
5520
|
+
if (inBrowser) {
|
|
5521
|
+
return Promise.resolve(getRect(element));
|
|
5522
|
+
}
|
|
5523
|
+
return new Promise((resolve, reject) => {
|
|
5524
|
+
Taro.createSelectorQuery().select(`#${element.uid}`).boundingClientRect().exec(([rects]) => {
|
|
5525
|
+
resolve(rects);
|
|
5526
|
+
});
|
|
5527
|
+
});
|
|
5511
5528
|
}
|
|
5512
|
-
return Promise.resolve(
|
|
5529
|
+
return Promise.resolve(makeRect(0, 0));
|
|
5513
5530
|
};
|
|
5514
5531
|
const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
|
|
5515
5532
|
const defaultRoot = canUseDom ? window : void 0;
|
|
@@ -7125,6 +7142,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7125
7142
|
activeColor,
|
|
7126
7143
|
activeIcon,
|
|
7127
7144
|
popup,
|
|
7145
|
+
popupProps = {},
|
|
7128
7146
|
visible,
|
|
7129
7147
|
options,
|
|
7130
7148
|
value,
|
|
@@ -7420,6 +7438,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7420
7438
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, popup ? /* @__PURE__ */ React.createElement(
|
|
7421
7439
|
Popup,
|
|
7422
7440
|
{
|
|
7441
|
+
...popupProps,
|
|
7423
7442
|
visible,
|
|
7424
7443
|
position: "bottom",
|
|
7425
7444
|
round: true,
|
|
@@ -8953,7 +8972,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8953
8972
|
}
|
|
8954
8973
|
return false;
|
|
8955
8974
|
};
|
|
8956
|
-
const setTransform = (
|
|
8975
|
+
const setTransform = (type2, deg, time = DEFAULT_DURATION, translateY = 0) => {
|
|
8957
8976
|
let nTime = time;
|
|
8958
8977
|
if (type2 !== "end") {
|
|
8959
8978
|
nTime = 0;
|
|
@@ -8973,7 +8992,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8973
8992
|
}
|
|
8974
8993
|
const endMove = Math.round(updateMove / lineSpacing.current) * lineSpacing.current;
|
|
8975
8994
|
const deg = `${(Math.abs(Math.round(endMove / lineSpacing.current)) + 1) * rotation}deg`;
|
|
8976
|
-
setTransform(
|
|
8995
|
+
setTransform(type2, deg, time, endMove);
|
|
8977
8996
|
setCurrIndex(Math.abs(Math.round(endMove / lineSpacing.current)) + 1);
|
|
8978
8997
|
} else {
|
|
8979
8998
|
let deg = 0;
|
|
@@ -8982,7 +9001,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8982
9001
|
const minDeg = 0;
|
|
8983
9002
|
deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
|
|
8984
9003
|
if (minDeg < deg && deg < maxDeg) {
|
|
8985
|
-
setTransform(
|
|
9004
|
+
setTransform("", `${deg}deg`, void 0, updateMove);
|
|
8986
9005
|
setCurrIndex(Math.abs(Math.round(updateMove / lineSpacing.current)) + 1);
|
|
8987
9006
|
}
|
|
8988
9007
|
}
|
|
@@ -9236,9 +9255,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9236
9255
|
while (columnOptions && columnOptions.children) {
|
|
9237
9256
|
const options2 = columnOptions.children;
|
|
9238
9257
|
const value = values[columnIndex2];
|
|
9239
|
-
let index = options2.findIndex(
|
|
9240
|
-
(columnItem) => columnItem.value === value
|
|
9241
|
-
);
|
|
9258
|
+
let index = options2.findIndex((columnItem) => columnItem.value === value);
|
|
9242
9259
|
if (index === -1)
|
|
9243
9260
|
index = 0;
|
|
9244
9261
|
columnOptions = columnOptions.children[index];
|
|
@@ -10869,7 +10886,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10869
10886
|
__publicField(this, "fieldEntities", []);
|
|
10870
10887
|
// 校验成功或失败的回调,onFinish、onFinishFailed
|
|
10871
10888
|
__publicField(this, "callbacks", {});
|
|
10872
|
-
__publicField(this, "errors",
|
|
10889
|
+
__publicField(this, "errors", {});
|
|
10873
10890
|
/**
|
|
10874
10891
|
* 注册组件实例
|
|
10875
10892
|
* @param field
|
|
@@ -10891,6 +10908,19 @@ var __publicField = (obj, key, value) => {
|
|
|
10891
10908
|
var _a;
|
|
10892
10909
|
return (_a = this.store) == null ? void 0 : _a[name];
|
|
10893
10910
|
});
|
|
10911
|
+
/**
|
|
10912
|
+
* 获取全部字段
|
|
10913
|
+
*/
|
|
10914
|
+
__publicField(this, "getFieldsValue", (name) => {
|
|
10915
|
+
if (typeof name === "boolean") {
|
|
10916
|
+
return JSON.parse(JSON.stringify(this.store));
|
|
10917
|
+
}
|
|
10918
|
+
const fieldsValue = {};
|
|
10919
|
+
name.forEach((field) => {
|
|
10920
|
+
fieldsValue[field] = this.getFieldValue(field);
|
|
10921
|
+
});
|
|
10922
|
+
return fieldsValue;
|
|
10923
|
+
});
|
|
10894
10924
|
/**
|
|
10895
10925
|
* 设置 form 的初始值,之后在 reset 的时候使用
|
|
10896
10926
|
* @param values
|
|
@@ -10948,13 +10978,45 @@ var __publicField = (obj, key, value) => {
|
|
|
10948
10978
|
validator.validate({ [name]: (_a = this.store) == null ? void 0 : _a[name] }, (errors) => {
|
|
10949
10979
|
if (errors) {
|
|
10950
10980
|
err.push(...errors);
|
|
10951
|
-
this.errors
|
|
10981
|
+
this.errors[name] = errors;
|
|
10952
10982
|
}
|
|
10953
10983
|
entity.onStoreChange("validate");
|
|
10954
10984
|
});
|
|
10955
10985
|
});
|
|
10956
10986
|
return err;
|
|
10957
10987
|
});
|
|
10988
|
+
__publicField(this, "validateFields", (nameList) => {
|
|
10989
|
+
if (!nameList || nameList.length === 0) {
|
|
10990
|
+
this.validate();
|
|
10991
|
+
return;
|
|
10992
|
+
}
|
|
10993
|
+
this.fieldEntities.filter(({ props: { name } }) => {
|
|
10994
|
+
return nameList.includes(name);
|
|
10995
|
+
}).forEach((entity) => {
|
|
10996
|
+
var _a;
|
|
10997
|
+
const { name, rules: rules2 = [] } = entity.props;
|
|
10998
|
+
const descriptor = {};
|
|
10999
|
+
if (rules2.length) {
|
|
11000
|
+
if (rules2.length > 1) {
|
|
11001
|
+
descriptor[name] = [];
|
|
11002
|
+
rules2.forEach((v) => {
|
|
11003
|
+
descriptor[name].push(v);
|
|
11004
|
+
});
|
|
11005
|
+
} else {
|
|
11006
|
+
descriptor[name] = rules2[0];
|
|
11007
|
+
}
|
|
11008
|
+
}
|
|
11009
|
+
const validator = new Schema(descriptor);
|
|
11010
|
+
validator.messages();
|
|
11011
|
+
validator.validate({ [name]: (_a = this.store) == null ? void 0 : _a[name] }, (errors) => {
|
|
11012
|
+
this.errors[name] = [];
|
|
11013
|
+
if (errors) {
|
|
11014
|
+
this.errors[name] = errors;
|
|
11015
|
+
}
|
|
11016
|
+
entity.onStoreChange("validate");
|
|
11017
|
+
});
|
|
11018
|
+
});
|
|
11019
|
+
});
|
|
10958
11020
|
__publicField(this, "submit", () => {
|
|
10959
11021
|
var _a, _b, _c, _d;
|
|
10960
11022
|
const errors = this.validate();
|
|
@@ -10971,12 +11033,17 @@ var __publicField = (obj, key, value) => {
|
|
|
10971
11033
|
entity.onStoreChange("reset");
|
|
10972
11034
|
});
|
|
10973
11035
|
});
|
|
11036
|
+
__publicField(this, "dispatch", ({ name }) => {
|
|
11037
|
+
this.validateFields([name]);
|
|
11038
|
+
});
|
|
10974
11039
|
__publicField(this, "getForm", () => {
|
|
10975
11040
|
return {
|
|
11041
|
+
dispatch: this.dispatch,
|
|
10976
11042
|
setInitialValues: this.setInitialValues,
|
|
10977
11043
|
setCallback: this.setCallback,
|
|
10978
11044
|
registerField: this.registerField,
|
|
10979
11045
|
getFieldValue: this.getFieldValue,
|
|
11046
|
+
getFieldsValue: this.getFieldsValue,
|
|
10980
11047
|
setFieldsValue: this.setFieldsValue,
|
|
10981
11048
|
resetFields: this.resetFields,
|
|
10982
11049
|
submit: this.submit,
|
|
@@ -11097,7 +11164,8 @@ var __publicField = (obj, key, value) => {
|
|
|
11097
11164
|
name: "",
|
|
11098
11165
|
label: "",
|
|
11099
11166
|
rules: [{ required: false, message: "" }],
|
|
11100
|
-
errorMessageAlign: "left"
|
|
11167
|
+
errorMessageAlign: "left",
|
|
11168
|
+
validateTrigger: "onChange"
|
|
11101
11169
|
};
|
|
11102
11170
|
class FormItem extends React.Component {
|
|
11103
11171
|
constructor(props) {
|
|
@@ -11107,14 +11175,15 @@ var __publicField = (obj, key, value) => {
|
|
|
11107
11175
|
// children添加value属性和onChange事件
|
|
11108
11176
|
__publicField(this, "getControlled", (children) => {
|
|
11109
11177
|
var _a;
|
|
11110
|
-
const { setFieldsValue, getFieldValue } = this.context;
|
|
11178
|
+
const { setFieldsValue, getFieldValue, dispatch } = this.context;
|
|
11111
11179
|
const { name = "" } = this.props;
|
|
11112
11180
|
if ((_a = children == null ? void 0 : children.props) == null ? void 0 : _a.defaultValue) {
|
|
11113
11181
|
console.warn("通过 initialValue 设置初始值");
|
|
11114
11182
|
}
|
|
11183
|
+
const fieldValue = getFieldValue(name);
|
|
11115
11184
|
const controlled = {
|
|
11116
11185
|
...children.props,
|
|
11117
|
-
[this.props.valuePropName || "value"]:
|
|
11186
|
+
[this.props.valuePropName || "value"]: fieldValue !== void 0 ? fieldValue : this.props.initialValue,
|
|
11118
11187
|
[this.props.trigger || "onChange"]: (...args) => {
|
|
11119
11188
|
const originOnChange = children.props[this.props.trigger || "onChange"];
|
|
11120
11189
|
if (originOnChange) {
|
|
@@ -11127,6 +11196,24 @@ var __publicField = (obj, key, value) => {
|
|
|
11127
11196
|
setFieldsValue({ [name]: next });
|
|
11128
11197
|
}
|
|
11129
11198
|
};
|
|
11199
|
+
const { validateTrigger } = this.props;
|
|
11200
|
+
let validateTriggers = [this.props.trigger || "onChange"];
|
|
11201
|
+
if (validateTrigger) {
|
|
11202
|
+
validateTriggers = typeof validateTrigger === "string" ? [...validateTriggers, validateTrigger] : [...validateTriggers, ...validateTrigger];
|
|
11203
|
+
validateTriggers.forEach((trigger) => {
|
|
11204
|
+
const originTrigger = controlled[trigger];
|
|
11205
|
+
controlled[trigger] = (...args) => {
|
|
11206
|
+
if (originTrigger) {
|
|
11207
|
+
originTrigger(...args);
|
|
11208
|
+
}
|
|
11209
|
+
if (this.props.rules && this.props.rules.length) {
|
|
11210
|
+
dispatch({
|
|
11211
|
+
name: this.props.name
|
|
11212
|
+
});
|
|
11213
|
+
}
|
|
11214
|
+
};
|
|
11215
|
+
});
|
|
11216
|
+
}
|
|
11130
11217
|
if (isForwardRefComponent(children)) {
|
|
11131
11218
|
controlled.ref = (componentInstance) => {
|
|
11132
11219
|
const originRef = children.ref;
|
|
@@ -11156,16 +11243,22 @@ var __publicField = (obj, key, value) => {
|
|
|
11156
11243
|
}
|
|
11157
11244
|
});
|
|
11158
11245
|
__publicField(this, "renderLayout", (childNode) => {
|
|
11159
|
-
|
|
11160
|
-
|
|
11246
|
+
const {
|
|
11247
|
+
label,
|
|
11248
|
+
name,
|
|
11249
|
+
required: required2,
|
|
11250
|
+
rules: rules2,
|
|
11251
|
+
className,
|
|
11252
|
+
style,
|
|
11253
|
+
errorMessageAlign
|
|
11254
|
+
} = {
|
|
11161
11255
|
...defaultProps$X,
|
|
11162
11256
|
...this.props
|
|
11163
11257
|
};
|
|
11164
|
-
const
|
|
11165
|
-
|
|
11166
|
-
}));
|
|
11258
|
+
const requiredInRules = rules2 == null ? void 0 : rules2.some((rule) => rule.required);
|
|
11259
|
+
const item = name ? this.context.errors[name] : [];
|
|
11167
11260
|
const { starPosition } = this.context;
|
|
11168
|
-
const renderStar = required2 && /* @__PURE__ */ React.createElement("i", { className: "required" });
|
|
11261
|
+
const renderStar = (required2 || requiredInRules) && /* @__PURE__ */ React.createElement("i", { className: "required" });
|
|
11169
11262
|
const renderLabel = /* @__PURE__ */ React.createElement(React.Fragment, null, starPosition === "left" ? renderStar : null, label, starPosition === "right" ? renderStar : null);
|
|
11170
11263
|
return /* @__PURE__ */ React.createElement(
|
|
11171
11264
|
Cell,
|
|
@@ -11175,7 +11268,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11175
11268
|
onClick: (e) => this.props.onClick && this.props.onClick(e, this.componentRef)
|
|
11176
11269
|
},
|
|
11177
11270
|
label ? /* @__PURE__ */ React.createElement("div", { className: "nut-cell__title nut-form-item__label" }, renderLabel) : null,
|
|
11178
|
-
/* @__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(
|
|
11271
|
+
/* @__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(
|
|
11179
11272
|
"div",
|
|
11180
11273
|
{
|
|
11181
11274
|
className: "nut-form-item__body__tips",
|
|
@@ -11564,7 +11657,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11564
11657
|
};
|
|
11565
11658
|
const changeFormatValue = (e) => {
|
|
11566
11659
|
const input = e.target.value;
|
|
11567
|
-
const numReg =
|
|
11660
|
+
const numReg = /^[0-9]*$/;
|
|
11568
11661
|
const numValue = input.replace(/[^0-9|.]/gi, "");
|
|
11569
11662
|
if (formatter) {
|
|
11570
11663
|
if (!numReg.test(input[0]) && numValue) {
|
|
@@ -11583,7 +11676,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11583
11676
|
};
|
|
11584
11677
|
const burFormatValue = (e) => {
|
|
11585
11678
|
const input = e.target.value;
|
|
11586
|
-
const numReg =
|
|
11679
|
+
const numReg = /^[0-9]*$/;
|
|
11587
11680
|
const numValue = input.replace(/[^0-9|.]/gi, "");
|
|
11588
11681
|
if (formatter) {
|
|
11589
11682
|
if (formatter(numValue) === input) {
|
|
@@ -13176,7 +13269,9 @@ var __publicField = (obj, key, value) => {
|
|
|
13176
13269
|
}
|
|
13177
13270
|
)));
|
|
13178
13271
|
};
|
|
13179
|
-
const Signature = React.forwardRef(
|
|
13272
|
+
const Signature = React.forwardRef(
|
|
13273
|
+
InternalSignature
|
|
13274
|
+
);
|
|
13180
13275
|
Signature.defaultProps = defaultProps$L;
|
|
13181
13276
|
Signature.displayName = "NutSignature";
|
|
13182
13277
|
const defaultProps$K = {
|
|
@@ -14859,10 +14954,13 @@ var __publicField = (obj, key, value) => {
|
|
|
14859
14954
|
if (childCount <= 1)
|
|
14860
14955
|
return;
|
|
14861
14956
|
stopAutoPlay();
|
|
14862
|
-
swiperRef.current.autoplayTimer = setTimeout(
|
|
14863
|
-
|
|
14864
|
-
|
|
14865
|
-
|
|
14957
|
+
swiperRef.current.autoplayTimer = setTimeout(
|
|
14958
|
+
() => {
|
|
14959
|
+
next();
|
|
14960
|
+
autoplay();
|
|
14961
|
+
},
|
|
14962
|
+
Number(duration) + 100 * speed
|
|
14963
|
+
);
|
|
14866
14964
|
};
|
|
14867
14965
|
const move = ({ pace = 0, offset: offset2 = 0 }) => {
|
|
14868
14966
|
if (childCount <= 1)
|
|
@@ -14899,7 +14997,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14899
14997
|
const getStyle = (moveOffset = offset) => {
|
|
14900
14998
|
const target = innerRef.current;
|
|
14901
14999
|
let _offset = 0;
|
|
14902
|
-
const val = (rect == null ? void 0 : rect.height) - height;
|
|
15000
|
+
const val = ((rect == null ? void 0 : rect.height) || 0) - height;
|
|
14903
15001
|
_offset = moveOffset + Number(active === childCount - 1 && val / 2);
|
|
14904
15002
|
target.style.transitionDuration = `${swiperRef.current.moving ? 0 : duration}ms`;
|
|
14905
15003
|
target.style.height = `${Number(height) * childCount}px`;
|
|
@@ -15454,7 +15552,6 @@ var __publicField = (obj, key, value) => {
|
|
|
15454
15552
|
};
|
|
15455
15553
|
const handleTouchStart = (e) => {
|
|
15456
15554
|
touch.start(e);
|
|
15457
|
-
pullingRef.current = true;
|
|
15458
15555
|
};
|
|
15459
15556
|
const handleTouchMove = (e) => {
|
|
15460
15557
|
if (props.scrollTop > 0) {
|
|
@@ -15463,17 +15560,16 @@ var __publicField = (obj, key, value) => {
|
|
|
15463
15560
|
if (status === "refreshing" || status === "complete")
|
|
15464
15561
|
return;
|
|
15465
15562
|
touch.move(e);
|
|
15466
|
-
if (
|
|
15467
|
-
|
|
15563
|
+
if (touch.isVertical()) {
|
|
15564
|
+
pullingRef.current = true;
|
|
15565
|
+
setHeight(
|
|
15566
|
+
Math.max(
|
|
15567
|
+
rubberbandIfOutOfBounds(touch.deltaY, 0, 0, headHeight * 5, 0.5),
|
|
15568
|
+
0
|
|
15569
|
+
)
|
|
15570
|
+
);
|
|
15571
|
+
setStatus(height > threshold ? "canRelease" : "pulling");
|
|
15468
15572
|
}
|
|
15469
|
-
e.stopPropagation();
|
|
15470
|
-
setHeight(
|
|
15471
|
-
Math.max(
|
|
15472
|
-
rubberbandIfOutOfBounds(touch.deltaY, 0, 0, headHeight * 5, 0.5),
|
|
15473
|
-
0
|
|
15474
|
-
)
|
|
15475
|
-
);
|
|
15476
|
-
setStatus(height > threshold ? "canRelease" : "pulling");
|
|
15477
15573
|
};
|
|
15478
15574
|
async function doRefresh() {
|
|
15479
15575
|
setHeight(headHeight);
|
|
@@ -15666,7 +15762,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15666
15762
|
...icon.props,
|
|
15667
15763
|
className: `${icon.props.className || ""} icon`
|
|
15668
15764
|
}) : null, children && /* @__PURE__ */ React.createElement("span", { className: "text" }, children), !src && !icon && !children && /* @__PURE__ */ React.createElement(a$c, { className: "icon" })),
|
|
15669
|
-
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)}`)
|
|
15765
|
+
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)}`)
|
|
15670
15766
|
));
|
|
15671
15767
|
};
|
|
15672
15768
|
Avatar.defaultProps = defaultProps$v;
|
|
@@ -15958,49 +16054,59 @@ var __publicField = (obj, key, value) => {
|
|
|
15958
16054
|
closeOnOverlayClick,
|
|
15959
16055
|
lockScroll,
|
|
15960
16056
|
contentClassName,
|
|
15961
|
-
size,
|
|
15962
16057
|
visible,
|
|
16058
|
+
size,
|
|
15963
16059
|
className,
|
|
15964
16060
|
style,
|
|
15965
16061
|
onClose
|
|
15966
16062
|
},
|
|
15967
16063
|
setParams
|
|
15968
16064
|
} = useParams({ ...defaultProps$s, ...props });
|
|
15969
|
-
|
|
15970
|
-
const [
|
|
16065
|
+
const timer = React.useRef(-1);
|
|
16066
|
+
const [innerVisible, setInnerVisible] = usePropsValue({
|
|
16067
|
+
value: visible,
|
|
16068
|
+
defaultValue: void 0,
|
|
16069
|
+
finalValue: false,
|
|
16070
|
+
onChange: (v) => {
|
|
16071
|
+
!v && (onClose == null ? void 0 : onClose());
|
|
16072
|
+
}
|
|
16073
|
+
});
|
|
15971
16074
|
React.useEffect(() => {
|
|
15972
|
-
if (
|
|
15973
|
-
|
|
15974
|
-
} else {
|
|
15975
|
-
hide2();
|
|
16075
|
+
if (innerVisible) {
|
|
16076
|
+
autoClose();
|
|
15976
16077
|
}
|
|
15977
|
-
}, [
|
|
16078
|
+
}, [innerVisible, duration]);
|
|
15978
16079
|
useCustomEvent(
|
|
15979
16080
|
id,
|
|
15980
16081
|
({ status, options }) => {
|
|
15981
16082
|
if (status) {
|
|
16083
|
+
options.visible = true;
|
|
15982
16084
|
setParams(options);
|
|
15983
16085
|
show2();
|
|
15984
16086
|
} else {
|
|
16087
|
+
setParams({ visible: false });
|
|
15985
16088
|
hide2();
|
|
15986
16089
|
}
|
|
15987
16090
|
}
|
|
15988
16091
|
);
|
|
15989
16092
|
const clearTimer = () => {
|
|
15990
|
-
if (timer) {
|
|
15991
|
-
clearTimeout(timer);
|
|
15992
|
-
timer =
|
|
16093
|
+
if (timer.current) {
|
|
16094
|
+
clearTimeout(timer.current);
|
|
16095
|
+
timer.current = -1;
|
|
15993
16096
|
}
|
|
15994
16097
|
};
|
|
16098
|
+
const show2 = () => {
|
|
16099
|
+
setInnerVisible(true);
|
|
16100
|
+
};
|
|
15995
16101
|
const hide2 = () => {
|
|
15996
|
-
|
|
15997
|
-
|
|
16102
|
+
clearTimer();
|
|
16103
|
+
setInnerVisible(false);
|
|
15998
16104
|
};
|
|
15999
|
-
const
|
|
16105
|
+
const autoClose = () => {
|
|
16000
16106
|
clearTimer();
|
|
16001
|
-
SetOpenState(true);
|
|
16002
16107
|
if (duration) {
|
|
16003
|
-
timer = window.setTimeout(() => {
|
|
16108
|
+
timer.current = window.setTimeout(() => {
|
|
16109
|
+
setParams({ visible: false });
|
|
16004
16110
|
hide2();
|
|
16005
16111
|
}, duration * 1e3);
|
|
16006
16112
|
}
|
|
@@ -16031,10 +16137,10 @@ var __publicField = (obj, key, value) => {
|
|
|
16031
16137
|
"nut-toast-has-icon": icon,
|
|
16032
16138
|
[`nut-toast-${size}`]: true
|
|
16033
16139
|
});
|
|
16034
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null,
|
|
16140
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, innerVisible ? /* @__PURE__ */ React.createElement(
|
|
16035
16141
|
Overlay,
|
|
16036
16142
|
{
|
|
16037
|
-
visible:
|
|
16143
|
+
visible: innerVisible,
|
|
16038
16144
|
style,
|
|
16039
16145
|
className: `${classPrefix$8}__overlay-default ${className}`,
|
|
16040
16146
|
closeOnOverlayClick,
|
|
@@ -16210,7 +16316,6 @@ var __publicField = (obj, key, value) => {
|
|
|
16210
16316
|
__publicField(AnimatingNumbers, "displayName", "NutAnimatingNumbers");
|
|
16211
16317
|
__publicField(AnimatingNumbers, "CountUp", CountUp);
|
|
16212
16318
|
AnimatingNumbers.CountUp = CountUp;
|
|
16213
|
-
const warn = console.warn;
|
|
16214
16319
|
const defaultProps$o = {
|
|
16215
16320
|
...ComponentDefaults,
|
|
16216
16321
|
className: "",
|
|
@@ -16278,7 +16383,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16278
16383
|
});
|
|
16279
16384
|
audioCtx.onEnded(() => {
|
|
16280
16385
|
if (props.loop) {
|
|
16281
|
-
warn(locale.audio.tips || "onPlayEnd事件在loop=false时才会触发");
|
|
16386
|
+
console.warn(locale.audio.tips || "onPlayEnd事件在loop=false时才会触发");
|
|
16282
16387
|
} else {
|
|
16283
16388
|
props.onPlayEnd && props.onPlayEnd(audioCtx);
|
|
16284
16389
|
}
|
|
@@ -16999,7 +17104,9 @@ var __publicField = (obj, key, value) => {
|
|
|
16999
17104
|
)
|
|
17000
17105
|
);
|
|
17001
17106
|
};
|
|
17002
|
-
const CountDown = React.forwardRef(
|
|
17107
|
+
const CountDown = React.forwardRef(
|
|
17108
|
+
InternalCountDown
|
|
17109
|
+
);
|
|
17003
17110
|
CountDown.defaultProps = defaultProps$k;
|
|
17004
17111
|
CountDown.displayName = "NutCountDown";
|
|
17005
17112
|
const defaultProps$j = {
|
|
@@ -17152,18 +17259,18 @@ var __publicField = (obj, key, value) => {
|
|
|
17152
17259
|
}
|
|
17153
17260
|
};
|
|
17154
17261
|
const verifyEllipsis = async () => {
|
|
17155
|
-
var _a2, _b2, _c2, _d2, _e, _f;
|
|
17262
|
+
var _a2, _b2, _c2, _d2, _e, _f, _g;
|
|
17156
17263
|
const refe = await getRectByTaro(rootContain.current);
|
|
17157
17264
|
if (refe && refe.height && refe.height > maxHeight.current) {
|
|
17158
17265
|
if (direction === "end") {
|
|
17159
|
-
ellipsis.current.leading = (
|
|
17266
|
+
ellipsis.current.leading = (_d2 = (_a2 = ellipsis.current) == null ? void 0 : _a2.leading) == null ? void 0 : _d2.slice(
|
|
17160
17267
|
0,
|
|
17161
|
-
((_b2 = ellipsis.current) == null ? void 0 : _b2.leading.length) - 1
|
|
17268
|
+
(((_c2 = (_b2 = ellipsis.current) == null ? void 0 : _b2.leading) == null ? void 0 : _c2.length) || 0) - 1
|
|
17162
17269
|
);
|
|
17163
17270
|
} else {
|
|
17164
|
-
ellipsis.current.tailing = (
|
|
17271
|
+
ellipsis.current.tailing = (_g = (_e = ellipsis.current) == null ? void 0 : _e.tailing) == null ? void 0 : _g.slice(
|
|
17165
17272
|
1,
|
|
17166
|
-
(
|
|
17273
|
+
(_f = ellipsis.current) == null ? void 0 : _f.tailing.length
|
|
17167
17274
|
);
|
|
17168
17275
|
}
|
|
17169
17276
|
assignContent();
|
|
@@ -18095,8 +18202,8 @@ var __publicField = (obj, key, value) => {
|
|
|
18095
18202
|
return [columns2.key, columns2.render];
|
|
18096
18203
|
});
|
|
18097
18204
|
};
|
|
18098
|
-
const renderBodyTds = (item) => {
|
|
18099
|
-
return sortDataItem().map(([value, render]
|
|
18205
|
+
const renderBodyTds = (item, rowIndex) => {
|
|
18206
|
+
return sortDataItem().map(([value, render]) => {
|
|
18100
18207
|
return /* @__PURE__ */ React.createElement(
|
|
18101
18208
|
"span",
|
|
18102
18209
|
{
|
|
@@ -18106,13 +18213,13 @@ var __publicField = (obj, key, value) => {
|
|
|
18106
18213
|
),
|
|
18107
18214
|
key: value
|
|
18108
18215
|
},
|
|
18109
|
-
typeof item[value] === "function" || typeof render === "function" ? /* @__PURE__ */ React.createElement("div", null, render ? render(item) : item[value](item)) : item[value]
|
|
18216
|
+
typeof item[value] === "function" || typeof render === "function" ? /* @__PURE__ */ React.createElement("div", null, render ? render(item, rowIndex) : item[value](item)) : item[value]
|
|
18110
18217
|
);
|
|
18111
18218
|
});
|
|
18112
18219
|
};
|
|
18113
18220
|
const renderBoyTrs = () => {
|
|
18114
|
-
return curData.map((item,
|
|
18115
|
-
return /* @__PURE__ */ React.createElement("div", { className: bodyClassPrefix, key:
|
|
18221
|
+
return curData.map((item, rowIndex) => {
|
|
18222
|
+
return /* @__PURE__ */ React.createElement("div", { className: bodyClassPrefix, key: rowIndex }, renderBodyTds(item, rowIndex));
|
|
18116
18223
|
});
|
|
18117
18224
|
};
|
|
18118
18225
|
return /* @__PURE__ */ React.createElement("div", { className: cls, style, ...rest }, /* @__PURE__ */ React.createElement(
|
|
@@ -18501,7 +18608,7 @@ var __publicField = (obj, key, value) => {
|
|
|
18501
18608
|
}
|
|
18502
18609
|
return positions;
|
|
18503
18610
|
};
|
|
18504
|
-
const binarySearch = (positionsList, value = 0
|
|
18611
|
+
const binarySearch = (positionsList, horizontal, value = 0) => {
|
|
18505
18612
|
let start = 0;
|
|
18506
18613
|
let end = positionsList.length - 1;
|
|
18507
18614
|
let tempIndex = null;
|
|
@@ -18644,7 +18751,7 @@ var __publicField = (obj, key, value) => {
|
|
|
18644
18751
|
const listScroll = (e) => {
|
|
18645
18752
|
const scrollTop = e.detail ? e.detail.scrollTop : e.target.scrollTop;
|
|
18646
18753
|
const scrollSize = Math.floor(scrollTop);
|
|
18647
|
-
const startIndex = binarySearch(positions,
|
|
18754
|
+
const startIndex = binarySearch(positions, false, scrollSize);
|
|
18648
18755
|
const overStart = startIndex - overscan > -1 ? startIndex - overscan : 0;
|
|
18649
18756
|
const endIndex = end();
|
|
18650
18757
|
if (!itemEqual) {
|
|
@@ -18809,7 +18916,9 @@ var __publicField = (obj, key, value) => {
|
|
|
18809
18916
|
);
|
|
18810
18917
|
})));
|
|
18811
18918
|
};
|
|
18812
|
-
const Barrage = React.forwardRef(
|
|
18919
|
+
const Barrage = React.forwardRef(
|
|
18920
|
+
InternalBarrage
|
|
18921
|
+
);
|
|
18813
18922
|
Barrage.defaultProps = defaultProps$5;
|
|
18814
18923
|
Barrage.displayName = "NutBarrage";
|
|
18815
18924
|
const defaultProps$4 = {
|
|
@@ -19089,7 +19198,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19089
19198
|
return console.warn(`传入的值:${num}不是一个数字`);
|
|
19090
19199
|
}
|
|
19091
19200
|
num = parseFloat(num);
|
|
19092
|
-
const numPow =
|
|
19201
|
+
const numPow = 10 ** digit;
|
|
19093
19202
|
return (Math.round((num + Number.EPSILON) * numPow) / numPow).toFixed(digit);
|
|
19094
19203
|
};
|
|
19095
19204
|
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 {
|