@nutui/nutui 3.1.21 → 3.1.22-beta.5

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 (233) hide show
  1. package/dist/nutui.es.js +4203 -19263
  2. package/dist/nutui.umd.js +4208 -19368
  3. package/dist/packages/_es/ActionSheet.js +17 -167
  4. package/dist/packages/_es/Address.js +110 -552
  5. package/dist/packages/_es/AddressList.js +113 -613
  6. package/dist/packages/_es/Animate.js +22 -0
  7. package/dist/packages/_es/Audio.js +53 -274
  8. package/dist/packages/_es/AudioOperate.js +13 -121
  9. package/dist/packages/_es/Avatar.js +38 -177
  10. package/dist/packages/_es/AvatarGroup.js +14 -73
  11. package/dist/packages/_es/BackTop.js +43 -156
  12. package/dist/packages/_es/Badge.js +14 -86
  13. package/dist/packages/_es/Barrage.js +41 -120
  14. package/dist/packages/_es/Button.js +23 -128
  15. package/dist/packages/_es/Calendar.js +30 -237
  16. package/dist/packages/_es/CalendarItem.js +2 -1
  17. package/dist/packages/_es/Card.js +10 -107
  18. package/dist/packages/_es/Cascader.js +147 -523
  19. package/dist/packages/_es/Category.js +15 -58
  20. package/dist/packages/_es/CategoryPane.js +11 -111
  21. package/dist/packages/_es/Cell.js +21 -100
  22. package/dist/packages/_es/CellGroup.js +9 -44
  23. package/dist/packages/_es/Checkbox.js +31 -113
  24. package/dist/packages/_es/CheckboxGroup.js +29 -58
  25. package/dist/packages/_es/CircleProgress.js +28 -151
  26. package/dist/packages/_es/Col.js +14 -56
  27. package/dist/packages/_es/Collapse.js +32 -84
  28. package/dist/packages/_es/CollapseItem.js +59 -272
  29. package/dist/packages/_es/Comment.js +64 -434
  30. package/dist/packages/_es/ConfigProvider.js +13 -0
  31. package/dist/packages/_es/CountDown.js +56 -256
  32. package/dist/packages/_es/CountUp.js +140 -556
  33. package/dist/packages/_es/DatePicker.js +98 -332
  34. package/dist/packages/_es/Dialog.js +60 -271
  35. package/dist/packages/_es/Divider.js +13 -82
  36. package/dist/packages/_es/Drag.js +56 -197
  37. package/dist/packages/_es/Ecard.js +24 -159
  38. package/dist/packages/_es/Elevator.js +58 -212
  39. package/dist/packages/_es/Ellipsis.js +64 -0
  40. package/dist/packages/_es/Empty.js +12 -71
  41. package/dist/packages/_es/FixedNav.js +15 -122
  42. package/dist/packages/_es/Form.js +64 -151
  43. package/dist/packages/_es/FormItem.js +15 -110
  44. package/dist/packages/_es/Grid.js +5 -6
  45. package/dist/packages/_es/GridItem.js +33 -144
  46. package/dist/packages/_es/Icon.js +15 -40
  47. package/dist/packages/_es/Image.js +31 -0
  48. package/dist/packages/_es/ImagePreview.js +77 -309
  49. package/dist/packages/_es/Indicator.js +15 -62
  50. package/dist/packages/_es/InfiniteLoading.js +57 -268
  51. package/dist/packages/_es/Input.js +51 -413
  52. package/dist/packages/_es/InputNumber.js +41 -160
  53. package/dist/packages/_es/Layout.js +4 -5
  54. package/dist/packages/_es/List.js +18 -124
  55. package/dist/packages/_es/Menu.js +45 -118
  56. package/dist/packages/_es/MenuItem.js +37 -162
  57. package/dist/packages/_es/Navbar.js +30 -192
  58. package/dist/packages/_es/NoticeBar.js +74 -397
  59. package/dist/packages/_es/Notify.js +72 -246
  60. package/dist/packages/_es/NumberKeyboard.js +41 -272
  61. package/dist/packages/_es/OldPicker.js +131 -474
  62. package/dist/packages/_es/OverLay.js +24 -113
  63. package/dist/packages/_es/Pagination.js +39 -157
  64. package/dist/packages/_es/Picker.js +129 -469
  65. package/dist/packages/_es/Popover.js +318 -975
  66. package/dist/packages/_es/Popup.js +55 -313
  67. package/dist/packages/_es/Price.js +16 -118
  68. package/dist/packages/_es/Progress.js +14 -146
  69. package/dist/packages/_es/PullRefresh.js +84 -354
  70. package/dist/packages/_es/Radio.js +22 -90
  71. package/dist/packages/_es/RadioGroup.js +8 -37
  72. package/dist/packages/_es/Range.js +83 -427
  73. package/dist/packages/_es/Rate.js +35 -137
  74. package/dist/packages/_es/Row.js +22 -64
  75. package/dist/packages/_es/SearchBar.js +37 -257
  76. package/dist/packages/_es/ShortPassword.js +35 -225
  77. package/dist/packages/_es/SideNavBar.js +24 -99
  78. package/dist/packages/_es/SideNavBarItem.js +11 -46
  79. package/dist/packages/_es/Signature.js +41 -179
  80. package/dist/packages/_es/Skeleton.js +20 -136
  81. package/dist/packages/_es/Sku.js +84 -509
  82. package/dist/packages/_es/Step.js +20 -133
  83. package/dist/packages/_es/Steps.js +18 -53
  84. package/dist/packages/_es/Sticky.js +53 -138
  85. package/dist/packages/_es/SubSideNavBar.js +17 -100
  86. package/dist/packages/_es/Swipe.js +41 -197
  87. package/dist/packages/_es/Swiper.js +121 -433
  88. package/dist/packages/_es/SwiperItem.js +22 -53
  89. package/dist/packages/_es/Switch.js +21 -116
  90. package/dist/packages/_es/TabPane.js +12 -39
  91. package/dist/packages/_es/Tabbar.js +17 -72
  92. package/dist/packages/_es/TabbarItem.js +29 -151
  93. package/dist/packages/_es/Table.js +18 -196
  94. package/dist/packages/_es/Tabs.js +43 -217
  95. package/dist/packages/_es/Tag.js +20 -97
  96. package/dist/packages/_es/TextArea.js +42 -160
  97. package/dist/packages/_es/TimeDetail.js +18 -98
  98. package/dist/packages/_es/TimePannel.js +14 -66
  99. package/dist/packages/_es/TimeSelect.js +15 -103
  100. package/dist/packages/_es/Toast.js +71 -329
  101. package/dist/packages/_es/Uploader.js +104 -468
  102. package/dist/packages/_es/Video.js +74 -350
  103. package/dist/packages/_es/common.js +38 -128
  104. package/dist/packages/_es/component.js +35 -76
  105. package/dist/packages/_es/index.js +5 -6
  106. package/dist/packages/_es/index2.js +9 -30
  107. package/dist/packages/_es/index3.js +6 -8
  108. package/dist/packages/_es/index4.js +13 -58
  109. package/dist/packages/_es/index5.js +164 -682
  110. package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
  111. package/dist/packages/_es/pxCheck.js +3 -5
  112. package/dist/packages/_es/raf.js +8 -15
  113. package/dist/packages/animate/index.scss +299 -0
  114. package/dist/packages/button/index.scss +2 -1
  115. package/dist/packages/cell/index.scss +18 -1
  116. package/dist/packages/checkbox/index.scss +16 -0
  117. package/dist/packages/configprovider/index.scss +2 -0
  118. package/dist/packages/dialog/index.scss +1 -0
  119. package/dist/packages/elevator/index.scss +21 -0
  120. package/dist/packages/ellipsis/index.scss +12 -0
  121. package/dist/packages/formitem/index.scss +12 -0
  122. package/dist/packages/griditem/index.scss +11 -0
  123. package/dist/packages/image/index.scss +39 -0
  124. package/dist/packages/imagepreview/index.scss +21 -2
  125. package/dist/packages/input/index.scss +26 -1
  126. package/dist/packages/inputnumber/index.scss +21 -0
  127. package/dist/packages/locale/lang/baseLang.d.ts +1 -0
  128. package/dist/packages/locale/lang/baseLang.js +3 -3
  129. package/dist/packages/locale/lang/en-US.d.ts +8 -0
  130. package/dist/packages/locale/lang/en-US.js +5 -97
  131. package/dist/packages/locale/lang/id-ID.d.ts +8 -0
  132. package/dist/packages/locale/lang/id-ID.js +5 -97
  133. package/dist/packages/locale/lang/index.js +16 -38
  134. package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
  135. package/dist/packages/locale/lang/zh-CN.js +5 -97
  136. package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
  137. package/dist/packages/locale/lang/zh-TW.js +5 -97
  138. package/dist/packages/menu/index.scss +45 -36
  139. package/dist/packages/menuitem/index.scss +4 -0
  140. package/dist/packages/navbar/index.scss +9 -0
  141. package/dist/packages/pagination/index.scss +19 -0
  142. package/dist/packages/radio/index.scss +19 -0
  143. package/dist/packages/range/index.scss +19 -0
  144. package/dist/packages/rate/index.scss +1 -1
  145. package/dist/packages/searchbar/index.scss +21 -0
  146. package/dist/packages/switch/index.scss +4 -3
  147. package/dist/packages/tabbar/index.scss +5 -0
  148. package/dist/packages/tabbaritem/index.scss +7 -0
  149. package/dist/packages/tabpane/index.scss +6 -0
  150. package/dist/packages/tabs/index.scss +22 -0
  151. package/dist/packages/textarea/index.scss +8 -0
  152. package/dist/smartips/attributes.json +192 -12
  153. package/dist/smartips/tags.json +70 -10
  154. package/dist/smartips/web-types.json +6945 -0
  155. package/dist/style.css +1 -1
  156. package/dist/style.es.js +1 -1
  157. package/dist/styles/font/config.json +3 -1
  158. package/dist/styles/font/demo_index.html +49 -3
  159. package/dist/styles/font/iconfont.css +11 -3
  160. package/dist/styles/font/iconfont.js +15 -15
  161. package/dist/styles/font/iconfont.json +14 -0
  162. package/dist/styles/font/iconfont.ttf +0 -0
  163. package/dist/styles/font/iconfont.woff +0 -0
  164. package/dist/styles/font/iconfont.woff2 +0 -0
  165. package/dist/styles/themes/default.scss +54 -50
  166. package/dist/styles/themes/jdb.scss +54 -50
  167. package/dist/styles/themes/jdt.scss +54 -50
  168. package/dist/styles/variables-jdb.scss +19 -1
  169. package/dist/styles/variables-jdt.scss +19 -1
  170. package/dist/styles/variables.scss +22 -1
  171. package/dist/types/__VUE/address/index.vue.d.ts +2 -2
  172. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
  173. package/dist/types/__VUE/animate/index.vue.d.ts +48 -0
  174. package/dist/types/__VUE/animate/type.d.ts +6 -0
  175. package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
  176. package/dist/types/__VUE/avatar/index.vue.d.ts +7 -7
  177. package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
  178. package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
  179. package/dist/types/__VUE/button/index.vue.d.ts +2 -2
  180. package/dist/types/__VUE/calendaritem/index.vue.d.ts +10 -2
  181. package/dist/types/__VUE/cell/index.vue.d.ts +13 -6
  182. package/dist/types/__VUE/checkbox/common.d.ts +59 -0
  183. package/dist/types/__VUE/checkbox/index.vue.d.ts +20 -7
  184. package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
  185. package/dist/types/__VUE/circleprogress/index.vue.d.ts +2 -2
  186. package/dist/types/__VUE/collapse/index.vue.d.ts +5 -3
  187. package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
  188. package/dist/types/__VUE/configprovider/common.d.ts +20 -0
  189. package/dist/types/__VUE/configprovider/index.vue.d.ts +33 -0
  190. package/dist/types/__VUE/datepicker/index.vue.d.ts +5 -5
  191. package/dist/types/__VUE/datepicker/type.d.ts +6 -0
  192. package/dist/types/__VUE/dialog/index.d.ts +9 -2
  193. package/dist/types/__VUE/dialog/index.vue.d.ts +26 -17
  194. package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
  195. package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
  196. package/dist/types/__VUE/ellipsis/index.vue.d.ts +72 -0
  197. package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
  198. package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
  199. package/dist/types/__VUE/grid/common.d.ts +3 -3
  200. package/dist/types/__VUE/grid/index.vue.d.ts +5 -5
  201. package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
  202. package/dist/types/__VUE/image/index.vue.d.ts +105 -0
  203. package/dist/types/__VUE/image/type.d.ts +6 -0
  204. package/dist/types/__VUE/imagepreview/index.vue.d.ts +36 -2
  205. package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
  206. package/dist/types/__VUE/input/index.vue.d.ts +4 -4
  207. package/dist/types/__VUE/menu/index.vue.d.ts +29 -2
  208. package/dist/types/__VUE/menuitem/index.vue.d.ts +16 -7
  209. package/dist/types/__VUE/menuitem/type.d.ts +8 -0
  210. package/dist/types/__VUE/noticebar/index.vue.d.ts +3 -3
  211. package/dist/types/__VUE/picker/Column.vue.d.ts +1 -1
  212. package/dist/types/__VUE/picker/index.vue.d.ts +1 -1
  213. package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
  214. package/dist/types/__VUE/range/index.vue.d.ts +1 -1
  215. package/dist/types/__VUE/rate/common.d.ts +149 -0
  216. package/dist/types/__VUE/rate/index.vue.d.ts +17 -7
  217. package/dist/types/__VUE/searchbar/index.vue.d.ts +2 -2
  218. package/dist/types/__VUE/skeleton/common.d.ts +2 -4
  219. package/dist/types/__VUE/step/index.vue.d.ts +2 -2
  220. package/dist/types/__VUE/swiper/index.vue.d.ts +4 -4
  221. package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
  222. package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
  223. package/dist/types/__VUE/tabs/common.d.ts +2 -2
  224. package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
  225. package/dist/types/__VUE/timeselect/index.vue.d.ts +8 -0
  226. package/dist/types/__VUE/toast/index.vue.d.ts +2 -2
  227. package/dist/types/__VUE/uploader/index.vue.d.ts +4 -4
  228. package/dist/types/__VUE/uploader/type.d.ts +2 -1
  229. package/dist/types/__VUE/uploader/uploader.d.ts +1 -0
  230. package/dist/types/__VUE/video/index.vue.d.ts +1 -1
  231. package/dist/types/index.d.ts +1 -1
  232. package/dist/types/nutui.d.ts +5 -1
  233. package/package.json +7 -3
