@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,163 +1,120 @@
1
- import { reactive, ref, computed, watch, toRefs, onMounted, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, resolveComponent, renderSlot, createVNode } from "vue";
2
- import { c as createComponent, d as preventDefault, e as clamp } from "./component-81a4c1d0.js";
3
- import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
4
- import { u as useTouch } from "./index-7a7385e4.js";
5
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ var le = Object.defineProperty, oe = Object.defineProperties;
2
+ var ae = Object.getOwnPropertyDescriptors;
3
+ var Q = Object.getOwnPropertySymbols;
4
+ var re = Object.prototype.hasOwnProperty, se = Object.prototype.propertyIsEnumerable;
5
+ var W = (e, n, a) => n in e ? le(e, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[n] = a, B = (e, n) => {
6
+ for (var a in n || (n = {}))
7
+ re.call(n, a) && W(e, a, n[a]);
8
+ if (Q)
9
+ for (var a of Q(n))
10
+ se.call(n, a) && W(e, a, n[a]);
11
+ return e;
12
+ }, L = (e, n) => oe(e, ae(n));
13
+ import { reactive as x, ref as $, computed as b, watch as E, toRefs as J, onMounted as ue, openBlock as S, createElementBlock as D, createElementVNode as N, normalizeStyle as I, Fragment as U, renderList as _, normalizeClass as ee, toDisplayString as R, createCommentVNode as j, resolveComponent as ie, renderSlot as X, createVNode as ce } from "vue";
14
+ import { c as q, d as Z, e as me } from "./component-234624bc.js";
15
+ import { p as de } from "./pxCheck-38173291.js";
16
+ import { u as he } from "./index-53ec2d4d.js";
17
+ import { _ as te } from "./_plugin-vue_export-helper-dad06003.js";
6
18
  import "../locale/lang";
7
- const { componentName: componentName$1 } = createComponent("picker");
8
- const usePicker = (props, emit) => {
9
- const state = reactive({
10
- formattedColumns: props.columns
11
- });
12
- let defaultValues = ref([]);
13
- const pickerColumn = ref([]);
14
- const swipeRef = (el) => {
15
- if (el && pickerColumn.value.length < columnsList.value.length) {
16
- pickerColumn.value.push(el);
17
- }
18
- };
19
- const classes = computed(() => {
20
- const prefixCls = componentName$1;
21
- return {
22
- [prefixCls]: true
23
- };
24
- });
25
- const selectedOptions = computed(() => {
26
- let optins = [];
27
- columnsList.value.map((column2, index) => {
28
- let currOptions = [];
29
- currOptions = column2.filter((item) => item.value == defaultValues.value[index]);
30
- optins.push(currOptions[0]);
31
- });
32
- return optins;
33
- });
34
- const columnsType = computed(() => {
35
- const firstColumn = state.formattedColumns[0];
36
- if (firstColumn) {
37
- if (Array.isArray(firstColumn)) {
19
+ const { componentName: fe } = q("picker"), ve = (e, n) => {
20
+ const a = x({
21
+ formattedColumns: e.columns
22
+ }), t = $([]), y = $([]), p = (l) => {
23
+ l && y.value.length < d.value.length && y.value.push(l);
24
+ }, r = b(() => ({
25
+ [fe]: !0
26
+ })), s = b(() => d.value.map((l, c) => l.find((T) => T.value === t.value[c]))), g = b(() => {
27
+ const l = a.formattedColumns[0];
28
+ if (l) {
29
+ if (Array.isArray(l))
38
30
  return "multiple";
39
- }
40
- if ("children" in firstColumn) {
31
+ if ("children" in l)
41
32
  return "cascade";
42
- }
43
33
  }
44
34
  return "single";
45
- });
46
- const columnsList = computed(() => {
47
- switch (columnsType.value) {
35
+ }), d = b(() => {
36
+ switch (g.value) {
48
37
  case "multiple":
49
- return state.formattedColumns;
38
+ return a.formattedColumns;
50
39
  case "cascade":
51
- return formatCascade(state.formattedColumns, defaultValues.value ? defaultValues.value : []);
40
+ return H(a.formattedColumns, t.value ? t.value : []);
52
41
  default:
53
- return [state.formattedColumns];
42
+ return [a.formattedColumns];
54
43
  }
55
- });
56
- const formatCascade = (columns, defaultValues2) => {
57
- const formatted = [];
58
- let cursor = {
44
+ }), H = (l, c) => {
45
+ const T = [];
46
+ let u = {
59
47
  text: "",
60
48
  value: "",
61
- children: columns
62
- };
63
- let columnIndex = 0;
64
- while (cursor && cursor.children) {
65
- const options = cursor.children;
66
- const value = defaultValues2[columnIndex];
67
- let index = options.findIndex((columnItem) => columnItem.value == value);
68
- if (index == -1)
69
- index = 0;
70
- cursor = cursor.children[index];
71
- columnIndex++;
72
- formatted.push(options);
49
+ children: l
50
+ }, z = 0;
51
+ for (; u && u.children; ) {
52
+ const P = u.children, w = c[z];
53
+ let C = P.findIndex((O) => O.value === w);
54
+ C === -1 && (C = 0), u = u.children[C], z++, T.push(P);
73
55
  }
74
- return formatted;
75
- };
76
- const cancel = () => {
77
- emit("cancel", {
78
- selectedValue: defaultValues.value,
79
- selectedOptions: selectedOptions.value
56
+ return T;
57
+ }, M = () => {
58
+ n("cancel", {
59
+ selectedValue: t.value,
60
+ selectedOptions: s.value
80
61
  });
81
- };
82
- const changeHandler = (columnIndex, option) => {
83
- if (option && Object.keys(option).length) {
84
- defaultValues.value = defaultValues.value ? defaultValues.value : [];
85
- if (columnsType.value === "cascade") {
86
- defaultValues.value[columnIndex] = option.value ? option.value : "";
87
- let index = columnIndex;
88
- let cursor = option;
89
- while (cursor && cursor.children && cursor.children[0]) {
90
- defaultValues.value[index + 1] = cursor.children[0].value;
91
- index++;
92
- cursor = cursor.children[0];
93
- }
94
- if (cursor && cursor.children && cursor.children.length == 0) {
95
- defaultValues.value = defaultValues.value.slice(0, index + 1);
96
- }
97
- } else {
98
- defaultValues.value[columnIndex] = option.hasOwnProperty("value") ? option.value : "";
99
- }
100
- emit("change", {
101
- columnIndex,
102
- selectedValue: defaultValues.value,
103
- selectedOptions: selectedOptions.value
62
+ }, A = (l, c) => {
63
+ if (c && Object.keys(c).length) {
64
+ if (t.value = t.value ? t.value : [], g.value === "cascade") {
65
+ t.value[l] = c.value ? c.value : "";
66
+ let T = l, u = c;
67
+ for (; u && u.children && u.children[0]; )
68
+ t.value[T + 1] = u.children[0].value, T++, u = u.children[0];
69
+ u && u.children && u.children.length === 0 && (t.value = t.value.slice(0, T + 1));
70
+ } else
71
+ t.value[l] = c.hasOwnProperty("value") ? c.value : "";
72
+ n("change", {
73
+ columnIndex: l,
74
+ selectedValue: t.value,
75
+ selectedOptions: s.value
104
76
  });
105
77
  }
106
- };
107
- const confirm = () => {
108
- if (defaultValues.value && !defaultValues.value.length) {
109
- columnsList.value.forEach((columns) => {
110
- defaultValues.value.push(columns[0].value);
111
- });
112
- }
113
- emit("confirm", {
114
- selectedValue: defaultValues.value,
115
- selectedOptions: selectedOptions.value
78
+ }, f = () => {
79
+ t.value && !t.value.length && d.value.forEach((l) => {
80
+ t.value.push(l[0].value);
81
+ }), n("confirm", {
82
+ selectedValue: t.value,
83
+ selectedOptions: s.value
116
84
  });
117
- };
118
- const isSameValue = (valA, valB) => JSON.stringify(valA) === JSON.stringify(valB);
119
- watch(
120
- () => props.modelValue,
121
- (newValues) => {
122
- if (!isSameValue(newValues, defaultValues.value)) {
123
- defaultValues.value = newValues;
124
- }
85
+ }, Y = (l, c) => JSON.stringify(l) === JSON.stringify(c);
86
+ return E(
87
+ () => e.modelValue,
88
+ (l) => {
89
+ Y(l, t.value) || (t.value = l);
125
90
  },
126
- { deep: true, immediate: true }
127
- );
128
- watch(
129
- defaultValues,
130
- (newValues) => {
131
- if (!isSameValue(newValues, props.modelValue)) {
132
- emit("update:modelValue", newValues);
133
- }
91
+ { deep: !0, immediate: !0 }
92
+ ), E(
93
+ t,
94
+ (l) => {
95
+ Y(l, e.modelValue) || n("update:modelValue", l);
134
96
  },
135
- { deep: true }
136
- );
137
- watch(
138
- () => props.columns,
139
- (val) => {
140
- if (val.length)
141
- state.formattedColumns = val;
97
+ { deep: !0 }
98
+ ), E(
99
+ () => e.columns,
100
+ (l) => {
101
+ l.length && (a.formattedColumns = l);
142
102
  }
143
- );
144
- return {
145
- classes,
146
- ...toRefs(state),
147
- columnsType,
148
- columnsList,
149
- cancel,
150
- changeHandler,
151
- confirm,
152
- defaultValues,
153
- pickerColumn,
154
- swipeRef,
155
- selectedOptions,
156
- isSameValue
157
- };
158
- };
159
- const { create: create$1 } = createComponent("picker-column");
160
- const _sfc_main$1 = create$1({
103
+ ), L(B({
104
+ classes: r
105
+ }, J(a)), {
106
+ columnsType: g,
107
+ columnsList: d,
108
+ cancel: M,
109
+ changeHandler: A,
110
+ confirm: f,
111
+ defaultValues: t,
112
+ pickerColumn: y,
113
+ swipeRef: p,
114
+ selectedOptions: s,
115
+ isSameValue: Y
116
+ });
117
+ }, { create: pe } = q("picker-column"), ge = pe({
161
118
  props: {
162
119
  // 当前选中项
163
120
  value: [String, Number],
@@ -169,7 +126,7 @@ const _sfc_main$1 = create$1({
169
126
  // 是否开启3D效果
170
127
  threeDimensional: {
171
128
  type: Boolean,
172
- default: true
129
+ default: !0
173
130
  },
174
131
  swipeDuration: {
175
132
  type: [Number, String],
@@ -185,9 +142,8 @@ const _sfc_main$1 = create$1({
185
142
  }
186
143
  },
187
144
  emits: ["click", "change"],
188
- setup(props, { emit }) {
189
- const touch = useTouch();
190
- const state = reactive({
145
+ setup(e, { emit: n }) {
146
+ const a = he(), t = x({
191
147
  touchParams: {
192
148
  startY: 0,
193
149
  endY: 0,
@@ -200,229 +156,141 @@ const _sfc_main$1 = create$1({
200
156
  transformY: 0,
201
157
  scrollDistance: 0,
202
158
  rotation: 20
203
- });
204
- const roller = ref(null);
205
- const moving = ref(false);
206
- const touchDeg = ref(0);
207
- const touchTime = ref(0);
208
- const DEFAULT_DURATION = 200;
209
- const INERTIA_TIME = 300;
210
- const INERTIA_DISTANCE = 15;
211
- const touchRollerStyle = computed(() => {
212
- return {
213
- transition: `transform ${touchTime.value}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
214
- transform: `rotate3d(1, 0, 0, ${touchDeg.value})`,
215
- top: `calc(50% - ${+props.optionHeight / 2}px)`
216
- };
217
- });
218
- const touchTileStyle = computed(() => {
219
- const { optionHeight } = props;
159
+ }), y = $(null), p = $(!1), r = $(0), s = $(0), g = 200, d = 300, H = 15, M = b(() => ({
160
+ transition: `transform ${s.value}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
161
+ transform: `rotate3d(1, 0, 0, ${r.value})`,
162
+ top: `calc(50% - ${+e.optionHeight / 2}px)`
163
+ })), A = b(() => {
164
+ const { optionHeight: o } = e;
220
165
  return {
221
- transition: `transform ${touchTime.value}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
222
- transform: `translate3d(0, ${state.scrollDistance}px, 0)`,
223
- top: `calc(50% - ${+optionHeight / 2}px)`,
224
- height: `${optionHeight}px`
166
+ transition: `transform ${s.value}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
167
+ transform: `translate3d(0, ${t.scrollDistance}px, 0)`,
168
+ top: `calc(50% - ${+o / 2}px)`,
169
+ height: `${o}px`
225
170
  };
226
- });
227
- const setRollerStyle = (index) => {
228
- return `transform: rotate3d(1, 0, 0, ${-state.rotation * index}deg) translate3d(0px, 0px, 104px)`;
229
- };
230
- const maskStyles = computed(() => {
231
- return {
232
- backgroundSize: `100% ${(+props.visibleOptionNum - 1) * +props.optionHeight / 2}px`
233
- };
234
- });
235
- const onTouchStart = (event) => {
236
- touch.start(event);
237
- if (moving.value) {
238
- let dom = roller.value;
239
- const { transform } = window.getComputedStyle(dom);
240
- if (props.threeDimensional) {
241
- const circle = Math.floor(parseInt(touchDeg.value) / 360);
242
- const cos = +transform.split(", ")[5];
243
- const sin = +transform.split(", ")[6] < 0 ? 180 : 0;
244
- const endDeg = circle * 360 + Math.acos(cos) / Math.PI * 180 + sin;
245
- state.scrollDistance = -Math.abs((endDeg / state.rotation - 1) * +props.optionHeight);
246
- } else {
247
- state.scrollDistance = +transform.slice(7, transform.length - 1).split(", ")[5];
248
- }
171
+ }), f = (o) => `transform: rotate3d(1, 0, 0, ${-t.rotation * o}deg) translate3d(0px, 0px, 104px)`, Y = b(() => ({
172
+ backgroundSize: `100% ${(+e.visibleOptionNum - 1) * +e.optionHeight / 2}px`
173
+ })), l = (o) => {
174
+ if (a.start(o), p.value) {
175
+ let m = y.value;
176
+ const { transform: i } = window.getComputedStyle(m);
177
+ if (e.threeDimensional) {
178
+ const h = Math.floor(parseInt(r.value) / 360), v = +i.split(", ")[5], k = +i.split(", ")[6] < 0 ? 180 : 0, V = h * 360 + Math.acos(v) / Math.PI * 180 + k;
179
+ t.scrollDistance = -Math.abs((V / t.rotation - 1) * +e.optionHeight);
180
+ } else
181
+ t.scrollDistance = +i.slice(7, i.length - 1).split(", ")[5];
249
182
  }
250
- preventDefault(event, true);
251
- state.touchParams.startY = touch.deltaY.value;
252
- state.touchParams.startTime = Date.now();
253
- state.transformY = state.scrollDistance;
254
- };
255
- const onTouchMove = (event) => {
256
- touch.move(event);
257
- if (touch.isVertical()) {
258
- moving.value = true;
259
- preventDefault(event, true);
260
- }
261
- state.touchParams.lastY = touch.deltaY.value;
262
- let move = state.touchParams.lastY - state.touchParams.startY;
263
- setMove(move);
264
- };
265
- const onTouchEnd = () => {
266
- state.touchParams.lastY = touch.deltaY.value;
267
- state.touchParams.lastTime = Date.now();
268
- let move = state.touchParams.lastY - state.touchParams.startY;
269
- let moveTime = state.touchParams.lastTime - state.touchParams.startTime;
270
- if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
271
- const distance = momentum(move, moveTime);
272
- setMove(distance, "end", +props.swipeDuration);
183
+ Z(o, !0), t.touchParams.startY = a.deltaY.value, t.touchParams.startTime = Date.now(), t.transformY = t.scrollDistance;
184
+ }, c = (o) => {
185
+ a.move(o), a.isVertical() && (p.value = !0, Z(o, !0)), t.touchParams.lastY = a.deltaY.value;
186
+ let m = t.touchParams.lastY - t.touchParams.startY;
187
+ w(m);
188
+ }, T = () => {
189
+ t.touchParams.lastY = a.deltaY.value, t.touchParams.lastTime = Date.now();
190
+ let o = t.touchParams.lastY - t.touchParams.startY, m = t.touchParams.lastTime - t.touchParams.startTime;
191
+ if (m <= d && Math.abs(o) > H) {
192
+ const i = u(o, m);
193
+ w(i, "end", +e.swipeDuration);
273
194
  return;
274
- } else {
275
- setMove(move, "end");
276
- }
195
+ } else
196
+ w(o, "end");
277
197
  setTimeout(() => {
278
- touch.reset();
279
- moving.value = false;
198
+ a.reset(), p.value = !1;
280
199
  }, 0);
281
- };
282
- const momentum = (distance, duration) => {
283
- const speed = Math.abs(distance / duration);
284
- distance = speed / 3e-3 * (distance < 0 ? -1 : 1);
285
- return distance;
286
- };
287
- const isHidden = (index) => {
288
- if (index >= state.currIndex + 8 || index <= state.currIndex - 8) {
289
- return true;
200
+ }, u = (o, m) => (o = Math.abs(o / m) / 3e-3 * (o < 0 ? -1 : 1), o), z = (o) => o >= t.currIndex + 8 || o <= t.currIndex - 8, P = (o = 0, m, i = g, h) => {
201
+ m === "end" ? s.value = i : s.value = 0, r.value = h, t.scrollDistance = o;
202
+ }, w = (o, m, i) => {
203
+ const { optionHeight: h } = e;
204
+ let v = o + t.transformY;
205
+ if (m === "end") {
206
+ v > 0 && (v = 0), v < -(e.column.length - 1) * +h && (v = -(e.column.length - 1) * +h);
207
+ let k = Math.round(v / +h) * +h, V = `${(Math.abs(Math.round(k / +h)) + 1) * t.rotation}deg`;
208
+ P(k, m, i, V), t.currIndex = Math.abs(Math.round(k / +h)) + 1;
290
209
  } else {
291
- return false;
210
+ let k = 0, V = (-v / +h + 1) * t.rotation;
211
+ const G = (e.column.length + 1) * t.rotation, K = 0;
212
+ k = me(V, K, G), K < k && k < G && (P(v, null, void 0, k + "deg"), t.currIndex = Math.abs(Math.round(v / +h)) + 1);
292
213
  }
214
+ }, C = () => {
215
+ n("change", e.column[t.currIndex - 1]);
216
+ }, O = (o) => {
217
+ const { column: m } = e;
218
+ let i = m.findIndex((v) => v.value === e.value);
219
+ t.currIndex = i === -1 ? 1 : i + 1;
220
+ let h = i === -1 ? 0 : i * +e.optionHeight;
221
+ o && C(), w(-h);
222
+ }, ne = () => {
223
+ p.value = !1, s.value = 0, C();
293
224
  };
294
- const setTransform = (translateY = 0, type, time = DEFAULT_DURATION, deg) => {
295
- if (type === "end") {
296
- touchTime.value = time;
297
- } else {
298
- touchTime.value = 0;
299
- }
300
- touchDeg.value = deg;
301
- state.scrollDistance = translateY;
302
- };
303
- const setMove = (move, type, time) => {
304
- const { optionHeight } = props;
305
- let updateMove = move + state.transformY;
306
- if (type === "end") {
307
- if (updateMove > 0) {
308
- updateMove = 0;
309
- }
310
- if (updateMove < -(props.column.length - 1) * +optionHeight) {
311
- updateMove = -(props.column.length - 1) * +optionHeight;
312
- }
313
- let endMove = Math.round(updateMove / +optionHeight) * +optionHeight;
314
- let deg = `${(Math.abs(Math.round(endMove / +optionHeight)) + 1) * state.rotation}deg`;
315
- setTransform(endMove, type, time, deg);
316
- state.currIndex = Math.abs(Math.round(endMove / +optionHeight)) + 1;
317
- } else {
318
- let deg = 0;
319
- let currentDeg = (-updateMove / +optionHeight + 1) * state.rotation;
320
- const maxDeg = (props.column.length + 1) * state.rotation;
321
- const minDeg = 0;
322
- deg = clamp(currentDeg, minDeg, maxDeg);
323
- if (minDeg < deg && deg < maxDeg) {
324
- setTransform(updateMove, null, void 0, deg + "deg");
325
- state.currIndex = Math.abs(Math.round(updateMove / +optionHeight)) + 1;
326
- }
327
- }
328
- };
329
- const setChooseValue = () => {
330
- emit("change", props.column[state.currIndex - 1]);
331
- };
332
- const modifyStatus = (type) => {
333
- const { column: column2 } = props;
334
- let index = column2.findIndex((columnItem) => columnItem.value == props.value);
335
- state.currIndex = index === -1 ? 1 : index + 1;
336
- let move = index === -1 ? 0 : index * +props.optionHeight;
337
- type && setChooseValue();
338
- setMove(-move);
339
- };
340
- const stopMomentum = () => {
341
- moving.value = false;
342
- touchTime.value = 0;
343
- setChooseValue();
344
- };
345
- watch(
346
- () => props.column,
347
- (val) => {
348
- if (props.column && props.column.length > 0) {
349
- state.transformY = 0;
350
- modifyStatus(false);
351
- }
225
+ return E(
226
+ () => e.column,
227
+ (o) => {
228
+ e.column && e.column.length > 0 && (t.transformY = 0, O(!1));
352
229
  },
353
230
  {
354
- deep: true
231
+ deep: !0
355
232
  }
356
- );
357
- watch(
358
- () => props.value,
359
- (val) => {
360
- state.transformY = 0;
361
- modifyStatus(false);
233
+ ), E(
234
+ () => e.value,
235
+ (o) => {
236
+ t.transformY = 0, O(!1);
362
237
  },
363
238
  {
364
- deep: true
239
+ deep: !0
365
240
  }
366
- );
367
- onMounted(() => {
368
- modifyStatus(true);
241
+ ), ue(() => {
242
+ O(!0);
243
+ }), L(B(B({}, J(t)), J(e)), {
244
+ setRollerStyle: f,
245
+ isHidden: z,
246
+ roller: y,
247
+ onTouchStart: l,
248
+ onTouchMove: c,
249
+ onTouchEnd: T,
250
+ touchRollerStyle: M,
251
+ touchTileStyle: A,
252
+ setMove: w,
253
+ stopMomentum: ne,
254
+ pxCheck: de,
255
+ maskStyles: Y
369
256
  });
370
- return {
371
- ...toRefs(state),
372
- ...toRefs(props),
373
- setRollerStyle,
374
- isHidden,
375
- roller,
376
- onTouchStart,
377
- onTouchMove,
378
- onTouchEnd,
379
- touchRollerStyle,
380
- touchTileStyle,
381
- setMove,
382
- stopMomentum,
383
- pxCheck,
384
- maskStyles
385
- };
386
257
  }
387
258
  });
388
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
389
- return openBlock(), createElementBlock("view", {
259
+ function ye(e, n, a, t, y, p) {
260
+ return S(), D("view", {
390
261
  class: "nut-picker__list",
391
- onTouchstart: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
392
- onTouchmove: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
393
- onTouchend: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
262
+ onTouchstart: n[1] || (n[1] = (...r) => e.onTouchStart && e.onTouchStart(...r)),
263
+ onTouchmove: n[2] || (n[2] = (...r) => e.onTouchMove && e.onTouchMove(...r)),
264
+ onTouchend: n[3] || (n[3] = (...r) => e.onTouchEnd && e.onTouchEnd(...r))
394
265
  }, [
395
- createElementVNode("view", {
266
+ N("view", {
396
267
  class: "nut-picker-roller",
397
268
  ref: "roller",
398
- style: normalizeStyle(_ctx.threeDimensional ? _ctx.touchRollerStyle : _ctx.touchTileStyle),
399
- onTransitionend: _cache[0] || (_cache[0] = (...args) => _ctx.stopMomentum && _ctx.stopMomentum(...args))
269
+ style: I(e.threeDimensional ? e.touchRollerStyle : e.touchTileStyle),
270
+ onTransitionend: n[0] || (n[0] = (...r) => e.stopMomentum && e.stopMomentum(...r))
400
271
  }, [
401
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.column, (item, index) => {
402
- return openBlock(), createElementBlock(Fragment, {
403
- key: item.value ? item.value : index
404
- }, [
405
- item && item.text && _ctx.threeDimensional ? (openBlock(), createElementBlock("view", {
406
- key: 0,
407
- class: normalizeClass(["nut-picker-roller-item", { "nut-picker-roller-item-hidden": _ctx.isHidden(index + 1) }]),
408
- style: normalizeStyle(_ctx.setRollerStyle(index + 1))
409
- }, toDisplayString(item.text), 7)) : createCommentVNode("", true),
410
- item && item.text && !_ctx.threeDimensional ? (openBlock(), createElementBlock("view", {
411
- key: 1,
412
- class: "nut-picker-roller-item-tile",
413
- style: normalizeStyle({ height: _ctx.pxCheck(_ctx.optionHeight) })
414
- }, toDisplayString(item.text), 5)) : createCommentVNode("", true)
415
- ], 64);
416
- }), 128))
272
+ (S(!0), D(U, null, _(e.column, (r, s) => (S(), D(U, {
273
+ key: r.value ? r.value : s
274
+ }, [
275
+ r && r.text && e.threeDimensional ? (S(), D("view", {
276
+ key: 0,
277
+ class: ee(["nut-picker-roller-item", { "nut-picker-roller-item-hidden": e.isHidden(s + 1) }]),
278
+ style: I(e.setRollerStyle(s + 1))
279
+ }, R(r.text), 7)) : j("", !0),
280
+ r && r.text && !e.threeDimensional ? (S(), D("view", {
281
+ key: 1,
282
+ class: "nut-picker-roller-item-tile",
283
+ style: I({ height: e.pxCheck(e.optionHeight), lineHeight: e.pxCheck(e.optionHeight) })
284
+ }, R(r.text), 5)) : j("", !0)
285
+ ], 64))), 128))
417
286
  ], 36),
418
- createElementVNode("view", {
287
+ N("view", {
419
288
  class: "nut-picker-roller-mask",
420
- style: normalizeStyle(_ctx.maskStyles)
289
+ style: I(e.maskStyles)
421
290
  }, null, 4)
422
291
  ], 32);
423
292
  }
424
- const column = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
425
- const baseProps = {
293
+ const F = /* @__PURE__ */ te(ge, [["render", ye]]), Te = {
426
294
  modelValue: {
427
295
  type: Array,
428
296
  default: () => []
@@ -441,13 +309,11 @@ const baseProps = {
441
309
  },
442
310
  columns: {
443
311
  type: Array,
444
- default: () => {
445
- return [];
446
- }
312
+ default: () => []
447
313
  },
448
314
  threeDimensional: {
449
315
  type: Boolean,
450
- default: true
316
+ default: !0
451
317
  },
452
318
  swipeDuration: {
453
319
  type: [Number, String],
@@ -455,7 +321,7 @@ const baseProps = {
455
321
  },
456
322
  showToolbar: {
457
323
  type: Boolean,
458
- default: true
324
+ default: !0
459
325
  },
460
326
  visibleOptionNum: {
461
327
  type: [Number, String],
@@ -465,102 +331,87 @@ const baseProps = {
465
331
  type: [Number, String],
466
332
  default: 36
467
333
  }
468
- };
469
- const { componentName, create, translate } = createComponent("picker");
470
- const _sfc_main = create({
334
+ }, { componentName: Ve, create: ke, translate: Se } = q("picker"), De = ke({
471
335
  components: {
472
- [column.name]: column
336
+ [F.name]: F
473
337
  },
474
- props: baseProps,
338
+ props: Te,
475
339
  emits: ["cancel", "change", "confirm", "update:modelValue"],
476
- setup(props, { emit }) {
477
- const { changeHandler, confirm, defaultValues, columnsList, columnsType, classes, cancel } = usePicker(props, emit);
478
- const pickerColumn = ref([]);
479
- const swipeRef = (el) => {
480
- if (el && pickerColumn.value.length < columnsList.value.length) {
481
- pickerColumn.value.push(el);
482
- }
483
- };
484
- const columnStyle = computed(() => {
485
- const styles = {};
486
- styles.height = `${+props.visibleOptionNum * +props.optionHeight}px`;
487
- styles["--lineHeight"] = `${+props.optionHeight}px`;
488
- return styles;
340
+ setup(e, { emit: n }) {
341
+ const { changeHandler: a, confirm: t, defaultValues: y, columnsList: p, columnsType: r, classes: s, cancel: g } = ve(e, n), d = $([]), H = (f) => {
342
+ f && d.value.length < p.value.length && d.value.push(f);
343
+ }, M = b(() => {
344
+ const f = {};
345
+ return f.height = `${+e.visibleOptionNum * +e.optionHeight}px`, f["--lineHeight"] = `${+e.optionHeight}px`, f;
489
346
  });
490
- const confirmHandler = () => {
491
- pickerColumn.value.length > 0 && pickerColumn.value.forEach((column2) => {
492
- column2.stopMomentum();
493
- });
494
- confirm();
495
- };
496
347
  return {
497
- classes,
498
- column,
499
- columnsType,
500
- columnsList,
501
- cancel,
502
- changeHandler,
503
- confirmHandler,
504
- defaultValues,
505
- translate,
506
- pickerColumn,
507
- swipeRef,
508
- columnStyle
348
+ classes: s,
349
+ column: F,
350
+ columnsType: r,
351
+ columnsList: p,
352
+ cancel: g,
353
+ changeHandler: a,
354
+ confirmHandler: () => {
355
+ d.value.length > 0 && d.value.forEach((f) => {
356
+ f.stopMomentum();
357
+ }), t();
358
+ },
359
+ defaultValues: y,
360
+ translate: Se,
361
+ pickerColumn: d,
362
+ swipeRef: H,
363
+ columnStyle: M
509
364
  };
510
365
  }
511
- });
512
- const _hoisted_1 = {
366
+ }), be = {
513
367
  key: 0,
514
368
  class: "nut-picker__bar"
515
- };
516
- const _hoisted_2 = { class: "nut-picker__title" };
517
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
518
- const _component_nut_picker_column = resolveComponent("nut-picker-column");
519
- return openBlock(), createElementBlock("div", {
520
- class: normalizeClass(_ctx.classes)
369
+ }, we = { class: "nut-picker__title" };
370
+ function $e(e, n, a, t, y, p) {
371
+ const r = ie("nut-picker-column");
372
+ return S(), D("div", {
373
+ class: ee(e.classes)
521
374
  }, [
522
- _ctx.showToolbar ? (openBlock(), createElementBlock("view", _hoisted_1, [
523
- createElementVNode("view", {
375
+ e.showToolbar ? (S(), D("view", be, [
376
+ N("view", {
524
377
  class: "nut-picker__left",
525
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.cancel && _ctx.cancel(...args))
526
- }, toDisplayString(_ctx.cancelText || _ctx.translate("cancel")), 1),
527
- createElementVNode("view", _hoisted_2, toDisplayString(_ctx.title), 1),
528
- createElementVNode("view", {
378
+ onClick: n[0] || (n[0] = (...s) => e.cancel && e.cancel(...s))
379
+ }, R(e.cancelText || e.translate("cancel")), 1),
380
+ N("view", we, R(e.title), 1),
381
+ N("view", {
529
382
  class: "nut-picker__right",
530
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirmHandler())
531
- }, toDisplayString(_ctx.okText || _ctx.translate("confirm")), 1)
532
- ])) : createCommentVNode("", true),
533
- renderSlot(_ctx.$slots, "top"),
534
- createElementVNode("view", {
383
+ onClick: n[1] || (n[1] = (s) => e.confirmHandler())
384
+ }, R(e.okText || e.translate("confirm")), 1)
385
+ ])) : j("", !0),
386
+ X(e.$slots, "top"),
387
+ N("view", {
535
388
  class: "nut-picker__column",
536
- style: normalizeStyle(_ctx.columnStyle)
389
+ style: I(e.columnStyle)
537
390
  }, [
538
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columnsList, (column2, columnIndex) => {
539
- return openBlock(), createElementBlock("view", {
540
- class: "nut-picker__columnitem",
541
- key: columnIndex
542
- }, [
543
- createVNode(_component_nut_picker_column, {
544
- ref_for: true,
545
- ref: _ctx.swipeRef,
546
- column: column2,
547
- columnsType: _ctx.columnsType,
548
- value: _ctx.defaultValues && _ctx.defaultValues[columnIndex],
549
- threeDimensional: _ctx.threeDimensional,
550
- swipeDuration: _ctx.swipeDuration,
551
- visibleOptionNum: _ctx.visibleOptionNum,
552
- optionHeight: _ctx.optionHeight,
553
- onChange: (option) => {
554
- _ctx.changeHandler(columnIndex, option);
555
- }
556
- }, null, 8, ["column", "columnsType", "value", "threeDimensional", "swipeDuration", "visibleOptionNum", "optionHeight", "onChange"])
557
- ]);
558
- }), 128))
391
+ (S(!0), D(U, null, _(e.columnsList, (s, g) => (S(), D("view", {
392
+ class: "nut-picker__columnitem",
393
+ key: g
394
+ }, [
395
+ ce(r, {
396
+ ref_for: !0,
397
+ ref: e.swipeRef,
398
+ column: s,
399
+ columnsType: e.columnsType,
400
+ value: e.defaultValues && e.defaultValues[g],
401
+ threeDimensional: e.threeDimensional,
402
+ swipeDuration: e.swipeDuration,
403
+ visibleOptionNum: e.visibleOptionNum,
404
+ optionHeight: e.optionHeight,
405
+ onChange: (d) => {
406
+ e.changeHandler(g, d);
407
+ }
408
+ }, null, 8, ["column", "columnsType", "value", "threeDimensional", "swipeDuration", "visibleOptionNum", "optionHeight", "onChange"])
409
+ ]))), 128))
559
410
  ], 4),
560
- renderSlot(_ctx.$slots, "default")
411
+ X(e.$slots, "default")
561
412
  ], 2);
562
413
  }
563
- const Picker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
414
+ const Ie = /* @__PURE__ */ te(De, [["render", $e]]);
564
415
  export {
565
- Picker as default
416
+ Ie as default
566
417
  };