@nutui/nutui-react-taro 1.4.13 → 1.4.14
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/dist/esm/Cascader.js +2 -2
- package/dist/esm/DatePicker.js +3 -2
- package/dist/esm/GridItem.js +1 -1
- package/dist/esm/Input.js +1 -1
- package/dist/esm/Picker.js +2 -1
- package/dist/esm/Tabs.js +1 -1
- package/dist/esm/TextArea.js +1 -1
- package/dist/esm/{cascader.taro-a824b371.js → cascader.taro-eb1fb011.js} +1 -1
- package/dist/esm/{datepicker.taro-a86c6052.js → datepicker.taro-6e9b4b8f.js} +3 -2
- package/dist/esm/{griditem.taro-da155df6.js → griditem.taro-cdb3f119.js} +3 -2
- package/dist/esm/{input.taro-851446b6.js → input.taro-0b72dce2.js} +1 -1
- package/dist/esm/nutui-react.es.js +7 -7
- package/dist/esm/{picker.taro-f32ec88a.js → picker.taro-9ad1b7c5.js} +153 -103
- package/dist/esm/{tabs.taro-07e4adce.js → tabs.taro-6a7524a4.js} +5 -2
- package/dist/esm/{textarea.taro-92a1651c.js → textarea.taro-442e7350.js} +1 -3
- 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/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.mjs +193 -119
- package/dist/nutui.react.umd.js +192 -118
- package/dist/packages/picker/picker.scss +103 -97
- package/dist/packages/swiper/swiper1.scss +65 -0
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/package.json +23 -16
package/dist/nutui.react.mjs
CHANGED
|
@@ -5,14 +5,14 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
/*!
|
|
8
|
-
* @nutui/nutui-react-taro v1.4.
|
|
8
|
+
* @nutui/nutui-react-taro v1.4.14 Thu Apr 06 2023 15:50:10 GMT+0800 (China Standard Time)
|
|
9
9
|
* (c) 2023 @jdf2e.
|
|
10
10
|
* Released under the MIT License.
|
|
11
11
|
*/
|
|
12
12
|
import * as React from "react";
|
|
13
13
|
import React__default, { useCallback, useState, useEffect, createContext, useMemo, useContext, useRef, forwardRef, useImperativeHandle, useLayoutEffect, Component, memo } from "react";
|
|
14
14
|
import Taro, { redirectTo, navigateTo, getEnv, usePageScroll, getSystemInfoSync, nextTick, createSelectorQuery, uploadFile, chooseMedia, chooseImage, pageScrollTo, useReady, createInnerAudioContext, getSystemInfo, createOffscreenCanvas, canvasToTempFilePath } from "@tarojs/taro";
|
|
15
|
-
import { View, ScrollView, Image as Image$2 } from "@tarojs/components";
|
|
15
|
+
import { View, ScrollView, PickerView, PickerViewColumn, Image as Image$2 } from "@tarojs/components";
|
|
16
16
|
import ReactDOM, { createPortal, unstable_batchedUpdates } from "react-dom";
|
|
17
17
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
18
18
|
var classnameExports = {};
|
|
@@ -3282,6 +3282,7 @@ const GridItem = (props) => {
|
|
|
3282
3282
|
direction,
|
|
3283
3283
|
iconClassPrefix,
|
|
3284
3284
|
iconFontClassName,
|
|
3285
|
+
className,
|
|
3285
3286
|
onClick,
|
|
3286
3287
|
...rest
|
|
3287
3288
|
} = {
|
|
@@ -3289,6 +3290,7 @@ const GridItem = (props) => {
|
|
|
3289
3290
|
...props
|
|
3290
3291
|
};
|
|
3291
3292
|
const b2 = cn("grid-item");
|
|
3293
|
+
const classes = classNames(b2(), className);
|
|
3292
3294
|
const context = useContext(GridContext);
|
|
3293
3295
|
const pxCheck2 = (value) => {
|
|
3294
3296
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
@@ -3344,16 +3346,25 @@ const GridItem = (props) => {
|
|
|
3344
3346
|
index
|
|
3345
3347
|
);
|
|
3346
3348
|
};
|
|
3347
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
3348
|
-
|
|
3349
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
3350
|
+
"div",
|
|
3349
3351
|
{
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
}
|
|
3356
|
-
|
|
3352
|
+
className: classes,
|
|
3353
|
+
style: rootStyle(),
|
|
3354
|
+
...rest,
|
|
3355
|
+
onClick: handleClick
|
|
3356
|
+
},
|
|
3357
|
+
/* @__PURE__ */ React__default.createElement("div", { className: contentClass() }, icon && isIconName() ? /* @__PURE__ */ React__default.createElement(
|
|
3358
|
+
Icon$1,
|
|
3359
|
+
{
|
|
3360
|
+
classPrefix: iconClassPrefix,
|
|
3361
|
+
fontClassName: iconFontClassName,
|
|
3362
|
+
name: icon,
|
|
3363
|
+
size: iconSize || parentIconSize,
|
|
3364
|
+
color: iconColor || parentIconColor
|
|
3365
|
+
}
|
|
3366
|
+
) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, icon), text && /* @__PURE__ */ React__default.createElement("div", { className: "nut-grid-item__text", style: { fontSize, color } }, text), children && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children))
|
|
3367
|
+
);
|
|
3357
3368
|
};
|
|
3358
3369
|
GridItem.defaultProps = defaultProps$1l;
|
|
3359
3370
|
GridItem.displayName = "NutGridItem";
|
|
@@ -4871,7 +4882,7 @@ const Tabs = (props) => {
|
|
|
4871
4882
|
const childProps = child == null ? void 0 : child.props;
|
|
4872
4883
|
if ((childProps == null ? void 0 : childProps.title) || (childProps == null ? void 0 : childProps.paneKey)) {
|
|
4873
4884
|
title.title = childProps == null ? void 0 : childProps.title;
|
|
4874
|
-
title.paneKey = (childProps == null ? void 0 : childProps.paneKey
|
|
4885
|
+
title.paneKey = getPaneKey(childProps == null ? void 0 : childProps.paneKey, idx);
|
|
4875
4886
|
title.disabled = childProps == null ? void 0 : childProps.disabled;
|
|
4876
4887
|
title.index = idx;
|
|
4877
4888
|
if (title.paneKey === value) {
|
|
@@ -4905,6 +4916,9 @@ const Tabs = (props) => {
|
|
|
4905
4916
|
transform: direction === "horizontal" ? `translate3d(-${index * 100}%, 0, 0)` : `translate3d( 0,-${index * 100}%, 0)`,
|
|
4906
4917
|
transitionDuration: `${animatedTime}ms`
|
|
4907
4918
|
};
|
|
4919
|
+
const getPaneKey = (paneKey, index2) => {
|
|
4920
|
+
return typeof paneKey === "string" ? paneKey : String(paneKey || index2);
|
|
4921
|
+
};
|
|
4908
4922
|
const tabChange = (item, index2) => {
|
|
4909
4923
|
onClick && onClick(item);
|
|
4910
4924
|
if (item.disabled) {
|
|
@@ -4974,7 +4988,7 @@ const Tabs = (props) => {
|
|
|
4974
4988
|
...child.props,
|
|
4975
4989
|
activeKey: value
|
|
4976
4990
|
};
|
|
4977
|
-
if (String(value) !==
|
|
4991
|
+
if (String(value) !== getPaneKey((_a = child.props) == null ? void 0 : _a.paneKey, idx) && autoHeight) {
|
|
4978
4992
|
childProps = {
|
|
4979
4993
|
...childProps,
|
|
4980
4994
|
autoHeightClassName: "inactive"
|
|
@@ -4999,7 +5013,7 @@ const Utils = {
|
|
|
4999
5013
|
* @return {String}
|
|
5000
5014
|
*/
|
|
5001
5015
|
getWhatDay(year, month, day) {
|
|
5002
|
-
const date =
|
|
5016
|
+
const date = new Date(`${year}/${month}/${day}`);
|
|
5003
5017
|
const index = date.getDay();
|
|
5004
5018
|
const dayNames = [
|
|
5005
5019
|
"星期日",
|
|
@@ -5017,7 +5031,7 @@ const Utils = {
|
|
|
5017
5031
|
* @return {Number}
|
|
5018
5032
|
*/
|
|
5019
5033
|
getMonthPreDay(year, month) {
|
|
5020
|
-
const date =
|
|
5034
|
+
const date = new Date(`${year}/${month}/01`);
|
|
5021
5035
|
let day = date.getDay();
|
|
5022
5036
|
if (day == 0) {
|
|
5023
5037
|
day = 7;
|
|
@@ -5074,7 +5088,7 @@ const Utils = {
|
|
|
5074
5088
|
*/
|
|
5075
5089
|
getDay(i) {
|
|
5076
5090
|
i = i || 0;
|
|
5077
|
-
let date =
|
|
5091
|
+
let date = new Date();
|
|
5078
5092
|
const diff = i * (1e3 * 60 * 60 * 24);
|
|
5079
5093
|
date = new Date(date.getTime() + diff);
|
|
5080
5094
|
return this.date2Str(date);
|
|
@@ -5266,7 +5280,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
5266
5280
|
};
|
|
5267
5281
|
const isCurrDay = (month, day) => {
|
|
5268
5282
|
const date = `${month.curData[0]}-${month.curData[1]}-${day}`;
|
|
5269
|
-
return Utils.isEqual(date, Utils.date2Str(
|
|
5283
|
+
return Utils.isEqual(date, Utils.date2Str(new Date()));
|
|
5270
5284
|
};
|
|
5271
5285
|
const confirm = () => {
|
|
5272
5286
|
const { type: type2 } = props;
|
|
@@ -5602,8 +5616,8 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
5602
5616
|
}
|
|
5603
5617
|
});
|
|
5604
5618
|
} else {
|
|
5605
|
-
const currentYear2 =
|
|
5606
|
-
const currentMonth =
|
|
5619
|
+
const currentYear2 = new Date().getFullYear();
|
|
5620
|
+
const currentMonth = new Date().getMonth() + 1;
|
|
5607
5621
|
const currentYearMonthIndex = state.monthsData.findIndex((item) => {
|
|
5608
5622
|
return +item.curData[0] === currentYear2 && +item.curData[1] === currentMonth;
|
|
5609
5623
|
});
|
|
@@ -6724,7 +6738,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
6724
6738
|
const rotation = 20;
|
|
6725
6739
|
const moving = useRef(false);
|
|
6726
6740
|
let timer;
|
|
6727
|
-
const
|
|
6741
|
+
const listRef = useRef(null);
|
|
6728
6742
|
const rollerRef = useRef(null);
|
|
6729
6743
|
const pickerSlotRef = useRef(null);
|
|
6730
6744
|
const [startTime, setStartTime] = useState(0);
|
|
@@ -6847,7 +6861,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
6847
6861
|
}
|
|
6848
6862
|
};
|
|
6849
6863
|
const getReference = async () => {
|
|
6850
|
-
const refe = await getRectByTaro(
|
|
6864
|
+
const refe = await getRectByTaro(listRef == null ? void 0 : listRef.current);
|
|
6851
6865
|
lineSpacing.current = refe.height ? refe.height : 36;
|
|
6852
6866
|
modifyStatus(true);
|
|
6853
6867
|
};
|
|
@@ -6930,7 +6944,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
6930
6944
|
})
|
|
6931
6945
|
),
|
|
6932
6946
|
/* @__PURE__ */ React__default.createElement("div", { className: "nut-picker-mask" }),
|
|
6933
|
-
/* @__PURE__ */ React__default.createElement("div", { className: "nut-picker-indicator", ref:
|
|
6947
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "nut-picker-indicator", ref: listRef })
|
|
6934
6948
|
);
|
|
6935
6949
|
};
|
|
6936
6950
|
const PickerSlot = React__default.forwardRef(InternalPickerSlot);
|
|
@@ -6973,44 +6987,65 @@ const InternalPicker = (props, ref) => {
|
|
|
6973
6987
|
const [columnsList, setColumnsList] = useState([]);
|
|
6974
6988
|
const b2 = cn("picker");
|
|
6975
6989
|
const isConfirmEvent = useRef(false);
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6990
|
+
const formatCascade = (columns, values) => {
|
|
6991
|
+
const formatted = [];
|
|
6992
|
+
let cursor = {
|
|
6993
|
+
text: "",
|
|
6994
|
+
value: "",
|
|
6995
|
+
children: columns
|
|
6996
|
+
};
|
|
6997
|
+
let columnIndex2 = 0;
|
|
6998
|
+
while (cursor && cursor.children) {
|
|
6999
|
+
const options = cursor.children;
|
|
7000
|
+
const value = values[columnIndex2];
|
|
7001
|
+
let index = options.findIndex(
|
|
7002
|
+
(columnItem) => columnItem.value === value
|
|
7003
|
+
);
|
|
7004
|
+
if (index === -1)
|
|
7005
|
+
index = 0;
|
|
7006
|
+
cursor = cursor.children[index];
|
|
7007
|
+
columnIndex2++;
|
|
7008
|
+
formatted.push(options);
|
|
6981
7009
|
}
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
7010
|
+
return formatted;
|
|
7011
|
+
};
|
|
7012
|
+
const columnsType = () => {
|
|
7013
|
+
const firstColumn = listData[0];
|
|
7014
|
+
if (firstColumn) {
|
|
7015
|
+
if (Array.isArray(firstColumn)) {
|
|
7016
|
+
return "multiple";
|
|
7017
|
+
}
|
|
7018
|
+
if ("children" in firstColumn) {
|
|
7019
|
+
return "cascade";
|
|
7020
|
+
}
|
|
6988
7021
|
}
|
|
6989
|
-
|
|
7022
|
+
return "single";
|
|
7023
|
+
};
|
|
7024
|
+
const normalListData = () => {
|
|
7025
|
+
const type = columnsType();
|
|
7026
|
+
switch (type) {
|
|
7027
|
+
case "multiple":
|
|
7028
|
+
return listData;
|
|
7029
|
+
case "cascade":
|
|
7030
|
+
return formatCascade(listData, chooseValueData);
|
|
7031
|
+
default:
|
|
7032
|
+
return [listData];
|
|
7033
|
+
}
|
|
7034
|
+
};
|
|
7035
|
+
const init = () => {
|
|
7036
|
+
const normalData = normalListData();
|
|
7037
|
+
setColumnsList(normalData);
|
|
7038
|
+
};
|
|
6990
7039
|
useEffect(() => {
|
|
6991
7040
|
init();
|
|
6992
7041
|
}, [listData]);
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
let movings = false;
|
|
6999
|
-
refs.forEach((_ref) => {
|
|
7000
|
-
if (_ref.moving)
|
|
7001
|
-
movings = true;
|
|
7002
|
-
_ref.stopMomentum();
|
|
7003
|
-
});
|
|
7004
|
-
if (movings) {
|
|
7005
|
-
isConfirmEvent.current = true;
|
|
7006
|
-
} else {
|
|
7007
|
-
onConfirm && onConfirm(chooseValueData, selectedOptions());
|
|
7042
|
+
useEffect(() => {
|
|
7043
|
+
if (defaultValueData && defaultValueData.length !== 0 && defaultValueData.toString() !== chooseValueData.toString() && !currentValue2.length) {
|
|
7044
|
+
const data = [...defaultValueData];
|
|
7045
|
+
setchooseValueData(data);
|
|
7046
|
+
setColumnsList(normalListData());
|
|
7008
7047
|
}
|
|
7009
|
-
|
|
7010
|
-
setTimeout(() => {
|
|
7011
|
-
isConfirmEvent.current = false;
|
|
7012
|
-
}, 0);
|
|
7013
|
-
};
|
|
7048
|
+
}, [defaultValueData]);
|
|
7014
7049
|
const selectedOptions = () => {
|
|
7015
7050
|
const optins = [];
|
|
7016
7051
|
columnsList.map((column, index) => {
|
|
@@ -7027,6 +7062,18 @@ const InternalPicker = (props, ref) => {
|
|
|
7027
7062
|
});
|
|
7028
7063
|
return optins;
|
|
7029
7064
|
};
|
|
7065
|
+
useEffect(() => {
|
|
7066
|
+
Taro.getEnv() !== "WEB" && setCurrentValue(defaultValuesConvert());
|
|
7067
|
+
onChange && onChange(columnIndex, chooseValueData, selectedOptions());
|
|
7068
|
+
if (isConfirmEvent.current) {
|
|
7069
|
+
isConfirmEvent.current = false;
|
|
7070
|
+
onConfirm && onConfirm(chooseValueData, selectedOptions());
|
|
7071
|
+
}
|
|
7072
|
+
}, [chooseValueData]);
|
|
7073
|
+
const closeActionSheet = () => {
|
|
7074
|
+
onClose && onClose(chooseValueData, selectedOptions());
|
|
7075
|
+
onCloseUpdate && onCloseUpdate(chooseValueData, selectedOptions(), pickerRef);
|
|
7076
|
+
};
|
|
7030
7077
|
const chooseItem = (option, columnIndex2) => {
|
|
7031
7078
|
if (option && Object.keys(option).length) {
|
|
7032
7079
|
if (chooseValueData[columnIndex2] !== option.value) {
|
|
@@ -7039,8 +7086,7 @@ const InternalPicker = (props, ref) => {
|
|
|
7039
7086
|
chooseValueData[index + 1] = cursor.children[0].value;
|
|
7040
7087
|
setchooseValueData([...chooseValueData]);
|
|
7041
7088
|
index++;
|
|
7042
|
-
|
|
7043
|
-
cursor = cc;
|
|
7089
|
+
cursor = cursor.children[0];
|
|
7044
7090
|
}
|
|
7045
7091
|
if (cursor && cursor.children) {
|
|
7046
7092
|
chooseValueData[index + 1] = "";
|
|
@@ -7061,65 +7107,68 @@ const InternalPicker = (props, ref) => {
|
|
|
7061
7107
|
}
|
|
7062
7108
|
}
|
|
7063
7109
|
};
|
|
7064
|
-
const
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7110
|
+
const confirm = () => {
|
|
7111
|
+
let movings = false;
|
|
7112
|
+
refs.forEach((_ref) => {
|
|
7113
|
+
if (_ref.moving)
|
|
7114
|
+
movings = true;
|
|
7115
|
+
_ref.stopMomentum();
|
|
7116
|
+
});
|
|
7117
|
+
if (movings) {
|
|
7118
|
+
isConfirmEvent.current = true;
|
|
7119
|
+
} else {
|
|
7120
|
+
onConfirm && onConfirm(chooseValueData, selectedOptions());
|
|
7073
7121
|
}
|
|
7122
|
+
onClose && onClose(chooseValueData, selectedOptions());
|
|
7123
|
+
setTimeout(() => {
|
|
7124
|
+
isConfirmEvent.current = false;
|
|
7125
|
+
}, 0);
|
|
7074
7126
|
};
|
|
7075
|
-
const
|
|
7076
|
-
|
|
7077
|
-
if (firstColumn) {
|
|
7078
|
-
if (Array.isArray(firstColumn)) {
|
|
7079
|
-
return "multiple";
|
|
7080
|
-
}
|
|
7081
|
-
if ("children" in firstColumn) {
|
|
7082
|
-
return "cascade";
|
|
7083
|
-
}
|
|
7084
|
-
}
|
|
7085
|
-
return "single";
|
|
7127
|
+
const renderToolbar = () => {
|
|
7128
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: b2("control") }, /* @__PURE__ */ React__default.createElement("span", { className: b2("cancel-btn"), onClick: () => closeActionSheet() }, locale.cancel), /* @__PURE__ */ React__default.createElement("div", { className: b2("title") }, title || ""), /* @__PURE__ */ React__default.createElement("span", { className: b2("confirm-btn"), onClick: confirm }, locale.confirm));
|
|
7086
7129
|
};
|
|
7087
|
-
const
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
formatted.push(options);
|
|
7130
|
+
const [currentValue2, setCurrentValue] = useState([]);
|
|
7131
|
+
const [pickingStatus, setPickingStatus] = useState(false);
|
|
7132
|
+
const defaultValuesConvert = () => {
|
|
7133
|
+
const defaultIndexs = [];
|
|
7134
|
+
if (chooseValueData.length > 0) {
|
|
7135
|
+
chooseValueData.forEach((value, index) => {
|
|
7136
|
+
for (let i = 0; i < columnsList[index].length; i++) {
|
|
7137
|
+
if (columnsList[index][i].value === value) {
|
|
7138
|
+
defaultIndexs.push(i);
|
|
7139
|
+
break;
|
|
7140
|
+
}
|
|
7141
|
+
}
|
|
7142
|
+
});
|
|
7143
|
+
} else if (columnsList && columnsList.length > 0) {
|
|
7144
|
+
columnsList.forEach((item) => {
|
|
7145
|
+
defaultIndexs.push(0);
|
|
7146
|
+
item.length > 0 && chooseValueData.push(item[0].value);
|
|
7147
|
+
});
|
|
7106
7148
|
}
|
|
7107
|
-
return
|
|
7149
|
+
return defaultIndexs;
|
|
7108
7150
|
};
|
|
7109
|
-
const
|
|
7110
|
-
|
|
7111
|
-
const normalData = normalListData();
|
|
7112
|
-
setColumnsList(normalData);
|
|
7113
|
-
normalData.length > 0 && normalData.map((item) => {
|
|
7114
|
-
item[0] && data.push(item[0].value);
|
|
7115
|
-
return item;
|
|
7116
|
-
});
|
|
7117
|
-
if (!defaultValueData && chooseValueData.length === 0) {
|
|
7118
|
-
setchooseValueData([...data]);
|
|
7119
|
-
}
|
|
7151
|
+
const pickerStart = () => {
|
|
7152
|
+
setPickingStatus(true);
|
|
7120
7153
|
};
|
|
7121
|
-
const
|
|
7122
|
-
|
|
7154
|
+
const pickerEnd = () => {
|
|
7155
|
+
setPickingStatus(false);
|
|
7156
|
+
};
|
|
7157
|
+
const pickerChange = (data) => {
|
|
7158
|
+
const prevDefaultValue = currentValue2;
|
|
7159
|
+
let changeIndex = 0;
|
|
7160
|
+
console.log("chage", data);
|
|
7161
|
+
const list = data.detail.value;
|
|
7162
|
+
for (let i = 0, len = list.length; i < len; i++) {
|
|
7163
|
+
if (prevDefaultValue[i] !== list[i]) {
|
|
7164
|
+
changeIndex = i;
|
|
7165
|
+
break;
|
|
7166
|
+
}
|
|
7167
|
+
}
|
|
7168
|
+
chooseItem(
|
|
7169
|
+
columnsList[changeIndex][data.detail.value[changeIndex]],
|
|
7170
|
+
changeIndex
|
|
7171
|
+
);
|
|
7123
7172
|
};
|
|
7124
7173
|
return /* @__PURE__ */ React__default.createElement(
|
|
7125
7174
|
Popup,
|
|
@@ -7139,7 +7188,7 @@ const InternalPicker = (props, ref) => {
|
|
|
7139
7188
|
catchMove: true
|
|
7140
7189
|
},
|
|
7141
7190
|
renderToolbar(),
|
|
7142
|
-
/* @__PURE__ */ React__default.createElement("div", { className: b2("panel"), ref: pickerRef }, columnsList == null ? void 0 : columnsList.map((item, index) => {
|
|
7191
|
+
/* @__PURE__ */ React__default.createElement("div", { className: b2("panel"), ref: pickerRef }, Taro.getEnv() === "WEB" ? columnsList == null ? void 0 : columnsList.map((item, index) => {
|
|
7143
7192
|
return /* @__PURE__ */ React__default.createElement(
|
|
7144
7193
|
PickerSlot$1,
|
|
7145
7194
|
{
|
|
@@ -7154,7 +7203,30 @@ const InternalPicker = (props, ref) => {
|
|
|
7154
7203
|
itemShow: isVisible
|
|
7155
7204
|
}
|
|
7156
7205
|
);
|
|
7157
|
-
})
|
|
7206
|
+
}) : /* @__PURE__ */ React__default.createElement(
|
|
7207
|
+
PickerView,
|
|
7208
|
+
{
|
|
7209
|
+
ref: pickerRef,
|
|
7210
|
+
value: currentValue2,
|
|
7211
|
+
immediateChange: true,
|
|
7212
|
+
onPickStart: pickerStart,
|
|
7213
|
+
onChange: pickerChange,
|
|
7214
|
+
onPickEnd: pickerEnd,
|
|
7215
|
+
className: "picker-view-panel"
|
|
7216
|
+
},
|
|
7217
|
+
columnsList == null ? void 0 : columnsList.map((column, index) => {
|
|
7218
|
+
return /* @__PURE__ */ React__default.createElement(PickerViewColumn, { key: `col${index}` }, column.map((item, index2) => {
|
|
7219
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
7220
|
+
View,
|
|
7221
|
+
{
|
|
7222
|
+
key: item.value || index2,
|
|
7223
|
+
className: "nut-picker-roller-item-title"
|
|
7224
|
+
},
|
|
7225
|
+
/* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.text || item)
|
|
7226
|
+
);
|
|
7227
|
+
}));
|
|
7228
|
+
})
|
|
7229
|
+
))
|
|
7158
7230
|
)
|
|
7159
7231
|
);
|
|
7160
7232
|
};
|
|
@@ -7172,7 +7244,7 @@ const ConfigContext = createContext(null);
|
|
|
7172
7244
|
const useConfig = () => {
|
|
7173
7245
|
return useContext(ConfigContext) ?? getDefaultConfig();
|
|
7174
7246
|
};
|
|
7175
|
-
const currentYear =
|
|
7247
|
+
const currentYear = new Date().getFullYear();
|
|
7176
7248
|
const defaultProps$_ = {
|
|
7177
7249
|
modelValue: null,
|
|
7178
7250
|
visible: false,
|
|
@@ -7459,11 +7531,12 @@ const DatePicker = (props) => {
|
|
|
7459
7531
|
}
|
|
7460
7532
|
}, [currentDate]);
|
|
7461
7533
|
return /* @__PURE__ */ React__default.createElement(
|
|
7462
|
-
|
|
7534
|
+
View,
|
|
7463
7535
|
{
|
|
7464
7536
|
className: `nut-datepicker ${className || ""}`,
|
|
7465
7537
|
style,
|
|
7466
|
-
...rest
|
|
7538
|
+
...rest,
|
|
7539
|
+
catchMove: true
|
|
7467
7540
|
},
|
|
7468
7541
|
listData.length > 0 && /* @__PURE__ */ React__default.createElement(
|
|
7469
7542
|
Picker$1,
|
|
@@ -7953,7 +8026,7 @@ const Input = forwardRef((props, ref) => {
|
|
|
7953
8026
|
if (maxlength && val.length > Number(maxlength)) {
|
|
7954
8027
|
val = val.slice(0, Number(maxlength));
|
|
7955
8028
|
}
|
|
7956
|
-
updateValue(
|
|
8029
|
+
updateValue(val, "onBlur");
|
|
7957
8030
|
onBlur && onBlur(val, event);
|
|
7958
8031
|
};
|
|
7959
8032
|
const handleClickInput = (event) => {
|
|
@@ -9963,6 +10036,7 @@ const TextArea = (props) => {
|
|
|
9963
10036
|
onCompositionEnd: (e) => endComposing(),
|
|
9964
10037
|
onCompositionStart: (e) => startComposing(),
|
|
9965
10038
|
rows,
|
|
10039
|
+
maxLength: maxlength < 0 ? 0 : maxlength,
|
|
9966
10040
|
placeholder: placeholder || locale.placeholder
|
|
9967
10041
|
}
|
|
9968
10042
|
),
|
|
@@ -10261,7 +10335,7 @@ class FileItem {
|
|
|
10261
10335
|
constructor() {
|
|
10262
10336
|
__publicField(this, "status", "ready");
|
|
10263
10337
|
__publicField(this, "message", "准备中..");
|
|
10264
|
-
__publicField(this, "uid",
|
|
10338
|
+
__publicField(this, "uid", new Date().getTime().toString());
|
|
10265
10339
|
__publicField(this, "name");
|
|
10266
10340
|
__publicField(this, "url");
|
|
10267
10341
|
__publicField(this, "type");
|
|
@@ -18340,7 +18414,7 @@ const ImagePreview = (props) => {
|
|
|
18340
18414
|
const touches = event.touches;
|
|
18341
18415
|
const events = touches[0];
|
|
18342
18416
|
const events2 = touches[1];
|
|
18343
|
-
const curTouchTime =
|
|
18417
|
+
const curTouchTime = new Date().getTime();
|
|
18344
18418
|
if (curTouchTime - lastTouchEndTime < 300) {
|
|
18345
18419
|
const store12 = store;
|
|
18346
18420
|
if (store12.scale > 1) {
|
|
@@ -18394,7 +18468,7 @@ const ImagePreview = (props) => {
|
|
|
18394
18468
|
}
|
|
18395
18469
|
};
|
|
18396
18470
|
const onTouchEnd = () => {
|
|
18397
|
-
setLastTouchEndTime(
|
|
18471
|
+
setLastTouchEndTime(new Date().getTime());
|
|
18398
18472
|
const store1 = store;
|
|
18399
18473
|
store1.moveable = false;
|
|
18400
18474
|
if (store1.scale < 1.1 && store1.scale > 1 || store1.scale < 1) {
|
|
@@ -20829,7 +20903,7 @@ const InternalBarrage = (props, ref) => {
|
|
|
20829
20903
|
const barrageListSet = useRef(barrageList);
|
|
20830
20904
|
const barrageBody = useRef(null);
|
|
20831
20905
|
const barrageContainer = useRef(null);
|
|
20832
|
-
const timeId = useRef(
|
|
20906
|
+
const timeId = useRef(new Date().getTime());
|
|
20833
20907
|
const timer = useRef(0);
|
|
20834
20908
|
useRef(0);
|
|
20835
20909
|
const b2 = cn("barrage");
|