@@ -1,320 +1,62 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
1
  /*!
21
- * @nutui/nutui v3.1.21 Mon May 30 2022 20:20:01 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
22
3
  * (c) 2022 @jdf2e.
23
4
  * Released under the MIT License.
24
5
  */
25
- import { ref, reactive, computed, onMounted, onBeforeUnmount, onBeforeMount, onActivated, onDeactivated, watch, toRefs, resolveComponent, openBlock, createBlock, Teleport, normalizeClass, normalizeStyle, createCommentVNode, createVNode, Transition, withCtx, withDirectives, createElementVNode, renderSlot, createElementBlock, vShow } from "vue";
26
- import overlay, { overlayProps } from "./OverLay.js";
27
- import _sfc_main$1 from "./Icon.js";
28
- import { c as createComponent } from "./component.js";
29
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
6
+ import { ref as e, reactive as o, computed as l, onMounted as n, onBeforeUnmount as i, onBeforeMount as t, onActivated as s, onDeactivated as c, watch as a, toRefs as r, resolveComponent as p, openBlock as d, createBlock as u, Teleport as v, normalizeClass as y, normalizeStyle as k, createCommentVNode as m, createVNode as C, Transition as f, withCtx as b, withDirectives as I, createElementVNode as x, renderSlot as S, createElementBlock as O, vShow as z } from "vue";
7
+ import A, { overlayProps as w } from "./OverLay.js";
8
+ import _ from "./Icon.js";
9
+ import { c as h } from "./component.js";
10
+ import { _ as g } from "./plugin-vue_export-helper.js";
30
11
  import "../locale/lang";
