@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,30 +0,0 @@
1
- import { ref, onMounted } from "vue";
2
- const overflowScrollReg = /scroll|auto|overlay/i;
3
- const defaultRoot = window;
4
- function isElement(node) {
5
- const ELEMENT_NODE_TYPE = 1;
6
- return node.tagName !== "HTML" && node.tagName !== "BODY" && node.nodeType === ELEMENT_NODE_TYPE;
7
- }
8
- function getScrollParent(el, root = defaultRoot) {
9
- let node = el;
10
- while (node && node !== root && isElement(node)) {
11
- const { overflowY } = window.getComputedStyle(node);
12
- if (overflowScrollReg.test(overflowY)) {
13
- return node;
14
- }
15
- node = node.parentNode;
16
- }
17
- return root;
18
- }
19
- function useScrollParent(el, root = defaultRoot) {
20
- const scrollParent = ref();
21
- onMounted(() => {
22
- if (el.value) {
23
- scrollParent.value = getScrollParent(el.value, root);
24
- }
25
- });
26
- return scrollParent;
27
- }
28
- export {
29
- useScrollParent as u
30
- };
@@ -1,8 +0,0 @@
1
- import { getCurrentInstance } from "vue";
2
- function useRouter() {
3
- const proxy = getCurrentInstance().proxy;
4
- return proxy.$router || null;
5
- }
6
- export {
7
- useRouter as u
8
- };
@@ -1,10 +0,0 @@
1
- import { getCurrentInstance } from "vue";
2
- function useExpose(apis) {
3
- const instance = getCurrentInstance();
4
- if (instance) {
5
- Object.assign(instance.proxy, apis);
6
- }
7
- }
8
- export {
9
- useExpose as u
10
- };
@@ -1,67 +0,0 @@
1
- import { ref } from "vue";
2
- const MIN_DISTANCE = 10;
3
- function getDirection(x, y) {
4
- if (x > y && x > MIN_DISTANCE) {
5
- return "horizontal";
6
- }
7
- if (y > x && y > MIN_DISTANCE) {
8
- return "vertical";
9
- }
10
- return "";
11
- }
12
- function useTouch() {
13
- const startX = ref(0);
14
- const startY = ref(0);
15
- const moveX = ref(0);
16
- const moveY = ref(0);
17
- const deltaX = ref(0);
18
- const deltaY = ref(0);
19
- const offsetX = ref(0);
20
- const offsetY = ref(0);
21
- const direction = ref("");
22
- const isVertical = () => direction.value === "vertical";
23
- const isHorizontal = () => direction.value === "horizontal";
24
- const reset = () => {
25
- deltaX.value = 0;
26
- deltaY.value = 0;
27
- offsetX.value = 0;
28
- offsetY.value = 0;
29
- direction.value = "";
30
- };
31
- const start = (event) => {
32
- reset();
33
- startX.value = event.touches[0].clientX;
34
- startY.value = event.touches[0].clientY;
35
- };
36
- const move = (event) => {
37
- const touch = event.touches[0];
38
- deltaX.value = touch.clientX - startX.value;
39
- deltaY.value = touch.clientY - startY.value;
40
- moveX.value = touch.clientX;
41
- moveY.value = touch.clientY;
42
- offsetX.value = Math.abs(deltaX.value);
43
- offsetY.value = Math.abs(deltaY.value);
44
- if (!direction.value) {
45
- direction.value = getDirection(offsetX.value, offsetY.value);
46
- }
47
- };
48
- return {
49
- move,
50
- start,
51
- reset,
52
- startX,
53
- startY,
54
- moveX,
55
- moveY,
56
- deltaX,
57
- deltaY,
58
- offsetX,
59
- offsetY,
60
- direction,
61
- isVertical,
62
- isHorizontal
63
- };
64
- }
65
- export {
66
- useTouch as u
67
- };
@@ -1,244 +0,0 @@
1
- import { c as createComponent } from "./component-81a4c1d0.js";
2
- import { reactive, computed, watch, watchEffect, toRefs, resolveComponent, openBlock, createBlock, Teleport, mergeProps, createCommentVNode, createVNode, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, vShow } from "vue";
3
- import Overlay from "./Overlay.js";
4
- import { Close } from "@nutui/icons-vue";
5
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
6
- const popupProps = {
7
- visible: {
8
- type: Boolean,
9
- default: false
10
- },
11
- zIndex: {
12
- type: [Number, String],
13
- default: 2e3
14
- },
15
- duration: {
16
- type: [Number, String],
17
- default: 0.3
18
- },
19
- lockScroll: {
20
- type: Boolean,
21
- default: true
22
- },
23
- closeOnClickOverlay: {
24
- type: Boolean,
25
- default: true
26
- },
27
- position: {
28
- type: String,
29
- default: "center"
30
- },
31
- transition: {
32
- type: String,
33
- default: ""
34
- },
35
- style: {
36
- type: Object,
37
- default: {}
38
- },
39
- popClass: {
40
- type: String,
41
- default: ""
42
- },
43
- closeable: {
44
- type: Boolean,
45
- default: false
46
- },
47
- closeIconPosition: {
48
- type: String,
49
- default: "top-right"
50
- },
51
- closeIcon: {
52
- type: String,
53
- default: "close"
54
- },
55
- destroyOnClose: {
56
- type: Boolean,
57
- default: true
58
- },
59
- teleport: {
60
- type: [String, Element],
61
- default: "body"
62
- },
63
- overlay: {
64
- type: Boolean,
65
- default: true
66
- },
67
- round: {
68
- type: Boolean,
69
- default: false
70
- },
71
- teleportDisable: {
72
- type: Boolean,
73
- default: false
74
- },
75
- safeAreaInsetBottom: {
76
- type: Boolean,
77
- default: false
78
- },
79
- overlayClass: {
80
- type: String,
81
- default: ""
82
- },
83
- overlayStyle: {
84
- type: Object,
85
- default: {}
86
- }
87
- };
88
- const initIndex = 2e3;
89
- let _zIndex = initIndex;
90
- const component = (componentName2, components) => {
91
- return {
92
- components,
93
- props: {
94
- ...popupProps
95
- },
96
- emits: ["click-pop", "click-close-icon", "open", "close", "opend", "closed", "click-overlay", "update:visible"],
97
- setup(props, { emit }) {
98
- const state = reactive({
99
- zIndex: props.zIndex,
100
- showSlot: true,
101
- closed: props.closeable
102
- });
103
- const classes = computed(() => {
104
- const prefixCls = componentName2;
105
- return {
106
- [prefixCls]: true,
107
- ["round"]: props.round,
108
- [`nut-popup--${props.position}`]: true,
109
- [`nut-popup--${props.position}--safebottom`]: props.position === "bottom" && props.safeAreaInsetBottom,
110
- [props.popClass]: true
111
- };
112
- });
113
- const popStyle = computed(() => {
114
- return {
115
- zIndex: state.zIndex,
116
- transitionDuration: `${props.duration}s`,
117
- ...props.style
118
- };
119
- });
120
- const transitionName = computed(() => {
121
- return props.transition ? props.transition : `nut-popup-slide-${props.position}`;
122
- });
123
- const open = () => {
124
- if (props.zIndex !== initIndex) {
125
- _zIndex = Number(props.zIndex);
126
- }
127
- emit("update:visible", true);
128
- state.zIndex = ++_zIndex;
129
- if (props.destroyOnClose) {
130
- state.showSlot = true;
131
- }
132
- emit("open");
133
- };
134
- const close = () => {
135
- emit("update:visible", false);
136
- emit("close");
137
- if (props.destroyOnClose) {
138
- setTimeout(() => {
139
- state.showSlot = false;
140
- }, +props.duration * 1e3);
141
- }
142
- };
143
- const onClick = (e) => {
144
- emit("click-pop", e);
145
- };
146
- const onClickCloseIcon = (e) => {
147
- e.stopPropagation();
148
- emit("click-close-icon", e);
149
- emit("update:visible", false);
150
- };
151
- const onClickOverlay = (e) => {
152
- if (props.closeOnClickOverlay) {
153
- emit("click-overlay", e);
154
- emit("update:visible", false);
155
- }
156
- };
157
- const onOpened = (e) => {
158
- emit("opend", e);
159
- };
160
- const onClosed = (e) => {
161
- emit("closed", e);
162
- };
163
- watch(
164
- () => props.visible,
165
- (val) => {
166
- props.visible ? open() : close();
167
- }
168
- );
169
- watchEffect(() => {
170
- state.closed = props.closeable;
171
- });
172
- return {
173
- ...toRefs(state),
174
- popStyle,
175
- transitionName,
176
- classes,
177
- onClick,
178
- onClickCloseIcon,
179
- onClickOverlay,
180
- onOpened,
181
- onClosed
182
- };
183
- }
184
- };
185
- };
186
- const { componentName, create } = createComponent("popup");
187
- const _sfc_main = create(
188
- component(componentName, {
189
- [Overlay.name]: Overlay,
190
- Close
191
- })
192
- );
193
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
194
- const _component_nut_overlay = resolveComponent("nut-overlay");
195
- const _component_Close = resolveComponent("Close");
196
- return openBlock(), createBlock(Teleport, {
197
- to: _ctx.teleport,
198
- disabled: !_ctx.teleportDisable
199
- }, [
200
- _ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, mergeProps({
201
- key: 0,
202
- visible: _ctx.visible,
203
- "close-on-click-overlay": _ctx.closeOnClickOverlay,
204
- "z-index": _ctx.zIndex,
205
- "lock-scroll": _ctx.lockScroll,
206
- duration: _ctx.duration,
207
- "overlay-class": _ctx.overlayClass,
208
- "overlay-style": _ctx.overlayStyle,
209
- onClick: _ctx.onClickOverlay
210
- }, _ctx.$attrs), null, 16, ["visible", "close-on-click-overlay", "z-index", "lock-scroll", "duration", "overlay-class", "overlay-style", "onClick"])) : createCommentVNode("", true),
211
- createVNode(Transition, {
212
- name: _ctx.transitionName,
213
- onAfterEnter: _ctx.onOpened,
214
- onAfterLeave: _ctx.onClosed
215
- }, {
216
- default: withCtx(() => [
217
- withDirectives(createElementVNode("view", {
218
- class: normalizeClass(_ctx.classes),
219
- style: normalizeStyle(_ctx.popStyle),
220
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClick && _ctx.onClick(...args))
221
- }, [
222
- _ctx.showSlot ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true),
223
- _ctx.closed ? (openBlock(), createElementBlock("view", {
224
- key: 1,
225
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClickCloseIcon && _ctx.onClickCloseIcon(...args)),
226
- class: normalizeClass(["nut-popup__close-icon", "nut-popup__close-icon--" + _ctx.closeIconPosition])
227
- }, [
228
- renderSlot(_ctx.$slots, "close-icon", {}, () => [
229
- createVNode(_component_Close, { height: "12px" })
230
- ])
231
- ], 2)) : createCommentVNode("", true)
232
- ], 6), [
233
- [vShow, _ctx.visible]
234
- ])
235
- ]),
236
- _: 3
237
- }, 8, ["name", "onAfterEnter", "onAfterLeave"])
238
- ], 8, ["to", "disabled"]);
239
- }
240
- const Popup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
241
- export {
242
- Popup as P,
243
- popupProps as p
244
- };
@@ -1,46 +0,0 @@
1
- import { provide, readonly, computed, watch, h } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- const { componentName, create } = createComponent("radio-group");
4
- const _sfc_main = create({
5
- props: {
6
- modelValue: {
7
- type: [Number, String, Boolean],
8
- default: ""
9
- },
10
- direction: {
11
- type: String,
12
- default: "vertical"
13
- //horizontal
14
- },
15
- textPosition: {
16
- type: String,
17
- default: "right"
18
- }
19
- },
20
- emits: ["change", "update:modelValue"],
21
- setup(props, { emit, slots }) {
22
- const updateValue = (value) => emit("update:modelValue", value);
23
- provide("parent", {
24
- label: readonly(computed(() => props.modelValue)),
25
- position: props.textPosition,
26
- updateValue
27
- });
28
- watch(
29
- () => props.modelValue,
30
- (value) => emit("change", value)
31
- );
32
- return () => {
33
- var _a;
34
- return h(
35
- "view",
36
- {
37
- class: `${componentName} ${componentName}--${props.direction}`
38
- },
39
- (_a = slots.default) == null ? void 0 : _a.call(slots)
40
- );
41
- };
42
- }
43
- });
44
- export {
45
- _sfc_main as _
46
- };
@@ -1,98 +0,0 @@
1
- import { inject, computed, h } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { CheckNormal, CheckChecked } from "@nutui/icons-vue";
4
- import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
5
- const { componentName, create } = createComponent("radio");
6
- const _sfc_main = create({
7
- components: {
8
- CheckNormal,
9
- CheckChecked
10
- },
11
- props: {
12
- disabled: {
13
- type: Boolean,
14
- default: false
15
- },
16
- shape: {
17
- type: String,
18
- default: "round"
19
- // button
20
- },
21
- label: {
22
- type: [String, Number, Boolean],
23
- default: ""
24
- },
25
- iconSize: {
26
- type: [String, Number],
27
- default: ""
28
- }
29
- },
30
- setup(props, { emit, slots }) {
31
- let parent = inject("parent", null);
32
- const isCurValue = computed(() => {
33
- return parent.label.value === props.label;
34
- });
35
- const color = computed(() => {
36
- return !props.disabled ? isCurValue.value ? "nut-radio__icon" : "nut-radio__icon--unchecked" : "nut-radio__icon--disable";
37
- });
38
- const position = computed(() => {
39
- return parent.position;
40
- });
41
- const renderIcon = () => {
42
- const { iconSize } = props;
43
- const iconNodeMap = {
44
- CheckNormal: slots.icon ? slots.icon : CheckNormal,
45
- Checked: slots.checkedIcon ? slots.checkedIcon : CheckChecked
46
- };
47
- const iconNode = !isCurValue.value ? iconNodeMap.CheckNormal : iconNodeMap.Checked;
48
- const size = pxCheck(iconSize);
49
- return h(iconNode, {
50
- width: size,
51
- height: size,
52
- size,
53
- class: color.value
54
- });
55
- };
56
- const renderLabel = () => {
57
- var _a;
58
- return h(
59
- "view",
60
- {
61
- class: `${componentName}__label ${props.disabled ? `${componentName}__label--disabled` : ""}`
62
- },
63
- (_a = slots.default) == null ? void 0 : _a.call(slots)
64
- );
65
- };
66
- const renderButton = () => {
67
- var _a;
68
- return h(
69
- "view",
70
- {
71
- class: `${componentName}__button ${isCurValue.value && `${componentName}__button--active`} ${props.disabled ? `${componentName}__button--disabled` : ""}`
72
- },
73
- (_a = slots.default) == null ? void 0 : _a.call(slots)
74
- );
75
- };
76
- const handleClick = () => {
77
- if (isCurValue.value || props.disabled)
78
- return;
79
- parent.updateValue(props.label);
80
- };
81
- let reverseState = position.value === "left";
82
- return () => {
83
- return h(
84
- "view",
85
- {
86
- class: `${componentName} ${componentName}--${props.shape} ${reverseState ? `${componentName}--reverse` : ""}`,
87
- onClick: handleClick
88
- },
89
- [
90
- props.shape == "button" ? renderButton() : reverseState ? [renderLabel(), renderIcon()] : [renderIcon(), renderLabel()]
91
- ]
92
- );
93
- };
94
- }
95
- });
96
- export {
97
- _sfc_main as _
98
- };
@@ -1,151 +0,0 @@
1
- import { ref, reactive, computed, watch, onMounted, onUnmounted, h, unref } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { u as useRect } from "./index-29892cda.js";
4
- const { componentName, create } = createComponent("sticky");
5
- const _sfc_main = create({
6
- props: {
7
- position: {
8
- type: String,
9
- default: "top"
10
- },
11
- top: {
12
- type: [Number, String],
13
- default: 0
14
- },
15
- bottom: {
16
- type: [Number, String],
17
- default: 0
18
- },
19
- container: {
20
- type: Object
21
- },
22
- zIndex: {
23
- type: [Number, String],
24
- default: 2e3
25
- }
26
- },
27
- emits: ["change", "scroll"],
28
- setup(props, { emit, slots }) {
29
- const root = ref();
30
- const state = reactive({
31
- width: 0,
32
- height: 0,
33
- fixed: false,
34
- transform: 0
35
- });
36
- const rootStyle = computed(() => {
37
- const { fixed, width, height } = state;
38
- if (fixed) {
39
- return {
40
- width: `${width}px`,
41
- height: `${height}px`
42
- };
43
- }
44
- });
45
- const stickyStyle = computed(() => {
46
- if (!state.fixed)
47
- return;
48
- const style = {
49
- width: `${state.width}px`,
50
- height: `${state.height}px`,
51
- [props.position]: `${offset.value}px`,
52
- zIndex: +props.zIndex
53
- };
54
- if (state.transform)
55
- style.transform = `translate3d(0, ${state.transform}px, 0)`;
56
- return style;
57
- });
58
- const offset = computed(() => {
59
- return props.position === "top" ? props.top : props.bottom;
60
- });
61
- const isHidden = (elementRef) => {
62
- const el = unref(elementRef);
63
- if (!el)
64
- return false;
65
- const style = window.getComputedStyle(el);
66
- const hidden = style.display === "none";
67
- const parentHidden = el.offsetParent === null && style.position !== "fixed";
68
- return hidden || parentHidden;
69
- };
70
- const isExistRoot = () => {
71
- if (!root.value || isHidden(root))
72
- return false;
73
- return true;
74
- };
75
- const getScrollTop = (el) => {
76
- return Math.max(0, "scrollTop" in el ? el.scrollTop : el.pageYOffset);
77
- };
78
- const renderFixed = () => {
79
- var _a;
80
- return h(
81
- "view",
82
- {
83
- style: stickyStyle.value,
84
- class: state.fixed ? `${componentName} nut-sticky--fixed` : componentName
85
- },
86
- (_a = slots.default) == null ? void 0 : _a.call(slots)
87
- );
88
- };
89
- const onScroll = () => {
90
- if (!isExistRoot())
91
- return;
92
- const { container, position } = props;
93
- const scrollTop = getScrollTop(window);
94
- const rootRect = useRect(root);
95
- if (rootRect.width || rootRect.height) {
96
- state.width = rootRect.width;
97
- state.height = rootRect.height;
98
- }
99
- if (position === "top") {
100
- if (container) {
101
- const containerRect = useRect(container);
102
- const diff = containerRect.bottom - +offset.value - state.height;
103
- state.fixed = +offset.value > rootRect.top && containerRect.bottom > 0;
104
- state.transform = diff < 0 ? diff : 0;
105
- } else {
106
- state.fixed = offset.value > rootRect.top;
107
- }
108
- } else if (position === "bottom") {
109
- const clientHeight = document.documentElement.clientHeight;
110
- if (container) {
111
- const containerRect = useRect(container);
112
- const diff = clientHeight - containerRect.top - +offset.value - state.height;
113
- state.fixed = clientHeight - +offset.value < rootRect.bottom && clientHeight > containerRect.top;
114
- state.transform = diff < 0 ? -diff : 0;
115
- } else {
116
- state.fixed = clientHeight - +offset.value < rootRect.bottom;
117
- }
118
- }
119
- emit("scroll", {
120
- top: scrollTop,
121
- fixed: state.fixed
122
- });
123
- };
124
- watch(
125
- () => state.fixed,
126
- (val) => {
127
- emit("change", val);
128
- }
129
- );
130
- onMounted(() => {
131
- window.addEventListener("scroll", onScroll);
132
- onScroll();
133
- });
134
- onUnmounted(() => {
135
- window.removeEventListener("scroll", onScroll);
136
- });
137
- return () => {
138
- return h(
139
- "view",
140
- {
141
- style: rootStyle.value,
142
- ref: root
143
- },
144
- [renderFixed()]
145
- );
146
- };
147
- }
148
- });
149
- export {
150
- _sfc_main as _
151
- };
@@ -1,29 +0,0 @@
1
- import { f as isPromise } from "./component-81a4c1d0.js";
2
- const funInterceptor = (interceptor, {
3
- args = [],
4
- done,
5
- canceled
6
- }) => {
7
- if (interceptor) {
8
- const returnVal = interceptor.apply(null, args);
9
- if (isPromise(returnVal)) {
10
- returnVal.then((value) => {
11
- if (value) {
12
- done(value);
13
- } else if (canceled) {
14
- canceled();
15
- }
16
- }).catch(() => {
17
- });
18
- } else if (returnVal) {
19
- done();
20
- } else if (canceled) {
21
- canceled();
22
- }
23
- } else {
24
- done();
25
- }
26
- };
27
- export {
28
- funInterceptor as f
29
- };