@nutui/nutui 4.0.12-beta.1 → 4.0.12

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 (158) hide show
  1. package/dist/nutui.es.js +1 -1
  2. package/dist/nutui.js +1 -1
  3. package/dist/nutui.umd.js +1 -1
  4. package/dist/packages/_es/ActionSheet.js +111 -78
  5. package/dist/packages/_es/Address.js +375 -250
  6. package/dist/packages/_es/AddressList.js +354 -269
  7. package/dist/packages/_es/Animate.js +58 -41
  8. package/dist/packages/_es/Audio.js +197 -128
  9. package/dist/packages/_es/AudioOperate.js +71 -60
  10. package/dist/packages/_es/Avatar.js +89 -66
  11. package/dist/packages/_es/AvatarGroup.js +31 -23
  12. package/dist/packages/_es/Backtop.js +99 -59
  13. package/dist/packages/_es/Badge.js +47 -36
  14. package/dist/packages/_es/Barrage.js +147 -68
  15. package/dist/packages/_es/Button.js +66 -47
  16. package/dist/packages/_es/Calendar.js +157 -135
  17. package/dist/packages/_es/CalendarItem.js +6 -6
  18. package/dist/packages/_es/Card.js +56 -42
  19. package/dist/packages/_es/Cascader.js +474 -315
  20. package/dist/packages/_es/Category.js +39 -29
  21. package/dist/packages/_es/CategoryPane.js +83 -57
  22. package/dist/packages/_es/Cell.js +71 -56
  23. package/dist/packages/_es/CellGroup.js +27 -19
  24. package/dist/packages/_es/Checkbox.js +156 -109
  25. package/dist/packages/_es/CheckboxGroup.js +59 -38
  26. package/dist/packages/_es/CircleProgress.js +96 -67
  27. package/dist/packages/_es/Col.js +31 -23
  28. package/dist/packages/_es/Collapse.js +58 -33
  29. package/dist/packages/_es/CollapseItem.js +108 -78
  30. package/dist/packages/_es/Comment.js +279 -207
  31. package/dist/packages/_es/ConfigProvider.js +55 -37
  32. package/dist/packages/_es/Countdown.js +212 -100
  33. package/dist/packages/_es/Countup.js +445 -232
  34. package/dist/packages/_es/DatePicker.js +265 -162
  35. package/dist/packages/_es/Dialog.js +213 -161
  36. package/dist/packages/_es/Divider.js +57 -42
  37. package/dist/packages/_es/Drag.js +153 -70
  38. package/dist/packages/_es/Ecard.js +104 -64
  39. package/dist/packages/_es/Elevator.js +219 -143
  40. package/dist/packages/_es/Ellipsis.js +178 -95
  41. package/dist/packages/_es/Empty.js +39 -23
  42. package/dist/packages/_es/FixedNav.js +116 -93
  43. package/dist/packages/_es/Form.js +178 -107
  44. package/dist/packages/_es/FormItem.js +61 -48
  45. package/dist/packages/_es/Grid.js +6 -5
  46. package/dist/packages/_es/GridItem.js +84 -58
  47. package/dist/packages/_es/Image.js +130 -90
  48. package/dist/packages/_es/ImagePreview.js +412 -256
  49. package/dist/packages/_es/Indicator.js +34 -30
  50. package/dist/packages/_es/InfiniteLoading.js +136 -83
  51. package/dist/packages/_es/Input.js +264 -160
  52. package/dist/packages/_es/InputNumber.js +117 -81
  53. package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
  54. package/dist/packages/_es/Invoice.js +130 -104
  55. package/dist/packages/_es/Layout.js +4 -3
  56. package/dist/packages/_es/List.js +215 -117
  57. package/dist/packages/_es/Menu.js +150 -95
  58. package/dist/packages/_es/MenuItem.js +154 -109
  59. package/dist/packages/_es/Navbar.js +119 -103
  60. package/dist/packages/_es/Noticebar.js +312 -197
  61. package/dist/packages/_es/Notify.js +166 -110
  62. package/dist/packages/_es/NumberKeyboard.js +202 -127
  63. package/dist/packages/_es/Overlay.js +80 -52
  64. package/dist/packages/_es/Pagination.js +100 -70
  65. package/dist/packages/_es/Picker.js +437 -275
  66. package/dist/packages/_es/Popover.js +225 -122
  67. package/dist/packages/_es/Popup.js +4 -4
  68. package/dist/packages/_es/Price.js +82 -44
  69. package/dist/packages/_es/Progress.js +79 -63
  70. package/dist/packages/_es/PullRefresh.js +173 -95
  71. package/dist/packages/_es/Radio.js +4 -4
  72. package/dist/packages/_es/RadioGroup.js +3 -3
  73. package/dist/packages/_es/Range.js +347 -204
  74. package/dist/packages/_es/Rate.js +141 -92
  75. package/dist/packages/_es/Row.js +27 -21
  76. package/dist/packages/_es/Searchbar.js +174 -123
  77. package/dist/packages/_es/ShortPassword.js +93 -69
  78. package/dist/packages/_es/SideNavbar.js +80 -49
  79. package/dist/packages/_es/SideNavbarItem.js +32 -22
  80. package/dist/packages/_es/Signature.js +146 -83
  81. package/dist/packages/_es/Skeleton.js +130 -110
  82. package/dist/packages/_es/Sku.js +343 -250
  83. package/dist/packages/_es/Step.js +86 -59
  84. package/dist/packages/_es/Steps.js +31 -26
  85. package/dist/packages/_es/Sticky.js +4 -4
  86. package/dist/packages/_es/SubSideNavbar.js +74 -52
  87. package/dist/packages/_es/Swipe.js +155 -83
  88. package/dist/packages/_es/Swiper.js +311 -174
  89. package/dist/packages/_es/SwiperItem.js +44 -28
  90. package/dist/packages/_es/Switch.js +68 -55
  91. package/dist/packages/_es/TabPane.js +41 -30
  92. package/dist/packages/_es/Tabbar.js +52 -41
  93. package/dist/packages/_es/TabbarItem.js +82 -61
  94. package/dist/packages/_es/Table.js +165 -109
  95. package/dist/packages/_es/Tabs.js +388 -240
  96. package/dist/packages/_es/Tag.js +61 -44
  97. package/dist/packages/_es/Textarea.js +124 -80
  98. package/dist/packages/_es/TimeDetail.js +76 -49
  99. package/dist/packages/_es/TimePannel.js +48 -34
  100. package/dist/packages/_es/TimeSelect.js +68 -47
  101. package/dist/packages/_es/Toast.js +218 -144
  102. package/dist/packages/_es/Tour.js +192 -138
  103. package/dist/packages/_es/TrendArrow.js +77 -57
  104. package/dist/packages/_es/Uploader.js +359 -234
  105. package/dist/packages/_es/Video.js +316 -191
  106. package/dist/packages/_es/Watermark.js +117 -84
  107. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
  108. package/dist/packages/_es/common-b9a5e726.js +145 -0
  109. package/dist/packages/_es/component-81a4c1d0.js +145 -0
  110. package/dist/packages/_es/index-29892cda.js +33 -0
  111. package/dist/packages/_es/index-43c34ac6.js +30 -0
  112. package/dist/packages/_es/index-54d03fc1.js +8 -0
  113. package/dist/packages/_es/index-79c5dc33.js +10 -0
  114. package/dist/packages/_es/index-7a7385e4.js +67 -0
  115. package/dist/packages/_es/index-87422be8.js +942 -0
  116. package/dist/packages/_es/index-da0a7662.js +259 -0
  117. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
  118. package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
  120. package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
  121. package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
  122. package/dist/packages/_es/raf-729dad54.js +25 -0
  123. package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
  124. package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
  125. package/dist/packages/locale/lang/en-US.js +39 -36
  126. package/dist/packages/locale/lang/id-ID.js +39 -36
  127. package/dist/packages/locale/lang/index.js +44 -22
  128. package/dist/packages/locale/lang/zh-CN.js +38 -35
  129. package/dist/packages/locale/lang/zh-TW.js +38 -35
  130. package/dist/resolver/index.js +26 -1
  131. package/dist/resolver/index.mjs +17 -14
  132. package/dist/smartips/web-types.json +1 -1
  133. package/dist/style.css +1 -1
  134. package/dist/styles/themes/default.scss +50 -50
  135. package/dist/styles/themes/jdb.scss +50 -50
  136. package/dist/styles/themes/jddkh.scss +50 -50
  137. package/dist/styles/themes/jdt.scss +50 -50
  138. package/dist/types/index.d.ts +1 -1
  139. package/package.json +2 -2
  140. package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
  141. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
  142. package/dist/packages/_es/common-d218746f.js +0 -116
  143. package/dist/packages/_es/component-234624bc.js +0 -89
  144. package/dist/packages/_es/index-14dfadc4.js +0 -561
  145. package/dist/packages/_es/index-192a3ef6.js +0 -29
  146. package/dist/packages/_es/index-360c5092.js +0 -210
  147. package/dist/packages/_es/index-496e6e05.js +0 -24
  148. package/dist/packages/_es/index-50eed3d9.js +0 -7
  149. package/dist/packages/_es/index-53ec2d4d.js +0 -34
  150. package/dist/packages/_es/index-fadb0974.js +0 -8
  151. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
  152. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
  153. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
  154. package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
  155. package/dist/packages/_es/pxCheck-38173291.js +0 -4
  156. package/dist/packages/_es/raf-a74f1a06.js +0 -16
  157. package/dist/packages/_es/renderIcon-47498b32.js +0 -5
  158. package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
