@nutui/nutui 4.0.0 → 4.0.1-2.beta-1

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.
Files changed (285) hide show
  1. package/CHANGELOG.md +226 -0
  2. package/README.md +34 -65
  3. package/dist/nutui.es.js +10 -17
  4. package/dist/nutui.js +16202 -0
  5. package/dist/nutui.umd.js +1 -7
  6. package/dist/packages/_es/ActionSheet.js +79 -94
  7. package/dist/packages/_es/Address.js +260 -345
  8. package/dist/packages/_es/AddressList.js +269 -354
  9. package/dist/packages/_es/Animate.js +46 -38
  10. package/dist/packages/_es/Audio.js +128 -180
  11. package/dist/packages/_es/AudioOperate.js +60 -52
  12. package/dist/packages/_es/Avatar.js +67 -75
  13. package/dist/packages/_es/AvatarGroup.js +23 -31
  14. package/dist/packages/_es/Backtop.js +59 -99
  15. package/dist/packages/_es/Badge.js +39 -46
  16. package/dist/packages/_es/Barrage.js +68 -145
  17. package/dist/packages/_es/Button.js +47 -66
  18. package/dist/packages/_es/Calendar.js +135 -152
  19. package/dist/packages/_es/CalendarItem.js +6 -6
  20. package/dist/packages/_es/Card.js +42 -56
  21. package/dist/packages/_es/Cascader.js +323 -433
  22. package/dist/packages/_es/Category.js +29 -39
  23. package/dist/packages/_es/CategoryPane.js +57 -83
  24. package/dist/packages/_es/Cell.js +56 -71
  25. package/dist/packages/_es/CellGroup.js +19 -27
  26. package/dist/packages/_es/Checkbox.js +109 -138
  27. package/dist/packages/_es/CheckboxGroup.js +38 -61
  28. package/dist/packages/_es/CircleProgress.js +67 -96
  29. package/dist/packages/_es/Col.js +23 -31
  30. package/dist/packages/_es/Collapse.js +37 -67
  31. package/dist/packages/_es/CollapseItem.js +91 -184
  32. package/dist/packages/_es/Comment.js +207 -279
  33. package/dist/packages/_es/ConfigProvider.js +38 -56
  34. package/dist/packages/_es/Countdown.js +100 -194
  35. package/dist/packages/_es/Countup.js +232 -428
  36. package/dist/packages/_es/DatePicker.js +169 -245
  37. package/dist/packages/_es/Dialog.js +163 -188
  38. package/dist/packages/_es/Divider.js +42 -40
  39. package/dist/packages/_es/Drag.js +70 -153
  40. package/dist/packages/_es/Ecard.js +64 -104
  41. package/dist/packages/_es/Elevator.js +144 -201
  42. package/dist/packages/_es/Ellipsis.js +95 -159
  43. package/dist/packages/_es/Empty.js +23 -39
  44. package/dist/packages/_es/FixedNav.js +93 -116
  45. package/dist/packages/_es/Form.js +108 -164
  46. package/dist/packages/_es/FormItem.js +48 -61
  47. package/dist/packages/_es/Grid.js +5 -6
  48. package/dist/packages/_es/GridItem.js +58 -84
  49. package/dist/packages/_es/Image.js +98 -88
  50. package/dist/packages/_es/ImagePreview.js +262 -392
  51. package/dist/packages/_es/Indicator.js +30 -34
  52. package/dist/packages/_es/InfiniteLoading.js +83 -117
  53. package/dist/packages/_es/Input.js +176 -223
  54. package/dist/packages/_es/InputNumber.js +81 -117
  55. package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
  56. package/dist/packages/_es/Invoice.js +105 -113
  57. package/dist/packages/_es/Layout.js +3 -4
  58. package/dist/packages/_es/List.js +147 -89
  59. package/dist/packages/_es/Menu.js +96 -152
  60. package/dist/packages/_es/MenuItem.js +117 -153
  61. package/dist/packages/_es/Navbar.js +103 -119
  62. package/dist/packages/_es/Noticebar.js +207 -273
  63. package/dist/packages/_es/Notify.js +110 -147
  64. package/dist/packages/_es/NumberKeyboard.js +127 -202
  65. package/dist/packages/_es/Overlay.js +53 -66
  66. package/dist/packages/_es/Pagination.js +70 -100
  67. package/dist/packages/_es/Picker.js +276 -425
  68. package/dist/packages/_es/Popover.js +122 -225
  69. package/dist/packages/_es/Popup.js +4 -4
  70. package/dist/packages/_es/Price.js +47 -80
  71. package/dist/packages/_es/Progress.js +63 -79
  72. package/dist/packages/_es/PullRefresh.js +96 -157
  73. package/dist/packages/_es/Radio.js +4 -4
  74. package/dist/packages/_es/RadioGroup.js +3 -3
  75. package/dist/packages/_es/Range.js +205 -329
  76. package/dist/packages/_es/Rate.js +93 -122
  77. package/dist/packages/_es/Row.js +21 -27
  78. package/dist/packages/_es/Searchbar.js +130 -160
  79. package/dist/packages/_es/ShortPassword.js +69 -93
  80. package/dist/packages/_es/SideNavbar.js +49 -59
  81. package/dist/packages/_es/SideNavbarItem.js +22 -32
  82. package/dist/packages/_es/Signature.js +83 -128
  83. package/dist/packages/_es/Skeleton.js +110 -130
  84. package/dist/packages/_es/Sku.js +251 -326
  85. package/dist/packages/_es/Step.js +60 -69
  86. package/dist/packages/_es/Steps.js +26 -31
  87. package/dist/packages/_es/Sticky.js +4 -4
  88. package/dist/packages/_es/SubSideNavbar.js +52 -56
  89. package/dist/packages/_es/Swipe.js +84 -137
  90. package/dist/packages/_es/Swiper.js +175 -310
  91. package/dist/packages/_es/SwiperItem.js +28 -44
  92. package/dist/packages/_es/Switch.js +55 -67
  93. package/dist/packages/_es/TabPane.js +32 -20
  94. package/dist/packages/_es/Tabbar.js +41 -52
  95. package/dist/packages/_es/TabbarItem.js +61 -81
  96. package/dist/packages/_es/Table.js +110 -148
  97. package/dist/packages/_es/Tabs.js +284 -205
  98. package/dist/packages/_es/Tag.js +44 -61
  99. package/dist/packages/_es/Textarea.js +80 -124
  100. package/dist/packages/_es/TimeDetail.js +49 -57
  101. package/dist/packages/_es/TimePannel.js +35 -31
  102. package/dist/packages/_es/TimeSelect.js +47 -68
  103. package/dist/packages/_es/Toast.js +150 -203
  104. package/dist/packages/_es/Tour.js +139 -175
  105. package/dist/packages/_es/TrendArrow.js +57 -58
  106. package/dist/packages/_es/Uploader.js +235 -359
  107. package/dist/packages/_es/Video.js +191 -298
  108. package/dist/packages/_es/Watermark.js +84 -98
  109. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
  110. package/dist/packages/_es/common-d218746f.js +116 -0
  111. package/dist/packages/_es/component-234624bc.js +89 -0
  112. package/dist/packages/_es/index-14dfadc4.js +561 -0
  113. package/dist/packages/_es/index-192a3ef6.js +29 -0
  114. package/dist/packages/_es/index-360c5092.js +210 -0
  115. package/dist/packages/_es/index-496e6e05.js +24 -0
  116. package/dist/packages/_es/index-50eed3d9.js +7 -0
  117. package/dist/packages/_es/index-53ec2d4d.js +34 -0
  118. package/dist/packages/_es/index-fadb0974.js +8 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
  120. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
  121. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
  122. package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
  123. package/dist/packages/_es/pxCheck-38173291.js +4 -0
  124. package/dist/packages/_es/raf-a74f1a06.js +16 -0
  125. package/dist/packages/_es/renderIcon-47498b32.js +5 -0
  126. package/dist/packages/actionsheet/index.scss +2 -0
  127. package/dist/packages/actionsheet/style.mjs +0 -2
  128. package/dist/packages/address/index.scss +5 -2
  129. package/dist/packages/address/style.mjs +0 -3
  130. package/dist/packages/addresslist/index.scss +3 -0
  131. package/dist/packages/addresslist/style.mjs +0 -2
  132. package/dist/packages/audio/index.scss +2 -0
  133. package/dist/packages/audio/style.mjs +0 -1
  134. package/dist/packages/audiooperate/index.scss +2 -0
  135. package/dist/packages/audiooperate/style.mjs +0 -1
  136. package/dist/packages/badge/index.scss +3 -0
  137. package/dist/packages/button/index.scss +1 -1
  138. package/dist/packages/calendar/index.scss +3 -0
  139. package/dist/packages/calendar/style.mjs +0 -3
  140. package/dist/packages/card/index.scss +3 -0
  141. package/dist/packages/card/style.mjs +0 -2
  142. package/dist/packages/cascader/index.scss +4 -0
  143. package/dist/packages/cascader/style.mjs +0 -5
  144. package/dist/packages/cellgroup/index.scss +1 -1
  145. package/dist/packages/checkbox/index.scss +41 -0
  146. package/dist/packages/col/index.scss +2 -2
  147. package/dist/packages/comment/index.scss +2 -0
  148. package/dist/packages/comment/style.mjs +0 -1
  149. package/dist/packages/datepicker/index.scss +1 -2
  150. package/dist/packages/datepicker/style.mjs +0 -3
  151. package/dist/packages/dialog/index.scss +11 -0
  152. package/dist/packages/dialog/style.mjs +0 -3
  153. package/dist/packages/ecard/index.scss +2 -0
  154. package/dist/packages/ecard/style.mjs +0 -1
  155. package/dist/packages/fixednav/index.scss +2 -0
  156. package/dist/packages/fixednav/style.mjs +0 -1
  157. package/dist/packages/form/index.scss +1 -2
  158. package/dist/packages/form/style.mjs +0 -1
  159. package/dist/packages/formitem/index.scss +3 -0
  160. package/dist/packages/formitem/style.mjs +0 -1
  161. package/dist/packages/imagepreview/index.scss +5 -5
  162. package/dist/packages/imagepreview/style.mjs +0 -5
  163. package/dist/packages/input/index.scss +13 -13
  164. package/dist/packages/invoice/index.scss +6 -0
  165. package/dist/packages/invoice/style.mjs +0 -7
  166. package/dist/packages/list/index.scss +8 -8
  167. package/dist/packages/menuitem/index.scss +9 -10
  168. package/dist/packages/menuitem/style.mjs +0 -2
  169. package/dist/packages/navbar/index.scss +0 -1
  170. package/dist/packages/noticebar/index.scss +12 -2
  171. package/dist/packages/notify/index.scss +2 -0
  172. package/dist/packages/notify/style.mjs +0 -2
  173. package/dist/packages/numberkeyboard/index.scss +2 -0
  174. package/dist/packages/numberkeyboard/style.mjs +0 -2
  175. package/dist/packages/picker/index.scss +4 -9
  176. package/dist/packages/picker/style.mjs +0 -2
  177. package/dist/packages/popover/index.scss +2 -0
  178. package/dist/packages/popover/style.mjs +0 -2
  179. package/dist/packages/popup/index.scss +2 -0
  180. package/dist/packages/popup/style.mjs +0 -1
  181. package/dist/packages/price/index.scss +5 -10
  182. package/dist/packages/rate/index.scss +6 -9
  183. package/dist/packages/searchbar/index.scss +4 -0
  184. package/dist/packages/shortpassword/index.scss +18 -0
  185. package/dist/packages/shortpassword/style.mjs +0 -2
  186. package/dist/packages/signature/index.scss +2 -0
  187. package/dist/packages/signature/style.mjs +0 -1
  188. package/dist/packages/skeleton/index.scss +2 -0
  189. package/dist/packages/skeleton/style.mjs +0 -1
  190. package/dist/packages/sku/index.scss +4 -0
  191. package/dist/packages/sku/style.mjs +0 -4
  192. package/dist/packages/tabbaritem/index.scss +2 -0
  193. package/dist/packages/tabbaritem/style.mjs +0 -1
  194. package/dist/packages/tabs/index.scss +36 -2
  195. package/dist/packages/tabs/style.mjs +0 -1
  196. package/dist/packages/textarea/index.scss +2 -0
  197. package/dist/packages/timeselect/index.scss +2 -0
  198. package/dist/packages/timeselect/style.mjs +0 -2
  199. package/dist/packages/tour/index.scss +2 -0
  200. package/dist/packages/tour/style.mjs +0 -3
  201. package/dist/packages/uploader/index.scss +10 -2
  202. package/dist/packages/uploader/style.mjs +0 -2
  203. package/dist/resolver/index.d.ts +6 -0
  204. package/dist/resolver/index.js +1 -0
  205. package/dist/resolver/index.mjs +24 -0
  206. package/dist/resolver/package.json +20 -0
  207. package/dist/smartips/web-types.json +114 -15
  208. package/dist/style.css +1 -1
  209. package/dist/styles/themes/default.scss +155 -52
  210. package/dist/styles/themes/jdb.scss +155 -52
  211. package/dist/styles/themes/jddkh.scss +155 -52
  212. package/dist/styles/themes/jdt.scss +155 -52
  213. package/dist/styles/variables-jdb.scss +9 -1
  214. package/dist/styles/variables-jddkh.scss +9 -1
  215. package/dist/styles/variables-jdt.scss +9 -1
  216. package/dist/styles/variables.scss +8 -0
  217. package/dist/types/__VUE/address/index.vue.d.ts +2 -1
  218. package/dist/types/__VUE/addresslist/components/GeneralShell.vue.d.ts +1 -1
  219. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -1
  220. package/dist/types/__VUE/addresslist/index.vue.d.ts +1 -1
  221. package/dist/types/__VUE/animate/index.vue.d.ts +6 -0
  222. package/dist/types/__VUE/audiooperate/index.vue.d.ts +4 -4
  223. package/dist/types/__VUE/badge/index.vue.d.ts +9 -0
  224. package/dist/types/__VUE/button/type.d.ts +1 -0
  225. package/dist/types/__VUE/calendaritem/type.d.ts +1 -0
  226. package/dist/types/__VUE/collapse/index.vue.d.ts +31 -5
  227. package/dist/types/__VUE/collapseitem/index.vue.d.ts +117 -11
  228. package/dist/types/__VUE/configprovider/index.vue.d.ts +2 -2
  229. package/dist/types/__VUE/datepicker/index.vue.d.ts +1 -1
  230. package/dist/types/__VUE/dialog/index.d.ts +1 -0
  231. package/dist/types/__VUE/dialog/index.vue.d.ts +1 -0
  232. package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
  233. package/dist/types/__VUE/image/index.vue.d.ts +14 -3
  234. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +9 -0
  235. package/dist/types/__VUE/imagepreview/index.vue.d.ts +1 -1
  236. package/dist/types/__VUE/input/index.vue.d.ts +27 -2
  237. package/dist/types/__VUE/list/index.vue.d.ts +42 -13
  238. package/dist/types/__VUE/list/type.d.ts +13 -0
  239. package/dist/types/__VUE/menu/index.vue.d.ts +0 -2
  240. package/dist/types/__VUE/menuitem/index.vue.d.ts +9 -17
  241. package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
  242. package/dist/types/__VUE/noticebar/index.vue.d.ts +5 -2
  243. package/dist/types/__VUE/picker/common.d.ts +2 -0
  244. package/dist/types/__VUE/picker/usePicker.d.ts +1 -1
  245. package/dist/types/__VUE/price/index.vue.d.ts +9 -0
  246. package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
  247. package/dist/types/__VUE/row/index.vue.d.ts +1 -1
  248. package/dist/types/__VUE/searchbar/index.vue.d.ts +121 -5
  249. package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
  250. package/dist/types/__VUE/swiper/index.vue.d.ts +9 -2
  251. package/dist/types/__VUE/switch/index.vue.d.ts +1 -0
  252. package/dist/types/__VUE/table/common.d.ts +55 -2
  253. package/dist/types/__VUE/tabpane/index.vue.d.ts +1 -4
  254. package/dist/types/__VUE/tabs/hooks.d.ts +12 -0
  255. package/dist/types/__VUE/tabs/index.vue.d.ts +35 -5
  256. package/dist/types/__VUE/tabs/types.d.ts +12 -0
  257. package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
  258. package/dist/types/__VUE/toast/index.vue.d.ts +11 -4
  259. package/dist/types/__VUE/uploader/type.d.ts +2 -1
  260. package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
  261. package/dist/types/index.d.ts +1 -2
  262. package/dist/types/resolver/index.d.ts +6 -0
  263. package/dist/types/utils/date.d.ts +4 -0
  264. package/dist/types/utils/useTaroRect/index.d.ts +1 -1
  265. package/dist/types/utils/util.d.ts +1 -1
  266. package/package.json +13 -6
  267. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
  268. package/dist/packages/_es/common-b9a5e726.js +0 -145
  269. package/dist/packages/_es/component-81a4c1d0.js +0 -145
  270. package/dist/packages/_es/index-29892cda.js +0 -33
  271. package/dist/packages/_es/index-2ae3ae87.js +0 -846
  272. package/dist/packages/_es/index-43c34ac6.js +0 -30
  273. package/dist/packages/_es/index-54d03fc1.js +0 -8
  274. package/dist/packages/_es/index-79c5dc33.js +0 -10
  275. package/dist/packages/_es/index-7a7385e4.js +0 -67
  276. package/dist/packages/_es/index-991c279f.js +0 -244
  277. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
  278. package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
  279. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
  280. package/dist/packages/_es/interceptor-956b24fc.js +0 -29
  281. package/dist/packages/_es/mountComponent-1ece4110.js +0 -39
  282. package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
  283. package/dist/packages/_es/raf-729dad54.js +0 -25
  284. package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
  285. /package/dist/types/utils/{interceptor.d.ts → Interceptor.d.ts} +0 -0
