@nutui/nutui-react-taro 3.0.14 → 3.0.16
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 +27 -0
- package/dist/cjs/packages/button/style/button.scss +3 -0
- package/dist/cjs/packages/button/style/style.css +3 -3
- package/dist/cjs/packages/button/style/style.harmony.css +12 -0
- package/dist/cjs/packages/button/style-jmapp/button.scss +3 -0
- package/dist/cjs/packages/button/style-jmapp/style.css +3 -3
- package/dist/cjs/packages/button/style-jrkf/button.scss +3 -0
- package/dist/cjs/packages/button/style-jrkf/style.css +3 -3
- package/dist/cjs/packages/calendarcard/calendarcard.js +10 -4
- package/dist/cjs/packages/calendaritem/calendaritem.d.ts +1 -1
- package/dist/cjs/packages/calendaritem/calendaritem.js +3 -3
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/datepicker/utils.js +22 -37
- package/dist/cjs/packages/dialog/dialog.js +2 -7
- package/dist/cjs/packages/formitem/formitem.js +2 -2
- package/dist/cjs/packages/formitem/style/formitem.scss +14 -15
- package/dist/cjs/packages/formitem/style/style.css +9 -11
- package/dist/cjs/packages/formitem/style/style.harmony.css +8 -10
- package/dist/cjs/packages/formitem/style-jmapp/formitem.scss +14 -15
- package/dist/cjs/packages/formitem/style-jmapp/style.css +8 -10
- package/dist/cjs/packages/formitem/style-jrkf/formitem.scss +14 -15
- package/dist/cjs/packages/formitem/style-jrkf/style.css +8 -10
- package/dist/cjs/packages/imagepreview/imagepreview.js +25 -4
- package/dist/cjs/packages/noticebar/noticebar.js +66 -42
- package/dist/cjs/packages/overlay/style/overlay.scss +0 -1
- package/dist/cjs/packages/overlay/style/style.css +0 -1
- package/dist/cjs/packages/overlay/style/style.harmony.css +0 -1
- package/dist/cjs/packages/overlay/style-jmapp/overlay.scss +0 -1
- package/dist/cjs/packages/overlay/style-jmapp/style.css +0 -1
- package/dist/cjs/packages/overlay/style-jrkf/overlay.scss +0 -1
- package/dist/cjs/packages/overlay/style-jrkf/style.css +0 -1
- package/dist/cjs/packages/pickerview/pickerroller.js +9 -1
- package/dist/cjs/packages/swiper/index.d.ts +1 -1
- package/dist/cjs/packages/swiper/swiper.js +6 -0
- package/dist/cjs/types/spec/calendar/base.d.ts +3 -1
- package/dist/cjs/types/spec/calendarcard/base.d.ts +1 -0
- package/dist/cjs/types/spec/datepicker/base.d.ts +1 -1
- package/dist/cjs/types/spec/imagepreview/h5.d.ts +4 -1
- package/dist/cjs/types/spec/imagepreview/taro.d.ts +4 -1
- package/dist/cjs/utils/date.d.ts +2 -2
- package/dist/cjs/utils/date.js +2 -2
- package/dist/es/packages/button/style/button.scss +3 -0
- package/dist/es/packages/button/style/style.css +3 -3
- package/dist/es/packages/button/style/style.harmony.css +12 -0
- package/dist/es/packages/button/style-jmapp/button.scss +3 -0
- package/dist/es/packages/button/style-jmapp/style.css +3 -3
- package/dist/es/packages/button/style-jrkf/button.scss +3 -0
- package/dist/es/packages/button/style-jrkf/style.css +3 -3
- package/dist/es/packages/calendarcard/calendarcard.js +11 -5
- package/dist/es/packages/calendaritem/calendaritem.d.ts +1 -1
- package/dist/es/packages/calendaritem/calendaritem.js +3 -3
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/datepicker/utils.js +22 -37
- package/dist/es/packages/dialog/dialog.js +2 -7
- package/dist/es/packages/formitem/formitem.js +2 -2
- package/dist/es/packages/formitem/style/formitem.scss +14 -15
- package/dist/es/packages/formitem/style/style.css +9 -11
- package/dist/es/packages/formitem/style/style.harmony.css +8 -10
- package/dist/es/packages/formitem/style-jmapp/formitem.scss +14 -15
- package/dist/es/packages/formitem/style-jmapp/style.css +8 -10
- package/dist/es/packages/formitem/style-jrkf/formitem.scss +14 -15
- package/dist/es/packages/formitem/style-jrkf/style.css +8 -10
- package/dist/es/packages/imagepreview/imagepreview.js +25 -4
- package/dist/es/packages/noticebar/noticebar.js +67 -43
- package/dist/es/packages/overlay/style/overlay.scss +0 -1
- package/dist/es/packages/overlay/style/style.css +0 -1
- package/dist/es/packages/overlay/style/style.harmony.css +0 -1
- package/dist/es/packages/overlay/style-jmapp/overlay.scss +0 -1
- package/dist/es/packages/overlay/style-jmapp/style.css +0 -1
- package/dist/es/packages/overlay/style-jrkf/overlay.scss +0 -1
- package/dist/es/packages/overlay/style-jrkf/style.css +0 -1
- package/dist/es/packages/pickerview/pickerroller.js +9 -1
- package/dist/es/packages/swiper/index.d.ts +1 -1
- package/dist/es/packages/swiper/swiper.js +7 -1
- package/dist/es/types/spec/calendar/base.d.ts +3 -1
- package/dist/es/types/spec/calendarcard/base.d.ts +4 -0
- package/dist/es/types/spec/datepicker/base.d.ts +1 -1
- package/dist/es/types/spec/imagepreview/h5.d.ts +4 -1
- package/dist/es/types/spec/imagepreview/taro.d.ts +4 -1
- package/dist/es/utils/date.d.ts +2 -2
- package/dist/es/utils/date.js +2 -2
- package/dist/nutui.react.umd.js +145 -101
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +40 -40
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +41 -41
- package/dist/style.css +1 -1
- package/dist/style.scss +37 -37
- package/dist/styles/variables.scss +1 -2
- package/package.json +1 -1
|
@@ -67,7 +67,9 @@ var InternalPickerRoller = function(props, ref) {
|
|
|
67
67
|
var selectValue = function(move) {
|
|
68
68
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(options === null || options === void 0 ? void 0 : options[Math.round(-move / lineSpacing.current)], keyIndex);
|
|
69
69
|
};
|
|
70
|
+
var isScroll = useRef(false);
|
|
70
71
|
var handleTouchStart = function(event) {
|
|
72
|
+
isScroll.current = true;
|
|
71
73
|
touch.start(event);
|
|
72
74
|
setStartY(touch.deltaY.current);
|
|
73
75
|
setStartTime(Date.now());
|
|
@@ -92,6 +94,7 @@ var InternalPickerRoller = function(props, ref) {
|
|
|
92
94
|
} else {
|
|
93
95
|
handleMove(move, 'end');
|
|
94
96
|
}
|
|
97
|
+
isScroll.current = false;
|
|
95
98
|
setTimeout(function() {
|
|
96
99
|
touch.reset();
|
|
97
100
|
}, 0);
|
|
@@ -211,6 +214,11 @@ var InternalPickerRoller = function(props, ref) {
|
|
|
211
214
|
handleTouchMove,
|
|
212
215
|
handleTouchEnd
|
|
213
216
|
]);
|
|
217
|
+
var onTransitionEnd = function() {
|
|
218
|
+
if (!isScroll.current) {
|
|
219
|
+
stopMomentumScroll();
|
|
220
|
+
}
|
|
221
|
+
};
|
|
214
222
|
return /*#__PURE__*/ React.createElement(View, {
|
|
215
223
|
className: "nut-pickerview-list",
|
|
216
224
|
ref: pickerRollerRef
|
|
@@ -223,7 +231,7 @@ var InternalPickerRoller = function(props, ref) {
|
|
|
223
231
|
id: "".concat(classPrefix, "-").concat(uuid),
|
|
224
232
|
ref: rollerRef,
|
|
225
233
|
style: threeDimensional ? touchRollerStyle() : touchTiledStyle(),
|
|
226
|
-
onTransitionEnd:
|
|
234
|
+
onTransitionEnd: onTransitionEnd
|
|
227
235
|
}, threeDimensional && options.map(function(item, index) {
|
|
228
236
|
var _item_value;
|
|
229
237
|
var _obj;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import SwiperItem from "../swiperitem/index";
|
|
3
3
|
import { TaroSwiperProps } from "../../types";
|
|
4
4
|
export type { TaroSwiperProps as SwiperProps } from "../../types";
|
|
5
|
-
type CompoundedComponent = React.ForwardRefExoticComponent<Partial<TaroSwiperProps> &
|
|
5
|
+
type CompoundedComponent = React.ForwardRefExoticComponent<Partial<TaroSwiperProps> & React.RefAttributes<any>> & {
|
|
6
6
|
Item: typeof SwiperItem;
|
|
7
7
|
};
|
|
8
8
|
declare const InnerSwiper: CompoundedComponent;
|
|
@@ -3,7 +3,7 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
|
3
3
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
4
4
|
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
5
5
|
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
6
|
-
import React, { Children, useImperativeHandle, useMemo, useState } from "react";
|
|
6
|
+
import React, { Children, useImperativeHandle, useMemo, useState, useEffect } from "react";
|
|
7
7
|
import { Swiper as TaroSwiper, SwiperItem as TSwiperItem, View } from "@tarojs/components";
|
|
8
8
|
import classNames from "classnames";
|
|
9
9
|
import Indicator from "../indicator/index";
|
|
@@ -48,6 +48,12 @@ export var Swiper = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
|
48
48
|
}, [
|
|
49
49
|
children
|
|
50
50
|
]);
|
|
51
|
+
useEffect(function() {
|
|
52
|
+
setInnerValue(current || defaultValue);
|
|
53
|
+
}, [
|
|
54
|
+
defaultValue,
|
|
55
|
+
current
|
|
56
|
+
]);
|
|
51
57
|
var renderIndicator = function() {
|
|
52
58
|
if (/*#__PURE__*/ React.isValidElement(indicator)) return indicator;
|
|
53
59
|
if (indicator || indicatorDots) {
|
|
@@ -4,6 +4,8 @@ import { BaseProps } from '../../base/props';
|
|
|
4
4
|
export interface CalendarDay {
|
|
5
5
|
day: SimpleValue;
|
|
6
6
|
type: string;
|
|
7
|
+
month?: SimpleValue;
|
|
8
|
+
year?: SimpleValue;
|
|
7
9
|
}
|
|
8
10
|
export interface CalendarMonthInfo {
|
|
9
11
|
curData: string[] | string;
|
|
@@ -121,7 +123,7 @@ export interface BaseCalendar {
|
|
|
121
123
|
/**
|
|
122
124
|
* 点击/选择后触发
|
|
123
125
|
*/
|
|
124
|
-
onDayClick: (data: string) => void
|
|
126
|
+
onDayClick: (data: string[]) => void
|
|
125
127
|
/**
|
|
126
128
|
* 年月子标题到达顶部时触发
|
|
127
129
|
*/
|
|
@@ -20,7 +20,7 @@ export interface BaseDatePicker extends BaseProps {
|
|
|
20
20
|
/**
|
|
21
21
|
* 类时间类型,可选值 date time year-month month-day datehour datetime hour-minutes
|
|
22
22
|
*/
|
|
23
|
-
type: 'date' | 'time' | 'year-month' | 'month-day' | 'datehour' | 'datetime' | 'hour-minutes'
|
|
23
|
+
type: 'date' | 'time' | 'year-month' | 'month-day' | 'datehour' | 'datetime' | 'hour-minutes' | ''
|
|
24
24
|
/**
|
|
25
25
|
* 每列是否展示中文
|
|
26
26
|
*/
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { BaseImagePreview } from './base';
|
|
2
|
-
|
|
2
|
+
import { WebSwiperProps } from "../../../types";
|
|
3
|
+
type props = BaseImagePreview & Omit<WebSwiperProps, 'autoPlay' | 'indicator'>;
|
|
4
|
+
export interface WebImagePreviewProps extends Omit<props, 'autoplay'> {
|
|
3
5
|
}
|
|
6
|
+
export {};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { BaseImagePreview } from './base';
|
|
2
|
-
|
|
2
|
+
import { TaroSwiperProps } from "../../../types";
|
|
3
|
+
type props = Omit<BaseImagePreview, 'autoPlay'> & Omit<TaroSwiperProps, 'autoPlay' | 'autoplay' | 'indicator'>;
|
|
4
|
+
export interface TaroImagePreviewProps extends props {
|
|
3
5
|
autoPlay: boolean;
|
|
4
6
|
showMenuByLongpress: boolean;
|
|
5
7
|
}
|
|
8
|
+
export {};
|
package/dist/es/utils/date.d.ts
CHANGED
|
@@ -60,6 +60,6 @@ export declare const getDaysStatus: (type: string, year: number, month: number)
|
|
|
60
60
|
export declare const getPreMonthDates: (type: string, year: number, month: number, firstDayOfWeek: number) => {
|
|
61
61
|
day: number;
|
|
62
62
|
type: string;
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
year: number;
|
|
64
|
+
month: number;
|
|
65
65
|
}[];
|
package/dist/es/utils/date.js
CHANGED
|
@@ -229,8 +229,8 @@ export var getPreMonthDates = function(type, year, month, firstDayOfWeek) {
|
|
|
229
229
|
return {
|
|
230
230
|
day: k + 1,
|
|
231
231
|
type: type,
|
|
232
|
-
|
|
233
|
-
|
|
232
|
+
year: preYear,
|
|
233
|
+
month: preMonth
|
|
234
234
|
};
|
|
235
235
|
});
|
|
236
236
|
return months.slice(preDates - days);
|