@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,16 +1,15 @@
1
- import { useSlots, ref, computed, onMounted, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, createVNode } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { Checked } from "@nutui/icons-vue";
4
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ import { useSlots as k, ref as i, computed as u, onMounted as S, resolveComponent as C, openBlock as r, createElementBlock as s, createElementVNode as p, normalizeClass as h, normalizeStyle as t, toDisplayString as o, createCommentVNode as n, renderSlot as y, createVNode as v } from "vue";
2
+ import { c as w } from "./component-234624bc.js";
3
+ import { Checked as $ } from "@nutui/icons-vue";
4
+ import { _ as b } from "./_plugin-vue_export-helper-dad06003.js";
5
5
  import "../locale/lang";
6
- const { create } = createComponent("progress");
7
- const _sfc_main = create({
8
- components: { Checked },
6
+ const { create: T } = w("progress"), B = T({
7
+ components: { Checked: $ },
9
8
  props: {
10
9
  percentage: {
11
10
  type: [Number, String],
12
11
  default: 0,
13
- required: true
12
+ required: !0
14
13
  },
15
14
  size: {
16
15
  type: String,
@@ -26,11 +25,11 @@ const _sfc_main = create({
26
25
  },
27
26
  textInside: {
28
27
  type: Boolean,
29
- default: false
28
+ default: !1
30
29
  },
31
30
  showText: {
32
31
  type: Boolean,
33
- default: true
32
+ default: !0
34
33
  },
35
34
  strokeColor: {
36
35
  type: String,
@@ -46,101 +45,86 @@ const _sfc_main = create({
46
45
  },
47
46
  isShowPercentage: {
48
47
  type: Boolean,
49
- default: true
48
+ default: !0
50
49
  }
51
50
  },
52
- setup(props) {
53
- const slotDefault = !!useSlots().default;
54
- const height = ref(props.strokeWidth + "px");
55
- const progressOuter = ref();
56
- const insideText = ref();
57
- const percentage = computed(() => {
58
- return props.percentage >= 100 ? 100 : props.percentage;
59
- });
60
- const bgStyle = computed(() => {
61
- return {
62
- width: percentage.value + "%",
63
- background: props.strokeColor || ""
64
- };
65
- });
66
- const textStyle = computed(() => {
67
- return {
68
- color: props.textColor || ""
69
- };
70
- });
71
- onMounted(() => {
72
- });
73
- return {
74
- height,
75
- percentage,
76
- bgStyle,
77
- textStyle,
78
- progressOuter,
79
- insideText,
80
- slotDefault
51
+ setup(e) {
52
+ const d = !!k().default, g = i(e.strokeWidth + "px"), f = i(), c = i(), a = u(() => e.percentage >= 100 ? 100 : e.percentage), l = u(() => ({
53
+ width: a.value + "%",
54
+ background: e.strokeColor || ""
55
+ })), m = u(() => ({
56
+ color: e.textColor || ""
57
+ }));
58
+ return S(() => {
59
+ }), {
60
+ height: g,
61
+ percentage: a,
62
+ bgStyle: l,
63
+ textStyle: m,
64
+ progressOuter: f,
65
+ insideText: c,
66
+ slotDefault: d
81
67
  };
82
68
  }
83
- });
84
- const _hoisted_1 = { class: "nut-progress" };
85
- const _hoisted_2 = {
69
+ }), z = { class: "nut-progress" }, I = {
86
70
  key: 0,
87
71
  class: "nut-progress-text"
88
72
  };
89
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
90
- const _component_Checked = resolveComponent("Checked");
91
- return openBlock(), createElementBlock("div", _hoisted_1, [
92
- createElementVNode("div", {
93
- class: normalizeClass(["nut-progress-outer", [_ctx.showText && !_ctx.textInside ? "nut-progress-outer-part" : "", _ctx.size ? "nut-progress-" + _ctx.size : ""]]),
73
+ function N(e, d, g, f, c, a) {
74
+ const l = C("Checked");
75
+ return r(), s("div", z, [
76
+ p("div", {
77
+ class: h(["nut-progress-outer", [e.showText && !e.textInside ? "nut-progress-outer-part" : "", e.size ? "nut-progress-" + e.size : ""]]),
94
78
  ref: "progressOuter",
95
- style: normalizeStyle({ height: _ctx.height })
79
+ style: t({ height: e.height })
96
80
  }, [
97
- createElementVNode("div", {
98
- class: normalizeClass(["nut-progress-inner", _ctx.status == "active" ? "nut-active" : ""]),
99
- style: normalizeStyle(_ctx.bgStyle)
81
+ p("div", {
82
+ class: h(["nut-progress-inner", e.status == "active" ? "nut-active" : ""]),
83
+ style: t(e.bgStyle)
100
84
  }, null, 6),
101
- _ctx.showText && _ctx.textInside && !_ctx.slotDefault ? (openBlock(), createElementBlock("div", {
85
+ e.showText && e.textInside && !e.slotDefault ? (r(), s("div", {
102
86
  key: 0,
103
87
  class: "nut-progress-text nut-progress-insidetext",
104
88
  ref: "insideText",
105
- style: normalizeStyle({
106
- lineHeight: _ctx.height,
107
- left: `${_ctx.percentage}%`,
108
- transform: `translate(-${+_ctx.percentage}%,-50%)`,
109
- background: _ctx.textBackground || _ctx.strokeColor
89
+ style: t({
90
+ lineHeight: e.height,
91
+ left: `${e.percentage}%`,
92
+ transform: `translate(-${+e.percentage}%,-50%)`,
93
+ background: e.textBackground || e.strokeColor
110
94
  })
111
95
  }, [
112
- createElementVNode("span", {
113
- style: normalizeStyle(_ctx.textStyle)
114
- }, toDisplayString(_ctx.percentage) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)
115
- ], 4)) : createCommentVNode("", true),
116
- _ctx.showText && _ctx.textInside && _ctx.slotDefault ? (openBlock(), createElementBlock("div", {
96
+ p("span", {
97
+ style: t(e.textStyle)
98
+ }, o(e.percentage) + o(e.isShowPercentage ? "%" : ""), 5)
99
+ ], 4)) : n("", !0),
100
+ e.showText && e.textInside && e.slotDefault ? (r(), s("div", {
117
101
  key: 1,
118
102
  ref: "insideText",
119
- style: normalizeStyle({
120
- position: `absolute`,
121
- top: `50%`,
122
- left: `${_ctx.percentage}%`,
123
- transform: `translate(-${+_ctx.percentage}%,-50%)`
103
+ style: t({
104
+ position: "absolute",
105
+ top: "50%",
106
+ left: `${e.percentage}%`,
107
+ transform: `translate(-${+e.percentage}%,-50%)`
124
108
  })
125
109
  }, [
126
- renderSlot(_ctx.$slots, "default")
127
- ], 4)) : createCommentVNode("", true)
110
+ y(e.$slots, "default")
111
+ ], 4)) : n("", !0)
128
112
  ], 6),
129
- _ctx.showText && !_ctx.textInside ? (openBlock(), createElementBlock("div", _hoisted_2, [
130
- _ctx.status == "active" || _ctx.status == "" ? (openBlock(), createElementBlock("span", {
113
+ e.showText && !e.textInside ? (r(), s("div", I, [
114
+ e.status == "active" || e.status == "" ? (r(), s("span", {
131
115
  key: 0,
132
- style: normalizeStyle(_ctx.textStyle)
133
- }, toDisplayString(_ctx.percentage) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)) : _ctx.status == "icon" ? renderSlot(_ctx.$slots, "icon-name", { key: 1 }, () => [
134
- createVNode(_component_Checked, {
116
+ style: t(e.textStyle)
117
+ }, o(e.percentage) + o(e.isShowPercentage ? "%" : ""), 5)) : e.status == "icon" ? y(e.$slots, "icon-name", { key: 1 }, () => [
118
+ v(l, {
135
119
  width: "15px",
136
120
  height: "15px",
137
121
  color: "#439422"
138
122
  })
139
- ]) : createCommentVNode("", true)
140
- ])) : createCommentVNode("", true)
123
+ ]) : n("", !0)
124
+ ])) : n("", !0)
141
125
  ]);
142
126
  }
143
- const Progress = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
127
+ const W = /* @__PURE__ */ b(B, [["render", N]]);
144
128
  export {
145
- Progress as default
129
+ W as default
146
130
  };
@@ -1,29 +1,40 @@
1
- import { ref, reactive, computed, watch, nextTick, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createBlock, createCommentVNode, toDisplayString, renderSlot } from "vue";
2
- import { c as createComponent, l as getScrollTopRoot } from "./component-81a4c1d0.js";
3
- import { u as useTouch } from "./index-7a7385e4.js";
4
- import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
5
- import { u as useScrollParent } from "./index-43c34ac6.js";
6
- import { Loading } from "@nutui/icons-vue";
7
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ var w = Object.defineProperty, B = Object.defineProperties;
2
+ var M = Object.getOwnPropertyDescriptors;
3
+ var y = Object.getOwnPropertySymbols;
4
+ var L = Object.prototype.hasOwnProperty, z = Object.prototype.propertyIsEnumerable;
5
+ var v = (e, t, s) => t in e ? w(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, T = (e, t) => {
6
+ for (var s in t || (t = {}))
7
+ L.call(t, s) && v(e, s, t[s]);
8
+ if (y)
9
+ for (var s of y(t))
10
+ z.call(t, s) && v(e, s, t[s]);
11
+ return e;
12
+ }, P = (e, t) => B(e, M(t));
13
+ import { ref as Y, reactive as j, computed as d, watch as q, toRefs as x, nextTick as A, resolveComponent as F, openBlock as $, createElementBlock as G, normalizeClass as I, createElementVNode as S, normalizeStyle as k, createBlock as J, createCommentVNode as g, toDisplayString as K, renderSlot as f } from "vue";
14
+ import { c as O, l as Q } from "./component-234624bc.js";
15
+ import { u as U } from "./index-53ec2d4d.js";
16
+ import { p as W } from "./pxCheck-38173291.js";
17
+ import { u as X } from "./index-496e6e05.js";
18
+ import { Loading as Z } from "@nutui/icons-vue";
19
+ import { _ } from "./_plugin-vue_export-helper-dad06003.js";
8
20
  import "../locale/lang";
9
- const { componentName, create, translate } = createComponent("pull-refresh");
10
- const _sfc_main = create({
21
+ const { componentName: ee, create: te, translate: h } = O("pull-refresh"), le = te({
11
22
  props: {
12
23
  modelValue: {
13
24
  type: Boolean,
14
- default: false
25
+ default: !1
15
26
  },
16
27
  pullingTxt: {
17
28
  type: String,
18
- default: translate("pulling")
29
+ default: h("pulling")
19
30
  },
20
31
  loosingTxt: {
21
32
  type: String,
22
- default: translate("loosing")
33
+ default: h("loosing")
23
34
  },
24
35
  loadingTxt: {
25
36
  type: String,
26
- default: translate("loading")
37
+ default: h("loading")
27
38
  },
28
39
  // completeTxt: {
29
40
  // type: String,
@@ -43,172 +54,100 @@ const _sfc_main = create({
43
54
  }
44
55
  },
45
56
  emits: ["change", "refresh", "update:modelValue"],
46
- components: { Loading },
47
- setup(props, { emit, slots }) {
48
- const touch = useTouch();
49
- const scroller = ref();
50
- const scrollParent = useScrollParent(scroller);
51
- const state = reactive({
52
- isPullRefresh: false,
57
+ components: { Loading: Z },
58
+ setup(e, { emit: t, slots: s }) {
59
+ const a = U(), m = Y(), c = X(m), o = j({
60
+ isPullRefresh: !1,
53
61
  distance: 0,
54
62
  status: "normal"
55
- });
56
- const classes = computed(() => {
57
- const prefixCls = componentName;
58
- return {
59
- [prefixCls]: true
60
- };
61
- });
62
- const getPullStatus = computed(() => {
63
- switch (state.status) {
63
+ }), u = d(() => ({
64
+ [ee]: !0
65
+ })), D = d(() => {
66
+ switch (o.status) {
64
67
  case "pulling":
65
- return !slots.pulling ? props.pullingTxt : "";
68
+ return s.pulling ? "" : e.pullingTxt;
66
69
  case "loosing":
67
- return !slots.loosing ? props.loosingTxt : "";
70
+ return s.loosing ? "" : e.loosingTxt;
68
71
  case "loading":
69
- return !slots.loading ? props.loadingTxt : "";
72
+ return s.loading ? "" : e.loadingTxt;
70
73
  }
71
- });
72
- const getStyle = computed(() => {
73
- return {
74
- transitionDuration: `${props.duration}s`,
75
- transform: state.distance ? `translate3d(0,${state.distance}px, 0)` : ""
76
- };
77
- });
78
- const getHeightStyle = computed(() => {
79
- const styles = {};
80
- if (props.headHeight != 50)
81
- styles.height = pxCheck(props.headHeight);
82
- return styles;
83
- });
84
- const timing = (distance) => {
85
- const pullDistance = +(props.pullDistance || props.headHeight);
86
- let moveDistance = distance;
87
- if (distance > pullDistance) {
88
- if (distance < pullDistance * 2) {
89
- moveDistance = (distance + pullDistance) / 2;
90
- } else {
91
- moveDistance = pullDistance + distance / 4;
92
- }
93
- }
94
- return Math.round(moveDistance);
95
- };
96
- const setPullStatus = (distance, isLoading) => {
97
- const pullDistance = +(props.pullDistance || props.headHeight);
98
- state.distance = distance;
99
- if (isLoading) {
100
- state.status = "loading";
101
- } else if (distance === 0) {
102
- state.status = "normal";
103
- } else if (distance < pullDistance) {
104
- state.status = "pulling";
105
- } else {
106
- state.status = "loosing";
107
- }
108
- emit("change", { status: state.status, distance });
109
- };
110
- const isCanTouch = () => state.status !== "loading" && state.status !== "complete";
111
- const isScrollTop = () => {
112
- if (scrollParent.value == window) {
113
- return getScrollTopRoot() == 0;
114
- } else {
115
- return scrollParent.value && scrollParent.value.scrollTop == 0;
74
+ }), H = d(() => ({
75
+ transitionDuration: `${e.duration}s`,
76
+ transform: o.distance ? `translate3d(0,${o.distance}px, 0)` : ""
77
+ })), C = d(() => {
78
+ const l = {};
79
+ return e.headHeight != 50 && (l.height = W(e.headHeight)), l;
80
+ }), R = (l) => {
81
+ const n = +(e.pullDistance || e.headHeight);
82
+ let i = l;
83
+ return l > n && (l < n * 2 ? i = (l + n) / 2 : i = n + l / 4), Math.round(i);
84
+ }, r = (l, n) => {
85
+ const i = +(e.pullDistance || e.headHeight);
86
+ o.distance = l, n ? o.status = "loading" : l === 0 ? o.status = "normal" : l < i ? o.status = "pulling" : o.status = "loosing", t("change", { status: o.status, distance: l });
87
+ }, p = () => o.status !== "loading" && o.status !== "complete", V = () => c.value == window ? Q() == 0 : c.value && c.value.scrollTop == 0, b = (l) => {
88
+ p() && (V() ? (a.start(l), o.isPullRefresh = !0) : (o.distance = 0, o.isPullRefresh = !1));
89
+ }, N = (l) => {
90
+ if (p()) {
91
+ a.move(l);
92
+ const { deltaY: n } = a;
93
+ a.isVertical() && n.value > 0 && o.isPullRefresh && (l.preventDefault(), r(R(n.value)));
116
94
  }
117
- };
118
- const touchStart = (event) => {
119
- if (isCanTouch()) {
120
- if (isScrollTop()) {
121
- touch.start(event);
122
- state.isPullRefresh = true;
123
- } else {
124
- state.distance = 0;
125
- state.isPullRefresh = false;
126
- }
127
- }
128
- };
129
- const touchMove = (event) => {
130
- if (isCanTouch()) {
131
- touch.move(event);
132
- const { deltaY } = touch;
133
- if (touch.isVertical() && deltaY.value > 0 && state.isPullRefresh) {
134
- event.preventDefault();
135
- setPullStatus(timing(deltaY.value));
136
- }
137
- }
138
- };
139
- const touchEnd = () => {
140
- if (state.isPullRefresh && isCanTouch() && touch.deltaY.value) {
141
- if (state.status === "loosing") {
142
- setPullStatus(+props.headHeight, true);
143
- emit("update:modelValue", true);
144
- nextTick(() => emit("refresh"));
145
- } else {
146
- setPullStatus(0);
147
- }
148
- }
149
- setTimeout(() => {
150
- touch.reset();
95
+ }, E = () => {
96
+ o.isPullRefresh && p() && a.deltaY.value && (o.status === "loosing" ? (r(+e.headHeight, !0), t("update:modelValue", !0), A(() => t("refresh"))) : r(0)), setTimeout(() => {
97
+ a.reset();
151
98
  }, 0);
152
99
  };
153
- watch(
154
- () => props.modelValue,
155
- (val) => {
156
- console.log("监听", val);
157
- if (val) {
158
- setPullStatus(+props.headHeight, true);
159
- nextTick(() => emit("refresh"));
160
- } else {
161
- setPullStatus(0);
162
- }
100
+ return q(
101
+ () => e.modelValue,
102
+ (l) => {
103
+ l ? r(+e.headHeight, !0) : r(0);
163
104
  }
164
- );
165
- return {
166
- classes,
167
- scroller,
168
- ...toRefs(state),
169
- touchStart,
170
- touchMove,
171
- touchEnd,
172
- getStyle,
173
- translate,
174
- slots,
175
- getHeightStyle,
176
- getPullStatus
177
- };
105
+ ), P(T({
106
+ classes: u,
107
+ scroller: m
108
+ }, x(o)), {
109
+ touchStart: b,
110
+ touchMove: N,
111
+ touchEnd: E,
112
+ getStyle: H,
113
+ translate: h,
114
+ slots: s,
115
+ getHeightStyle: C,
116
+ getPullStatus: D
117
+ });
178
118
  }
179
- });
180
- const _hoisted_1 = { class: "nut-pull-refresh-container-topbox-text" };
181
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
182
- const _component_Loading = resolveComponent("Loading");
183
- return openBlock(), createElementBlock("div", {
184
- class: normalizeClass(_ctx.classes),
119
+ }), oe = { class: "nut-pull-refresh-container-topbox-text" };
120
+ function se(e, t, s, a, m, c) {
121
+ const o = F("Loading");
122
+ return $(), G("div", {
123
+ class: I(e.classes),
185
124
  ref: "scroller",
186
- onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.touchStart && _ctx.touchStart(...args)),
187
- onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.touchMove && _ctx.touchMove(...args)),
188
- onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
125
+ onTouchstart: t[0] || (t[0] = (...u) => e.touchStart && e.touchStart(...u)),
126
+ onTouchmove: t[1] || (t[1] = (...u) => e.touchMove && e.touchMove(...u)),
127
+ onTouchend: t[2] || (t[2] = (...u) => e.touchEnd && e.touchEnd(...u))
189
128
  }, [
190
- createElementVNode("div", {
129
+ S("div", {
191
130
  class: "nut-pull-refresh-container",
192
- style: normalizeStyle(_ctx.getStyle)
131
+ style: k(e.getStyle)
193
132
  }, [
194
- createElementVNode("div", {
133
+ S("div", {
195
134
  class: "nut-pull-refresh-container-topbox",
196
- style: normalizeStyle(_ctx.getHeightStyle)
135
+ style: k(e.getHeightStyle)
197
136
  }, [
198
- _ctx.status == "loading" && !_ctx.slots.loading ? (openBlock(), createBlock(_component_Loading, {
137
+ e.status == "loading" && !e.slots.loading ? ($(), J(o, {
199
138
  key: 0,
200
139
  class: "nut-icon-loading nut-pull-refresh-container-topbox-icon"
201
- })) : createCommentVNode("", true),
202
- createElementVNode("div", _hoisted_1, toDisplayString(_ctx.getPullStatus), 1),
203
- _ctx.status == "pulling" ? renderSlot(_ctx.$slots, "pulling", { key: 1 }) : createCommentVNode("", true),
204
- _ctx.status == "loosing" ? renderSlot(_ctx.$slots, "loosing", { key: 2 }) : createCommentVNode("", true),
205
- _ctx.status == "loading" ? renderSlot(_ctx.$slots, "loading", { key: 3 }) : createCommentVNode("", true)
140
+ })) : g("", !0),
141
+ S("div", oe, K(e.getPullStatus), 1),
142
+ e.status == "pulling" ? f(e.$slots, "pulling", { key: 1 }) : g("", !0),
143
+ e.status == "loosing" ? f(e.$slots, "loosing", { key: 2 }) : g("", !0),
144
+ e.status == "loading" ? f(e.$slots, "loading", { key: 3 }) : g("", !0)
206
145
  ], 4),
207
- renderSlot(_ctx.$slots, "default")
146
+ f(e.$slots, "default")
208
147
  ], 4)
209
148
  ], 34);
210
149
  }
211
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
150
+ const he = /* @__PURE__ */ _(le, [["render", se]]);
212
151
  export {
213
- index as default
152
+ he as default
214
153
  };
@@ -1,9 +1,9 @@
1
- import { _ as _sfc_main } from "./index.vue_vue_type_script_lang-442e4704.js";
1
+ import { _ as o } from "./index.vue_vue_type_script_lang-43b774dd.js";
2
2
  import "vue";
3
- import "./component-81a4c1d0.js";
3
+ import "./component-234624bc.js";
4
4
  import "../locale/lang";
5
5
  import "@nutui/icons-vue";
6
- import "./pxCheck-c6b9f6b7.js";
6
+ import "./pxCheck-38173291.js";
7
7
  export {
8
- _sfc_main as default
8
+ o as default
9
9
  };
@@ -1,7 +1,7 @@
1
- import { _ as _sfc_main } from "./index.vue_vue_type_script_lang-22dfc112.js";
1
+ import { _ as o } from "./index.vue_vue_type_script_lang-1139b29a.js";
2
2
  import "vue";
3
- import "./component-81a4c1d0.js";
3
+ import "./component-234624bc.js";
4
4
  import "../locale/lang";
5
5
  export {
6
- _sfc_main as default
6
+ o as default
7
7
  };