31
12
  import "./pxCheck.js";
32
- let count = 0;
33
- const CLSNAME = "nut-overflow-hidden";
34
- const useLockScroll = (isLock) => {
35
- const lock = () => {
36
- if (isLock()) {
37
- !count && document.body.classList.add(CLSNAME);
38
- count++;
39
- }
13
+ let B = 0;
14
+ const { componentName: L, create: N } = h("popup");
15
+ let $ = 2e3;
16
+ const j = { ...w, position: { type: String, default: "center" }, transition: String, style: { type: Object }, popClass: { type: String, default: "" }, closeable: { type: Boolean, default: false }, closeIconPosition: { type: String, default: "top-right" }, closeIcon: { type: String, default: "close" }, destroyOnClose: { type: Boolean, default: true }, teleport: { type: [String, Element], default: "body" }, overlay: { type: Boolean, default: true }, round: { type: Boolean, default: false }, isWrapTeleport: { type: Boolean, default: true }, safeAreaInsetBottom: { type: Boolean, default: false } }, E = N({ components: { [A.name]: A, [_.name]: _ }, props: { ...j }, emits: ["click", "click-close-icon", "open", "close", "opend", "closed", "update:visible", "click-overlay"], setup(p2, { emit: d2 }) {
17
+ const u2 = e(), v2 = o({ zIndex: p2.zIndex ? p2.zIndex : $, showSlot: true, transitionName: `popup-fade-${p2.position}`, overLayCount: 1, keepAlive: false, closed: p2.closeable }), [y2, k2] = (m2 = () => p2.lockScroll, [() => {
18
+ m2() && (!B && document.body.classList.add("nut-overflow-hidden"), B++);
19
+ }, () => {
20
+ m2() && B && (B--, !B && document.body.classList.remove("nut-overflow-hidden"));
21
+ }]);
22
+ var m2;
23
+ const C2 = l(() => ({ [L]: true, round: p2.round, [`popup-${p2.position}`]: true, [`popup-${p2.position}--safebottom`]: p2.position === "bottom" && p2.safeAreaInsetBottom, [p2.popClass]: true })), f2 = l(() => ({ zIndex: v2.zIndex, animationDuration: p2.duration ? `${p2.duration}s` : "initial", ...p2.style })), b2 = () => {
24
+ p2.visible || (p2.zIndex !== void 0 && ($ = Number(p2.zIndex)), d2("update:visible", true), y2(), v2.zIndex = ++$), p2.destroyOnClose && (v2.showSlot = true), d2("open");
25
+ }, I2 = () => {
26
+ p2.visible && (k2(), d2("update:visible", false), p2.destroyOnClose && setTimeout(() => {
27
+ v2.showSlot = false, d2("close");
28
+ }, 1e3 * +p2.duration));
40
29
  };
41
- const unlock = () => {
42
- if (isLock() && count) {
43
- count--;
44
- !count && document.body.classList.remove(CLSNAME);
45
- }
46
- };
47
- return [lock, unlock];
48
- };
49
- const { componentName, create } = createComponent("popup");
50
- let _zIndex = 2e3;
51
- const popupProps = __spreadProps(__spreadValues({}, overlayProps), {
52
- position: {
53
- type: String,
54
- default: "center"
55
- },
56
- transition: String,
57
- style: {
58
- type: Object
59
- },
60
- popClass: {
61
- type: String,
62
- default: ""
63
- },
64
- closeable: {
65
- type: Boolean,
66
- default: false
67
- },
68
- closeIconPosition: {
69
- type: String,
70
- default: "top-right"
71
- },
72
- closeIcon: {
73
- type: String,
74
- default: "close"
75
- },
76
- destroyOnClose: {
77
- type: Boolean,
78
- default: true
79
- },
80
- teleport: {
81
- type: [String, Element],
82
- default: "body"
83
- },
84
- overlay: {
85
- type: Boolean,
86
- default: true
87
- },
88
- round: {
89
- type: Boolean,
90
- default: false
91
- },
92
- isWrapTeleport: {
93
- type: Boolean,
94
- default: true
95
- },
96
- safeAreaInsetBottom: {
97
- type: Boolean,
98
- default: false
99
- }
100
- });
101
- const _sfc_main = create({
102
- components: {
103
- [overlay.name]: overlay,
104
- [_sfc_main$1.name]: _sfc_main$1
105
- },
106
- props: __spreadValues({}, popupProps),
107
- emits: ["click", "click-close-icon", "open", "close", "opend", "closed", "update:visible", "click-overlay"],
108
- setup(props, { emit }) {
109
- const popupRef = ref();
110
- const state = reactive({
111
- zIndex: props.zIndex ? props.zIndex : _zIndex,
112
- showSlot: true,
113
- transitionName: `popup-fade-${props.position}`,
114
- overLayCount: 1,
115
- keepAlive: false,
116
- closed: props.closeable
117
- });
118
- const [lockScroll, unlockScroll] = useLockScroll(() => props.lockScroll);
119
- const classes = computed(() => {
120
- const prefixCls = componentName;
121
- return {
122
- [prefixCls]: true,
123
- ["round"]: props.round,
124
- [`popup-${props.position}`]: true,
125
- [`popup-${props.position}--safebottom`]: props.position === "bottom" && props.safeAreaInsetBottom,
126
- [props.popClass]: true
127
- };
128
- });
129
- const popStyle = computed(() => {
130
- return __spreadValues({
131
- zIndex: state.zIndex,
132
- animationDuration: props.duration ? `${props.duration}s` : "initial"
133
- }, props.style);
134
- });
135
- const open = () => {
136
- if (!props.visible) {
137
- if (props.zIndex !== void 0) {
138
- _zIndex = Number(props.zIndex);
139
- }
140
- emit("update:visible", true);
141
- lockScroll();
142
- state.zIndex = ++_zIndex;
143
- }
144
- if (props.destroyOnClose) {
145
- state.showSlot = true;
146
- }
147
- emit("open");
148
- };
149
- const close = () => {
150
- if (props.visible) {
151
- unlockScroll();
152
- emit("update:visible", false);
153
- if (props.destroyOnClose) {
154
- setTimeout(() => {
155
- state.showSlot = false;
156
- emit("close");
157
- }, +props.duration * 1e3);
158
- }
159
- }
160
- };
161
- const onClick = (e) => {
162
- emit("click", e);
163
- };
164
- const onClickCloseIcon = (e) => {
165
- emit("click-close-icon", e);
166
- close();
167
- };
168
- const onClickOverlay = (e) => {
169
- if (props.closeOnClickOverlay) {
170
- emit("click-overlay", e);
171
- close();
172
- }
173
- };
174
- const onOpened = (e) => {
175
- emit("opend", e);
176
- };
177
- const onClosed = (e) => {
178
- emit("closed", e);
179
- };
180
- onMounted(() => {
181
- props.transition ? state.transitionName = props.transition : state.transitionName = `popup-slide-${props.position}`;
182
- props.visible && open();
183
- });
184
- onBeforeUnmount(() => {
185
- props.visible && close();
186
- });
187
- onBeforeMount(() => {
188
- if (props.visible) {
189
- unlockScroll();
190
- }
191
- });
192
- onActivated(() => {
193
- if (state.keepAlive) {
194
- emit("update:visible", true);
195
- state.keepAlive = false;
196
- }
197
- });
198
- onDeactivated(() => {
199
- if (props.visible) {
200
- close();
201
- state.keepAlive = true;
202
- }
203
- });
204
- watch(() => props.visible, (value) => {
205
- if (value) {
206
- open();
207
- } else {
208
- close();
209
- }
210
- });
211
- watch(() => props.position, (value) => {
212
- value === "center" ? state.transitionName = "popup-fade" : state.transitionName = `popup-slide-${value}`;
213
- });
214
- watch(() => props.closeable, (value) => {
215
- state.closed = value;
216
- });
217
- return __spreadProps(__spreadValues({}, toRefs(state)), {
218
- popStyle,
219
- classes,
220
- onClick,
221
- onClickCloseIcon,
222
- onClickOverlay,
223
- onOpened,
224
- onClosed,
225
- popupRef
226
- });
227
- }
228
- });
229
- const _hoisted_1 = { key: 1 };
230
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
231
- const _component_nut_overlay = resolveComponent("nut-overlay");
232
- const _component_nut_icon = resolveComponent("nut-icon");
233
- return _ctx.isWrapTeleport ? (openBlock(), createBlock(Teleport, {
234
- key: 0,
235
- to: _ctx.teleport
236
- }, [
237
- _ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, {
238
- key: 0,
239
- visible: _ctx.visible,
240
- "close-on-click-overlay": _ctx.closeOnClickOverlay,
241
- class: normalizeClass(_ctx.overlayClass),
242
- style: normalizeStyle(_ctx.overlayStyle),
243
- "z-index": _ctx.zIndex,
244
- "lock-scroll": _ctx.lockScroll,
245
- duration: _ctx.duration,
246
- onClick: _ctx.onClickOverlay
247
- }, null, 8, ["visible", "close-on-click-overlay", "class", "style", "z-index", "lock-scroll", "duration", "onClick"])) : createCommentVNode("", true),
248
- createVNode(Transition, {
249
- name: _ctx.transitionName,
250
- onAfterEnter: _ctx.onOpened,
251
- onAfterLeave: _ctx.onClosed
252
- }, {
253
- default: withCtx(() => [
254
- withDirectives(createElementVNode("view", {
255
- class: normalizeClass(_ctx.classes),
256
- style: normalizeStyle(_ctx.popStyle),
257
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClick && _ctx.onClick(...args)),
258
- ref: "popupRef"
259
- }, [
260
- _ctx.showSlot ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true),
261
- _ctx.closed ? (openBlock(), createElementBlock("view", {
262
- key: 1,
263
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClickCloseIcon && _ctx.onClickCloseIcon(...args)),
264
- class: normalizeClass(["nutui-popup__close-icon", "nutui-popup__close-icon--" + _ctx.closeIconPosition])
265
- }, [
266
- createVNode(_component_nut_icon, {
267
- name: _ctx.closeIcon,
268
- size: "12px"
269
- }, null, 8, ["name"])
270
- ], 2)) : createCommentVNode("", true)
271
- ], 6), [
272
- [vShow, _ctx.visible]
273
- ])
274
- ]),
275
- _: 3
276
- }, 8, ["name", "onAfterEnter", "onAfterLeave"])
277
- ], 8, ["to"])) : (openBlock(), createElementBlock("view", _hoisted_1, [
278
- _ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, {
279
- key: 0,
280
- visible: _ctx.visible,
281
- "close-on-click-overlay": _ctx.closeOnClickOverlay,
282
- class: normalizeClass(_ctx.overlayClass),
283
- style: normalizeStyle(_ctx.overlayStyle),
284
- "z-index": _ctx.zIndex,
285
- "lock-scroll": _ctx.lockScroll,
286
- duration: _ctx.duration,
287
- onClick: _ctx.onClickOverlay
288
- }, null, 8, ["visible", "close-on-click-overlay", "class", "style", "z-index", "lock-scroll", "duration", "onClick"])) : createCommentVNode("", true),
289
- createVNode(Transition, {
290
- name: _ctx.transitionName,
291
- onAfterEnter: _ctx.onOpened,
292
- onAfterLeave: _ctx.onClosed
293
- }, {
294
- default: withCtx(() => [
295
- withDirectives(createElementVNode("view", {
296
- class: normalizeClass(_ctx.classes),
297
- style: normalizeStyle(_ctx.popStyle),
298
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.onClick && _ctx.onClick(...args))
299
- }, [
300
- _ctx.showSlot ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true),
301
- _ctx.closed ? (openBlock(), createElementBlock("view", {
302
- key: 1,
303
- onClick: _cache[2] || (_cache[2] = (...args) => _ctx.onClickCloseIcon && _ctx.onClickCloseIcon(...args)),
304
- class: normalizeClass(["nutui-popup__close-icon", "nutui-popup__close-icon--" + _ctx.closeIconPosition])
305
- }, [
306
- createVNode(_component_nut_icon, {
307
- name: _ctx.closeIcon,
308
- size: "12px"
309
- }, null, 8, ["name"])
310
- ], 2)) : createCommentVNode("", true)
311
- ], 6), [
312
- [vShow, _ctx.visible]
313
- ])
314
- ]),
315
- _: 3
316
- }, 8, ["name", "onAfterEnter", "onAfterLeave"])
317
- ]));
318
- }
319
- var Popup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
320
- export { Popup as default, popupProps };
30
+ return n(() => {
31
+ p2.transition ? v2.transitionName = p2.transition : v2.transitionName = `popup-slide-${p2.position}`, p2.visible && b2();
32
+ }), i(() => {
33
+ p2.visible && I2();
34
+ }), t(() => {
35
+ p2.visible && k2();
36
+ }), s(() => {
37
+ v2.keepAlive && (d2("update:visible", true), v2.keepAlive = false);
38
+ }), c(() => {
39
+ p2.visible && (I2(), v2.keepAlive = true);
40
+ }), a(() => p2.visible, (e2) => {
41
+ e2 ? b2() : I2();
42
+ }), a(() => p2.position, (e2) => {
43
+ v2.transitionName = e2 === "center" ? "popup-fade" : `popup-slide-${e2}`;
44
+ }), a(() => p2.closeable, (e2) => {
45
+ v2.closed = e2;
46
+ }), { ...r(v2), popStyle: f2, classes: C2, onClick: (e2) => {
47
+ d2("click", e2);
48
+ }, onClickCloseIcon: (e2) => {
49
+ d2("click-close-icon", e2), I2();
50
+ }, onClickOverlay: (e2) => {
51
+ p2.closeOnClickOverlay && (d2("click-overlay", e2), I2());
52
+ }, onOpened: (e2) => {
53
+ d2("opend", e2);
54
+ }, onClosed: (e2) => {
55
+ d2("closed", e2);
56
+ }, popupRef: u2 };
57
+ } }), P = { key: 1 };
58
+ var T = g(E, [["render", function(e2, o2, l2, n2, i2, t2) {
59
+ const s2 = p("nut-overlay"), c2 = p("nut-icon");
60
+ return e2.isWrapTeleport ? (d(), u(v, { key: 0, to: e2.teleport }, [e2.overlay ? (d(), u(s2, { key: 0, visible: e2.visible, "close-on-click-overlay": e2.closeOnClickOverlay, class: y(e2.overlayClass), style: k(e2.overlayStyle), "z-index": e2.zIndex, "lock-scroll": e2.lockScroll, duration: e2.duration, onClick: e2.onClickOverlay }, null, 8, ["visible", "close-on-click-overlay", "class", "style", "z-index", "lock-scroll", "duration", "onClick"])) : m("", true), C(f, { name: e2.transitionName, onAfterEnter: e2.onOpened, onAfterLeave: e2.onClosed }, { default: b(() => [I(x("view", { class: y(e2.classes), style: k(e2.popStyle), onClick: o2[1] || (o2[1] = (...o3) => e2.onClick && e2.onClick(...o3)), ref: "popupRef" }, [e2.showSlot ? S(e2.$slots, "default", { key: 0 }) : m("", true), e2.closed ? (d(), O("view", { key: 1, onClick: o2[0] || (o2[0] = (...o3) => e2.onClickCloseIcon && e2.onClickCloseIcon(...o3)), class: y(["nutui-popup__close-icon", "nutui-popup__close-icon--" + e2.closeIconPosition]) }, [C(c2, { name: e2.closeIcon, size: "12px" }, null, 8, ["name"])], 2)) : m("", true)], 6), [[z, e2.visible]])]), _: 3 }, 8, ["name", "onAfterEnter", "onAfterLeave"])], 8, ["to"])) : (d(), O("view", P, [e2.overlay ? (d(), u(s2, { key: 0, visible: e2.visible, "close-on-click-overlay": e2.closeOnClickOverlay, class: y(e2.overlayClass), style: k(e2.overlayStyle), "z-index": e2.zIndex, "lock-scroll": e2.lockScroll, duration: e2.duration, onClick: e2.onClickOverlay }, null, 8, ["visible", "close-on-click-overlay", "class", "style", "z-index", "lock-scroll", "duration", "onClick"])) : m("", true), C(f, { name: e2.transitionName, onAfterEnter: e2.onOpened, onAfterLeave: e2.onClosed }, { default: b(() => [I(x("view", { class: y(e2.classes), style: k(e2.popStyle), onClick: o2[3] || (o2[3] = (...o3) => e2.onClick && e2.onClick(...o3)) }, [e2.showSlot ? S(e2.$slots, "default", { key: 0 }) : m("", true), e2.closed ? (d(), O("view", { key: 1, onClick: o2[2] || (o2[2] = (...o3) => e2.onClickCloseIcon && e2.onClickCloseIcon(...o3)), class: y(["nutui-popup__close-icon", "nutui-popup__close-icon--" + e2.closeIconPosition]) }, [C(c2, { name: e2.closeIcon, size: "12px" }, null, 8, ["name"])], 2)) : m("", true)], 6), [[z, e2.visible]])]), _: 3 }, 8, ["name", "onAfterEnter", "onAfterLeave"])]));
61
+ }]]);
62
+ export { T as default, j as popupProps };
@@ -1,123 +1,21 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.21 Mon May 30 2022 20:20:01 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { computed, openBlock, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString } from "vue";
7
- import { c as createComponent } from "./component.js";
8
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
6
+ import { computed as e, openBlock as i, createElementBlock as t, normalizeClass as s, createCommentVNode as r, createElementVNode as o, toDisplayString as n } from "vue";
7
+ import { c as l } from "./component.js";
8
+ import { _ as a } from "./plugin-vue_export-helper.js";
9
9
  import "../locale/lang";
