@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,31 +1,36 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, resolveDynamicComponent, h } from "vue";
8
- import { c as createComponent } from "./component-81a4c1d0.js";
9
- import { f as funInterceptor } from "./interceptor-956b24fc.js";
10
- import { P as Popup, p as popupProps } from "./index-991c279f.js";
11
- import Button from "./Button.js";
12
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
13
- import Overlay from "./Overlay.js";
1
+ var N = Object.defineProperty, j = Object.defineProperties;
2
+ var E = Object.getOwnPropertyDescriptors;
3
+ var b = Object.getOwnPropertySymbols;
4
+ var I = Object.prototype.hasOwnProperty, L = Object.prototype.propertyIsEnumerable;
5
+ var k = (e, n, o) => n in e ? N(e, n, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[n] = o, w = (e, n) => {
6
+ for (var o in n || (n = {}))
7
+ I.call(n, o) && k(e, o, n[o]);
8
+ if (b)
9
+ for (var o of b(n))
10
+ L.call(n, o) && k(e, o, n[o]);
11
+ return e;
12
+ }, B = (e, n) => j(e, E(n));
13
+ var t = (e, n, o) => (k(e, typeof n != "symbol" ? n + "" : n, o), o);
14
+ import { ref as M, onMounted as U, watch as V, computed as h, resolveComponent as D, openBlock as l, createBlock as p, normalizeStyle as $, withCtx as m, createElementVNode as T, normalizeClass as P, createElementBlock as i, renderSlot as C, Fragment as A, createTextVNode as v, toDisplayString as g, createCommentVNode as u, resolveDynamicComponent as H, nextTick as W, h as q } from "vue";
15
+ import { c as G } from "./component-234624bc.js";
16
+ import { f as J } from "./Interceptor-6e26b757.js";
17
+ import { P as O, p as K } from "./index-360c5092.js";
18
+ import S from "./Button.js";
19
+ import { _ as Q } from "./_plugin-vue_export-helper-dad06003.js";
20
+ import R from "./Overlay.js";
14
21
  import "../locale/lang";
15
- import { C as CreateComponent } from "./mountComponent-1ece4110.js";
22
+ import { C as X } from "./mountComponent-6d4ff200.js";
16
23
  import "@nutui/icons-vue";
17
- const { componentName, create, translate } = createComponent("dialog");
18
- const _sfc_main = create({
19
- inheritAttrs: false,
24
+ const { componentName: Y, create: Z, translate: _ } = G("dialog"), x = Z({
25
+ inheritAttrs: !1,
20
26
  components: {
21
- [Popup.name]: Popup,
22
- [Button.name]: Button
27
+ [O.name]: O,
28
+ [S.name]: S
23
29
  },
24
- props: {
25
- ...popupProps,
30
+ props: B(w({}, K), {
26
31
  closeOnClickOverlay: {
27
32
  type: Boolean,
28
- default: false
33
+ default: !0
29
34
  },
30
35
  title: {
31
36
  type: String,
@@ -37,15 +42,15 @@ const _sfc_main = create({
37
42
  },
38
43
  noFooter: {
39
44
  type: Boolean,
40
- default: false
45
+ default: !1
41
46
  },
42
47
  noOkBtn: {
43
48
  type: Boolean,
44
- default: false
49
+ default: !1
45
50
  },
46
51
  noCancelBtn: {
47
52
  type: Boolean,
48
- default: false
53
+ default: !1
49
54
  },
50
55
  cancelText: {
51
56
  type: String,
@@ -57,7 +62,7 @@ const _sfc_main = create({
57
62
  },
58
63
  cancelAutoClose: {
59
64
  type: Boolean,
60
- default: true
65
+ default: !0
61
66
  },
62
67
  textAlign: {
63
68
  type: String,
@@ -65,7 +70,7 @@ const _sfc_main = create({
65
70
  },
66
71
  closeOnPopstate: {
67
72
  type: Boolean,
68
- default: false
73
+ default: !1
69
74
  },
70
75
  footerDirection: {
71
76
  type: String,
@@ -80,218 +85,188 @@ const _sfc_main = create({
80
85
  type: Object
81
86
  },
82
87
  beforeClose: Function
83
- },
88
+ }),
84
89
  emits: ["update", "update:visible", "ok", "cancel", "opened", "closed"],
85
- setup(props, { emit }) {
86
- const showPopup = ref(props.visible);
87
- onMounted(() => {
88
- if (props.closeOnPopstate) {
89
- window.addEventListener("popstate", function() {
90
- closed("page");
91
- });
92
- }
93
- });
94
- watch(
95
- () => props.visible,
96
- (value) => {
97
- showPopup.value = value;
98
- if (value) {
99
- emit("opened");
100
- }
90
+ setup(e, { emit: n }) {
91
+ const o = M(e.visible);
92
+ U(() => {
93
+ e.closeOnPopstate && window.addEventListener("popstate", function() {
94
+ s("page");
95
+ });
96
+ }), V(
97
+ () => e.visible,
98
+ (a) => {
99
+ o.value = a, a && n("opened");
101
100
  }
102
101
  );
103
- const classes = computed(() => {
104
- return {
105
- [componentName]: true,
106
- [props.customClass]: true
107
- };
108
- });
109
- const update = (val) => {
110
- emit("update", val);
111
- emit("update:visible", val);
112
- };
113
- const closed = (action) => {
114
- funInterceptor(props.beforeClose, {
115
- args: [action],
102
+ const c = h(() => ({
103
+ [Y]: !0,
104
+ [e.customClass]: !0
105
+ })), f = (a) => {
106
+ n("update", a), n("update:visible", a);
107
+ }, s = (a) => {
108
+ J(e.beforeClose, {
109
+ args: [a],
116
110
  done: () => {
117
- update(false);
118
- emit("closed");
111
+ o.value = !1, f(!1), n("closed");
119
112
  }
120
113
  });
121
- };
122
- const onCancel = () => {
123
- emit("cancel");
124
- if (props.cancelAutoClose) {
125
- closed("cancel");
126
- }
127
- };
128
- const onOk = () => {
129
- emit("ok");
130
- closed("ok");
131
- };
132
- const contentStyle = computed(() => {
133
- return {
134
- textAlign: props.textAlign
135
- };
136
- });
114
+ }, r = () => {
115
+ n("cancel"), e.cancelAutoClose && (o.value = !1, s("cancel"));
116
+ }, d = () => {
117
+ n("ok"), s("ok");
118
+ }, y = () => {
119
+ e.closeOnClickOverlay && s("");
120
+ }, F = h(() => ({
121
+ textAlign: e.textAlign
122
+ }));
137
123
  return {
138
- closed,
139
- classes,
140
- onCancel,
141
- onOk,
142
- showPopup,
143
- contentStyle,
144
- translate
124
+ closed: s,
125
+ classes: c,
126
+ onCancel: r,
127
+ onOk: d,
128
+ showPopup: o,
129
+ onClickOverlay: y,
130
+ contentStyle: F,
131
+ translate: _
145
132
  };
146
133
  }
147
- });
148
- const _hoisted_1 = {
134
+ }), ee = {
149
135
  key: 0,
150
136
  class: "nut-dialog__header"
151
- };
152
- const _hoisted_2 = ["innerHTML"];
153
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
154
- const _component_nut_button = resolveComponent("nut-button");
155
- const _component_nut_popup = resolveComponent("nut-popup");
156
- return openBlock(), createBlock(_component_nut_popup, {
157
- teleport: _ctx.teleport,
158
- visible: _ctx.showPopup,
159
- "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event),
160
- "close-on-click-overlay": _ctx.closeOnClickOverlay,
161
- "lock-scroll": _ctx.lockScroll,
162
- "pop-class": _ctx.popClass,
163
- "overlay-class": _ctx.overlayClass,
164
- "overlay-style": _ctx.overlayStyle,
165
- style: normalizeStyle(_ctx.popStyle),
137
+ }, oe = ["innerHTML"];
138
+ function te(e, n, o, c, f, s) {
139
+ const r = D("nut-button"), d = D("nut-popup");
140
+ return l(), p(d, {
141
+ teleport: e.teleport,
142
+ visible: e.showPopup,
143
+ "onUpdate:visible": n[0] || (n[0] = (y) => e.showPopup = y),
144
+ "close-on-click-overlay": !1,
145
+ "lock-scroll": e.lockScroll,
146
+ "pop-class": e.popClass,
147
+ "overlay-class": e.overlayClass,
148
+ "overlay-style": e.overlayStyle,
149
+ style: $(e.popStyle),
166
150
  round: "",
167
- onClickOverlay: _ctx.closed,
168
- onClickCloseIcon: _ctx.closed
151
+ onClickOverlay: e.onClickOverlay,
152
+ onClickCloseIcon: e.closed
169
153
  }, {
170
- default: withCtx(() => [
171
- createElementVNode("view", {
172
- class: normalizeClass(_ctx.classes)
154
+ default: m(() => [
155
+ T("view", {
156
+ class: P(e.classes)
173
157
  }, [
174
- _ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("view", _hoisted_1, [
175
- _ctx.$slots.header ? renderSlot(_ctx.$slots, "header", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
176
- createTextVNode(toDisplayString(_ctx.title), 1)
158
+ e.$slots.header || e.title ? (l(), i("view", ee, [
159
+ e.$slots.header ? C(e.$slots, "header", { key: 0 }) : (l(), i(A, { key: 1 }, [
160
+ v(g(e.title), 1)
177
161
  ], 64))
178
- ])) : createCommentVNode("", true),
179
- createElementVNode("view", {
162
+ ])) : u("", !0),
163
+ T("view", {
180
164
  class: "nut-dialog__content",
181
- style: normalizeStyle(_ctx.contentStyle)
165
+ style: $(e.contentStyle)
182
166
  }, [
183
- _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : typeof _ctx.content === "string" ? (openBlock(), createElementBlock("view", {
167
+ e.$slots.default ? C(e.$slots, "default", { key: 0 }) : typeof e.content == "string" ? (l(), i("view", {
184
168
  key: 1,
185
- innerHTML: _ctx.content
186
- }, null, 8, _hoisted_2)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.content), { key: 2 }))
169
+ innerHTML: e.content
170
+ }, null, 8, oe)) : (l(), p(H(e.content), { key: 2 }))
187
171
  ], 4),
188
- !_ctx.noFooter ? (openBlock(), createElementBlock("view", {
172
+ e.noFooter ? u("", !0) : (l(), i("view", {
189
173
  key: 1,
190
- class: normalizeClass(["nut-dialog__footer", { [_ctx.footerDirection]: _ctx.footerDirection }])
174
+ class: P(["nut-dialog__footer", { [e.footerDirection]: e.footerDirection }])
191
175
  }, [
192
- _ctx.$slots.footer ? renderSlot(_ctx.$slots, "footer", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
193
- !_ctx.noCancelBtn ? (openBlock(), createBlock(_component_nut_button, {
176
+ e.$slots.footer ? C(e.$slots, "footer", { key: 0 }) : (l(), i(A, { key: 1 }, [
177
+ e.noCancelBtn ? u("", !0) : (l(), p(r, {
194
178
  key: 0,
195
179
  size: "small",
196
180
  plain: "",
197
181
  type: "primary",
198
182
  class: "nut-dialog__footer-cancel",
199
- onClick: _ctx.onCancel
183
+ onClick: e.onCancel
200
184
  }, {
201
- default: withCtx(() => [
202
- createTextVNode(toDisplayString(_ctx.cancelText || _ctx.translate("cancel")), 1)
185
+ default: m(() => [
186
+ v(g(e.cancelText || e.translate("cancel")), 1)
203
187
  ]),
204
188
  _: 1
205
- }, 8, ["onClick"])) : createCommentVNode("", true),
206
- !_ctx.noOkBtn ? (openBlock(), createBlock(_component_nut_button, {
189
+ }, 8, ["onClick"])),
190
+ e.noOkBtn ? u("", !0) : (l(), p(r, {
207
191
  key: 1,
208
192
  size: "small",
209
193
  type: "primary",
210
194
  class: "nut-dialog__footer-ok",
211
- onClick: _ctx.onOk
195
+ onClick: e.onOk
212
196
  }, {
213
- default: withCtx(() => [
214
- createTextVNode(toDisplayString(_ctx.okText || _ctx.translate("confirm")), 1)
197
+ default: m(() => [
198
+ v(g(e.okText || e.translate("confirm")), 1)
215
199
  ]),
216
200
  _: 1
217
- }, 8, ["onClick"])) : createCommentVNode("", true)
201
+ }, 8, ["onClick"]))
218
202
  ], 64))
219
- ], 2)) : createCommentVNode("", true)
203
+ ], 2))
220
204
  ], 2)
221
205
  ]),
222
206
  _: 3
223
- }, 8, ["teleport", "visible", "close-on-click-overlay", "lock-scroll", "pop-class", "overlay-class", "overlay-style", "style", "onClickOverlay", "onClickCloseIcon"]);
207
+ }, 8, ["teleport", "visible", "lock-scroll", "pop-class", "overlay-class", "overlay-style", "style", "onClickOverlay", "onClickCloseIcon"]);
224
208
  }
225
- const Dialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
226
- class DialogOptions {
209
+ const z = /* @__PURE__ */ Q(x, [["render", te]]);
210
+ class ne {
227
211
  constructor() {
228
- __publicField(this, "title", "");
229
- __publicField(this, "content", "");
230
- __publicField(this, "cancelText", "");
231
- __publicField(this, "okText", "");
232
- __publicField(this, "textAlign", "center");
233
- __publicField(this, "customClass", "");
234
- __publicField(this, "overlayStyle", {});
235
- __publicField(this, "overlayClass", "");
236
- __publicField(this, "popStyle", {});
237
- __publicField(this, "popClass", "");
238
- __publicField(this, "teleport", "body");
239
- __publicField(this, "id", new Date().getTime());
240
- __publicField(this, "footerDirection", "horizontal");
212
+ t(this, "title", "");
213
+ t(this, "content", "");
214
+ t(this, "cancelText", "");
215
+ t(this, "okText", "");
216
+ t(this, "textAlign", "center");
217
+ t(this, "customClass", "");
218
+ t(this, "overlayStyle", {});
219
+ t(this, "overlayClass", "");
220
+ t(this, "popStyle", {});
221
+ t(this, "popClass", "");
222
+ t(this, "teleport", "body");
223
+ t(this, "id", (/* @__PURE__ */ new Date()).getTime());
224
+ t(this, "footerDirection", "horizontal");
241
225
  //使用横纵方向 可选值 horizontal、vertical
242
226
  // function
243
- __publicField(this, "onUpdate");
244
- __publicField(this, "onOk");
245
- __publicField(this, "onCancel");
246
- __publicField(this, "onOpened");
247
- __publicField(this, "onClosed");
248
- __publicField(this, "beforeClose");
249
- __publicField(this, "visible", true);
250
- __publicField(this, "noFooter", false);
251
- __publicField(this, "noOkBtn", false);
252
- __publicField(this, "noCancelBtn", false);
253
- __publicField(this, "okBtnDisabled", false);
254
- __publicField(this, "closeOnPopstate", false);
255
- __publicField(this, "lockScroll", true);
227
+ t(this, "onUpdate");
228
+ t(this, "onOk");
229
+ t(this, "onCancel");
230
+ t(this, "onOpened");
231
+ t(this, "onClosed");
232
+ t(this, "beforeClose");
233
+ t(this, "visible", !0);
234
+ t(this, "noFooter", !1);
235
+ t(this, "noOkBtn", !1);
236
+ t(this, "noCancelBtn", !1);
237
+ t(this, "okBtnDisabled", !1);
238
+ t(this, "closeOnPopstate", !1);
239
+ t(this, "closeOnClickOverlay", !0);
240
+ t(this, "lockScroll", !0);
256
241
  }
257
242
  }
258
- class DialogFunction {
259
- constructor(_options) {
260
- __publicField(this, "options", new DialogOptions());
261
- __publicField(this, "instance");
262
- const options = Object.assign(this.options, _options);
263
- const { unmount } = CreateComponent(options, {
243
+ class le {
244
+ constructor(n) {
245
+ t(this, "options", new ne());
246
+ t(this, "instance");
247
+ const o = Object.assign(this.options, n), { unmount: c } = X(o, {
264
248
  name: "dialog",
265
- components: [Popup, Button, Overlay],
266
- wrapper: (elWarp, root) => {
267
- return {
268
- setup() {
269
- options.onUpdate = (val) => {
270
- if (val == false) {
271
- unmount();
272
- }
273
- };
274
- if (options == null ? void 0 : options.onOpened) {
275
- options == null ? void 0 : options.onOpened();
276
- }
277
- options.teleport = `#${root.id}`;
278
- return () => {
279
- return h(Dialog, options);
280
- };
281
- }
282
- };
283
- }
249
+ components: [O, S, R],
250
+ wrapper: (f, s) => ({
251
+ setup() {
252
+ return o.onUpdate = (r) => {
253
+ r === !1 && W(() => {
254
+ c();
255
+ });
256
+ }, o != null && o.onOpened && (o == null || o.onOpened()), o.teleport = `#${s.id}`, () => q(z, o);
257
+ }
258
+ })
284
259
  });
285
260
  }
286
261
  }
287
- const showDialog = function(options) {
288
- return new DialogFunction(options);
262
+ const se = function(e) {
263
+ return new le(e);
289
264
  };
290
- showDialog.install = (app) => {
291
- app.use(Dialog);
265
+ se.install = (e) => {
266
+ e.use(z);
292
267
  };
293
268
  export {
294
- DialogOptions,
295
- Dialog as default,
296
- showDialog
269
+ ne as DialogOptions,
270
+ z as default,
271
+ se as showDialog
297
272
  };
@@ -1,9 +1,20 @@
1
- import { computed, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ var m = Object.defineProperty, p = Object.defineProperties;
2
+ var h = Object.getOwnPropertyDescriptors;
3
+ var l = Object.getOwnPropertySymbols;
4
+ var $ = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
5
+ var c = (e, t, n) => t in e ? m(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, r = (e, t) => {
6
+ for (var n in t || (t = {}))
7
+ $.call(t, n) && c(e, n, t[n]);
8
+ if (l)
9
+ for (var n of l(t))
10
+ y.call(t, n) && c(e, n, t[n]);
11
+ return e;
12
+ }, a = (e, t) => p(e, h(t));
13
+ import { computed as v, openBlock as d, createElementBlock as f, normalizeClass as u, renderSlot as _ } from "vue";
14
+ import { c as g } from "./component-234624bc.js";
15
+ import { _ as k } from "./_plugin-vue_export-helper-dad06003.js";
4
16
  import "../locale/lang";
5
- const { componentName, create } = createComponent("divider");
6
- const _sfc_main = create({
17
+ const { componentName: z, create: B } = g("divider"), C = B({
7
18
  props: {
8
19
  contentPosition: {
9
20
  type: String,
@@ -11,11 +22,11 @@ const _sfc_main = create({
11
22
  },
12
23
  dashed: {
13
24
  type: Boolean,
14
- default: false
25
+ default: !1
15
26
  },
16
27
  hairline: {
17
28
  type: Boolean,
18
- default: true
29
+ default: !0
19
30
  },
20
31
  direction: {
21
32
  type: String,
@@ -23,45 +34,36 @@ const _sfc_main = create({
23
34
  }
24
35
  },
25
36
  components: {},
26
- setup(props, context) {
27
- const classes = computed(() => {
28
- const prefixCls = componentName;
29
- let defaultClassesObj = {
30
- [prefixCls]: true
31
- };
32
- let classesObj = {};
33
- if (props.direction === "horizontal") {
34
- classesObj = {
35
- ...defaultClassesObj,
36
- [`${prefixCls}-center`]: context.slots.default,
37
- [`${prefixCls}-left`]: props.contentPosition === "left",
38
- [`${prefixCls}-right`]: props.contentPosition === "right",
39
- [`${prefixCls}-dashed`]: props.dashed,
40
- [`${prefixCls}-hairline`]: props.hairline
41
- };
42
- } else {
43
- classesObj = {
44
- ...defaultClassesObj,
45
- [`${prefixCls}-vertical`]: props.direction === "vertical"
46
- };
47
- }
48
- return classesObj;
49
- });
50
- return { classes };
37
+ setup(e, t) {
38
+ return { classes: v(() => {
39
+ const o = z;
40
+ let i = {
41
+ [o]: !0
42
+ }, s = {};
43
+ return e.direction === "horizontal" ? s = a(r({}, i), {
44
+ [`${o}-center`]: t.slots.default,
45
+ [`${o}-left`]: e.contentPosition === "left",
46
+ [`${o}-right`]: e.contentPosition === "right",
47
+ [`${o}-dashed`]: e.dashed,
48
+ [`${o}-hairline`]: e.hairline
49
+ }) : s = a(r({}, i), {
50
+ [`${o}-vertical`]: e.direction === "vertical"
51
+ }), s;
52
+ }) };
51
53
  }
52
54
  });
53
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
54
- return _ctx.direction === "horizontal" ? (openBlock(), createElementBlock("view", {
55
+ function P(e, t, n, o, i, s) {
56
+ return e.direction === "horizontal" ? (d(), f("view", {
55
57
  key: 0,
56
- class: normalizeClass(_ctx.classes)
58
+ class: u(e.classes)
57
59
  }, [
58
- renderSlot(_ctx.$slots, "default")
59
- ], 2)) : (openBlock(), createElementBlock("view", {
60
+ _(e.$slots, "default")
61
+ ], 2)) : (d(), f("view", {
60
62
  key: 1,
61
- class: normalizeClass(_ctx.classes)
63
+ class: u(e.classes)
62
64
  }, null, 2));
63
65
  }
64
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
66
+ const x = /* @__PURE__ */ k(C, [["render", P]]);
65
67
  export {
66
- index as default
68
+ x as default
67
69
  };