@nutui/nutui-react-taro 2.0.22 → 2.0.23
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 +13 -0
- package/dist/esm/ActionSheet/style/style.css +1 -1
- package/dist/esm/ActionSheet.js +6 -3
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/Address.js +7 -5
- package/dist/esm/Audio.js +3 -3
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/Calendar.js +7 -4
- package/dist/esm/CalendarCard/style/css.js +1 -0
- package/dist/esm/CalendarCard/style/index.js +2 -0
- package/dist/esm/CalendarCard/style/style.css +1 -0
- package/dist/esm/CalendarCard.js +11 -0
- package/dist/esm/CalendarItem.js +2 -1
- package/dist/esm/Cascader/style/style.css +1 -1
- package/dist/esm/Cascader.js +6 -4
- package/dist/esm/DatePicker/style/style.css +1 -1
- package/dist/esm/DatePicker.js +6 -6
- package/dist/esm/Dialog/style/style.css +1 -1
- package/dist/esm/Dialog.js +4 -2
- package/dist/esm/FixedNav/style/style.css +1 -1
- package/dist/esm/FixedNav.js +5 -2
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/ImagePreview.js +5 -3
- package/dist/esm/Menu/style/style.css +1 -1
- package/dist/esm/Menu.js +5 -3
- package/dist/esm/MenuItem/style/style.css +1 -1
- package/dist/esm/MenuItem.js +4 -2
- package/dist/esm/NoticeBar/style/style.css +1 -1
- package/dist/esm/NoticeBar.js +1 -1
- package/dist/esm/NumberKeyboard/style/style.css +1 -1
- package/dist/esm/NumberKeyboard.js +6 -3
- package/dist/esm/Overlay/style/style.css +1 -1
- package/dist/esm/Overlay.js +4 -1
- package/dist/esm/Picker/style/style.css +1 -1
- package/dist/esm/Picker.js +5 -5
- package/dist/esm/Popover/style/style.css +1 -1
- package/dist/esm/Popover.js +5 -3
- package/dist/esm/Popup/style/style.css +1 -1
- package/dist/esm/Popup.js +5 -2
- package/dist/esm/PullToRefresh.js +2 -2
- package/dist/esm/Range.js +2 -2
- package/dist/esm/SearchBar.js +1 -1
- package/dist/esm/ShortPassword/style/style.css +1 -1
- package/dist/esm/ShortPassword.js +6 -3
- package/dist/esm/SideNavBar/style/style.css +1 -1
- package/dist/esm/SideNavBar.js +6 -3
- package/dist/esm/Sticky.js +2 -2
- package/dist/esm/Swipe.js +2 -2
- package/dist/esm/TimeSelect/style/style.css +1 -1
- package/dist/esm/TimeSelect.js +6 -3
- package/dist/esm/Toast.js +5 -3
- package/dist/esm/Tour/style/style.css +1 -1
- package/dist/esm/Tour.js +6 -4
- package/dist/esm/{actionsheet.taro-4ce9962a.js → actionsheet.taro-c3556cf1.js} +1 -1
- package/dist/esm/{address.taro-4295c3b3.js → address.taro-315e935e.js} +2 -2
- package/dist/esm/{audio.taro-abacd130.js → audio.taro-c98ee643.js} +1 -1
- package/dist/esm/{calendar.taro-802f92e1.js → calendar.taro-7c342305.js} +3 -2
- package/dist/esm/calendarcard.taro-cef184a2.js +400 -0
- package/dist/esm/{calendaritem.taro-f1995224.js → calendaritem.taro-da659861.js} +4 -218
- package/dist/esm/{cascader.taro-9070043a.js → cascader.taro-fe8472ca.js} +1 -1
- package/dist/esm/date-04589b69.js +222 -0
- package/dist/esm/{datepicker.taro-59c99fd7.js → datepicker.taro-5d8f0e45.js} +3 -3
- package/dist/esm/{dialog.taro-eb61fb7a.js → dialog.taro-2e0e7c57.js} +3 -2
- package/dist/esm/{fixednav.taro-0d998d65.js → fixednav.taro-bd96e277.js} +1 -1
- package/dist/esm/get-scroll-parent-3d880563.js +25 -0
- package/dist/esm/{imagepreview.taro-8bbafaa4.js → imagepreview.taro-44db4eba.js} +1 -1
- package/dist/esm/{menu.taro-cad143e1.js → menu.taro-f3e49415.js} +1 -1
- package/dist/esm/{menuitem.taro-60e01217.js → menuitem.taro-0045e4a8.js} +1 -1
- package/dist/esm/{noticebar.taro-bc771bc9.js → noticebar.taro-11fe07b1.js} +7 -8
- package/dist/esm/{numberkeyboard.taro-ec8f8435.js → numberkeyboard.taro-7d5a8c83.js} +1 -1
- package/dist/esm/nutui-react.es.js +46 -43
- package/dist/esm/overlay.taro-ad4b4c8a.js +153 -0
- package/dist/esm/{picker.taro-11d54577.js → picker.taro-4cbe43f7.js} +24 -27
- package/dist/esm/{popover.taro-539d15e4.js → popover.taro-076ba3ac.js} +1 -1
- package/dist/esm/{popup.taro-3273aa87.js → popup.taro-6f68b86f.js} +7 -7
- package/dist/esm/{pulltorefresh.taro-f3ab76c2.js → pulltorefresh.taro-57993124.js} +2 -2
- package/dist/esm/{range.taro-021442f5.js → range.taro-5254c32d.js} +3 -3
- package/dist/esm/{searchbar.taro-7daf43fc.js → searchbar.taro-9729e815.js} +7 -6
- package/dist/esm/{shortpassword.taro-b01da5b3.js → shortpassword.taro-e29734ce.js} +1 -1
- package/dist/esm/{sidenavbar.taro-97230c40.js → sidenavbar.taro-f1b1b6f0.js} +1 -1
- package/dist/esm/{sticky.taro-2b9a5231.js → sticky.taro-bee7a130.js} +1 -21
- package/dist/esm/{swipe.taro-3d5c4b51.js → swipe.taro-20be8e8c.js} +11 -6
- package/dist/esm/{timeselect.taro-892ca807.js → timeselect.taro-58a9729d.js} +1 -1
- package/dist/esm/{toast.taro-3bdf6d67.js → toast.taro-d63f6e12.js} +1 -1
- package/dist/esm/{tour.taro-b38e06a5.js → tour.taro-2c596c1e.js} +1 -1
- package/dist/esm/types/src/packages/calendarcard/__tests__/calendarcard.spec.d.ts +1 -0
- package/dist/esm/types/src/packages/calendarcard/calendarcard.d.ts +24 -0
- package/dist/esm/types/src/packages/calendarcard/calendarcard.taro.d.ts +24 -0
- package/dist/esm/types/src/packages/calendarcard/demo.d.ts +3 -0
- package/dist/esm/types/src/packages/calendarcard/demo.taro.d.ts +3 -0
- package/dist/esm/types/src/packages/calendarcard/icon.d.ts +5 -0
- package/dist/esm/types/src/packages/calendarcard/icon.taro.d.ts +5 -0
- package/dist/esm/types/src/packages/calendarcard/index.d.ts +3 -0
- package/dist/esm/types/src/packages/calendarcard/index.taro.d.ts +3 -0
- package/dist/esm/types/src/packages/calendarcard/types.d.ts +11 -0
- package/dist/esm/types/src/packages/calendarcard/utils.d.ts +19 -0
- package/dist/esm/types/src/packages/datepicker/datepicker.d.ts +2 -1
- package/dist/esm/types/src/packages/datepicker/datepicker.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/nutui.react.build.d.ts +2 -1
- package/dist/esm/types/src/packages/nutui.react.d.ts +3 -1
- package/dist/esm/types/src/packages/nutui.react.scss.d.ts +1 -0
- package/dist/esm/types/src/packages/nutui.react.taro.d.ts +3 -1
- package/dist/esm/types/src/packages/nutui.react.taro.scss.d.ts +1 -0
- package/dist/esm/types/src/packages/nutui.taro.react.build.d.ts +2 -1
- package/dist/esm/types/src/packages/picker/picker.d.ts +2 -0
- package/dist/esm/types/src/packages/picker/picker.taro.d.ts +2 -0
- package/dist/esm/types/src/utils/use-lock-scoll-taro.d.ts +2 -0
- package/dist/esm/types/src/utils/use-lock-scroll.d.ts +2 -0
- package/dist/esm/types/src/utils/use-touch.d.ts +8 -9
- package/dist/esm/use-touch-38cf73ae.js +61 -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 +787 -325
- package/dist/nutui.react.umd.js +786 -324
- package/dist/packages/calendarcard/calendarcard.scss +104 -0
- package/dist/packages/noticebar/noticebar.scss +1 -0
- package/dist/packages/overlay/overlay.scss +5 -0
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/themes/default.scss +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/packages/calendarcard/calendarcard.taro.d.ts +76 -0
- package/dist/types/packages/calendarcard/icon.taro.d.ts +5 -0
- package/dist/types/packages/calendarcard/index.taro.d.ts +3 -0
- package/dist/types/packages/calendarcard/types.d.ts +11 -0
- package/dist/types/packages/calendarcard/utils.d.ts +19 -0
- package/dist/types/packages/datepicker/datepicker.taro.d.ts +6 -1
- package/dist/types/packages/picker/picker.taro.d.ts +6 -0
- package/dist/types/utils/use-lock-scoll-taro.d.ts +1 -0
- package/dist/types/utils/use-lock-scroll.d.ts +2 -0
- package/dist/types/utils/use-touch.d.ts +8 -9
- package/package.json +1 -1
- package/dist/esm/can-use-dom-0e539bd3.js +0 -4
- package/dist/esm/overlay.taro-626840fc.js +0 -73
- package/dist/esm/types/src/packages/dialog/dialogwrap.taro.d.ts +0 -14
- package/dist/esm/use-touch-ff43512c.js +0 -69
- package/dist/types/packages/overlay/index.d.ts +0 -3
- package/dist/types/packages/overlay/overlay.d.ts +0 -14
- package/dist/types/packages/picker/index.d.ts +0 -4
- package/dist/types/packages/picker/picker.d.ts +0 -23
- package/dist/types/packages/picker/pickerpanel.d.ts +0 -15
- package/dist/types/packages/popup/index.d.ts +0 -3
- package/dist/types/packages/popup/popup.d.ts +0 -24
|
@@ -2,7 +2,7 @@ import React__default, { forwardRef, useRef, useState, useImperativeHandle, useE
|
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { View } from "@tarojs/components";
|
|
4
4
|
import { useReady, nextTick } from "@tarojs/taro";
|
|
5
|
-
import { u as useTouch } from "./use-touch-
|
|
5
|
+
import { u as useTouch } from "./use-touch-38cf73ae.js";
|
|
6
6
|
import { g as getRectByTaro } from "./get-rect-by-taro-fe02fe2b.js";
|
|
7
7
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
8
8
|
function preventDefault(event, isStopPropagation) {
|
|
@@ -53,6 +53,7 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
53
53
|
const leftWidth = actionWidth.left;
|
|
54
54
|
const rightWidth = actionWidth.right;
|
|
55
55
|
const onTouchStart = async (event) => {
|
|
56
|
+
var _a;
|
|
56
57
|
if (leftWrapper.current) {
|
|
57
58
|
const leftRect = await getRectByTaro(leftWrapper.current);
|
|
58
59
|
setActionWidth((v) => ({ ...v, left: leftRect.width }));
|
|
@@ -64,34 +65,37 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
64
65
|
if (!props.disabled) {
|
|
65
66
|
startOffset.current = state.offset;
|
|
66
67
|
touch.start(event);
|
|
67
|
-
props.onTouchStart
|
|
68
|
+
(_a = props.onTouchStart) == null ? void 0 : _a.call(props, event);
|
|
68
69
|
}
|
|
69
70
|
};
|
|
70
71
|
const onTouchMove = (event) => {
|
|
72
|
+
var _a;
|
|
71
73
|
if (props.disabled) {
|
|
72
74
|
return;
|
|
73
75
|
}
|
|
74
76
|
touch.move(event);
|
|
77
|
+
(_a = props.onTouchMove) == null ? void 0 : _a.call(props, event);
|
|
75
78
|
if (touch.isHorizontal()) {
|
|
76
79
|
lockClick.current = true;
|
|
77
80
|
props.onTouchMove && props.onTouchMove(event);
|
|
78
81
|
const newState = { ...state, dragging: true };
|
|
79
|
-
const isEdge = !opened || touch.deltaX * startOffset.current < 0;
|
|
82
|
+
const isEdge = !opened || touch.deltaX.current * startOffset.current < 0;
|
|
80
83
|
if (isEdge) {
|
|
81
84
|
preventDefault(event, true);
|
|
82
85
|
}
|
|
83
|
-
newState.offset = rangeCalculation(touch.deltaX + startOffset.current, -rightWidth || 0, leftWidth || 0);
|
|
86
|
+
newState.offset = rangeCalculation(touch.deltaX.current + startOffset.current, -rightWidth || 0, leftWidth || 0);
|
|
84
87
|
setState(newState);
|
|
85
88
|
}
|
|
86
89
|
};
|
|
87
90
|
const onTouchEnd = (event) => {
|
|
91
|
+
var _a;
|
|
88
92
|
if (state.dragging) {
|
|
89
93
|
setState((v) => ({ ...v, dragging: false }));
|
|
90
94
|
toggle(state.offset > 0 ? "left" : "right");
|
|
91
95
|
setTimeout(() => {
|
|
92
96
|
lockClick.current = false;
|
|
93
97
|
}, 0);
|
|
94
|
-
props.onTouchEnd
|
|
98
|
+
(_a = props.onTouchEnd) == null ? void 0 : _a.call(props, event);
|
|
95
99
|
}
|
|
96
100
|
};
|
|
97
101
|
const toggle = (side) => {
|
|
@@ -136,11 +140,12 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
136
140
|
return null;
|
|
137
141
|
};
|
|
138
142
|
const handleOperate = (event, position) => {
|
|
143
|
+
var _a;
|
|
139
144
|
event.stopPropagation();
|
|
140
145
|
if (props.beforeClose) {
|
|
141
146
|
props.beforeClose(position);
|
|
142
147
|
} else {
|
|
143
|
-
props.onActionClick
|
|
148
|
+
(_a = props.onActionClick) == null ? void 0 : _a.call(props, event, position);
|
|
144
149
|
}
|
|
145
150
|
};
|
|
146
151
|
useImperativeHandle(instanceRef, () => ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useState } from "react";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
-
import { P as Popup } from "./popup.taro-
|
|
3
|
+
import { P as Popup } from "./popup.taro-6f68b86f.js";
|
|
4
4
|
import { T as TimeDetail } from "./timedetail.taro-958b8c07.js";
|
|
5
5
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
6
6
|
import { u as useConfig } from "./configprovider.taro-c5ff4877.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useRef, useEffect } from "react";
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { Success, Failure, Tips, Loading } from "@nutui/icons-react-taro";
|
|
4
|
-
import { O as Overlay } from "./overlay.taro-
|
|
4
|
+
import { O as Overlay } from "./overlay.taro-ad4b4c8a.js";
|
|
5
5
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
6
6
|
import { u as useParams, a as useCustomEvent, b as useCustomEventsPath, c as customEvents } from "./use-custom-event-bb9c7f2e.js";
|
|
7
7
|
import { u as usePropsValue } from "./use-props-value-7637d900.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useState, useEffect } from "react";
|
|
2
2
|
import { Close } from "@nutui/icons-react-taro";
|
|
3
3
|
import classNames from "classnames";
|
|
4
|
-
import { P as Popover } from "./popover.taro-
|
|
4
|
+
import { P as Popover } from "./popover.taro-076ba3ac.js";
|
|
5
5
|
import Taro from "@tarojs/taro";
|
|
6
6
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
7
7
|
import { useConfig } from "./ConfigProvider.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { BasicComponent } from '@/utils/typings';
|
|
3
|
+
import { CalendarCardDay, CalendarCardMonth, CalendarCardValue } from './types';
|
|
4
|
+
export interface CalendarCardProps extends BasicComponent {
|
|
5
|
+
type: 'single' | 'multiple' | 'range' | 'week';
|
|
6
|
+
value?: CalendarCardValue;
|
|
7
|
+
defaultValue?: CalendarCardValue;
|
|
8
|
+
firstDayOfWeek?: number;
|
|
9
|
+
startDate?: Date;
|
|
10
|
+
endDate?: Date;
|
|
11
|
+
disableDay?: (day: CalendarCardDay) => boolean;
|
|
12
|
+
renderDay?: (day: CalendarCardDay) => ReactNode;
|
|
13
|
+
renderDayTop?: (day: CalendarCardDay) => ReactNode;
|
|
14
|
+
renderDayBottom?: (day: CalendarCardDay) => ReactNode;
|
|
15
|
+
onDayClick?: (day: CalendarCardDay) => void;
|
|
16
|
+
onPageChange: (data: CalendarCardMonth) => void;
|
|
17
|
+
onChange: (value: CalendarCardValue) => void;
|
|
18
|
+
}
|
|
19
|
+
type CalendarCardRef = {
|
|
20
|
+
jump: (step: number) => void;
|
|
21
|
+
jumpTo: (year: number, month: number) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare const CalendarCard: React.ForwardRefExoticComponent<Partial<CalendarCardProps> & React.RefAttributes<CalendarCardRef>>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { BasicComponent } from '@/utils/typings';
|
|
3
|
+
import { CalendarCardDay, CalendarCardMonth, CalendarCardValue } from './types';
|
|
4
|
+
export interface CalendarCardProps extends BasicComponent {
|
|
5
|
+
type: 'single' | 'multiple' | 'range' | 'week';
|
|
6
|
+
value?: CalendarCardValue;
|
|
7
|
+
defaultValue?: CalendarCardValue;
|
|
8
|
+
firstDayOfWeek?: number;
|
|
9
|
+
startDate?: Date;
|
|
10
|
+
endDate?: Date;
|
|
11
|
+
disableDay?: (day: CalendarCardDay) => boolean;
|
|
12
|
+
renderDay?: (day: CalendarCardDay) => ReactNode;
|
|
13
|
+
renderDayTop?: (day: CalendarCardDay) => ReactNode;
|
|
14
|
+
renderDayBottom?: (day: CalendarCardDay) => ReactNode;
|
|
15
|
+
onDayClick?: (day: CalendarCardDay) => void;
|
|
16
|
+
onPageChange: (data: CalendarCardMonth) => void;
|
|
17
|
+
onChange: (value: CalendarCardValue) => void;
|
|
18
|
+
}
|
|
19
|
+
type CalendarCardRef = {
|
|
20
|
+
jump: (step: number) => void;
|
|
21
|
+
jumpTo: (year: number, month: number) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare const CalendarCard: React.ForwardRefExoticComponent<Partial<CalendarCardProps> & React.RefAttributes<CalendarCardRef>>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface CalendarCardDay {
|
|
2
|
+
type?: 'prev' | 'current' | 'next';
|
|
3
|
+
year: number;
|
|
4
|
+
month: number;
|
|
5
|
+
date: number;
|
|
6
|
+
}
|
|
7
|
+
export interface CalendarCardMonth {
|
|
8
|
+
year: number;
|
|
9
|
+
month: number;
|
|
10
|
+
}
|
|
11
|
+
export type CalendarCardValue = Date | Date[] | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CalendarCardDay } from './types';
|
|
2
|
+
export declare const convertDateToDay: (date: Date) => {
|
|
3
|
+
year: number;
|
|
4
|
+
month: number;
|
|
5
|
+
date: number;
|
|
6
|
+
} | null;
|
|
7
|
+
export declare const convertDayToDate: (day: CalendarCardDay) => Date | null;
|
|
8
|
+
/**
|
|
9
|
+
* 获取当月面板中前一个月的日期数据
|
|
10
|
+
*/
|
|
11
|
+
export declare const getPrevMonthDays: (year: number, month: number, firstDayOfWeek: number) => CalendarCardDay[];
|
|
12
|
+
/**
|
|
13
|
+
* 获取当前月的日期数据
|
|
14
|
+
*/
|
|
15
|
+
export declare const getCurrentMonthDays: (year: number, month: number) => CalendarCardDay[];
|
|
16
|
+
/**
|
|
17
|
+
* 根据日期获取当前周的起始日期
|
|
18
|
+
*/
|
|
19
|
+
export declare const getCurrentWeekDays: (day: CalendarCardDay, firstDayOfWeek: number) => CalendarCardDay[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
|
-
import { PickerOption } from '@/packages/picker/index';
|
|
2
|
+
import { PickerOption, PickerProps } from '@/packages/picker/index';
|
|
3
3
|
import { BasicComponent } from '@/utils/typings';
|
|
4
4
|
export interface DatePickerProps extends BasicComponent {
|
|
5
5
|
value?: Date;
|
|
@@ -12,6 +12,7 @@ export interface DatePickerProps extends BasicComponent {
|
|
|
12
12
|
startDate: Date;
|
|
13
13
|
endDate: Date;
|
|
14
14
|
threeDimensional: boolean;
|
|
15
|
+
pickerProps: Partial<Omit<PickerProps, 'defaultValue' | 'threeDimensional' | 'title' | 'value' | 'onConfirm' | 'onClose' | 'onChange'>>;
|
|
15
16
|
formatter: (type: string, option: PickerOption) => PickerOption;
|
|
16
17
|
filter: (type: string, option: PickerOption[]) => PickerOption[];
|
|
17
18
|
onClose: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
|
-
import { PickerOption } from '@/packages/picker/index';
|
|
2
|
+
import { PickerOption, PickerProps } from '@/packages/picker/index.taro';
|
|
3
3
|
import { BasicComponent } from '@/utils/typings';
|
|
4
4
|
export interface DatePickerProps extends BasicComponent {
|
|
5
5
|
value?: Date;
|
|
@@ -12,6 +12,7 @@ export interface DatePickerProps extends BasicComponent {
|
|
|
12
12
|
startDate: Date;
|
|
13
13
|
endDate: Date;
|
|
14
14
|
threeDimensional: boolean;
|
|
15
|
+
pickerProps: Partial<Omit<PickerProps, 'defaultValue' | 'threeDimensional' | 'title' | 'value' | 'onConfirm' | 'onClose' | 'onChange'>>;
|
|
15
16
|
formatter: (type: string, option: PickerOption) => PickerOption;
|
|
16
17
|
filter: (type: string, option: PickerOption[]) => PickerOption[];
|
|
17
18
|
onClose: () => void;
|
|
@@ -26,6 +26,7 @@ import Tabs from '@/packages/tabs';
|
|
|
26
26
|
import Address from '@/packages/address';
|
|
27
27
|
import Calendar from '@/packages/calendar';
|
|
28
28
|
import CalendarItem from '@/packages/calendaritem';
|
|
29
|
+
import CalendarCard from '@/packages/calendarcard';
|
|
29
30
|
import Cascader from '@/packages/cascader';
|
|
30
31
|
import Checkbox from '@/packages/checkbox';
|
|
31
32
|
import CheckboxGroup from '@/packages/checkboxgroup';
|
|
@@ -93,4 +94,4 @@ import TimeDetail from '@/packages/timedetail';
|
|
|
93
94
|
import TimeSelect from '@/packages/timeselect';
|
|
94
95
|
import TrendArrow from '@/packages/trendarrow';
|
|
95
96
|
import WaterMark from '@/packages/watermark';
|
|
96
|
-
export { Button, Cell, CellGroup, ConfigProvider, Image, Overlay, Col, Divider, Grid, GridItem, Layout, Row, Space, Sticky, BackTop, Elevator, FixedNav, NavBar, SideNavBar, SideNavBarItem, SubSideNavBar, Tabbar, TabbarItem, TabPane, Tabs, Address, Calendar, CalendarItem, Cascader, Checkbox, CheckboxGroup, DatePicker, Form, FormItem, Input, InputNumber, Menu, MenuItem, NumberKeyboard, Picker, Radio, RadioGroup, Range, Rate, SearchBar, ShortPassword, Signature, Switch, TextArea, Uploader, ActionSheet, Badge, Dialog, Drag, Empty, InfiniteLoading, Loading, NoticeBar, Notify, Popover, Popup, PullToRefresh, Skeleton, Swipe, Toast, Animate, AnimatingNumbers, Audio, Avatar, AvatarGroup, CircleProgress, Collapse, CollapseItem, CountDown, Ellipsis, ImagePreview, Indicator, Pagination, Price, Progress, Step, Steps, Swiper, SwiperItem, Table, Tag, Tour, Video, VirtualList, Barrage, Card, TimeDetail, TimeSelect, TrendArrow, WaterMark };
|
|
97
|
+
export { Button, Cell, CellGroup, ConfigProvider, Image, Overlay, Col, Divider, Grid, GridItem, Layout, Row, Space, Sticky, BackTop, Elevator, FixedNav, NavBar, SideNavBar, SideNavBarItem, SubSideNavBar, Tabbar, TabbarItem, TabPane, Tabs, Address, Calendar, CalendarItem, CalendarCard, Cascader, Checkbox, CheckboxGroup, DatePicker, Form, FormItem, Input, InputNumber, Menu, MenuItem, NumberKeyboard, Picker, Radio, RadioGroup, Range, Rate, SearchBar, ShortPassword, Signature, Switch, TextArea, Uploader, ActionSheet, Badge, Dialog, Drag, Empty, InfiniteLoading, Loading, NoticeBar, Notify, Popover, Popup, PullToRefresh, Skeleton, Swipe, Toast, Animate, AnimatingNumbers, Audio, Avatar, AvatarGroup, CircleProgress, Collapse, CollapseItem, CountDown, Ellipsis, ImagePreview, Indicator, Pagination, Price, Progress, Step, Steps, Swiper, SwiperItem, Table, Tag, Tour, Video, VirtualList, Barrage, Card, TimeDetail, TimeSelect, TrendArrow, WaterMark };
|
|
@@ -26,6 +26,7 @@ import Tabs from '@/packages/tabs';
|
|
|
26
26
|
import Address from '@/packages/address';
|
|
27
27
|
import Calendar from '@/packages/calendar';
|
|
28
28
|
import CalendarItem from '@/packages/calendaritem';
|
|
29
|
+
import CalendarCard from '@/packages/calendarcard';
|
|
29
30
|
import Cascader from '@/packages/cascader';
|
|
30
31
|
import Checkbox from '@/packages/checkbox';
|
|
31
32
|
import CheckboxGroup from '@/packages/checkboxgroup';
|
|
@@ -121,6 +122,7 @@ import '@/packages/tabs/tabs.scss';
|
|
|
121
122
|
import '@/packages/address/address.scss';
|
|
122
123
|
import '@/packages/calendar/calendar.scss';
|
|
123
124
|
import '@/packages/calendaritem/calendaritem.scss';
|
|
125
|
+
import '@/packages/calendarcard/calendarcard.scss';
|
|
124
126
|
import '@/packages/cascader/cascader.scss';
|
|
125
127
|
import '@/packages/checkbox/checkbox.scss';
|
|
126
128
|
import '@/packages/checkboxgroup/checkboxgroup.scss';
|
|
@@ -188,4 +190,4 @@ import '@/packages/timedetail/timedetail.scss';
|
|
|
188
190
|
import '@/packages/timeselect/timeselect.scss';
|
|
189
191
|
import '@/packages/trendarrow/trendarrow.scss';
|
|
190
192
|
import '@/packages/watermark/watermark.scss';
|
|
191
|
-
export { Button, Cell, CellGroup, ConfigProvider, Image, Overlay, Col, Divider, Grid, GridItem, Layout, Row, Space, Sticky, BackTop, Elevator, FixedNav, NavBar, SideNavBar, SideNavBarItem, SubSideNavBar, Tabbar, TabbarItem, TabPane, Tabs, Address, Calendar, CalendarItem, Cascader, Checkbox, CheckboxGroup, DatePicker, Form, FormItem, Input, InputNumber, Menu, MenuItem, NumberKeyboard, Picker, Radio, RadioGroup, Range, Rate, SearchBar, ShortPassword, Signature, Switch, TextArea, Uploader, ActionSheet, Badge, Dialog, Drag, Empty, InfiniteLoading, Loading, NoticeBar, Notify, Popover, Popup, PullToRefresh, Skeleton, Swipe, Toast, Animate, AnimatingNumbers, Audio, Avatar, AvatarGroup, CircleProgress, Collapse, CollapseItem, CountDown, Ellipsis, ImagePreview, Indicator, Pagination, Price, Progress, Step, Steps, Swiper, SwiperItem, Table, Tag, Tour, Video, VirtualList, Barrage, Card, TimeDetail, TimeSelect, TrendArrow, WaterMark };
|
|
193
|
+
export { Button, Cell, CellGroup, ConfigProvider, Image, Overlay, Col, Divider, Grid, GridItem, Layout, Row, Space, Sticky, BackTop, Elevator, FixedNav, NavBar, SideNavBar, SideNavBarItem, SubSideNavBar, Tabbar, TabbarItem, TabPane, Tabs, Address, Calendar, CalendarItem, CalendarCard, Cascader, Checkbox, CheckboxGroup, DatePicker, Form, FormItem, Input, InputNumber, Menu, MenuItem, NumberKeyboard, Picker, Radio, RadioGroup, Range, Rate, SearchBar, ShortPassword, Signature, Switch, TextArea, Uploader, ActionSheet, Badge, Dialog, Drag, Empty, InfiniteLoading, Loading, NoticeBar, Notify, Popover, Popup, PullToRefresh, Skeleton, Swipe, Toast, Animate, AnimatingNumbers, Audio, Avatar, AvatarGroup, CircleProgress, Collapse, CollapseItem, CountDown, Ellipsis, ImagePreview, Indicator, Pagination, Price, Progress, Step, Steps, Swiper, SwiperItem, Table, Tag, Tour, Video, VirtualList, Barrage, Card, TimeDetail, TimeSelect, TrendArrow, WaterMark };
|
|
@@ -26,6 +26,7 @@ import '@/packages/tabs/tabs.scss';
|
|
|
26
26
|
import '@/packages/address/address.scss';
|
|
27
27
|
import '@/packages/calendar/calendar.scss';
|
|
28
28
|
import '@/packages/calendaritem/calendaritem.scss';
|
|
29
|
+
import '@/packages/calendarcard/calendarcard.scss';
|
|
29
30
|
import '@/packages/cascader/cascader.scss';
|
|
30
31
|
import '@/packages/checkbox/checkbox.scss';
|
|
31
32
|
import '@/packages/checkboxgroup/checkboxgroup.scss';
|
|
@@ -26,6 +26,7 @@ import Tabs from '@/packages/tabs/index.taro';
|
|
|
26
26
|
import Address from '@/packages/address/index.taro';
|
|
27
27
|
import Calendar from '@/packages/calendar/index.taro';
|
|
28
28
|
import CalendarItem from '@/packages/calendaritem/index.taro';
|
|
29
|
+
import CalendarCard from '@/packages/calendarcard/index.taro';
|
|
29
30
|
import Cascader from '@/packages/cascader/index.taro';
|
|
30
31
|
import Checkbox from '@/packages/checkbox/index.taro';
|
|
31
32
|
import CheckboxGroup from '@/packages/checkboxgroup/index.taro';
|
|
@@ -121,6 +122,7 @@ import '@/packages/tabs/tabs.scss';
|
|
|
121
122
|
import '@/packages/address/address.scss';
|
|
122
123
|
import '@/packages/calendar/calendar.scss';
|
|
123
124
|
import '@/packages/calendaritem/calendaritem.scss';
|
|
125
|
+
import '@/packages/calendarcard/calendarcard.scss';
|
|
124
126
|
import '@/packages/cascader/cascader.scss';
|
|
125
127
|
import '@/packages/checkbox/checkbox.scss';
|
|
126
128
|
import '@/packages/checkboxgroup/checkboxgroup.scss';
|
|
@@ -188,4 +190,4 @@ import '@/packages/timedetail/timedetail.scss';
|
|
|
188
190
|
import '@/packages/timeselect/timeselect.scss';
|
|
189
191
|
import '@/packages/trendarrow/trendarrow.scss';
|
|
190
192
|
import '@/packages/watermark/watermark.scss';
|
|
191
|
-
export { Button, Cell, CellGroup, ConfigProvider, Image, Overlay, Col, Divider, Grid, GridItem, Layout, Row, Space, Sticky, BackTop, Elevator, FixedNav, NavBar, SideNavBar, SideNavBarItem, SubSideNavBar, Tabbar, TabbarItem, TabPane, Tabs, Address, Calendar, CalendarItem, Cascader, Checkbox, CheckboxGroup, DatePicker, Form, FormItem, Input, InputNumber, Menu, MenuItem, NumberKeyboard, Picker, Radio, RadioGroup, Range, Rate, SearchBar, ShortPassword, Signature, Switch, TextArea, Uploader, ActionSheet, Badge, Dialog, Drag, Empty, InfiniteLoading, Loading, NoticeBar, Notify, Popover, Popup, PullToRefresh, Skeleton, Swipe, Toast, Animate, AnimatingNumbers, Audio, Avatar, AvatarGroup, CircleProgress, Collapse, CollapseItem, CountDown, Ellipsis, ImagePreview, Indicator, Pagination, Price, Progress, Step, Steps, Swiper, SwiperItem, Table, Tag, Tour, Video, VirtualList, Barrage, Card, TimeDetail, TimeSelect, TrendArrow, WaterMark };
|
|
193
|
+
export { Button, Cell, CellGroup, ConfigProvider, Image, Overlay, Col, Divider, Grid, GridItem, Layout, Row, Space, Sticky, BackTop, Elevator, FixedNav, NavBar, SideNavBar, SideNavBarItem, SubSideNavBar, Tabbar, TabbarItem, TabPane, Tabs, Address, Calendar, CalendarItem, CalendarCard, Cascader, Checkbox, CheckboxGroup, DatePicker, Form, FormItem, Input, InputNumber, Menu, MenuItem, NumberKeyboard, Picker, Radio, RadioGroup, Range, Rate, SearchBar, ShortPassword, Signature, Switch, TextArea, Uploader, ActionSheet, Badge, Dialog, Drag, Empty, InfiniteLoading, Loading, NoticeBar, Notify, Popover, Popup, PullToRefresh, Skeleton, Swipe, Toast, Animate, AnimatingNumbers, Audio, Avatar, AvatarGroup, CircleProgress, Collapse, CollapseItem, CountDown, Ellipsis, ImagePreview, Indicator, Pagination, Price, Progress, Step, Steps, Swiper, SwiperItem, Table, Tag, Tour, Video, VirtualList, Barrage, Card, TimeDetail, TimeSelect, TrendArrow, WaterMark };
|
|
@@ -26,6 +26,7 @@ import '@/packages/tabs/tabs.scss';
|
|
|
26
26
|
import '@/packages/address/address.scss';
|
|
27
27
|
import '@/packages/calendar/calendar.scss';
|
|
28
28
|
import '@/packages/calendaritem/calendaritem.scss';
|
|
29
|
+
import '@/packages/calendarcard/calendarcard.scss';
|
|
29
30
|
import '@/packages/cascader/cascader.scss';
|
|
30
31
|
import '@/packages/checkbox/checkbox.scss';
|
|
31
32
|
import '@/packages/checkboxgroup/checkboxgroup.scss';
|
|
@@ -26,6 +26,7 @@ import Tabs from '@/packages/tabs/index.taro';
|
|
|
26
26
|
import Address from '@/packages/address/index.taro';
|
|
27
27
|
import Calendar from '@/packages/calendar/index.taro';
|
|
28
28
|
import CalendarItem from '@/packages/calendaritem/index.taro';
|
|
29
|
+
import CalendarCard from '@/packages/calendarcard/index.taro';
|
|
29
30
|
import Cascader from '@/packages/cascader/index.taro';
|
|
30
31
|
import Checkbox from '@/packages/checkbox/index.taro';
|
|
31
32
|
import CheckboxGroup from '@/packages/checkboxgroup/index.taro';
|
|
@@ -93,4 +94,4 @@ import TimeDetail from '@/packages/timedetail/index.taro';
|
|
|
93
94
|
import TimeSelect from '@/packages/timeselect/index.taro';
|
|
94
95
|
import TrendArrow from '@/packages/trendarrow/index.taro';
|
|
95
96
|
import WaterMark from '@/packages/watermark/index.taro';
|
|
96
|
-
export { Button, Cell, CellGroup, ConfigProvider, Image, Overlay, Col, Divider, Grid, GridItem, Layout, Row, Space, Sticky, BackTop, Elevator, FixedNav, NavBar, SideNavBar, SideNavBarItem, SubSideNavBar, Tabbar, TabbarItem, TabPane, Tabs, Address, Calendar, CalendarItem, Cascader, Checkbox, CheckboxGroup, DatePicker, Form, FormItem, Input, InputNumber, Menu, MenuItem, NumberKeyboard, Picker, Radio, RadioGroup, Range, Rate, SearchBar, ShortPassword, Signature, Switch, TextArea, Uploader, ActionSheet, Badge, Dialog, Drag, Empty, InfiniteLoading, Loading, NoticeBar, Notify, Popover, Popup, PullToRefresh, Skeleton, Swipe, Toast, Animate, AnimatingNumbers, Audio, Avatar, AvatarGroup, CircleProgress, Collapse, CollapseItem, CountDown, Ellipsis, ImagePreview, Indicator, Pagination, Price, Progress, Step, Steps, Swiper, SwiperItem, Table, Tag, Tour, Video, VirtualList, Barrage, Card, TimeDetail, TimeSelect, TrendArrow, WaterMark };
|
|
97
|
+
export { Button, Cell, CellGroup, ConfigProvider, Image, Overlay, Col, Divider, Grid, GridItem, Layout, Row, Space, Sticky, BackTop, Elevator, FixedNav, NavBar, SideNavBar, SideNavBarItem, SubSideNavBar, Tabbar, TabbarItem, TabPane, Tabs, Address, Calendar, CalendarItem, CalendarCard, Cascader, Checkbox, CheckboxGroup, DatePicker, Form, FormItem, Input, InputNumber, Menu, MenuItem, NumberKeyboard, Picker, Radio, RadioGroup, Range, Rate, SearchBar, ShortPassword, Signature, Switch, TextArea, Uploader, ActionSheet, Badge, Dialog, Drag, Empty, InfiniteLoading, Loading, NoticeBar, Notify, Popover, Popup, PullToRefresh, Skeleton, Swipe, Toast, Animate, AnimatingNumbers, Audio, Avatar, AvatarGroup, CircleProgress, Collapse, CollapseItem, CountDown, Ellipsis, ImagePreview, Indicator, Pagination, Price, Progress, Step, Steps, Swiper, SwiperItem, Table, Tag, Tour, Video, VirtualList, Barrage, Card, TimeDetail, TimeSelect, TrendArrow, WaterMark };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { RefObject } from 'react';
|
|
2
|
+
import { PopupProps } from '@/packages/popup/popup';
|
|
2
3
|
import { PickerOption } from './types';
|
|
3
4
|
import { BasicComponent } from '@/utils/typings';
|
|
4
5
|
export type PickerActions = {
|
|
@@ -13,6 +14,7 @@ export interface PickerProps extends Omit<BasicComponent, 'children'> {
|
|
|
13
14
|
defaultValue?: (number | string)[];
|
|
14
15
|
threeDimensional?: boolean;
|
|
15
16
|
duration: number | string;
|
|
17
|
+
popupProps: Partial<Omit<PopupProps, 'title' | 'onClose'>>;
|
|
16
18
|
onConfirm?: (selectedOptions: PickerOption[], selectedValue: (string | number)[]) => void;
|
|
17
19
|
onClose?: (selectedOptions: PickerOption[], selectedValue: (string | number)[]) => void;
|
|
18
20
|
afterClose?: (selectedOptions: PickerOption[], selectedValue: (string | number)[], pickerRef: RefObject<HTMLDivElement>) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { RefObject } from 'react';
|
|
2
|
+
import { PopupProps } from '@/packages/popup/popup.taro';
|
|
2
3
|
import { PickerOption } from './types';
|
|
3
4
|
import { BasicComponent } from '@/utils/typings';
|
|
4
5
|
export type PickerActions = {
|
|
@@ -13,6 +14,7 @@ export interface PickerProps extends Omit<BasicComponent, 'children'> {
|
|
|
13
14
|
defaultValue?: (number | string)[];
|
|
14
15
|
threeDimensional?: boolean;
|
|
15
16
|
duration: number | string;
|
|
17
|
+
popupProps: Partial<Omit<PopupProps, 'title' | 'onClose'>>;
|
|
16
18
|
onConfirm?: (selectedOptions: PickerOption[], selectedValue: (string | number)[]) => void;
|
|
17
19
|
onClose?: (selectedOptions: PickerOption[], selectedValue: (string | number)[]) => void;
|
|
18
20
|
afterClose?: (selectedOptions: PickerOption[], selectedValue: (string | number)[], pickerRef: RefObject<HTMLDivElement>) => void;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
type Direction = '' | 'vertical' | 'horizontal';
|
|
2
3
|
export declare function useTouch(): {
|
|
3
4
|
move: (event: React.TouchEvent<HTMLElement>) => void;
|
|
4
5
|
start: (event: React.TouchEvent<HTMLElement>) => void;
|
|
5
6
|
reset: () => void;
|
|
6
|
-
startX: number
|
|
7
|
-
startY: number
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
offsetY: number;
|
|
14
|
-
direction: Direction;
|
|
7
|
+
startX: React.MutableRefObject<number>;
|
|
8
|
+
startY: React.MutableRefObject<number>;
|
|
9
|
+
deltaX: React.MutableRefObject<number>;
|
|
10
|
+
deltaY: React.MutableRefObject<number>;
|
|
11
|
+
offsetX: React.MutableRefObject<number>;
|
|
12
|
+
offsetY: React.MutableRefObject<number>;
|
|
13
|
+
direction: React.MutableRefObject<Direction>;
|
|
15
14
|
isVertical: () => boolean;
|
|
16
15
|
isHorizontal: () => boolean;
|
|
17
16
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
const MIN_DISTANCE = 10;
|
|
3
|
+
function getDirection(x, y) {
|
|
4
|
+
if (x > y && x > MIN_DISTANCE) {
|
|
5
|
+
return "horizontal";
|
|
6
|
+
}
|
|
7
|
+
if (y > x && y > MIN_DISTANCE) {
|
|
8
|
+
return "vertical";
|
|
9
|
+
}
|
|
10
|
+
return "";
|
|
11
|
+
}
|
|
12
|
+
function useTouch() {
|
|
13
|
+
const startX = useRef(0);
|
|
14
|
+
const startY = useRef(0);
|
|
15
|
+
const deltaX = useRef(0);
|
|
16
|
+
const deltaY = useRef(0);
|
|
17
|
+
const offsetX = useRef(0);
|
|
18
|
+
const offsetY = useRef(0);
|
|
19
|
+
const direction = useRef("");
|
|
20
|
+
const isVertical = () => direction.current === "vertical";
|
|
21
|
+
const isHorizontal = () => direction.current === "horizontal";
|
|
22
|
+
const reset = () => {
|
|
23
|
+
deltaX.current = 0;
|
|
24
|
+
deltaY.current = 0;
|
|
25
|
+
offsetX.current = 0;
|
|
26
|
+
offsetY.current = 0;
|
|
27
|
+
direction.current = "";
|
|
28
|
+
};
|
|
29
|
+
const start = (event) => {
|
|
30
|
+
reset();
|
|
31
|
+
startX.current = event.touches[0].clientX;
|
|
32
|
+
startY.current = event.touches[0].clientY;
|
|
33
|
+
};
|
|
34
|
+
const move = (event) => {
|
|
35
|
+
const touch = event.touches[0];
|
|
36
|
+
deltaX.current = touch.clientX < 0 ? 0 : touch.clientX - startX.current;
|
|
37
|
+
deltaY.current = touch.clientY - startY.current;
|
|
38
|
+
offsetX.current = Math.abs(deltaX.current);
|
|
39
|
+
offsetY.current = Math.abs(deltaY.current);
|
|
40
|
+
if (!direction.current) {
|
|
41
|
+
direction.current = getDirection(offsetX.current, offsetY.current);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
move,
|
|
46
|
+
start,
|
|
47
|
+
reset,
|
|
48
|
+
startX,
|
|
49
|
+
startY,
|
|
50
|
+
deltaX,
|
|
51
|
+
deltaY,
|
|
52
|
+
offsetX,
|
|
53
|
+
offsetY,
|
|
54
|
+
direction,
|
|
55
|
+
isVertical,
|
|
56
|
+
isHorizontal
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
useTouch as u
|
|
61
|
+
};
|
package/dist/locales/base.js
CHANGED
package/dist/locales/en-US.js
CHANGED
package/dist/locales/id-ID.js
CHANGED
package/dist/locales/tr-TR.js
CHANGED
package/dist/locales/zh-CN.js
CHANGED
package/dist/locales/zh-TW.js
CHANGED
package/dist/locales/zh-UG.js
CHANGED