@nutui/nutui-react-taro 3.0.0-beta.12 → 3.0.0-beta.13
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/cjs/{utils → hooks}/use-click-away.js +2 -2
- package/dist/cjs/{utils → hooks}/use-isomprphic-layout-effect.js +1 -1
- package/dist/cjs/{utils → hooks}/use-lock-scroll.js +2 -2
- package/dist/cjs/packages/address/address.d.ts +1 -1
- package/dist/cjs/packages/address/address.js +1 -1
- package/dist/cjs/packages/animate/animate.js +5 -6
- package/dist/cjs/packages/animate/style/animate.scss +63 -105
- package/dist/cjs/packages/animate/style/style.css +45 -44
- package/dist/cjs/packages/animate/style/style.harmony.css +45 -44
- package/dist/cjs/packages/avatarcropper/avatarcropper.js +3 -2
- package/dist/cjs/packages/badge/badge.js +10 -11
- package/dist/cjs/packages/calendar/style/calendar.scss +25 -31
- package/dist/cjs/packages/calendar/style/style.css +14 -20
- package/dist/cjs/packages/calendar/style/style.harmony.css +14 -20
- package/dist/cjs/packages/calendarcard/calendarcard.js +1 -1
- package/dist/cjs/packages/calendaritem/calendaritem.js +1 -2
- package/dist/cjs/packages/cascader/cascader.js +1 -1
- package/dist/cjs/packages/checkbox/checkbox.js +1 -1
- package/dist/cjs/packages/checkboxgroup/checkboxgroup.js +1 -1
- package/dist/cjs/packages/circleprogress/circleprogress.js +1 -1
- package/dist/cjs/packages/collapse/collapse.js +1 -1
- package/dist/cjs/packages/configprovider/configprovider.js +1 -1
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/datepicker/datepicker.js +1 -1
- package/dist/cjs/packages/datepicker/style/style.css +2 -2
- package/dist/cjs/packages/dialog/dialog.js +2 -2
- package/dist/cjs/packages/drag/drag.js +3 -2
- package/dist/cjs/packages/elevator/elevator.js +1 -1
- package/dist/cjs/packages/imagepreview/imagepreview.js +1 -1
- package/dist/cjs/packages/input/input.js +1 -1
- package/dist/cjs/packages/inputnumber/inputnumber.js +1 -1
- package/dist/cjs/packages/lottie/mp.js +3 -2
- package/dist/cjs/packages/menuitem/menuitem.js +5 -4
- package/dist/cjs/packages/notify/notify.js +1 -1
- package/dist/cjs/packages/nutui.react.build.d.ts +3 -1
- package/dist/cjs/packages/nutui.react.build.js +122 -118
- package/dist/cjs/packages/nutui.react.d.ts +4 -1
- package/dist/cjs/packages/nutui.react.js +123 -118
- package/dist/cjs/packages/nutui.react.scss.d.ts +1 -0
- package/dist/cjs/packages/nutui.react.scss.js +1 -0
- package/dist/cjs/packages/overlay/overlay.js +1 -1
- package/dist/cjs/packages/pagination/pagination.js +1 -1
- package/dist/cjs/packages/picker/picker.js +2 -2
- package/dist/cjs/packages/picker/pickerpanel.js +1 -1
- package/dist/cjs/packages/picker/style/style.css +2 -2
- package/dist/cjs/packages/picker/style/style.harmony.css +2 -2
- package/dist/cjs/packages/pickerview/index.d.ts +3 -0
- package/dist/cjs/packages/pickerview/index.js +13 -0
- package/dist/cjs/packages/pickerview/pickerroller.d.ts +7 -0
- package/dist/cjs/packages/pickerview/pickerroller.js +186 -0
- package/dist/cjs/packages/pickerview/pickerview.d.ts +4 -0
- package/dist/cjs/packages/pickerview/pickerview.js +201 -0
- package/dist/cjs/packages/pickerview/style/css.js +1 -0
- package/dist/cjs/packages/pickerview/style/index.js +1 -0
- package/dist/cjs/packages/pickerview/style/pickerview.scss +79 -0
- package/dist/cjs/packages/pickerview/style/style.css +73 -0
- package/dist/cjs/packages/pickerview/style/style.harmony.css +83 -0
- package/dist/cjs/packages/pickerview/types.d.ts +32 -0
- package/dist/cjs/packages/pickerview/types.js +4 -0
- package/dist/cjs/packages/pickerview/utils.d.ts +14 -0
- package/dist/cjs/packages/pickerview/utils.js +46 -0
- package/dist/cjs/packages/popover/popover.d.ts +2 -2
- package/dist/cjs/packages/popover/popover.js +1 -1
- package/dist/cjs/packages/popover/types.d.ts +3 -2
- package/dist/cjs/packages/popup/popup.js +1 -1
- package/dist/cjs/packages/progress/progress.js +1 -1
- package/dist/cjs/packages/pulltorefresh/pulltorefresh.js +3 -2
- package/dist/cjs/packages/radio/radio.js +1 -1
- package/dist/cjs/packages/radiogroup/radiogroup.js +1 -1
- package/dist/cjs/packages/range/range.js +2 -2
- package/dist/cjs/packages/rate/rate.js +2 -2
- package/dist/cjs/packages/segmented/segmented.js +1 -1
- package/dist/cjs/packages/shortpassword/shortpassword.js +1 -1
- package/dist/cjs/packages/sidebar/sidebar.js +3 -3
- package/dist/cjs/packages/sticky/sticky.js +3 -2
- package/dist/cjs/packages/swipe/swipe.js +2 -2
- package/dist/cjs/packages/switch/switch.js +1 -1
- package/dist/cjs/packages/tabbar/style/style.css +2 -9
- package/dist/cjs/packages/tabbar/tabbar.js +1 -1
- package/dist/cjs/packages/tabbaritem/style/style.css +2 -9
- package/dist/cjs/packages/tabbaritem/style/style.harmony.css +1 -1
- package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +2 -10
- package/dist/cjs/packages/tabbaritem/tabbaritem.js +9 -11
- package/dist/cjs/packages/table/table.js +1 -1
- package/dist/cjs/packages/tabs/tabs.js +3 -3
- package/dist/cjs/packages/textarea/textarea.d.ts +3 -3
- package/dist/cjs/packages/textarea/textarea.js +19 -22
- package/dist/cjs/packages/toast/toast.js +2 -2
- package/dist/cjs/packages/tour/tour.d.ts +1 -1
- package/dist/cjs/packages/tour/tour.js +1 -1
- package/dist/cjs/packages/uploader/types.d.ts +2 -1
- package/dist/cjs/packages/uploader/uploader.js +1 -1
- package/dist/cjs/packages/virtuallist/virtuallist.js +2 -2
- package/dist/cjs/utils/get-rect-by-taro.js +1 -1
- package/dist/cjs/utils/get-system-info.d.ts +19 -0
- package/dist/cjs/utils/get-system-info.js +32 -0
- package/dist/es/{utils → hooks}/use-click-away.js +3 -2
- package/dist/es/{utils → hooks}/use-isomprphic-layout-effect.js +1 -1
- package/dist/es/{utils → hooks}/use-lock-scroll.js +2 -2
- package/dist/es/packages/address/address.d.ts +1 -1
- package/dist/es/packages/address/address.js +1 -1
- package/dist/es/packages/animate/animate.js +5 -6
- package/dist/es/packages/animate/style/animate.scss +63 -105
- package/dist/es/packages/animate/style/style.css +45 -44
- package/dist/es/packages/animate/style/style.harmony.css +45 -44
- package/dist/es/packages/audio/audio.d.ts +30 -10
- package/dist/es/packages/avatarcropper/avatarcropper.js +3 -2
- package/dist/es/packages/badge/badge.js +10 -11
- package/dist/es/packages/calendar/calendar.d.ts +27 -135
- package/dist/es/packages/calendar/style/calendar.scss +25 -31
- package/dist/es/packages/calendar/style/style.css +14 -20
- package/dist/es/packages/calendar/style/style.harmony.css +14 -20
- package/dist/es/packages/calendarcard/calendarcard.js +1 -1
- package/dist/es/packages/calendaritem/calendaritem.js +1 -2
- package/dist/es/packages/cascader/cascader.js +1 -1
- package/dist/es/packages/checkbox/checkbox.js +1 -1
- package/dist/es/packages/checkboxgroup/checkboxgroup.js +1 -1
- package/dist/es/packages/circleprogress/circleprogress.d.ts +1 -1
- package/dist/es/packages/circleprogress/circleprogress.js +1 -1
- package/dist/es/packages/collapse/collapse.js +1 -1
- package/dist/es/packages/configprovider/configprovider.js +1 -1
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/datepicker/datepicker.js +1 -1
- package/dist/es/packages/datepicker/style/style.css +2 -2
- package/dist/es/packages/dialog/dialog.js +2 -2
- package/dist/es/packages/drag/drag.js +4 -3
- package/dist/es/packages/elevator/elevator.js +1 -1
- package/dist/es/packages/form/form.d.ts +1 -1
- package/dist/es/packages/imagepreview/imagepreview.js +1 -1
- package/dist/es/packages/input/input.js +1 -1
- package/dist/es/packages/inputnumber/inputnumber.js +1 -1
- package/dist/es/packages/lottie/mp.js +4 -3
- package/dist/es/packages/menuitem/menuitem.js +6 -5
- package/dist/es/packages/noticebar/noticebar.d.ts +1 -1
- package/dist/es/packages/notify/notify.js +1 -1
- package/dist/es/packages/nutui.react.build.d.ts +3 -1
- package/dist/es/packages/nutui.react.build.js +3 -1
- package/dist/es/packages/overlay/overlay.js +1 -1
- package/dist/es/packages/pagination/pagination.js +1 -1
- package/dist/es/packages/picker/picker.js +2 -2
- package/dist/es/packages/picker/pickerpanel.js +1 -1
- package/dist/es/packages/picker/style/style.css +2 -2
- package/dist/es/packages/picker/style/style.harmony.css +2 -2
- package/dist/es/packages/pickerview/index.d.ts +3 -0
- package/dist/es/packages/pickerview/index.js +2 -0
- package/dist/es/packages/pickerview/pickerroller.d.ts +7 -0
- package/dist/es/packages/pickerview/pickerroller.js +175 -0
- package/dist/es/packages/pickerview/pickerview.d.ts +4 -0
- package/dist/es/packages/pickerview/pickerview.js +189 -0
- package/dist/es/packages/pickerview/style/css.js +1 -0
- package/dist/es/packages/pickerview/style/index.js +1 -0
- package/dist/es/packages/pickerview/style/pickerview.scss +79 -0
- package/dist/es/packages/pickerview/style/style.css +73 -0
- package/dist/es/packages/pickerview/style/style.harmony.css +83 -0
- package/dist/es/packages/pickerview/types.d.ts +32 -0
- package/dist/es/packages/pickerview/types.js +1 -0
- package/dist/es/packages/pickerview/utils.d.ts +14 -0
- package/dist/es/packages/pickerview/utils.js +28 -0
- package/dist/es/packages/popover/popover.d.ts +2 -2
- package/dist/es/packages/popover/popover.js +1 -1
- package/dist/es/packages/popover/types.d.ts +3 -2
- package/dist/es/packages/popup/popup.js +1 -1
- package/dist/es/packages/progress/progress.js +1 -1
- package/dist/es/packages/pulltorefresh/pulltorefresh.js +3 -2
- package/dist/es/packages/radio/radio.js +1 -1
- package/dist/es/packages/radiogroup/radiogroup.js +1 -1
- package/dist/es/packages/range/range.js +2 -2
- package/dist/es/packages/rate/rate.js +2 -2
- package/dist/es/packages/segmented/segmented.js +1 -1
- package/dist/es/packages/shortpassword/shortpassword.js +1 -1
- package/dist/es/packages/sidebar/sidebar.js +3 -3
- package/dist/es/packages/sticky/sticky.js +4 -3
- package/dist/es/packages/swipe/swipe.js +2 -2
- package/dist/es/packages/switch/switch.js +1 -1
- package/dist/es/packages/tabbar/style/style.css +2 -9
- package/dist/es/packages/tabbar/tabbar.js +1 -1
- package/dist/es/packages/tabbaritem/style/style.css +2 -9
- package/dist/es/packages/tabbaritem/style/style.harmony.css +1 -1
- package/dist/es/packages/tabbaritem/style/tabbaritem.scss +2 -10
- package/dist/es/packages/tabbaritem/tabbaritem.js +9 -11
- package/dist/es/packages/table/table.js +1 -1
- package/dist/es/packages/tabs/tabs.js +3 -3
- package/dist/es/packages/textarea/textarea.d.ts +3 -3
- package/dist/es/packages/textarea/textarea.js +20 -23
- package/dist/es/packages/toast/toast.js +2 -2
- package/dist/es/packages/tour/tour.d.ts +1 -1
- package/dist/es/packages/tour/tour.js +1 -1
- package/dist/es/packages/uploader/types.d.ts +2 -1
- package/dist/es/packages/uploader/uploader.js +1 -1
- package/dist/es/packages/virtuallist/virtuallist.d.ts +1 -1
- package/dist/es/packages/virtuallist/virtuallist.js +2 -2
- package/dist/es/utils/get-rect-by-taro.js +1 -1
- package/dist/es/utils/get-system-info.d.ts +19 -0
- package/dist/es/utils/get-system-info.js +19 -0
- package/dist/nutui.react.umd.js +529 -172
- package/dist/style.css +1 -1
- package/dist/style.scss +44 -43
- package/dist/styles/variables.scss +3 -1
- package/package.json +1 -80
- /package/dist/cjs/{utils → hooks}/use-click-away.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-client-rect.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-client-rect.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-custom-event.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-custom-event.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-force-update.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-force-update.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-isomprphic-layout-effect.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-lock-scoll-taro.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-lock-scoll-taro.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-lock-scroll.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-memo.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-memo.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-props-value.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-props-value.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-ref-state.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-ref-state.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-refs.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-refs.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-taro-rect.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-taro-rect.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-touch.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-touch.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-uuid.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-uuid.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-watch.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-watch.js +0 -0
- /package/dist/es/{utils → hooks}/use-click-away.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-client-rect.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-client-rect.js +0 -0
- /package/dist/es/{utils → hooks}/use-custom-event.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-custom-event.js +0 -0
- /package/dist/es/{utils → hooks}/use-force-update.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-force-update.js +0 -0
- /package/dist/es/{utils → hooks}/use-isomprphic-layout-effect.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-lock-scoll-taro.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-lock-scoll-taro.js +0 -0
- /package/dist/es/{utils → hooks}/use-lock-scroll.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-memo.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-memo.js +0 -0
- /package/dist/es/{utils → hooks}/use-props-value.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-props-value.js +0 -0
- /package/dist/es/{utils → hooks}/use-ref-state.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-ref-state.js +0 -0
- /package/dist/es/{utils → hooks}/use-refs.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-refs.js +0 -0
- /package/dist/es/{utils → hooks}/use-taro-rect.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-taro-rect.js +0 -0
- /package/dist/es/{utils → hooks}/use-touch.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-touch.js +0 -0
- /package/dist/es/{utils → hooks}/use-uuid.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-uuid.js +0 -0
- /package/dist/es/{utils → hooks}/use-watch.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-watch.js +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BasicComponent } from "../../utils/typings";
|
|
2
|
+
export type PickerValue = string | number | null;
|
|
3
|
+
export interface PickerOptionItem {
|
|
4
|
+
label: string | number;
|
|
5
|
+
value: string | number;
|
|
6
|
+
children?: PickerOptionItem[];
|
|
7
|
+
}
|
|
8
|
+
export type PickerOptions = PickerOptionItem[];
|
|
9
|
+
export interface PickerRollerProps {
|
|
10
|
+
options: PickerOptionItem[];
|
|
11
|
+
keyIndex: number;
|
|
12
|
+
value: PickerValue;
|
|
13
|
+
threeDimensional?: boolean;
|
|
14
|
+
duration?: number | string;
|
|
15
|
+
onSelect: (option: PickerOptionItem, index: number) => void;
|
|
16
|
+
renderLabel: (item: PickerOptionItem) => React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export interface PickerOnChangeCallbackParameter {
|
|
19
|
+
value: PickerValue[];
|
|
20
|
+
index: number;
|
|
21
|
+
selectedOptions: PickerOptionItem[];
|
|
22
|
+
}
|
|
23
|
+
export interface PickerViewProps extends BasicComponent {
|
|
24
|
+
setRefs?: (ref: any) => any;
|
|
25
|
+
options: PickerOptions[];
|
|
26
|
+
value?: PickerValue[];
|
|
27
|
+
defaultValue?: PickerValue[];
|
|
28
|
+
threeDimensional?: boolean;
|
|
29
|
+
duration?: number | string;
|
|
30
|
+
renderLabel: (item: PickerOptionItem) => React.ReactNode;
|
|
31
|
+
onChange?: (arg0: PickerOnChangeCallbackParameter) => void;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const momentum: (distance: number, duration: number) => number;
|
|
2
|
+
export declare const useStyles: (touchTime: number, touchDeg: string, scrollDistance: number, lineSpacing: React.MutableRefObject<number>, rotation: number) => {
|
|
3
|
+
touchRollerStyle: () => {
|
|
4
|
+
transition: string;
|
|
5
|
+
transform: string;
|
|
6
|
+
};
|
|
7
|
+
touchTiledStyle: () => {
|
|
8
|
+
transition: string;
|
|
9
|
+
transform: string;
|
|
10
|
+
};
|
|
11
|
+
rollerStyle: (index: number) => {
|
|
12
|
+
transform: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export var momentum = function(distance, duration) {
|
|
2
|
+
var speed = Math.abs(distance / duration);
|
|
3
|
+
return speed / 0.003 * (distance < 0 ? -1 : 1);
|
|
4
|
+
};
|
|
5
|
+
export var useStyles = function(touchTime, touchDeg, scrollDistance, lineSpacing, rotation) {
|
|
6
|
+
var getTransitionStyle = function(transformValue) {
|
|
7
|
+
return {
|
|
8
|
+
transition: "transform ".concat(touchTime, "ms cubic-bezier(0.17, 0.89, 0.45, 1)"),
|
|
9
|
+
transform: transformValue
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
var touchRollerStyle = function() {
|
|
13
|
+
return getTransitionStyle("rotate3d(1, 0, 0, ".concat(touchDeg, ")"));
|
|
14
|
+
};
|
|
15
|
+
var touchTiledStyle = function() {
|
|
16
|
+
return getTransitionStyle("translate3d(0, ".concat(scrollDistance, "px, 0)"));
|
|
17
|
+
};
|
|
18
|
+
var rollerStyle = function(index) {
|
|
19
|
+
return {
|
|
20
|
+
transform: "rotate3d(1, 0, 0, ".concat(-rotation * (index + 1), "deg) translate3d(0px, 0px, ").concat(Math.round(lineSpacing.current * 3.2), "px)")
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
touchRollerStyle: touchRollerStyle,
|
|
25
|
+
touchTiledStyle: touchTiledStyle,
|
|
26
|
+
rollerStyle: rollerStyle
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -3,8 +3,8 @@ import { PopupProps } from "../popup/index";
|
|
|
3
3
|
import { PopoverTheme, PopoverLocation, PopoverList } from './types';
|
|
4
4
|
export interface PopoverProps extends PopupProps {
|
|
5
5
|
list: PopoverList[];
|
|
6
|
-
theme: PopoverTheme
|
|
7
|
-
location: PopoverLocation
|
|
6
|
+
theme: PopoverTheme;
|
|
7
|
+
location: PopoverLocation;
|
|
8
8
|
visible: boolean;
|
|
9
9
|
offset: string[] | number[];
|
|
10
10
|
arrowOffset: number;
|
|
@@ -13,7 +13,7 @@ import { ArrowRadius } from "@nutui/icons-react-taro";
|
|
|
13
13
|
import Popup from "../popup/index";
|
|
14
14
|
import { getRectByTaro } from "../../utils/get-rect-by-taro";
|
|
15
15
|
import { ComponentDefaults } from "../../utils/typings";
|
|
16
|
-
import { getRect } from "../../
|
|
16
|
+
import { getRect } from "../../hooks/use-client-rect";
|
|
17
17
|
import { useRtl } from "../configprovider/index";
|
|
18
18
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
19
19
|
list: [],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
1
|
+
import { FixAutoComplete } from "../../types/fix-string-literal-union";
|
|
2
|
+
export type PopoverTheme = FixAutoComplete<'light' | 'dark'>;
|
|
3
|
+
export type PopoverLocation = FixAutoComplete<'bottom' | 'top' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end'>;
|
|
3
4
|
export interface PopoverList {
|
|
4
5
|
key?: string;
|
|
5
6
|
name: string;
|
|
@@ -10,7 +10,7 @@ import { Close } from "@nutui/icons-react-taro";
|
|
|
10
10
|
import { View } from "@tarojs/components";
|
|
11
11
|
import { defaultOverlayProps } from "../overlay/overlay";
|
|
12
12
|
import Overlay from "../overlay/index";
|
|
13
|
-
import { useLockScrollTaro } from "../../
|
|
13
|
+
import { useLockScrollTaro } from "../../hooks/use-lock-scoll-taro";
|
|
14
14
|
var defaultProps = _object_spread_props(_object_spread({}, defaultOverlayProps), {
|
|
15
15
|
position: 'center',
|
|
16
16
|
transition: '',
|
|
@@ -10,7 +10,7 @@ import { View } from "@tarojs/components";
|
|
|
10
10
|
import pxTransform from "../../utils/px-transform";
|
|
11
11
|
import { ComponentDefaults } from "../../utils/typings";
|
|
12
12
|
import { useRtl } from "../configprovider/index";
|
|
13
|
-
import useUuid from "../../
|
|
13
|
+
import useUuid from "../../hooks/use-uuid";
|
|
14
14
|
import { harmony, web } from "../../utils/platform-taro";
|
|
15
15
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
16
16
|
percent: 0,
|
|
@@ -10,11 +10,12 @@ import { View } from "@tarojs/components";
|
|
|
10
10
|
import { Loading, More } from "@nutui/icons-react-taro";
|
|
11
11
|
import Taro from "@tarojs/taro";
|
|
12
12
|
import { useConfig } from "../configprovider/index";
|
|
13
|
-
import { useTouch } from "../../
|
|
13
|
+
import { useTouch } from "../../hooks/use-touch";
|
|
14
14
|
import { rubberbandIfOutOfBounds } from "../../utils/rubberband";
|
|
15
15
|
import { sleep } from "../../utils/sleep";
|
|
16
16
|
import { ComponentDefaults } from "../../utils/typings";
|
|
17
17
|
import pxTransform from "../../utils/px-transform";
|
|
18
|
+
import { getDeviceInfo } from "../../utils/get-system-info";
|
|
18
19
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
19
20
|
type: 'default',
|
|
20
21
|
pullingText: '',
|
|
@@ -155,7 +156,7 @@ export var PullToRefresh = function(p) {
|
|
|
155
156
|
}
|
|
156
157
|
};
|
|
157
158
|
// 安卓微信小程序onTouchMove回调次数少导致下拉卡顿,增加动效会更顺畅
|
|
158
|
-
var isAndroidWeApp =
|
|
159
|
+
var isAndroidWeApp = getDeviceInfo().platform === 'android' && Taro.getEnv() === 'WEAPP';
|
|
159
160
|
var springStyles = _object_spread({
|
|
160
161
|
height: pxTransform(height)
|
|
161
162
|
}, !pullingRef.current || isAndroidWeApp ? {
|
|
@@ -9,7 +9,7 @@ import classNames from "classnames";
|
|
|
9
9
|
import { View } from "@tarojs/components";
|
|
10
10
|
import RadioContext from "../radiogroup/context";
|
|
11
11
|
import { ComponentDefaults } from "../../utils/typings";
|
|
12
|
-
import { usePropsValue } from "../../
|
|
12
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
13
13
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
14
14
|
disabled: false,
|
|
15
15
|
shape: 'round',
|
|
@@ -8,7 +8,7 @@ import classNames from "classnames";
|
|
|
8
8
|
import { View } from "@tarojs/components";
|
|
9
9
|
import RadioContext from "./context";
|
|
10
10
|
import Radio from "../radio/index";
|
|
11
|
-
import { usePropsValue } from "../../
|
|
11
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
12
12
|
var defaultProps = {
|
|
13
13
|
labelPosition: 'right',
|
|
14
14
|
onChange: function(value) {},
|
|
@@ -8,9 +8,9 @@ import React, { useEffect, useState, useCallback, useMemo, useRef } from "react"
|
|
|
8
8
|
import classNames from "classnames";
|
|
9
9
|
import { View, Text } from "@tarojs/components";
|
|
10
10
|
import pxTransform from "../../utils/px-transform";
|
|
11
|
-
import { useTouch } from "../../
|
|
11
|
+
import { useTouch } from "../../hooks/use-touch";
|
|
12
12
|
import { ComponentDefaults } from "../../utils/typings";
|
|
13
|
-
import { usePropsValue } from "../../
|
|
13
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
14
14
|
import { getRectByTaro } from "../../utils/get-rect-by-taro";
|
|
15
15
|
import { useRtl } from "../configprovider/index";
|
|
16
16
|
import { harmony } from "../../utils/platform-taro";
|
|
@@ -8,9 +8,9 @@ import { StarFill } from "@nutui/icons-react-taro";
|
|
|
8
8
|
import { useReady } from "@tarojs/taro";
|
|
9
9
|
import { View, Text } from "@tarojs/components";
|
|
10
10
|
import { ComponentDefaults } from "../../utils/typings";
|
|
11
|
-
import { usePropsValue } from "../../
|
|
11
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
12
12
|
import { getRectByTaro } from "../../utils/get-rect-by-taro";
|
|
13
|
-
import useRefs from "../../
|
|
13
|
+
import useRefs from "../../hooks/use-refs";
|
|
14
14
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
15
15
|
size: 'normal',
|
|
16
16
|
showScore: false,
|
|
@@ -4,7 +4,7 @@ import { _ as _type_of } from "@swc/helpers/_/_type_of";
|
|
|
4
4
|
import React, { useCallback } from "react";
|
|
5
5
|
import classNames from "classnames";
|
|
6
6
|
import { View } from "@tarojs/components";
|
|
7
|
-
import { usePropsValue } from "../../
|
|
7
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
8
8
|
import { mergeProps } from "../../utils/merge-props";
|
|
9
9
|
var defaultProps = {
|
|
10
10
|
options: [],
|
|
@@ -10,7 +10,7 @@ import { View } from "@tarojs/components";
|
|
|
10
10
|
import Popup from "../popup/index";
|
|
11
11
|
import { useConfig } from "../configprovider/index";
|
|
12
12
|
import { ComponentDefaults } from "../../utils/typings";
|
|
13
|
-
import { usePropsValue } from "../../
|
|
13
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
14
14
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
15
15
|
value: '',
|
|
16
16
|
visible: false,
|
|
@@ -8,10 +8,10 @@ import { ScrollView, View } from "@tarojs/components";
|
|
|
8
8
|
import classNames from "classnames";
|
|
9
9
|
import Taro, { nextTick, createSelectorQuery } from "@tarojs/taro";
|
|
10
10
|
import { ComponentDefaults } from "../../utils/typings";
|
|
11
|
-
import { usePropsValue } from "../../
|
|
12
|
-
import { useForceUpdate } from "../../
|
|
11
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
12
|
+
import { useForceUpdate } from "../../hooks/use-force-update";
|
|
13
13
|
import raf from "../../utils/raf";
|
|
14
|
-
import useUuid from "../../
|
|
14
|
+
import useUuid from "../../hooks/use-uuid";
|
|
15
15
|
import SideBarItem from "../sidebaritem/index";
|
|
16
16
|
import { mergeProps } from "../../utils/merge-props";
|
|
17
17
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
@@ -7,10 +7,11 @@ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
|
7
7
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
8
8
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import classNames from "classnames";
|
|
10
|
-
import { getEnv,
|
|
10
|
+
import { getEnv, usePageScroll } from "@tarojs/taro";
|
|
11
11
|
import { View } from "@tarojs/components";
|
|
12
|
+
import { getWindowInfo } from "../../utils/get-system-info";
|
|
12
13
|
import { ComponentDefaults } from "../../utils/typings";
|
|
13
|
-
import useWatch from "../../
|
|
14
|
+
import useWatch from "../../hooks/use-watch";
|
|
14
15
|
import { getRectByTaro } from "../../utils/get-rect-by-taro";
|
|
15
16
|
import { getScrollParent } from "../../utils/get-scroll-parent";
|
|
16
17
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
@@ -140,7 +141,7 @@ export var Sticky = function(props) {
|
|
|
140
141
|
7
|
|
141
142
|
];
|
|
142
143
|
case 6:
|
|
143
|
-
windowHeight =
|
|
144
|
+
windowHeight = getWindowInfo().windowHeight;
|
|
144
145
|
setFixed(windowHeight - threshold < curRootRect.bottom);
|
|
145
146
|
_state.label = 7;
|
|
146
147
|
case 7:
|
|
@@ -6,12 +6,12 @@ import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
|
6
6
|
import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
7
7
|
import classNames from "classnames";
|
|
8
8
|
import { View } from "@tarojs/components";
|
|
9
|
-
import { useTouch } from "../../
|
|
9
|
+
import { useTouch } from "../../hooks/use-touch";
|
|
10
10
|
import { getRectByTaro } from "../../utils/get-rect-by-taro";
|
|
11
11
|
import { ComponentDefaults } from "../../utils/typings";
|
|
12
12
|
import { harmony } from "../../utils/platform-taro";
|
|
13
13
|
import pxTransform from "../../utils/px-transform";
|
|
14
|
-
import { useRefState } from "../../
|
|
14
|
+
import { useRefState } from "../../hooks/use-ref-state";
|
|
15
15
|
function preventDefault(event, isStopPropagation) {
|
|
16
16
|
if (typeof event.cancelable !== 'boolean' || event.cancelable) {
|
|
17
17
|
event.preventDefault();
|
|
@@ -7,7 +7,7 @@ import React from "react";
|
|
|
7
7
|
import { View } from "@tarojs/components";
|
|
8
8
|
import classNames from "classnames";
|
|
9
9
|
import { ComponentDefaults } from "../../utils/typings";
|
|
10
|
-
import { usePropsValue } from "../../
|
|
10
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
11
11
|
import { useRtl } from "../configprovider/index";
|
|
12
12
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
13
13
|
disabled: false,
|
|
@@ -138,15 +138,8 @@
|
|
|
138
138
|
.nut-tabbar-item-active {
|
|
139
139
|
color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
|
|
140
140
|
}
|
|
141
|
-
.nut-tabbar-item-active .nut-tabbar-item-icon-box
|
|
142
|
-
|
|
143
|
-
color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
|
|
144
|
-
/* #endif*/
|
|
145
|
-
/* #ifndef harmony*/
|
|
146
|
-
color: inherit;
|
|
147
|
-
/* #endif*/
|
|
148
|
-
}
|
|
149
|
-
.nut-tabbar-item-active .nut-tabbar-item-icon-box .nut-icon {
|
|
141
|
+
.nut-tabbar-item-active .nut-tabbar-item-icon-box,
|
|
142
|
+
.nut-tabbar-item-active .nut-icon {
|
|
150
143
|
/* #ifdef harmony*/
|
|
151
144
|
color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
|
|
152
145
|
/* #endif*/
|
|
@@ -6,7 +6,7 @@ import React from "react";
|
|
|
6
6
|
import classNames from "classnames";
|
|
7
7
|
import { View } from "@tarojs/components";
|
|
8
8
|
import { ComponentDefaults } from "../../utils/typings";
|
|
9
|
-
import { usePropsValue } from "../../
|
|
9
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
10
10
|
import TabbarItem from "../tabbaritem/index";
|
|
11
11
|
import TabbarContext from "./context";
|
|
12
12
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
@@ -138,15 +138,8 @@
|
|
|
138
138
|
.nut-tabbar-item-active {
|
|
139
139
|
color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
|
|
140
140
|
}
|
|
141
|
-
.nut-tabbar-item-active .nut-tabbar-item-icon-box
|
|
142
|
-
|
|
143
|
-
color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
|
|
144
|
-
/* #endif*/
|
|
145
|
-
/* #ifndef harmony*/
|
|
146
|
-
color: inherit;
|
|
147
|
-
/* #endif*/
|
|
148
|
-
}
|
|
149
|
-
.nut-tabbar-item-active .nut-tabbar-item-icon-box .nut-icon {
|
|
141
|
+
.nut-tabbar-item-active .nut-tabbar-item-icon-box,
|
|
142
|
+
.nut-tabbar-item-active .nut-icon {
|
|
150
143
|
/* #ifdef harmony*/
|
|
151
144
|
color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
|
|
152
145
|
/* #endif*/
|
|
@@ -41,22 +41,14 @@
|
|
|
41
41
|
&-active {
|
|
42
42
|
color: $tabbar-active-color;
|
|
43
43
|
|
|
44
|
-
.nut-tabbar-item-icon-box
|
|
44
|
+
.nut-tabbar-item-icon-box,
|
|
45
|
+
.nut-icon {
|
|
45
46
|
/* #ifdef harmony*/
|
|
46
47
|
color: $tabbar-active-color;
|
|
47
48
|
/* #endif*/
|
|
48
49
|
/* #ifndef harmony*/
|
|
49
50
|
color: inherit;
|
|
50
51
|
/* #endif*/
|
|
51
|
-
|
|
52
|
-
.nut-icon {
|
|
53
|
-
/* #ifdef harmony*/
|
|
54
|
-
color: $tabbar-active-color;
|
|
55
|
-
/* #endif*/
|
|
56
|
-
/* #ifndef harmony*/
|
|
57
|
-
color: inherit;
|
|
58
|
-
/* #endif*/
|
|
59
|
-
}
|
|
60
52
|
}
|
|
61
53
|
}
|
|
62
54
|
}
|
|
@@ -46,6 +46,14 @@ export var TabbarItem = function(props) {
|
|
|
46
46
|
right: right,
|
|
47
47
|
color: ctx === null || ctx === void 0 ? void 0 : ctx.activeColor
|
|
48
48
|
};
|
|
49
|
+
var renderTitleText = function() {
|
|
50
|
+
return title && /*#__PURE__*/ React.createElement(View, {
|
|
51
|
+
className: titleClass,
|
|
52
|
+
style: {
|
|
53
|
+
color: active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
|
|
54
|
+
}
|
|
55
|
+
}, title);
|
|
56
|
+
};
|
|
49
57
|
return /*#__PURE__*/ React.createElement(View, _object_spread({
|
|
50
58
|
className: tabbarItemClass,
|
|
51
59
|
style: _object_spread({
|
|
@@ -56,15 +64,5 @@ export var TabbarItem = function(props) {
|
|
|
56
64
|
}
|
|
57
65
|
}, rest), icon ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Badge, badgeProps, /*#__PURE__*/ React.createElement(View, {
|
|
58
66
|
className: boxPrefix
|
|
59
|
-
}, addColorForHarmony(icon, active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor))), /*#__PURE__*/ React.createElement(
|
|
60
|
-
className: titleClass,
|
|
61
|
-
style: {
|
|
62
|
-
color: active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
|
|
63
|
-
}
|
|
64
|
-
}, title)) : /*#__PURE__*/ React.createElement(Badge, badgeProps, /*#__PURE__*/ React.createElement(View, {
|
|
65
|
-
className: titleClass,
|
|
66
|
-
style: {
|
|
67
|
-
color: active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
|
|
68
|
-
}
|
|
69
|
-
}, title)));
|
|
67
|
+
}, addColorForHarmony(icon, active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor))), renderTitleText()) : /*#__PURE__*/ React.createElement(Badge, badgeProps, renderTitleText()));
|
|
70
68
|
};
|
|
@@ -10,7 +10,7 @@ import { ArrowDown } from "@nutui/icons-react-taro";
|
|
|
10
10
|
import { View } from "@tarojs/components";
|
|
11
11
|
import { useConfig, useRtl } from "../configprovider/index";
|
|
12
12
|
import { ComponentDefaults } from "../../utils/typings";
|
|
13
|
-
import { usePropsValue } from "../../
|
|
13
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
14
14
|
import { useTableSticky } from "./utils";
|
|
15
15
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
16
16
|
columns: [],
|
|
@@ -10,10 +10,10 @@ import { JoySmile } from "@nutui/icons-react-taro";
|
|
|
10
10
|
import Taro, { nextTick, createSelectorQuery } from "@tarojs/taro";
|
|
11
11
|
import { ComponentDefaults } from "../../utils/typings";
|
|
12
12
|
import TabPane from "../tabpane/index";
|
|
13
|
-
import { usePropsValue } from "../../
|
|
14
|
-
import { useForceUpdate } from "../../
|
|
13
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
14
|
+
import { useForceUpdate } from "../../hooks/use-force-update";
|
|
15
15
|
import raf from "../../utils/raf";
|
|
16
|
-
import useUuid from "../../
|
|
16
|
+
import useUuid from "../../hooks/use-uuid";
|
|
17
17
|
import { useRtl } from "../configprovider/configprovider";
|
|
18
18
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
19
19
|
tabStyle: {},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
|
-
import { TextareaProps } from '@tarojs/components';
|
|
2
|
+
import { BaseEventOrig, TextareaProps } from '@tarojs/components';
|
|
3
3
|
import { BasicComponent } from "../../utils/typings";
|
|
4
4
|
export interface TextAreaProps extends Omit<TextareaProps, 'showCount' | 'onFocus' | 'onBlur'>, Omit<BasicComponent, 'style'> {
|
|
5
5
|
value: string;
|
|
@@ -14,7 +14,7 @@ export interface TextAreaProps extends Omit<TextareaProps, 'showCount' | 'onFocu
|
|
|
14
14
|
plain: boolean;
|
|
15
15
|
status: 'error' | 'default';
|
|
16
16
|
onChange: (value: string) => void;
|
|
17
|
-
onBlur: (event:
|
|
18
|
-
onFocus: (event:
|
|
17
|
+
onBlur: (event: BaseEventOrig) => void;
|
|
18
|
+
onFocus: (event: BaseEventOrig) => void;
|
|
19
19
|
}
|
|
20
20
|
export declare const TextArea: FunctionComponent<Partial<TextAreaProps>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
1
2
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
3
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
4
|
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
@@ -5,10 +6,10 @@ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
|
5
6
|
import React, { useRef } from "react";
|
|
6
7
|
import classNames from "classnames";
|
|
7
8
|
import Taro from "@tarojs/taro";
|
|
8
|
-
import { Textarea, View
|
|
9
|
+
import { Text, Textarea, View } from "@tarojs/components";
|
|
9
10
|
import { useConfig, useRtl } from "../configprovider/index";
|
|
10
11
|
import { ComponentDefaults } from "../../utils/typings";
|
|
11
|
-
import { usePropsValue } from "../../
|
|
12
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
12
13
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
13
14
|
defaultValue: '',
|
|
14
15
|
showCount: false,
|
|
@@ -65,19 +66,21 @@ export var TextArea = function(props) {
|
|
|
65
66
|
setInputValue('');
|
|
66
67
|
}
|
|
67
68
|
};
|
|
69
|
+
var isDisabled = function() {
|
|
70
|
+
return disabled || readOnly;
|
|
71
|
+
};
|
|
68
72
|
var handleFocus = function(event) {
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
onFocus && onFocus(event);
|
|
73
|
+
if (isDisabled()) return;
|
|
74
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
72
75
|
};
|
|
73
76
|
var handleBlur = function(event) {
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
onBlur && onBlur(event);
|
|
77
|
+
if (isDisabled()) return;
|
|
78
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
77
79
|
};
|
|
80
|
+
var _obj;
|
|
78
81
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(View, {
|
|
79
|
-
className: classNames(classPrefix,
|
|
80
|
-
}, /*#__PURE__*/ React.createElement(Textarea, _object_spread({
|
|
82
|
+
className: classNames(classPrefix, (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-disabled"), disabled), _define_property(_obj, "".concat(classPrefix, "-readonly"), readOnly), _define_property(_obj, "".concat(classPrefix, "-rtl"), rtl), _define_property(_obj, "".concat(classPrefix, "-plain"), plain), _define_property(_obj, "".concat(classPrefix, "-container"), !plain), _define_property(_obj, "".concat(classPrefix, "-").concat(status), status), _obj), className)
|
|
83
|
+
}, /*#__PURE__*/ React.createElement(Textarea, _object_spread_props(_object_spread({}, rest), {
|
|
81
84
|
nativeProps: {
|
|
82
85
|
style: style,
|
|
83
86
|
readOnly: readOnly,
|
|
@@ -89,25 +92,19 @@ export var TextArea = function(props) {
|
|
|
89
92
|
compositionRef.current = false;
|
|
90
93
|
}
|
|
91
94
|
},
|
|
92
|
-
className: "".concat(classPrefix, "-textarea
|
|
95
|
+
className: classNames("".concat(classPrefix, "-textarea"), _define_property({}, "".concat(classPrefix, "-textarea-disabled"), disabled)),
|
|
93
96
|
style: Taro.getEnv() === 'WEB' ? undefined : style,
|
|
94
97
|
disabled: Taro.getEnv() === 'WEB' ? disabled : disabled || readOnly,
|
|
95
98
|
// @ts-ignore
|
|
96
99
|
value: inputValue,
|
|
97
|
-
onInput:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
onBlur: function(e) {
|
|
101
|
-
return handleBlur(e);
|
|
102
|
-
},
|
|
103
|
-
onFocus: function(e) {
|
|
104
|
-
return handleFocus(e);
|
|
105
|
-
},
|
|
100
|
+
onInput: handleChange,
|
|
101
|
+
onBlur: handleBlur,
|
|
102
|
+
onFocus: handleFocus,
|
|
106
103
|
autoHeight: autoSize,
|
|
107
104
|
maxlength: maxLength,
|
|
108
|
-
placeholder: placeholder
|
|
109
|
-
}
|
|
110
|
-
className: "".concat(classPrefix, "-limit
|
|
105
|
+
placeholder: placeholder !== undefined ? placeholder : locale.placeholder
|
|
106
|
+
})), showCount && /*#__PURE__*/ React.createElement(Text, {
|
|
107
|
+
className: classNames("".concat(classPrefix, "-limit"), _define_property({}, "".concat(classPrefix, "-limit-disabled"), disabled))
|
|
111
108
|
}, inputValue.length, "/", maxLength < 0 ? 0 : maxLength)));
|
|
112
109
|
};
|
|
113
110
|
TextArea.displayName = 'NutTextArea';
|
|
@@ -8,8 +8,8 @@ import { Text, View } from "@tarojs/components";
|
|
|
8
8
|
import { Failure, Loading, Success, Tips } from "@nutui/icons-react-taro";
|
|
9
9
|
import Overlay from "../overlay/index";
|
|
10
10
|
import { defaultOverlayProps } from "../overlay/overlay";
|
|
11
|
-
import { customEvents, useCustomEvent, useCustomEventsPath, useParams } from "../../
|
|
12
|
-
import { usePropsValue } from "../../
|
|
11
|
+
import { customEvents, useCustomEvent, useCustomEventsPath, useParams } from "../../hooks/use-custom-event";
|
|
12
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
13
13
|
import { useRtl } from "../configprovider/index";
|
|
14
14
|
import { harmony } from "../../utils/platform-taro";
|
|
15
15
|
import { mergeProps } from "../../utils/merge-props";
|
|
@@ -26,7 +26,7 @@ export interface TourProps extends BasicComponent {
|
|
|
26
26
|
* 弹出层位置,同 Popopver 的[location 属性](https://nutui.jd.com/h5/react/2x/#/zh-CN/component/popover)
|
|
27
27
|
* @default bottom
|
|
28
28
|
*/
|
|
29
|
-
location: PopoverLocation
|
|
29
|
+
location: PopoverLocation
|
|
30
30
|
/**
|
|
31
31
|
* 是否显示镂空遮罩
|
|
32
32
|
* @default true
|
|
@@ -6,7 +6,7 @@ import { Close } from "@nutui/icons-react-taro";
|
|
|
6
6
|
import classNames from "classnames";
|
|
7
7
|
import { View } from "@tarojs/components";
|
|
8
8
|
import Popover from "../popover/index";
|
|
9
|
-
import { getTaroRectById } from "../../
|
|
9
|
+
import { getTaroRectById } from "../../hooks/use-taro-rect";
|
|
10
10
|
import { ComponentDefaults } from "../../utils/typings";
|
|
11
11
|
import { useConfig } from "../configprovider/index";
|
|
12
12
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { FixAutoComplete } from "../../types/fix-string-literal-union";
|
|
1
2
|
export type FileItem = {
|
|
2
3
|
status?: FileItemStatus;
|
|
3
4
|
message?: string;
|
|
4
5
|
uid?: string | number;
|
|
5
6
|
name?: string;
|
|
6
7
|
url?: string;
|
|
7
|
-
type?: 'image' | 'list'
|
|
8
|
+
type?: FixAutoComplete<'image' | 'list'>;
|
|
8
9
|
path?: string;
|
|
9
10
|
loadingIcon?: React.ReactNode;
|
|
10
11
|
failIcon?: React.ReactNode;
|
|
@@ -14,7 +14,7 @@ import Button from "../button/index";
|
|
|
14
14
|
import { useConfig } from "../configprovider/index";
|
|
15
15
|
import { funcInterceptor } from "../../utils/interceptor";
|
|
16
16
|
import { ComponentDefaults } from "../../utils/typings";
|
|
17
|
-
import { usePropsValue } from "../../
|
|
17
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
18
18
|
import { Preview } from "./preview";
|
|
19
19
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
20
20
|
maxCount: Number.MAX_VALUE,
|
|
@@ -4,8 +4,8 @@ import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_
|
|
|
4
4
|
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
5
5
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { ScrollView, View } from "@tarojs/components";
|
|
7
|
-
import { getSystemInfoSync } from "@tarojs/taro";
|
|
8
7
|
import classNames from "classnames";
|
|
8
|
+
import { getWindowInfo } from "../../utils/get-system-info";
|
|
9
9
|
import { initPositinoCache, updateItemSize } from "./utils";
|
|
10
10
|
import { ComponentDefaults } from "../../utils/typings";
|
|
11
11
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
@@ -29,7 +29,7 @@ export var VirtualList = function(props) {
|
|
|
29
29
|
"containerHeight"
|
|
30
30
|
]);
|
|
31
31
|
var clientHeight = useMemo(function() {
|
|
32
|
-
return
|
|
32
|
+
return getWindowInfo().windowHeight - 5 || 667;
|
|
33
33
|
}, []);
|
|
34
34
|
var containerHeight = useMemo(function() {
|
|
35
35
|
return origContainerHeight !== null && origContainerHeight !== void 0 ? origContainerHeight : clientHeight;
|