@nutui/nutui-react-taro 2.0.10 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/esm/Address.js +2 -2
- package/dist/esm/Audio.js +2 -2
- package/dist/esm/Calendar.js +3 -3
- package/dist/esm/CalendarItem.js +2 -2
- package/dist/esm/ConfigProvider.js +2 -2
- package/dist/esm/CountDown.js +2 -2
- package/dist/esm/DatePicker.js +3 -3
- package/dist/esm/Dialog.js +2 -2
- package/dist/esm/Empty.js +2 -2
- package/dist/esm/FixedNav.js +2 -2
- package/dist/esm/Grid.js +3 -3
- package/dist/esm/GridItem.js +2 -2
- package/dist/esm/InfiniteLoading.js +2 -2
- package/dist/esm/Input.js +2 -2
- package/dist/esm/NumberKeyboard.js +2 -2
- package/dist/esm/Pagination.js +2 -2
- package/dist/esm/Picker.js +2 -2
- package/dist/esm/Popover.js +1 -1
- package/dist/esm/PullToRefresh.js +2 -2
- package/dist/esm/SearchBar.js +2 -2
- package/dist/esm/ShortPassword.js +2 -2
- package/dist/esm/Switch.js +1 -1
- package/dist/esm/Tabbar.js +2 -2
- package/dist/esm/TabbarItem.js +1 -1
- package/dist/esm/Table.js +2 -2
- package/dist/esm/TextArea.js +2 -2
- package/dist/esm/TimeSelect.js +2 -2
- package/dist/esm/Tour/style/css.js +1 -0
- package/dist/esm/Tour/style/index.js +2 -0
- package/dist/esm/Tour/style/style.css +1 -0
- package/dist/esm/Tour.js +17 -0
- package/dist/esm/Uploader/style/style.css +1 -1
- package/dist/esm/Uploader.js +2 -2
- package/dist/esm/WaterMark.js +2 -2
- package/dist/esm/{address.taro-477dd6df.js → address.taro-99b90732.js} +1 -1
- package/dist/esm/{audio.taro-8398218d.js → audio.taro-e85bb3b8.js} +1 -1
- package/dist/esm/{calendar.taro-cc40e611.js → calendar.taro-e980d2f0.js} +2 -2
- package/dist/esm/{calendaritem.taro-a18d8bd4.js → calendaritem.taro-9b37d00c.js} +1 -1
- package/dist/esm/{configprovider.taro-974adb9a.js → configprovider.taro-3a23ea84.js} +5 -0
- package/dist/esm/{countdown.taro-43884964.js → countdown.taro-80f2110b.js} +1 -1
- package/dist/esm/{datepicker.taro-8dd27172.js → datepicker.taro-2d333eb7.js} +2 -2
- package/dist/esm/{dialog.taro-0a2dfa58.js → dialog.taro-e9b5bc9d.js} +1 -1
- package/dist/esm/{empty.taro-bfe29449.js → empty.taro-cef66b01.js} +1 -1
- package/dist/esm/{fixednav.taro-579c4f66.js → fixednav.taro-fa851179.js} +1 -1
- package/dist/esm/{grid.taro-1fdfe6eb.js → grid.taro-6f1b764c.js} +1 -1
- package/dist/esm/{griditem.taro-751fb091.js → griditem.taro-0d03a061.js} +1 -1
- package/dist/esm/{infiniteloading.taro-87006d3e.js → infiniteloading.taro-590cfd4f.js} +1 -1
- package/dist/esm/{input.taro-fb8e7a49.js → input.taro-abe6d65e.js} +1 -1
- package/dist/esm/{numberkeyboard.taro-c4fc80ed.js → numberkeyboard.taro-0ee2f055.js} +2 -2
- package/dist/esm/nutui-react.es.js +37 -34
- package/dist/esm/{pagination.taro-afc104ce.js → pagination.taro-c2521fdf.js} +1 -1
- package/dist/esm/{picker.taro-7e4954f3.js → picker.taro-e387b0f3.js} +1 -1
- package/dist/esm/{popover.taro-fbf1ba5e.js → popover.taro-437724d4.js} +35 -3
- package/dist/esm/{pulltorefresh.taro-efb36521.js → pulltorefresh.taro-2b4a48be.js} +1 -1
- package/dist/esm/{searchbar.taro-14821587.js → searchbar.taro-75cf9937.js} +1 -1
- package/dist/esm/{shortpassword.taro-2533954b.js → shortpassword.taro-04749137.js} +1 -1
- package/dist/esm/{switch.taro-bbdada9e.js → switch.taro-9c344336.js} +2 -2
- package/dist/esm/{tabbar.taro-3046d794.js → tabbar.taro-ac4f72b9.js} +1 -1
- package/dist/esm/{tabbaritem.taro-fdaf7d3a.js → tabbaritem.taro-1d27af28.js} +2 -2
- package/dist/esm/{table.taro-0254a4e5.js → table.taro-48e8265e.js} +1 -1
- package/dist/esm/{textarea.taro-38d284c4.js → textarea.taro-115dc986.js} +1 -1
- package/dist/esm/{timeselect.taro-3f2aa90b.js → timeselect.taro-57650920.js} +1 -1
- package/dist/esm/tour.taro-105eadd5.js +184 -0
- package/dist/esm/types/src/locales/base.d.ts +5 -0
- package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -1
- package/dist/esm/types/src/packages/nutui.react.build.d.ts +3 -1
- package/dist/esm/types/src/packages/nutui.react.d.ts +5 -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/popover/popover.d.ts +1 -0
- package/dist/esm/types/src/packages/popover/popover.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/tour/__test__/tour.spec.d.ts +1 -0
- package/dist/esm/types/src/packages/tour/demo.d.ts +4 -0
- package/dist/esm/types/src/packages/tour/demo.taro.d.ts +4 -0
- package/dist/esm/types/src/packages/tour/index.d.ts +3 -0
- package/dist/esm/types/src/packages/tour/index.taro.d.ts +3 -0
- package/dist/esm/types/src/packages/tour/tour.d.ts +31 -0
- package/dist/esm/types/src/packages/tour/tour.taro.d.ts +31 -0
- package/dist/esm/types/src/utils/typings.d.ts +1 -0
- package/dist/esm/types/src/utils/use-taro-rect.d.ts +1 -0
- package/dist/esm/{uploader.taro-f834c8ff.js → uploader.taro-cdb38c18.js} +4 -3
- package/dist/esm/{watermark.taro-c269110c.js → watermark.taro-cea2fceb.js} +1 -1
- package/dist/locales/base.d.ts +5 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +6 -1
- package/dist/locales/id-ID.js +6 -1
- package/dist/locales/tr-TR.js +6 -1
- package/dist/locales/zh-CN.js +6 -1
- package/dist/locales/zh-TW.js +6 -1
- package/dist/locales/zh-UG.js +6 -1
- package/dist/nutui.react.es.js +628 -378
- package/dist/nutui.react.umd.js +628 -378
- package/dist/packages/tour/tour.scss +78 -0
- package/dist/packages/uploader/uploader.scss +1 -0
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/themes/default.scss +1 -0
- package/dist/styles/variables.scss +33 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/locales/base.d.ts +5 -0
- package/dist/types/packages/configprovider/types.d.ts +1 -1
- package/dist/types/packages/popover/popover.taro.d.ts +1 -0
- package/dist/types/packages/tour/index.taro.d.ts +3 -0
- package/dist/types/packages/tour/tour.taro.d.ts +95 -0
- package/dist/types/utils/typings.d.ts +1 -0
- package/dist/types/utils/use-taro-rect.d.ts +1 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import classNames from "classnames";
|
|
|
3
3
|
import { RectDown } from "@nutui/icons-react-taro";
|
|
4
4
|
import { View } from "@tarojs/components";
|
|
5
5
|
import { P as Popup } from "./popup.taro-6ecef0f4.js";
|
|
6
|
-
import { u as useConfig } from "./configprovider.taro-
|
|
6
|
+
import { u as useConfig } from "./configprovider.taro-3a23ea84.js";
|
|
7
7
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
8
8
|
const defaultProps = {
|
|
9
9
|
...ComponentDefaults,
|
|
@@ -105,7 +105,7 @@ const NumberKeyboard = (props) => {
|
|
|
105
105
|
"div",
|
|
106
106
|
{ className: `${classPrefix}__header` },
|
|
107
107
|
React__default.createElement("h3", { className: `${classPrefix}__header__title` }, title),
|
|
108
|
-
type === "default" && React__default.createElement("span", { className: `${classPrefix}__header__close`, onClick:
|
|
108
|
+
type === "default" && React__default.createElement("span", { className: `${classPrefix}__header__close`, onClick: onConfirm }, locale.done)
|
|
109
109
|
),
|
|
110
110
|
React__default.createElement(
|
|
111
111
|
"div",
|
|
@@ -1,95 +1,96 @@
|
|
|
1
1
|
import { B } from "./button.taro-25f559e1.js";
|
|
2
2
|
import { C } from "./cell.taro-0a9f80bc.js";
|
|
3
3
|
import { C as C2 } from "./cellgroup.taro-d2fad5e7.js";
|
|
4
|
-
import { C as C3 } from "./configprovider.taro-
|
|
4
|
+
import { C as C3 } from "./configprovider.taro-3a23ea84.js";
|
|
5
5
|
import { I } from "./image.taro-a7ad2272.js";
|
|
6
6
|
import { O } from "./overlay.taro-8f1e4912.js";
|
|
7
7
|
import { C as C4 } from "./col.taro-23d5f6bd.js";
|
|
8
8
|
import { D } from "./divider.taro-c61ab869.js";
|
|
9
|
-
import { G } from "./grid.taro-
|
|
10
|
-
import { G as G2 } from "./griditem.taro-
|
|
9
|
+
import { G } from "./grid.taro-6f1b764c.js";
|
|
10
|
+
import { G as G2 } from "./griditem.taro-0d03a061.js";
|
|
11
11
|
import { L } from "./layout.taro-7711a89c.js";
|
|
12
12
|
import { R } from "./row.taro-a71fbf76.js";
|
|
13
13
|
import { S } from "./space.taro-a7e4ced4.js";
|
|
14
14
|
import { S as S2 } from "./sticky.taro-2d78a04e.js";
|
|
15
15
|
import { B as B2 } from "./backtop.taro-61b1eeaf.js";
|
|
16
16
|
import { E } from "./elevator.taro-cdf3dba7.js";
|
|
17
|
-
import { F } from "./fixednav.taro-
|
|
17
|
+
import { F } from "./fixednav.taro-fa851179.js";
|
|
18
18
|
import { N } from "./navbar.taro-23394f73.js";
|
|
19
19
|
import { S as S3 } from "./sidenavbar.taro-1fb6115f.js";
|
|
20
20
|
import { S as S4 } from "./sidenavbaritem.taro-69b0784d.js";
|
|
21
21
|
import { S as S5 } from "./subsidenavbar.taro-797ce379.js";
|
|
22
|
-
import { T } from "./tabbar.taro-
|
|
23
|
-
import { T as T2 } from "./tabbaritem.taro-
|
|
22
|
+
import { T } from "./tabbar.taro-ac4f72b9.js";
|
|
23
|
+
import { T as T2 } from "./tabbaritem.taro-1d27af28.js";
|
|
24
24
|
import { T as T3 } from "./tabpane.taro-d0eea168.js";
|
|
25
25
|
import { T as T4 } from "./tabs.taro-eceaf324.js";
|
|
26
|
-
import { A } from "./address.taro-
|
|
27
|
-
import { C as C5 } from "./calendar.taro-
|
|
28
|
-
import { C as C6 } from "./calendaritem.taro-
|
|
26
|
+
import { A } from "./address.taro-99b90732.js";
|
|
27
|
+
import { C as C5 } from "./calendar.taro-e980d2f0.js";
|
|
28
|
+
import { C as C6 } from "./calendaritem.taro-9b37d00c.js";
|
|
29
29
|
import { C as C7 } from "./cascader.taro-96449f5a.js";
|
|
30
30
|
import { C as C8, a } from "./checkbox.taro-07d5c9d5.js";
|
|
31
|
-
import { D as D2 } from "./datepicker.taro-
|
|
31
|
+
import { D as D2 } from "./datepicker.taro-2d333eb7.js";
|
|
32
32
|
import { F as F2 } from "./form.taro-16cb71e2.js";
|
|
33
33
|
import { F as F3 } from "./formitem.taro-34af0204.js";
|
|
34
|
-
import { I as I2 } from "./input.taro-
|
|
34
|
+
import { I as I2 } from "./input.taro-abe6d65e.js";
|
|
35
35
|
import { I as I3 } from "./inputnumber.taro-9c74cc1c.js";
|
|
36
36
|
import { M } from "./menu.taro-7cab4e8c.js";
|
|
37
37
|
import { M as M2 } from "./menuitem.taro-567bf91f.js";
|
|
38
|
-
import { N as N2 } from "./numberkeyboard.taro-
|
|
39
|
-
import { P } from "./picker.taro-
|
|
38
|
+
import { N as N2 } from "./numberkeyboard.taro-0ee2f055.js";
|
|
39
|
+
import { P } from "./picker.taro-e387b0f3.js";
|
|
40
40
|
import { R as R2, a as a2 } from "./radio.taro-802db0e9.js";
|
|
41
41
|
import { R as R3 } from "./range.taro-70101605.js";
|
|
42
42
|
import { R as R4 } from "./rate.taro-f090e140.js";
|
|
43
|
-
import { S as S6 } from "./searchbar.taro-
|
|
44
|
-
import { S as S7 } from "./shortpassword.taro-
|
|
43
|
+
import { S as S6 } from "./searchbar.taro-75cf9937.js";
|
|
44
|
+
import { S as S7 } from "./shortpassword.taro-04749137.js";
|
|
45
45
|
import { S as S8 } from "./signature.taro-3e0c2694.js";
|
|
46
|
-
import { S as S9 } from "./switch.taro-
|
|
47
|
-
import { T as T5 } from "./textarea.taro-
|
|
48
|
-
import { U } from "./uploader.taro-
|
|
46
|
+
import { S as S9 } from "./switch.taro-9c344336.js";
|
|
47
|
+
import { T as T5 } from "./textarea.taro-115dc986.js";
|
|
48
|
+
import { U } from "./uploader.taro-cdb38c18.js";
|
|
49
49
|
import { A as A2 } from "./actionsheet.taro-b642975d.js";
|
|
50
50
|
import { B as B3 } from "./badge.taro-289489e5.js";
|
|
51
|
-
import { B as B4 } from "./dialog.taro-
|
|
51
|
+
import { B as B4 } from "./dialog.taro-e9b5bc9d.js";
|
|
52
52
|
import { D as D3 } from "./drag.taro-ce333e51.js";
|
|
53
|
-
import { E as E2 } from "./empty.taro-
|
|
54
|
-
import { I as I4 } from "./infiniteloading.taro-
|
|
53
|
+
import { E as E2 } from "./empty.taro-cef66b01.js";
|
|
54
|
+
import { I as I4 } from "./infiniteloading.taro-590cfd4f.js";
|
|
55
55
|
import { L as L2 } from "./loading.taro-0799622f.js";
|
|
56
56
|
import { N as N3 } from "./noticebar.taro-d95c13b6.js";
|
|
57
57
|
import { N as N4 } from "./notify.taro-687d6f8c.js";
|
|
58
|
-
import { P as P2 } from "./popover.taro-
|
|
58
|
+
import { P as P2 } from "./popover.taro-437724d4.js";
|
|
59
59
|
import { P as P3 } from "./popup.taro-6ecef0f4.js";
|
|
60
|
-
import { P as P4 } from "./pulltorefresh.taro-
|
|
60
|
+
import { P as P4 } from "./pulltorefresh.taro-2b4a48be.js";
|
|
61
61
|
import { S as S10 } from "./skeleton.taro-51b91a1a.js";
|
|
62
62
|
import { S as S11 } from "./swipe.taro-36f8782e.js";
|
|
63
63
|
import { T as T6 } from "./toast.taro-9e5afd6d.js";
|
|
64
64
|
import { A as A3 } from "./animate.taro-37bf4eab.js";
|
|
65
65
|
import { default as default2 } from "./AnimatingNumbers.js";
|
|
66
|
-
import { A as A4 } from "./audio.taro-
|
|
66
|
+
import { A as A4 } from "./audio.taro-e85bb3b8.js";
|
|
67
67
|
import { A as A5 } from "./avatar.taro-dd654a49.js";
|
|
68
68
|
import { A as A6 } from "./avatargroup.taro-1f8b7174.js";
|
|
69
69
|
import { C as C9 } from "./circleprogress.taro-417e1d3f.js";
|
|
70
70
|
import { C as C10 } from "./collapse.taro-bd6b2bb3.js";
|
|
71
71
|
import { C as C11 } from "./collapseitem.taro-e99fb1a2.js";
|
|
72
|
-
import { C as C12 } from "./countdown.taro-
|
|
72
|
+
import { C as C12 } from "./countdown.taro-80f2110b.js";
|
|
73
73
|
import { E as E3 } from "./ellipsis.taro-21b13b31.js";
|
|
74
74
|
import { I as I5 } from "./imagepreview.taro-0daf3f50.js";
|
|
75
75
|
import { I as I6 } from "./indicator.taro-4ed0d6da.js";
|
|
76
|
-
import { P as P5 } from "./pagination.taro-
|
|
76
|
+
import { P as P5 } from "./pagination.taro-c2521fdf.js";
|
|
77
77
|
import { P as P6 } from "./price.taro-0bd3f07a.js";
|
|
78
78
|
import { P as P7 } from "./progress.taro-421575b9.js";
|
|
79
79
|
import { S as S12 } from "./step.taro-dd522794.js";
|
|
80
80
|
import { S as S13 } from "./steps.taro-0680ae4f.js";
|
|
81
81
|
import { default as default3 } from "./Swiper.js";
|
|
82
82
|
import { S as S14 } from "./swiperitem.taro-da39a67b.js";
|
|
83
|
-
import { T as T7 } from "./table.taro-
|
|
83
|
+
import { T as T7 } from "./table.taro-48e8265e.js";
|
|
84
84
|
import { T as T8 } from "./tag.taro-518b9c70.js";
|
|
85
|
+
import { T as T9 } from "./tour.taro-105eadd5.js";
|
|
85
86
|
import { V } from "./video.taro-672ca6b8.js";
|
|
86
87
|
import { V as V2 } from "./virtuallist.taro-e552d954.js";
|
|
87
88
|
import { B as B5 } from "./barrage.taro-d77c34b4.js";
|
|
88
89
|
import { C as C13 } from "./card.taro-c0e9cfba.js";
|
|
89
|
-
import { T as
|
|
90
|
-
import { T as
|
|
91
|
-
import { T as
|
|
92
|
-
import { W } from "./watermark.taro-
|
|
90
|
+
import { T as T10 } from "./timedetail.taro-958b8c07.js";
|
|
91
|
+
import { T as T11 } from "./timeselect.taro-57650920.js";
|
|
92
|
+
import { T as T12 } from "./trendarrow.taro-53d6e250.js";
|
|
93
|
+
import { W } from "./watermark.taro-cea2fceb.js";
|
|
93
94
|
import "react";
|
|
94
95
|
import "classnames";
|
|
95
96
|
import "@nutui/icons-react-taro";
|
|
@@ -107,6 +108,7 @@ import "./use-touch-ff43512c.js";
|
|
|
107
108
|
import "./index-e3184f19.js";
|
|
108
109
|
import "react-dom";
|
|
109
110
|
import "./context-ab42ba7f.js";
|
|
111
|
+
import "./ConfigProvider.js";
|
|
110
112
|
export {
|
|
111
113
|
A2 as ActionSheet,
|
|
112
114
|
A as Address,
|
|
@@ -194,10 +196,11 @@ export {
|
|
|
194
196
|
T4 as Tabs,
|
|
195
197
|
T8 as Tag,
|
|
196
198
|
T5 as TextArea,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
+
T10 as TimeDetail,
|
|
200
|
+
T11 as TimeSelect,
|
|
199
201
|
T6 as Toast,
|
|
200
|
-
|
|
202
|
+
T9 as Tour,
|
|
203
|
+
T12 as TrendArrow,
|
|
201
204
|
U as Uploader,
|
|
202
205
|
V as Video,
|
|
203
206
|
V2 as VirtualList,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useMemo } from "react";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
-
import { u as useConfig } from "./configprovider.taro-
|
|
3
|
+
import { u as useConfig } from "./configprovider.taro-3a23ea84.js";
|
|
4
4
|
import { u as usePropsValue } from "./use-props-value-e8331e19.js";
|
|
5
5
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
6
6
|
const defaultProps = {
|
|
@@ -6,7 +6,7 @@ import { P as Popup } from "./popup.taro-6ecef0f4.js";
|
|
|
6
6
|
import { u as useTouch } from "./use-touch-ff43512c.js";
|
|
7
7
|
import { g as getRectByTaro } from "./use-client-rect-2bb6c562.js";
|
|
8
8
|
import { c as canUseDom } from "./can-use-dom-0e539bd3.js";
|
|
9
|
-
import { u as useConfig } from "./configprovider.taro-
|
|
9
|
+
import { u as useConfig } from "./configprovider.taro-3a23ea84.js";
|
|
10
10
|
import { u as usePropsValue } from "./use-props-value-e8331e19.js";
|
|
11
11
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
12
12
|
let passiveSupported = false;
|
|
@@ -10,6 +10,7 @@ const defaultProps = {
|
|
|
10
10
|
location: "bottom",
|
|
11
11
|
visible: false,
|
|
12
12
|
offset: [0, 12],
|
|
13
|
+
arrowOffset: 0,
|
|
13
14
|
targetId: "",
|
|
14
15
|
className: "",
|
|
15
16
|
showArrow: true,
|
|
@@ -25,7 +26,7 @@ const defaultProps = {
|
|
|
25
26
|
};
|
|
26
27
|
const classPrefix = `nut-popover`;
|
|
27
28
|
const Popover = (props) => {
|
|
28
|
-
const { children, list, location, visible, offset, targetId, overlay, closeOnOutsideClick, closeOnActionClick, className, showArrow, style, onClick, onOpen, onClose, onSelect, ...rest } = {
|
|
29
|
+
const { children, list, location, visible, offset, targetId, overlay, closeOnOutsideClick, closeOnActionClick, className, showArrow, arrowOffset, style, onClick, onOpen, onClose, onSelect, ...rest } = {
|
|
29
30
|
...defaultProps,
|
|
30
31
|
...props
|
|
31
32
|
};
|
|
@@ -149,6 +150,37 @@ const Popover = (props) => {
|
|
|
149
150
|
}
|
|
150
151
|
return styles;
|
|
151
152
|
};
|
|
153
|
+
const popoverArrowStyle = () => {
|
|
154
|
+
const styles = {};
|
|
155
|
+
const direction = location.split("-")[0];
|
|
156
|
+
const skew = location.split("-")[1];
|
|
157
|
+
const base = 16;
|
|
158
|
+
if (props.arrowOffset !== 0) {
|
|
159
|
+
if (["bottom", "top"].includes(direction)) {
|
|
160
|
+
if (!skew) {
|
|
161
|
+
styles.left = `calc(50% + ${arrowOffset}px)`;
|
|
162
|
+
}
|
|
163
|
+
if (skew === "start") {
|
|
164
|
+
styles.left = `${base + arrowOffset}px`;
|
|
165
|
+
}
|
|
166
|
+
if (skew === "end") {
|
|
167
|
+
styles.right = `${base - arrowOffset}px`;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (["left", "right"].includes(direction)) {
|
|
171
|
+
if (!skew) {
|
|
172
|
+
styles.top = `calc(50% - ${arrowOffset}px)`;
|
|
173
|
+
}
|
|
174
|
+
if (skew === "start") {
|
|
175
|
+
styles.top = `${base - arrowOffset}px`;
|
|
176
|
+
}
|
|
177
|
+
if (skew === "end") {
|
|
178
|
+
styles.bottom = `${base + arrowOffset}px`;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return styles;
|
|
183
|
+
};
|
|
152
184
|
const handleSelect = (item, index) => {
|
|
153
185
|
if (!item.disabled) {
|
|
154
186
|
onSelect && onSelect(item, index);
|
|
@@ -178,7 +210,7 @@ const Popover = (props) => {
|
|
|
178
210
|
React__default.createElement(
|
|
179
211
|
"div",
|
|
180
212
|
{ className: "nut-popover-content-group", ref: popoverContentRef },
|
|
181
|
-
showArrow && React__default.createElement("div", { className: popoverArrow() }),
|
|
213
|
+
showArrow && React__default.createElement("div", { className: popoverArrow(), style: popoverArrowStyle() }),
|
|
182
214
|
Array.isArray(children) ? children[1] : "",
|
|
183
215
|
list.map((item, index) => {
|
|
184
216
|
return React__default.createElement(
|
|
@@ -193,7 +225,7 @@ const Popover = (props) => {
|
|
|
193
225
|
})
|
|
194
226
|
)
|
|
195
227
|
),
|
|
196
|
-
showPopup && React__default.createElement("div", { className: "nut-popover-content-bg", onClick: clickAway, onTouchMove: clickAway })
|
|
228
|
+
showPopup && closeOnOutsideClick && React__default.createElement("div", { className: "nut-popover-content-bg", onClick: clickAway, onTouchMove: clickAway })
|
|
197
229
|
)
|
|
198
230
|
);
|
|
199
231
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useRef, useState } from "react";
|
|
2
2
|
import { View } from "@tarojs/components";
|
|
3
|
-
import { u as useConfig } from "./configprovider.taro-
|
|
3
|
+
import { u as useConfig } from "./configprovider.taro-3a23ea84.js";
|
|
4
4
|
import { u as useTouch } from "./use-touch-ff43512c.js";
|
|
5
5
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
6
6
|
function bound(position, min, max) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useRef, useState, useEffect } from "react";
|
|
2
2
|
import { Search, CircleClose } from "@nutui/icons-react-taro";
|
|
3
|
-
import { u as useConfig } from "./configprovider.taro-
|
|
3
|
+
import { u as useConfig } from "./configprovider.taro-3a23ea84.js";
|
|
4
4
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
5
5
|
const defaultProps = {
|
|
6
6
|
...ComponentDefaults,
|
|
@@ -2,7 +2,7 @@ import React__default, { useMemo, useEffect } from "react";
|
|
|
2
2
|
import { Tips } from "@nutui/icons-react-taro";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { P as Popup } from "./popup.taro-6ecef0f4.js";
|
|
5
|
-
import { u as useConfig } from "./configprovider.taro-
|
|
5
|
+
import { u as useConfig } from "./configprovider.taro-3a23ea84.js";
|
|
6
6
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
7
7
|
import { u as usePropsValue } from "./use-props-value-e8331e19.js";
|
|
8
8
|
const defaultProps = {
|
|
@@ -8,7 +8,7 @@ const defaultProps = {
|
|
|
8
8
|
inactiveText: ""
|
|
9
9
|
};
|
|
10
10
|
const Switch = (props) => {
|
|
11
|
-
const { checked, defaultChecked, disabled, activeText, inactiveText, className, style, onChange } = {
|
|
11
|
+
const { checked, defaultChecked, disabled, activeText, inactiveText, className, style, onChange, ...rest } = {
|
|
12
12
|
...defaultProps,
|
|
13
13
|
...props
|
|
14
14
|
};
|
|
@@ -28,7 +28,7 @@ const Switch = (props) => {
|
|
|
28
28
|
};
|
|
29
29
|
return React__default.createElement(
|
|
30
30
|
"div",
|
|
31
|
-
{ className: classes(), onClick: (e) => onClick(e), style },
|
|
31
|
+
{ className: classes(), onClick: (e) => onClick(e), style, ...rest },
|
|
32
32
|
React__default.createElement(
|
|
33
33
|
"div",
|
|
34
34
|
{ className: "switch-button" },
|
|
@@ -2,7 +2,7 @@ import React__default from "react";
|
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
4
4
|
import { u as usePropsValue } from "./use-props-value-e8331e19.js";
|
|
5
|
-
import { T as TabbarItem } from "./tabbaritem.taro-
|
|
5
|
+
import { T as TabbarItem } from "./tabbaritem.taro-1d27af28.js";
|
|
6
6
|
const defaultProps = {
|
|
7
7
|
...ComponentDefaults,
|
|
8
8
|
defaultValue: 0,
|
|
@@ -15,7 +15,7 @@ const defaultProps = {
|
|
|
15
15
|
right: "5"
|
|
16
16
|
};
|
|
17
17
|
const TabbarItem = (props) => {
|
|
18
|
-
const { className, style, title, icon, active, activeColor, inactiveColor, index, value, dot, max, top, right, handleClick } = {
|
|
18
|
+
const { className, style, title, icon, active, activeColor, inactiveColor, index, value, dot, max, top, right, handleClick, ...rest } = {
|
|
19
19
|
...defaultProps,
|
|
20
20
|
...props
|
|
21
21
|
};
|
|
@@ -38,7 +38,7 @@ const TabbarItem = (props) => {
|
|
|
38
38
|
return React__default.createElement("div", { className: tabbarItemClass, style: {
|
|
39
39
|
color: active ? activeColor : inactiveColor,
|
|
40
40
|
...style
|
|
41
|
-
}, onClick: () => handleClick(index) }, icon ? React__default.createElement(
|
|
41
|
+
}, onClick: () => handleClick(index), ...rest }, icon ? React__default.createElement(
|
|
42
42
|
React__default.Fragment,
|
|
43
43
|
null,
|
|
44
44
|
React__default.createElement(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useState, useEffect } from "react";
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { DownArrow } from "@nutui/icons-react-taro";
|
|
4
|
-
import { u as useConfig } from "./configprovider.taro-
|
|
4
|
+
import { u as useConfig } from "./configprovider.taro-3a23ea84.js";
|
|
5
5
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
6
6
|
const defaultProps = {
|
|
7
7
|
...ComponentDefaults,
|
|
@@ -2,7 +2,7 @@ import React__default, { useRef } from "react";
|
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import Taro from "@tarojs/taro";
|
|
4
4
|
import { Textarea } from "@tarojs/components";
|
|
5
|
-
import { u as useConfig } from "./configprovider.taro-
|
|
5
|
+
import { u as useConfig } from "./configprovider.taro-3a23ea84.js";
|
|
6
6
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
7
7
|
import { u as usePropsValue } from "./use-props-value-e8331e19.js";
|
|
8
8
|
const defaultProps = {
|
|
@@ -3,7 +3,7 @@ import classNames from "classnames";
|
|
|
3
3
|
import { P as Popup } from "./popup.taro-6ecef0f4.js";
|
|
4
4
|
import { T as TimeDetail } from "./timedetail.taro-958b8c07.js";
|
|
5
5
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
6
|
-
import { u as useConfig } from "./configprovider.taro-
|
|
6
|
+
import { u as useConfig } from "./configprovider.taro-3a23ea84.js";
|
|
7
7
|
const defaultProps = {
|
|
8
8
|
...ComponentDefaults,
|
|
9
9
|
visible: false,
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import React__default, { useState, useEffect } from "react";
|
|
2
|
+
import { Close } from "@nutui/icons-react-taro";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { P as Popover } from "./popover.taro-437724d4.js";
|
|
5
|
+
import Taro from "@tarojs/taro";
|
|
6
|
+
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
7
|
+
import { useConfig } from "./ConfigProvider.js";
|
|
8
|
+
const getTaroRectById = (id) => {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
if (Taro.getEnv() === Taro.ENV_TYPE.WEB) {
|
|
11
|
+
const t = document ? document.querySelector(`#${id}`) : "";
|
|
12
|
+
if (t) {
|
|
13
|
+
resolve(t == null ? void 0 : t.getBoundingClientRect());
|
|
14
|
+
}
|
|
15
|
+
reject();
|
|
16
|
+
} else {
|
|
17
|
+
const query = Taro.createSelectorQuery();
|
|
18
|
+
query.select(`#${id}`).boundingClientRect().exec(function(rect) {
|
|
19
|
+
if (rect[0]) {
|
|
20
|
+
resolve(rect[0]);
|
|
21
|
+
} else {
|
|
22
|
+
reject();
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
const defaultProps = {
|
|
29
|
+
...ComponentDefaults,
|
|
30
|
+
visible: false,
|
|
31
|
+
type: "step",
|
|
32
|
+
location: "bottom",
|
|
33
|
+
mask: true,
|
|
34
|
+
maskWidth: "",
|
|
35
|
+
maskHeight: "",
|
|
36
|
+
offset: [8, 10],
|
|
37
|
+
title: "",
|
|
38
|
+
next: "",
|
|
39
|
+
prev: "",
|
|
40
|
+
complete: "",
|
|
41
|
+
showPrev: true,
|
|
42
|
+
closeOnOverlayClick: true
|
|
43
|
+
};
|
|
44
|
+
const classPrefix = "nut-tour";
|
|
45
|
+
const Tour = (props) => {
|
|
46
|
+
const { locale } = useConfig();
|
|
47
|
+
const { children, className, title, closeOnOverlayClick, showPrev, list, type, location, visible, mask, maskWidth, maskHeight, offset, next, prev, complete, onClose, onChange, ...rest } = {
|
|
48
|
+
...defaultProps,
|
|
49
|
+
...props
|
|
50
|
+
};
|
|
51
|
+
const [showTour, setShowTour] = useState(false);
|
|
52
|
+
const [showPopup, setShowPopup] = useState(false);
|
|
53
|
+
const [active, setActive] = useState(0);
|
|
54
|
+
const [maskRect, setMaskRect] = useState({
|
|
55
|
+
top: 0,
|
|
56
|
+
left: 0,
|
|
57
|
+
right: 0,
|
|
58
|
+
bottom: 0,
|
|
59
|
+
width: 0,
|
|
60
|
+
height: 0
|
|
61
|
+
});
|
|
62
|
+
const classes = classNames(className, classPrefix);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (visible) {
|
|
65
|
+
getRootPosition();
|
|
66
|
+
}
|
|
67
|
+
setActive(0);
|
|
68
|
+
setShowTour(visible);
|
|
69
|
+
setShowPopup(visible);
|
|
70
|
+
}, [visible]);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (visible) {
|
|
73
|
+
setShowPopup(true);
|
|
74
|
+
getRootPosition();
|
|
75
|
+
}
|
|
76
|
+
}, [active]);
|
|
77
|
+
const getRootPosition = () => {
|
|
78
|
+
getTaroRectById(list[active].target).then((rect) => {
|
|
79
|
+
console.log("rect", rect);
|
|
80
|
+
setMaskRect({
|
|
81
|
+
top: rect.top,
|
|
82
|
+
left: rect.left,
|
|
83
|
+
right: rect.right,
|
|
84
|
+
bottom: rect.bottom,
|
|
85
|
+
width: rect.width,
|
|
86
|
+
height: rect.height
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
const maskStyle = () => {
|
|
91
|
+
const { width, height, left, top } = maskRect;
|
|
92
|
+
const center = [left + width / 2, top + height / 2];
|
|
93
|
+
const w = Number(maskWidth || width);
|
|
94
|
+
const h = Number(maskHeight || height);
|
|
95
|
+
const styles = {
|
|
96
|
+
width: `${w + +offset[1] * 2}px`,
|
|
97
|
+
height: `${h + +offset[0] * 2}px`,
|
|
98
|
+
top: `${center[1] - h / 2 - +offset[0]}px`,
|
|
99
|
+
left: `${center[0] - w / 2 - +offset[1]}px`
|
|
100
|
+
};
|
|
101
|
+
return styles;
|
|
102
|
+
};
|
|
103
|
+
const maskClose = (e) => {
|
|
104
|
+
setShowTour(false);
|
|
105
|
+
setShowPopup(false);
|
|
106
|
+
onClose && onClose(e);
|
|
107
|
+
};
|
|
108
|
+
const handleClickMask = (e) => {
|
|
109
|
+
closeOnOverlayClick && maskClose(e);
|
|
110
|
+
};
|
|
111
|
+
const changeStep = (type2) => {
|
|
112
|
+
if (type2 === "next") {
|
|
113
|
+
setActive(active + 1);
|
|
114
|
+
onChange && onChange(active + 1);
|
|
115
|
+
} else {
|
|
116
|
+
setActive(active - 1);
|
|
117
|
+
onChange && onChange(active - 1);
|
|
118
|
+
}
|
|
119
|
+
setShowPopup(false);
|
|
120
|
+
};
|
|
121
|
+
return React__default.createElement(
|
|
122
|
+
"div",
|
|
123
|
+
{ className: classes, ...rest },
|
|
124
|
+
React__default.createElement("div", { className: "nut-tour-masked", style: { display: showTour ? "block" : "none" }, onClick: handleClickMask }),
|
|
125
|
+
list.map((item, index) => {
|
|
126
|
+
return React__default.createElement("div", { key: index, style: { height: 0 } }, index === active && React__default.createElement(
|
|
127
|
+
React__default.Fragment,
|
|
128
|
+
null,
|
|
129
|
+
showTour && React__default.createElement("div", { className: `${mask ? "nut-tour-mask" : "nut-tour-mask nut-tour-mask-none"}`, id: "nut-tour-popid", style: maskStyle() }),
|
|
130
|
+
React__default.createElement(
|
|
131
|
+
Popover,
|
|
132
|
+
{ visible: showPopup, location: item.location || location, targetId: "nut-tour-popid", closeOnOutsideClick: false, offset: item.popoverOffset || [0, 12], arrowOffset: item.arrowOffset || 0 },
|
|
133
|
+
React__default.createElement(React__default.Fragment, null),
|
|
134
|
+
React__default.createElement(React__default.Fragment, null, children || React__default.createElement(
|
|
135
|
+
React__default.Fragment,
|
|
136
|
+
null,
|
|
137
|
+
type === "step" && React__default.createElement(
|
|
138
|
+
"div",
|
|
139
|
+
{ className: "nut-tour-content" },
|
|
140
|
+
title && React__default.createElement(
|
|
141
|
+
"div",
|
|
142
|
+
{ className: "nut-tour-content-top" },
|
|
143
|
+
React__default.createElement(
|
|
144
|
+
"div",
|
|
145
|
+
{ onClick: (e) => maskClose(e) },
|
|
146
|
+
React__default.createElement(Close, { className: "nut-tour-content-top-close" })
|
|
147
|
+
)
|
|
148
|
+
),
|
|
149
|
+
React__default.createElement("div", { className: "nut-tour-content-inner" }, item.content),
|
|
150
|
+
React__default.createElement(
|
|
151
|
+
"div",
|
|
152
|
+
{ className: "nut-tour-content-bottom" },
|
|
153
|
+
React__default.createElement(
|
|
154
|
+
"div",
|
|
155
|
+
{ className: "nut-tour-content-bottom-init" },
|
|
156
|
+
active + 1,
|
|
157
|
+
"/",
|
|
158
|
+
list.length
|
|
159
|
+
),
|
|
160
|
+
React__default.createElement(
|
|
161
|
+
"div",
|
|
162
|
+
{ className: "nut-tour-content-bottom-operate" },
|
|
163
|
+
active !== 0 && showPrev && React__default.createElement("div", { className: "nut-tour-content-bottom-operate-btn", onClick: () => changeStep("prev") }, prev || locale.tour.prevStepText),
|
|
164
|
+
list.length - 1 === active && React__default.createElement("div", { className: "nut-tour-content-bottom-operate-btn active", onClick: (e) => maskClose(e) }, complete || locale.tour.completeText),
|
|
165
|
+
list.length - 1 !== active && React__default.createElement("div", { className: "nut-tour-content-bottom-operate-btn active", onClick: () => changeStep("next") }, next || locale.tour.nextStepText)
|
|
166
|
+
)
|
|
167
|
+
)
|
|
168
|
+
),
|
|
169
|
+
type === "tile" && React__default.createElement(
|
|
170
|
+
"div",
|
|
171
|
+
{ className: "nut-tour-content nut-tour-content-tile" },
|
|
172
|
+
React__default.createElement("div", { className: "nut-tour-content-inner" }, item.content)
|
|
173
|
+
)
|
|
174
|
+
))
|
|
175
|
+
)
|
|
176
|
+
));
|
|
177
|
+
})
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
Tour.defaultProps = defaultProps;
|
|
181
|
+
Tour.displayName = "NutTour";
|
|
182
|
+
export {
|
|
183
|
+
Tour as T
|
|
184
|
+
};
|