@@ -1,21 +1,29 @@
1
- var k = Object.defineProperty, P = Object.defineProperties;
2
- var B = Object.getOwnPropertyDescriptors;
3
- var b = Object.getOwnPropertySymbols;
4
- var C = Object.prototype.hasOwnProperty, W = Object.prototype.propertyIsEnumerable;
5
- var w = (e, t, s) => t in e ? k(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, S = (e, t) => {
6
- for (var s in t || (t = {}))
7
- C.call(t, s) && w(e, s, t[s]);
8
- if (b)
9
- for (var s of b(t))
10
- W.call(t, s) && w(e, s, t[s]);
11
- return e;
12
- }, y = (e, t) => P(e, B(t));
13
- import { u as z } from "./index-53ec2d4d.js";
14
- import { computed as h, ref as $, reactive as D, openBlock as N, createElementBlock as H, normalizeClass as V, normalizeStyle as j, createElementVNode as T, renderSlot as M } from "vue";
15
- import { c as q } from "./component-234624bc.js";
16
- import { _ as A } from "./_plugin-vue_export-helper-dad06003.js";
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
+ import { u as useTouch } from "./index-7a7385e4.js";
21
+ import { computed, ref, reactive, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
22
+ import { c as createComponent } from "./component-81a4c1d0.js";
23
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
17
24
  import "../locale/lang";
18
- const { componentName: F, create: G } = q("swipe"), I = G({
25
+ const { componentName, create } = createComponent("swipe");
26
+ const _sfc_main = create({
19
27
  props: {
20
28
  name: {
21
29
  type: String,
@@ -23,110 +31,174 @@ const { componentName: F, create: G } = q("swipe"), I = G({
23
31
  },
24
32
  touchMoveStopPropagation: {
25
33
  type: Boolean,
26
- default: !1
34
+ default: false
27
35
  },
28
36
  touchMovePreventDefault: {
29
37
  type: Boolean,
30
- default: !1
38
+ default: false
31
39
  },
32
40
  disabled: {
33
41
  type: Boolean,
34
- default: !1
42
+ default: false
35
43
  }
36
44
  },
37
45
  emits: ["open", "close"],
38
- setup(e, { emit: t }) {
39
- const s = h(() => ({
40
- [F]: !0
41
- })), v = (o) => {
42
- var f;
43
- return ((f = o.value) == null ? void 0 : f.clientWidth) || 0;
44
- }, d = $(), r = h(() => v(d)), a = $(), i = h(() => v(a));
45
- let u = !1, l = "", p = "";
46
- const n = D({
46
+ setup(props, { emit }) {
47
+ const classes = computed(() => {
48
+ const prefixCls = componentName;
49
+ return {
50
+ [prefixCls]: true
51
+ };
52
+ });
53
+ const getRefWidth = (ref2) => {
54
+ var _a;
55
+ return ((_a = ref2.value) == null ? void 0 : _a.clientWidth) || 0;
56
+ };
57
+ const leftRef = ref(), leftRefWidth = computed(() => {
58
+ return getRefWidth(leftRef);
59
+ });
60
+ const rightRef = ref(), rightRefWidth = computed(() => {
61
+ return getRefWidth(rightRef);
62
+ });
63
+ let opened = false;
64
+ let position = "";
65
+ let oldPosition = "";
66
+ const state = reactive({
47
67
  offset: 0,
48
- moving: !1
49
- }), m = (o = "") => {
50
- u = !0, o && (n.offset = o === "left" ? -i.value : r.value), t("open", {
51
- name: e.name,
52
- position: l || o
68
+ moving: false
69
+ });
70
+ const open = (p = "") => {
71
+ opened = true;
72
+ if (p) {
73
+ state.offset = p === "left" ? -rightRefWidth.value : leftRefWidth.value;
74
+ }
75
+ emit("open", {
76
+ name: props.name,
77
+ position: position || p
53
78
  });
54
- }, g = () => {
55
- n.offset = 0, u = !1, t("close", {
56
- name: e.name,
57
- position: l
79
+ };
80
+ const close = () => {
81
+ state.offset = 0;
82
+ opened = false;
83
+ emit("close", {
84
+ name: props.name,
85
+ position
58
86
  });
59
- }, E = h(() => ({
60
- transform: `translate3d(${n.offset}px, 0, 0)`
61
- })), R = (o) => {
62
- l = o > 0 ? "right" : "left";
63
- let f = o;
64
- switch (l) {
87
+ };
88
+ const touchStyle = computed(() => {
89
+ return {
90
+ transform: `translate3d(${state.offset}px, 0, 0)`
91
+ };
92
+ });
93
+ const setoffset = (deltaX) => {
94
+ position = deltaX > 0 ? "right" : "left";
95
+ let offset = deltaX;
96
+ switch (position) {
65
97
  case "left":
66
- u && p === l ? f = -i.value : f = Math.abs(o) > i.value ? -i.value : o;
98
+ if (opened && oldPosition === position) {
99
+ offset = -rightRefWidth.value;
100
+ } else {
101
+ offset = Math.abs(deltaX) > rightRefWidth.value ? -rightRefWidth.value : deltaX;
102
+ }
67
103
  break;
68
104
  case "right":
69
- u && p === l ? f = r.value : f = Math.abs(o) > r.value ? r.value : o;
105
+ if (opened && oldPosition === position) {
106
+ offset = leftRefWidth.value;
107
+ } else {
108
+ offset = Math.abs(deltaX) > leftRefWidth.value ? leftRefWidth.value : deltaX;
109
+ }
70
110
  break;
71
111
  }
72
- n.offset = f;
73
- }, c = z();
74
- return y(S({
75
- classes: s,
76
- touchStyle: E
77
- }, {
78
- onTouchStart(o) {
79
- e.disabled || c.start(o);
112
+ state.offset = offset;
113
+ };
114
+ const touch = useTouch();
115
+ const touchMethods = {
116
+ onTouchStart(event) {
117
+ if (props.disabled)
118
+ return;
119
+ touch.start(event);
80
120
  },
81
- onTouchMove(o) {
82
- e.disabled || (c.move(o), c.isHorizontal() && (n.moving = !0, R(c.deltaX.value), e.touchMovePreventDefault && o.preventDefault(), e.touchMoveStopPropagation && o.stopPropagation()));
121
+ onTouchMove(event) {
122
+ if (props.disabled)
123
+ return;
124
+ touch.move(event);
125
+ if (touch.isHorizontal()) {
126
+ state.moving = true;
127
+ setoffset(touch.deltaX.value);
128
+ if (props.touchMovePreventDefault) {
129
+ event.preventDefault();
130
+ }
131
+ if (props.touchMoveStopPropagation) {
132
+ event.stopPropagation();
133
+ }
134
+ }
83
135
  },
84
136
  onTouchEnd() {
85
- if (n.moving)
86
- switch (n.moving = !1, p = l, l) {
137
+ if (state.moving) {
138
+ state.moving = false;
139
+ oldPosition = position;
140
+ switch (position) {
87
141
  case "left":
88
- Math.abs(n.offset) <= i.value / 2 ? g() : (n.offset = -i.value, m());
142
+ if (Math.abs(state.offset) <= rightRefWidth.value / 2) {
143
+ close();
144
+ } else {
145
+ state.offset = -rightRefWidth.value;
146
+ open();
147
+ }
89
148
  break;
90
149
  case "right":
91
- Math.abs(n.offset) <= r.value / 2 ? g() : (n.offset = r.value, m());
150
+ if (Math.abs(state.offset) <= leftRefWidth.value / 2) {
151
+ close();
152
+ } else {
153
+ state.offset = leftRefWidth.value;
154
+ open();
155
+ }
92
156
  break;
93
157
  }
158
+ }
94
159
  }
95
- }), {
96
- leftRef: d,
97
- rightRef: a,
98
- open: m,
99
- close: g
160
+ };
161
+ return __spreadProps(__spreadValues({
162
+ classes,
163
+ touchStyle
164
+ }, touchMethods), {
165
+ leftRef,
166
+ rightRef,
167
+ open,
168
+ close
100
169
  });
101
170
  }
102
- }), J = {
171
+ });
172
+ const _hoisted_1 = {
103
173
  class: "nut-swipe__left",
104
174
  ref: "leftRef"
105
- }, K = { class: "nut-swipe__content" }, L = {
175
+ };
176
+ const _hoisted_2 = { class: "nut-swipe__content" };
177
+ const _hoisted_3 = {
106
178
  class: "nut-swipe__right",
107
179
  ref: "rightRef"
108
180
  };
109
- function O(e, t, s, v, d, r) {
110
- return N(), H("view", {
111
- class: V(e.classes),
112
- style: j(e.touchStyle),
113
- onTouchstart: t[0] || (t[0] = (...a) => e.onTouchStart && e.onTouchStart(...a)),
114
- onTouchmove: t[1] || (t[1] = (...a) => e.onTouchMove && e.onTouchMove(...a)),
115
- onTouchend: t[2] || (t[2] = (...a) => e.onTouchEnd && e.onTouchEnd(...a)),
116
- onTouchcancel: t[3] || (t[3] = (...a) => e.onTouchEnd && e.onTouchEnd(...a))
181
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
182
+ return openBlock(), createElementBlock("view", {
183
+ class: normalizeClass(_ctx.classes),
184
+ style: normalizeStyle(_ctx.touchStyle),
185
+ onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
186
+ onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
187
+ onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
188
+ onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
117
189
  }, [
118
- T("view", J, [
119
- M(e.$slots, "left")
190
+ createElementVNode("view", _hoisted_1, [
191
+ renderSlot(_ctx.$slots, "left")
120
192
  ], 512),
121
- T("view", K, [
122
- M(e.$slots, "default")
193
+ createElementVNode("view", _hoisted_2, [
194
+ renderSlot(_ctx.$slots, "default")
123
195
  ]),
124
- T("view", L, [
125
- M(e.$slots, "right")
196
+ createElementVNode("view", _hoisted_3, [
197
+ renderSlot(_ctx.$slots, "right")
126
198
  ], 512)
127
199
  ], 38);
128
200
  }
129
- const ee = /* @__PURE__ */ A(I, [["render", O]]);
201
+ const Swipe = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
130
202
  export {
131
- ee as default
203
+ Swipe as default
132
204
  };