@@ -1,21 +1,32 @@
1
- import { reactive, ref, computed, onMounted, watch, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vShow, Fragment, renderList, normalizeStyle, createCommentVNode, createVNode, withCtx, renderSlot, toDisplayString } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { u as useRect } from "./index-29892cda.js";
4
- import { Close } from "@nutui/icons-vue";
5
- import Popover from "./Popover.js";
6
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ var E = Object.defineProperty, H = Object.defineProperties;
2
+ var W = Object.getOwnPropertyDescriptors;
3
+ var $ = Object.getOwnPropertySymbols;
4
+ var q = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
5
+ var T = (t, e, o) => e in t ? E(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, P = (t, e) => {
6
+ for (var o in e || (e = {}))
7
+ q.call(e, o) && T(t, o, e[o]);
8
+ if ($)
9
+ for (var o of $(e))
10
+ F.call(e, o) && T(t, o, e[o]);
11
+ return t;
12
+ }, B = (t, e) => H(t, W(e));
13
+ import { reactive as I, ref as L, computed as N, onMounted as U, watch as j, toRefs as G, nextTick as J, resolveComponent as O, openBlock as n, createElementBlock as r, normalizeClass as V, withDirectives as K, createElementVNode as i, vShow as Q, Fragment as M, renderList as X, normalizeStyle as Y, createCommentVNode as a, createVNode as R, withCtx as Z, renderSlot as v, toDisplayString as u } from "vue";
14
+ import { c as x } from "./component-234624bc.js";
15
+ import { u as _ } from "./index-192a3ef6.js";
16
+ import { Close as tt } from "@nutui/icons-vue";
17
+ import z from "./Popover.js";
18
+ import { _ as et } from "./_plugin-vue_export-helper-dad06003.js";
7
19
  import "../locale/lang";
8
- import "./renderIcon-3d0fd47c.js";
9
- import "./index-991c279f.js";
20
+ import "./renderIcon-47498b32.js";
21
+ import "./index-360c5092.js";
10
22
  import "./Overlay.js";
11
- const { create } = createComponent("tour");
12
- const _sfc_main = create({
23
+ const { create: ot } = x("tour"), st = ot({
13
24
  components: {
14
- [Popover.name]: Popover,
15
- Close
25
+ [z.name]: z,
26
+ Close: tt
16
27
  },
17
28
  props: {
18
- modelValue: { type: Boolean, default: false },
29
+ modelValue: { type: Boolean, default: !1 },
19
30
  type: {
20
31
  type: String,
21
32
  default: "step"
@@ -47,7 +58,7 @@ const _sfc_main = create({
47
58
  },
48
59
  mask: {
49
60
  type: Boolean,
50
- default: true
61
+ default: !0
51
62
  },
52
63
  offset: {
53
64
  type: Array,
@@ -71,196 +82,149 @@ const _sfc_main = create({
71
82
  },
72
83
  closeOnClickOverlay: {
73
84
  type: Boolean,
74
- default: true
85
+ default: !0
75
86
  },
76
87
  showPrevStep: {
77
88
  type: Boolean,
78
- default: true
89
+ default: !0
79
90
  },
80
91
  showTitleBar: {
81
92
  type: Boolean,
82
- default: true
93
+ default: !0
83
94
  }
84
95
  },
85
96
  emits: ["update:modelValue", "change", "close"],
86
- setup(props, { emit }) {
87
- const state = reactive({
88
- showTour: props.modelValue,
89
- showPopup: false,
97
+ setup(t, { emit: e }) {
98
+ const o = I({
99
+ showTour: t.modelValue,
100
+ showPopup: !1,
90
101
  active: 0
91
- });
92
- const maskRect = ref({});
93
- const classes = computed(() => {
94
- const prefixCls = "nut-tour";
95
- return `${prefixCls}`;
96
- });
97
- const maskStyle = computed(() => {
98
- const { offset, maskWidth, maskHeight } = props;
99
- const { width, height, left, top } = maskRect.value;
100
- const center = [left + width / 2, top + height / 2];
101
- const w = Number(maskWidth ? maskWidth : width);
102
- const h = Number(maskHeight ? maskHeight : height);
103
- const styles = {
104
- width: `${w + +offset[1] * 2}px`,
105
- height: `${h + +offset[0] * 2}px`,
106
- top: `${center[1] - h / 2 - +offset[0]}px`,
107
- left: `${center[0] - w / 2 - +offset[1]}px`
102
+ }), m = L({}), h = N(() => "nut-tour"), y = N(() => {
103
+ const { offset: s, maskWidth: d, maskHeight: k } = t, { width: g, height: w, left: A, top: D } = m.value, S = [A + g / 2, D + w / 2], C = Number(d || g), b = Number(k || w);
104
+ return {
105
+ width: `${C + +s[1] * 2}px`,
106
+ height: `${b + +s[0] * 2}px`,
107
+ top: `${S[1] - b / 2 - +s[0]}px`,
108
+ left: `${S[0] - C / 2 - +s[1]}px`
108
109
  };
109
- return styles;
110
- });
111
- const changeStep = (type) => {
112
- if (type == "next") {
113
- state.active = state.active + 1;
114
- } else {
115
- state.active = state.active - 1;
116
- }
117
- state.showPopup = false;
118
- nextTick(() => {
119
- state.showPopup = true;
120
- getRootPosition();
121
- });
122
- emit("change", state.active);
110
+ }), f = (s) => {
111
+ s == "next" ? o.active = o.active + 1 : o.active = o.active - 1, o.showPopup = !1, J(() => {
112
+ o.showPopup = !0, p();
113
+ }), e("change", o.active);
114
+ }, p = () => {
115
+ const s = document.querySelector(`#${t.steps[o.active].target}`), d = _(s);
116
+ m.value = d;
117
+ }, l = () => {
118
+ o.showTour = !1, o.showPopup = !1, e("close", o.active), e("update:modelValue", !1);
119
+ }, c = () => {
120
+ t.closeOnClickOverlay && l();
123
121
  };
124
- const getRootPosition = () => {
125
- const el = document.querySelector(`#${props.steps[state.active].target}`);
126
- const rect = useRect(el);
127
- maskRect.value = rect;
128
- };
129
- const close = () => {
130
- state.showTour = false;
131
- state.showPopup = false;
132
- emit("close", state.active);
133
- emit("update:modelValue", false);
134
- };
135
- const handleClickMask = () => {
136
- props.closeOnClickOverlay && close();
137
- };
138
- onMounted(() => {
139
- state.active = 0;
140
- getRootPosition();
141
- });
142
- watch(
143
- () => props.modelValue,
144
- (val) => {
145
- if (val) {
146
- getRootPosition();
147
- }
148
- state.active = 0;
149
- state.showTour = val;
150
- state.showPopup = val;
122
+ return U(() => {
123
+ o.active = 0, p();
124
+ }), j(
125
+ () => t.modelValue,
126
+ (s) => {
127
+ s && p(), o.active = 0, o.showTour = s, o.showPopup = s;
151
128
  }
152
- );
153
- return {
154
- ...toRefs(state),
155
- classes,
156
- maskStyle,
157
- changeStep,
158
- close,
159
- handleClickMask
160
- };
129
+ ), B(P({}, G(o)), {
130
+ classes: h,
131
+ maskStyle: y,
132
+ changeStep: f,
133
+ close: l,
134
+ handleClickMask: c
135
+ });
161
136
  }
162
- });
163
- const _hoisted_1 = {
137
+ }), nt = {
164
138
  key: 0,
165
139
  class: "nut-tour-content"
166
- };
167
- const _hoisted_2 = {
140
+ }, rt = {
168
141
  key: 0,
169
142
  class: "nut-tour-content-top"
170
- };
171
- const _hoisted_3 = { class: "nut-tour-content-inner" };
172
- const _hoisted_4 = { class: "nut-tour-content-bottom" };
173
- const _hoisted_5 = { class: "nut-tour-content-bottom-init" };
174
- const _hoisted_6 = { class: "nut-tour-content-bottom-operate" };
175
- const _hoisted_7 = {
143
+ }, lt = { class: "nut-tour-content-inner" }, at = { class: "nut-tour-content-bottom" }, it = { class: "nut-tour-content-bottom-init" }, ut = { class: "nut-tour-content-bottom-operate" }, pt = {
176
144
  key: 1,
177
145
  class: "nut-tour-content nut-tour-content-tile"
178
- };
179
- const _hoisted_8 = { class: "nut-tour-content-inner" };
180
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
181
- const _component_Close = resolveComponent("Close");
182
- const _component_nut_popover = resolveComponent("nut-popover");
183
- return openBlock(), createElementBlock("div", {
184
- class: normalizeClass(_ctx.classes)
146
+ }, ct = { class: "nut-tour-content-inner" };
147
+ function dt(t, e, o, m, h, y) {
148
+ const f = O("Close"), p = O("nut-popover");
149
+ return n(), r("div", {
150
+ class: V(t.classes)
185
151
  }, [
186
- withDirectives(createElementVNode("div", {
152
+ K(i("div", {
187
153
  class: "nut-tour-masked",
188
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClickMask && _ctx.handleClickMask(...args))
154
+ onClick: e[0] || (e[0] = (...l) => t.handleClickMask && t.handleClickMask(...l))
189
155
  }, null, 512), [
190
- [vShow, _ctx.showTour]
156
+ [Q, t.showTour]
191
157
  ]),
192
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.steps, (step, i) => {
193
- return openBlock(), createElementBlock("div", {
194
- key: i,
195
- style: { "height": "0" }
196
- }, [
197
- i == _ctx.active ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
198
- _ctx.showTour ? (openBlock(), createElementBlock("div", {
199
- key: 0,
200
- class: normalizeClass(["nut-tour-mask", [_ctx.mask ? "" : "nut-tour-mask-none"]]),
201
- style: normalizeStyle(_ctx.maskStyle),
202
- id: "nut-tour-popid"
203
- }, null, 6)) : createCommentVNode("", true),
204
- createVNode(_component_nut_popover, {
205
- visible: _ctx.showPopup,
206
- "onUpdate:visible": _cache[5] || (_cache[5] = ($event) => _ctx.showPopup = $event),
207
- location: step.location || _ctx.location,
208
- targetId: "nut-tour-popid",
209
- bgColor: _ctx.bgColor,
210
- theme: _ctx.theme,
211
- "close-on-click-outside": false,
212
- offset: step.popoverOffset || [0, 12],
213
- arrowOffset: step.arrowOffset || 0
214
- }, {
215
- content: withCtx(() => [
216
- renderSlot(_ctx.$slots, "default", {}, () => [
217
- _ctx.type == "step" ? (openBlock(), createElementBlock("div", _hoisted_1, [
218
- _ctx.showTitleBar ? (openBlock(), createElementBlock("div", _hoisted_2, [
219
- createElementVNode("div", {
220
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.close && _ctx.close(...args))
221
- }, [
222
- createVNode(_component_Close, { class: "nut-tour-content-top-close" })
223
- ])
224
- ])) : createCommentVNode("", true),
225
- createElementVNode("div", _hoisted_3, toDisplayString(step.content), 1),
226
- createElementVNode("div", _hoisted_4, [
227
- createElementVNode("div", _hoisted_5, toDisplayString(_ctx.active + 1) + "/" + toDisplayString(_ctx.steps.length), 1),
228
- createElementVNode("div", _hoisted_6, [
229
- renderSlot(_ctx.$slots, "prev-step", {}, () => [
230
- _ctx.active != 0 && _ctx.showPrevStep ? (openBlock(), createElementBlock("div", {
231
- key: 0,
232
- class: "nut-tour-content-bottom-operate-btn",
233
- onClick: _cache[2] || (_cache[2] = ($event) => _ctx.changeStep("prev"))
234
- }, toDisplayString(_ctx.prevStepTxt), 1)) : createCommentVNode("", true)
235
- ]),
236
- _ctx.steps.length - 1 == _ctx.active ? (openBlock(), createElementBlock("div", {
158
+ (n(!0), r(M, null, X(t.steps, (l, c) => (n(), r("div", {
159
+ key: c,
160
+ style: { height: "0" }
161
+ }, [
162
+ c == t.active ? (n(), r(M, { key: 0 }, [
163
+ t.showTour ? (n(), r("div", {
164
+ key: 0,
165
+ class: V(["nut-tour-mask", [t.mask ? "" : "nut-tour-mask-none"]]),
166
+ style: Y(t.maskStyle),
167
+ id: "nut-tour-popid"
168
+ }, null, 6)) : a("", !0),
169
+ R(p, {
170
+ visible: t.showPopup,
171
+ "onUpdate:visible": e[5] || (e[5] = (s) => t.showPopup = s),
172
+ location: l.location || t.location,
173
+ targetId: "nut-tour-popid",
174
+ bgColor: t.bgColor,
175
+ theme: t.theme,
176
+ "close-on-click-outside": !1,
177
+ offset: l.popoverOffset || [0, 12],
178
+ arrowOffset: l.arrowOffset || 0
179
+ }, {
180
+ content: Z(() => [
181
+ v(t.$slots, "default", {}, () => [
182
+ t.type == "step" ? (n(), r("div", nt, [
183
+ t.showTitleBar ? (n(), r("div", rt, [
184
+ i("div", {
185
+ onClick: e[1] || (e[1] = (...s) => t.close && t.close(...s))
186
+ }, [
187
+ R(f, { class: "nut-tour-content-top-close" })
188
+ ])
189
+ ])) : a("", !0),
190
+ i("div", lt, u(l.content), 1),
191
+ i("div", at, [
192
+ i("div", it, u(t.active + 1) + "/" + u(t.steps.length), 1),
193
+ i("div", ut, [
194
+ v(t.$slots, "prev-step", {}, () => [
195
+ t.active != 0 && t.showPrevStep ? (n(), r("div", {
196
+ key: 0,
197
+ class: "nut-tour-content-bottom-operate-btn",
198
+ onClick: e[2] || (e[2] = (s) => t.changeStep("prev"))
199
+ }, u(t.prevStepTxt), 1)) : a("", !0)
200
+ ]),
201
+ t.steps.length - 1 == t.active ? (n(), r("div", {
202
+ key: 0,
203
+ class: "nut-tour-content-bottom-operate-btn active",
204
+ onClick: e[3] || (e[3] = (...s) => t.close && t.close(...s))
205
+ }, u(t.completeTxt), 1)) : a("", !0),
206
+ v(t.$slots, "next-step", {}, () => [
207
+ t.steps.length - 1 != t.active ? (n(), r("div", {
237
208
  key: 0,
238
209
  class: "nut-tour-content-bottom-operate-btn active",
239
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.close && _ctx.close(...args))
240
- }, toDisplayString(_ctx.completeTxt), 1)) : createCommentVNode("", true),
241
- renderSlot(_ctx.$slots, "next-step", {}, () => [
242
- _ctx.steps.length - 1 != _ctx.active ? (openBlock(), createElementBlock("div", {
243
- key: 0,
244
- class: "nut-tour-content-bottom-operate-btn active",
245
- onClick: _cache[4] || (_cache[4] = ($event) => _ctx.changeStep("next"))
246
- }, toDisplayString(_ctx.nextStepTxt), 1)) : createCommentVNode("", true)
247
- ])
210
+ onClick: e[4] || (e[4] = (s) => t.changeStep("next"))
211
+ }, u(t.nextStepTxt), 1)) : a("", !0)
248
212
  ])
249
213
  ])
250
- ])) : createCommentVNode("", true),
251
- _ctx.type == "tile" ? (openBlock(), createElementBlock("div", _hoisted_7, [
252
- createElementVNode("div", _hoisted_8, toDisplayString(step.content), 1)
253
- ])) : createCommentVNode("", true)
254
- ])
255
- ]),
256
- _: 2
257
- }, 1032, ["visible", "location", "bgColor", "theme", "offset", "arrowOffset"])
258
- ], 64)) : createCommentVNode("", true)
259
- ]);
260
- }), 128))
214
+ ])
215
+ ])) : a("", !0),
216
+ t.type == "tile" ? (n(), r("div", pt, [
217
+ i("div", ct, u(l.content), 1)
218
+ ])) : a("", !0)
219
+ ])
220
+ ]),
221
+ _: 2
222
+ }, 1032, ["visible", "location", "bgColor", "theme", "offset", "arrowOffset"])
223
+ ], 64)) : a("", !0)
224
+ ]))), 128))
261
225
  ], 2);
262
226
  }
263
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
227
+ const Tt = /* @__PURE__ */ et(st, [["render", dt]]);
264
228
  export {
265
- index as default
229
+ Tt as default
266
230
  };
@@ -1,11 +1,22 @@
1
- import { reactive, computed, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, createVNode } from "vue";
2
- import { m as myFixed, c as createComponent } from "./component-81a4c1d0.js";
3
- import { TriangleUp, TriangleDown } from "@nutui/icons-vue";
4
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ var R = Object.defineProperty, h = Object.defineProperties;
2
+ var k = Object.getOwnPropertyDescriptors;
3
+ var m = Object.getOwnPropertySymbols;
4
+ var B = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
5
+ var y = (e, r, t) => r in e ? R(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, w = (e, r) => {
6
+ for (var t in r || (r = {}))
7
+ B.call(r, t) && y(e, t, r[t]);
8
+ if (m)
9
+ for (var t of m(r))
10
+ D.call(r, t) && y(e, t, r[t]);
11
+ return e;
12
+ }, C = (e, r) => h(e, k(r));
13
+ import { reactive as v, computed as u, toRefs as L, resolveComponent as g, openBlock as i, createElementBlock as p, normalizeClass as U, normalizeStyle as T, toDisplayString as S, createCommentVNode as s, renderSlot as b, createVNode as N } from "vue";
14
+ import { m as z, c as V } from "./component-234624bc.js";
15
+ import { TriangleUp as Z, TriangleDown as E } from "@nutui/icons-vue";
16
+ import { _ as F } from "./_plugin-vue_export-helper-dad06003.js";
5
17
  import "../locale/lang";
6
- const { componentName, create } = createComponent("trend-arrow");
7
- const _sfc_main = create({
8
- components: { TriangleUp, TriangleDown },
18
+ const { componentName: M, create: j } = V("trend-arrow"), q = j({
19
+ components: { TriangleUp: Z, TriangleDown: E },
9
20
  props: {
10
21
  rate: {
11
22
  type: Number,
@@ -17,19 +28,19 @@ const _sfc_main = create({
17
28
  },
18
29
  showSign: {
19
30
  type: Boolean,
20
- default: false
31
+ default: !1
21
32
  },
22
33
  showZero: {
23
34
  type: Boolean,
24
- default: false
35
+ default: !1
25
36
  },
26
37
  arrowLeft: {
27
38
  type: Boolean,
28
- default: false
39
+ default: !1
29
40
  },
30
41
  syncTextColor: {
31
42
  type: Boolean,
32
- default: true
43
+ default: !0
33
44
  },
34
45
  textColor: {
35
46
  type: String,
@@ -44,64 +55,52 @@ const _sfc_main = create({
44
55
  default: "#64b578"
45
56
  }
46
57
  },
47
- setup(props) {
48
- const state = reactive({
49
- rateTrend: props.rate > 0 ? true : false
50
- });
51
- const classes = computed(() => {
52
- const prefixCls = componentName;
53
- return {
54
- [prefixCls]: true
55
- };
56
- });
57
- const calcRate = computed(() => {
58
- const { rate, digits, showSign, showZero } = props;
59
- state.rateTrend = rate > 0 ? true : false;
60
- const absRate = Math.abs(rate);
61
- if (!showZero && rate === 0) {
62
- return "--";
63
- }
64
- let resultRate = `${showSign && rate !== 0 ? state.rateTrend ? "+" : "-" : ""}${myFixed(
65
- Number(absRate),
66
- digits
58
+ setup(e) {
59
+ const r = v({
60
+ rateTrend: e.rate > 0
61
+ }), t = u(() => ({
62
+ [M]: !0
63
+ })), d = u(() => {
64
+ const { rate: o, digits: a, showSign: n, showZero: l } = e;
65
+ r.rateTrend = o > 0;
66
+ const c = Math.abs(o);
67
+ return !l && o === 0 ? "--" : `${n && o !== 0 ? r.rateTrend ? "+" : "-" : ""}${z(
68
+ Number(c),
69
+ a
67
70
  )}%`;
68
- return resultRate;
69
- });
70
- const calcStyle = computed(() => {
71
- const { dropColor, riseColor, syncTextColor, textColor, rate } = props;
72
- let style = {
73
- color: rate === 0 ? textColor : syncTextColor ? state.rateTrend ? riseColor : dropColor : textColor
71
+ }), f = u(() => {
72
+ const { dropColor: o, riseColor: a, syncTextColor: n, textColor: l, rate: c } = e;
73
+ return {
74
+ color: c === 0 ? l : n ? r.rateTrend ? a : o : l
74
75
  };
75
- return style;
76
76
  });
77
- return { ...toRefs(state), classes, calcRate, calcStyle };
77
+ return C(w({}, L(r)), { classes: t, calcRate: d, calcStyle: f });
78
78
  }
79
79
  });
80
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
81
- const _component_TriangleUp = resolveComponent("TriangleUp");
82
- const _component_TriangleDown = resolveComponent("TriangleDown");
83
- return openBlock(), createElementBlock("view", {
84
- class: normalizeClass(_ctx.classes)
80
+ function A(e, r, t, d, f, o) {
81
+ const a = g("TriangleUp"), n = g("TriangleDown");
82
+ return i(), p("view", {
83
+ class: U(e.classes)
85
84
  }, [
86
- !_ctx.arrowLeft ? (openBlock(), createElementBlock("span", {
85
+ e.arrowLeft ? s("", !0) : (i(), p("span", {
87
86
  key: 0,
88
87
  class: "nut-trend-arrow-icon-before nut-trend-arrow-rate",
89
- style: normalizeStyle(_ctx.calcStyle)
90
- }, toDisplayString(_ctx.calcRate), 5)) : createCommentVNode("", true),
91
- Number(_ctx.rate) !== 0 && _ctx.rateTrend ? renderSlot(_ctx.$slots, "up-icon", { key: 1 }, () => [
92
- createVNode(_component_TriangleUp, { color: _ctx.riseColor }, null, 8, ["color"])
93
- ]) : createCommentVNode("", true),
94
- Number(_ctx.rate) !== 0 && !_ctx.rateTrend ? renderSlot(_ctx.$slots, "down-icon", { key: 2 }, () => [
95
- createVNode(_component_TriangleDown, { color: _ctx.dropColor }, null, 8, ["color"])
96
- ]) : createCommentVNode("", true),
97
- _ctx.arrowLeft ? (openBlock(), createElementBlock("span", {
88
+ style: T(e.calcStyle)
89
+ }, S(e.calcRate), 5)),
90
+ Number(e.rate) !== 0 && e.rateTrend ? b(e.$slots, "up-icon", { key: 1 }, () => [
91
+ N(a, { color: e.riseColor }, null, 8, ["color"])
92
+ ]) : s("", !0),
93
+ Number(e.rate) !== 0 && !e.rateTrend ? b(e.$slots, "down-icon", { key: 2 }, () => [
94
+ N(n, { color: e.dropColor }, null, 8, ["color"])
95
+ ]) : s("", !0),
96
+ e.arrowLeft ? (i(), p("span", {
98
97
  key: 3,
99
98
  class: "nut-trend-arrow-icon-after nut-trend-arrow-rate",
100
- style: normalizeStyle(_ctx.calcStyle)
101
- }, toDisplayString(_ctx.calcRate), 5)) : createCommentVNode("", true)
99
+ style: T(e.calcStyle)
100
+ }, S(e.calcRate), 5)) : s("", !0)
102
101
  ], 2);
103
102
  }
104
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
103
+ const P = /* @__PURE__ */ F(q, [["render", A]]);
105
104
  export {
106
- index as default
105
+ P as default
107
106
  };