10
- const { componentName, create } = createComponent("price");
11
- const _sfc_main = create({
12
- props: {
13
- price: {
14
- type: [Number, String],
15
- default: 0
16
- },
17
- needSymbol: {
18
- type: Boolean,
19
- default: true
20
- },
21
- symbol: {
22
- type: String,
23
- default: "¥"
24
- },
25
- decimalDigits: {
26
- type: [Number, String],
27
- default: 2
28
- },
29
- thousands: {
30
- type: Boolean,
31
- default: false
32
- },
33
- position: {
34
- type: String,
35
- default: "before"
36
- },
37
- size: {
38
- type: String,
39
- default: "large"
40
- }
41
- },
42
- setup(props) {
43
- const classes = computed(() => {
44
- return {
45
- [componentName]: true
46
- };
47
- });
48
- const showSymbol = computed(() => {
49
- const symbol = props.needSymbol ? props.symbol : "";
50
- return symbol;
51
- });
52
- const checkPoint = (price) => {
53
- return String(price).indexOf(".") > 0;
54
- };
55
- const formatThousands = (num) => {
56
- if (Number(num) == 0) {
57
- num = 0;
58
- }
59
- if (checkPoint(num)) {
60
- num = Number(num).toFixed(props.decimalDigits);
61
- num = typeof num.split(".") === "string" ? num.split(".") : num.split(".")[0];
62
- } else {
63
- num = num.toString();
64
- }
65
- if (props.thousands) {
66
- return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, "$1,");
67
- } else {
68
- return num;
69
- }
70
- };
71
- const formatDecimal = (decimalNum) => {
72
- if (Number(decimalNum) == 0) {
73
- decimalNum = 0;
74
- }
75
- if (checkPoint(decimalNum)) {
76
- decimalNum = Number(decimalNum).toFixed(props.decimalDigits);
77
- decimalNum = typeof decimalNum.split(".") === "string" ? 0 : decimalNum.split(".")[1] ? decimalNum.split(".")[1] : 0;
78
- } else {
79
- decimalNum = 0;
80
- }
81
- const result = "0." + decimalNum;
82
- const resultFixed = Number(result).toFixed(props.decimalDigits);
83
- return String(resultFixed).substring(2, resultFixed.length);
84
- };
85
- return {
86
- classes,
87
- showSymbol,
88
- checkPoint,
89
- formatThousands,
90
- formatDecimal
91
- };
92
- }
93
- });
94
- const _hoisted_1 = ["innerHTML"];
95
- const _hoisted_2 = ["innerHTML"];
96
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
97
- return openBlock(), createElementBlock("view", {
98
- class: normalizeClass(_ctx.classes)
99
- }, [
100
- _ctx.needSymbol && _ctx.position == "before" ? (openBlock(), createElementBlock("view", {
101
- key: 0,
102
- class: normalizeClass(["nut-price--symbol", `nut-price--symbol-${_ctx.size}`]),
103
- innerHTML: _ctx.showSymbol
104
- }, null, 10, _hoisted_1)) : createCommentVNode("", true),
105
- createElementVNode("view", {
106
- class: normalizeClass(`nut-price--${_ctx.size}`)
107
- }, toDisplayString(_ctx.formatThousands(_ctx.price)), 3),
108
- _ctx.decimalDigits != 0 ? (openBlock(), createElementBlock("view", {
109
- key: 1,
110
- class: normalizeClass(`nut-price--decimal-${_ctx.size}`)
111
- }, ".", 2)) : createCommentVNode("", true),
112
- createElementVNode("view", {
113
- class: normalizeClass(`nut-price--decimal-${_ctx.size}`)
114
- }, toDisplayString(_ctx.formatDecimal(_ctx.price)), 3),
115
- _ctx.needSymbol && _ctx.position == "after" ? (openBlock(), createElementBlock("view", {
116
- key: 2,
117
- class: normalizeClass(["nut-price--symbol", `nut-price--symbol-${_ctx.size}`]),
118
- innerHTML: _ctx.showSymbol
119
- }, null, 10, _hoisted_2)) : createCommentVNode("", true)
120
- ], 2);
121
- }
122
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
123
- export { index as default };
10
+ const { componentName: m, create: p } = l("price"), c = p({ props: { price: { type: [Number, String], default: 0 }, needSymbol: { type: Boolean, default: true }, symbol: { type: String, default: "¥" }, decimalDigits: { type: [Number, String], default: 2 }, thousands: { type: Boolean, default: false }, position: { type: String, default: "before" }, size: { type: String, default: "large" } }, setup(i2) {
11
+ const t2 = e(() => ({ [m]: true })), s2 = e(() => i2.needSymbol ? i2.symbol : ""), r2 = (e2) => String(e2).indexOf(".") > 0;
12
+ return { classes: t2, showSymbol: s2, checkPoint: r2, formatThousands: (e2) => (Number(e2) == 0 && (e2 = 0), e2 = r2(e2) ? typeof (e2 = Number(e2).toFixed(i2.decimalDigits)).split(".") == "string" ? e2.split(".") : e2.split(".")[0] : e2.toString(), i2.thousands ? (e2 || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, "$1,") : e2), formatDecimal: (e2) => {
13
+ Number(e2) == 0 && (e2 = 0), e2 = r2(e2) ? typeof (e2 = Number(e2).toFixed(i2.decimalDigits)).split(".") == "string" ? 0 : e2.split(".")[1] ? e2.split(".")[1] : 0 : 0;
14
+ const t3 = Number("0." + e2).toFixed(i2.decimalDigits);
15
+ return String(t3).substring(2, t3.length);
16
+ } };
17
+ } }), u = ["innerHTML"], d = ["innerHTML"];
18
+ var y = a(c, [["render", function(e2, l2, a2, m2, p2, c2) {
19
+ return i(), t("view", { class: s(e2.classes) }, [e2.needSymbol && e2.position == "before" ? (i(), t("view", { key: 0, class: s(["nut-price--symbol", `nut-price--symbol-${e2.size}`]), innerHTML: e2.showSymbol }, null, 10, u)) : r("", true), o("view", { class: s(`nut-price--${e2.size}`) }, n(e2.formatThousands(e2.price)), 3), e2.decimalDigits != 0 ? (i(), t("view", { key: 1, class: s(`nut-price--decimal-${e2.size}`) }, ".", 2)) : r("", true), o("view", { class: s(`nut-price--decimal-${e2.size}`) }, n(e2.formatDecimal(e2.price)), 3), e2.needSymbol && e2.position == "after" ? (i(), t("view", { key: 2, class: s(["nut-price--symbol", `nut-price--symbol-${e2.size}`]), innerHTML: e2.showSymbol }, null, 10, d)) : r("", true)], 2);
20
+ }]]);
21
+ export { y as default };