@nutui/nutui 3.1.18-beta.0 → 3.1.19-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 (149) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/LICENSE +1 -1
  3. package/README.md +6 -0
  4. package/dist/nutui.d.ts +39 -36
  5. package/dist/nutui.es.js +13149 -11288
  6. package/dist/nutui.umd.js +13156 -11381
  7. package/dist/packages/_es/ActionSheet.js +13 -19
  8. package/dist/packages/_es/Address.js +70 -55
  9. package/dist/packages/_es/Audio.js +13 -13
  10. package/dist/packages/_es/AudioOperate.js +125 -0
  11. package/dist/packages/_es/Avatar.js +4 -4
  12. package/dist/packages/_es/BackTop.js +69 -108
  13. package/dist/packages/_es/Badge.js +4 -4
  14. package/dist/packages/_es/Barrage.js +63 -56
  15. package/dist/packages/_es/Button.js +3 -3
  16. package/dist/packages/_es/Calendar.js +30 -702
  17. package/dist/packages/_es/CalendarItem.js +10 -0
  18. package/dist/packages/_es/Card.js +7 -6
  19. package/dist/packages/_es/Cascader.js +8 -8
  20. package/dist/packages/_es/Cell.js +27 -27
  21. package/dist/packages/_es/CellGroup.js +2 -2
  22. package/dist/packages/_es/Checkbox.js +4 -4
  23. package/dist/packages/_es/CheckboxGroup.js +3 -3
  24. package/dist/packages/_es/CircleProgress.js +150 -41
  25. package/dist/packages/_es/Col.js +2 -2
  26. package/dist/packages/_es/Collapse.js +35 -9
  27. package/dist/packages/_es/CollapseItem.js +79 -38
  28. package/dist/packages/_es/CountDown.js +8 -6
  29. package/dist/packages/_es/CountUp.js +31 -30
  30. package/dist/packages/_es/DatePicker.js +81 -44
  31. package/dist/packages/_es/Dialog.js +7 -83
  32. package/dist/packages/_es/Divider.js +5 -5
  33. package/dist/packages/_es/Drag.js +93 -55
  34. package/dist/packages/_es/Elevator.js +75 -50
  35. package/dist/packages/_es/Empty.js +4 -4
  36. package/dist/packages/_es/FixedNav.js +6 -6
  37. package/dist/packages/_es/Form.js +11 -9
  38. package/dist/packages/_es/FormItem.js +9 -6
  39. package/dist/packages/_es/Grid.js +2 -2
  40. package/dist/packages/_es/GridItem.js +9 -27
  41. package/dist/packages/_es/Icon.js +2 -2
  42. package/dist/packages/_es/ImagePreview.js +14 -83
  43. package/dist/packages/_es/Indicator.js +4 -4
  44. package/dist/packages/_es/InfiniteLoading.js +94 -108
  45. package/dist/packages/_es/Input.js +297 -73
  46. package/dist/packages/_es/InputNumber.js +24 -17
  47. package/dist/packages/_es/Layout.js +2 -2
  48. package/dist/packages/_es/List.js +131 -0
  49. package/dist/packages/_es/Menu.js +16 -13
  50. package/dist/packages/_es/MenuItem.js +8 -8
  51. package/dist/packages/_es/Navbar.js +17 -12
  52. package/dist/packages/_es/NoticeBar.js +47 -39
  53. package/dist/packages/_es/Notify.js +28 -163
  54. package/dist/packages/_es/NumberKeyboard.js +4 -4
  55. package/dist/packages/_es/OldPicker.js +486 -0
  56. package/dist/packages/_es/OverLay.js +6 -26
  57. package/dist/packages/_es/Pagination.js +8 -8
  58. package/dist/packages/_es/Picker.js +192 -163
  59. package/dist/packages/_es/Popover.js +155 -30
  60. package/dist/packages/_es/Popup.js +7 -70
  61. package/dist/packages/_es/Price.js +18 -6
  62. package/dist/packages/_es/Progress.js +29 -27
  63. package/dist/packages/_es/PullRefresh.js +363 -0
  64. package/dist/packages/_es/Radio.js +4 -4
  65. package/dist/packages/_es/RadioGroup.js +2 -2
  66. package/dist/packages/_es/Range.js +169 -46
  67. package/dist/packages/_es/Rate.js +17 -20
  68. package/dist/packages/_es/Row.js +2 -2
  69. package/dist/packages/_es/SearchBar.js +9 -7
  70. package/dist/packages/_es/ShortPassword.js +90 -68
  71. package/dist/packages/_es/SideNavBar.js +6 -17
  72. package/dist/packages/_es/SideNavBarItem.js +2 -2
  73. package/dist/packages/_es/Signature.js +70 -70
  74. package/dist/packages/_es/Skeleton.js +9 -12
  75. package/dist/packages/_es/Sku.js +40 -31
  76. package/dist/packages/_es/Step.js +28 -12
  77. package/dist/packages/_es/Steps.js +8 -3
  78. package/dist/packages/_es/Sticky.js +29 -24
  79. package/dist/packages/_es/SubSideNavBar.js +2 -2
  80. package/dist/packages/_es/Swipe.js +40 -27
  81. package/dist/packages/_es/Swiper.js +32 -14
  82. package/dist/packages/_es/SwiperItem.js +2 -2
  83. package/dist/packages/_es/Switch.js +4 -4
  84. package/dist/packages/_es/TabPane.js +2 -2
  85. package/dist/packages/_es/Tabbar.js +4 -4
  86. package/dist/packages/_es/TabbarItem.js +28 -23
  87. package/dist/packages/_es/Table.js +14 -14
  88. package/dist/packages/_es/Tabs.js +19 -15
  89. package/dist/packages/_es/Tag.js +14 -8
  90. package/dist/packages/_es/TextArea.js +49 -15
  91. package/dist/packages/_es/TimeDetail.js +5 -4
  92. package/dist/packages/_es/TimePannel.js +4 -4
  93. package/dist/packages/_es/TimeSelect.js +9 -8
  94. package/dist/packages/_es/Toast.js +42 -171
  95. package/dist/packages/_es/Uploader.js +108 -139
  96. package/dist/packages/_es/Video.js +14 -10
  97. package/dist/packages/_es/common.js +2 -2
  98. package/dist/packages/_es/component.js +2 -2
  99. package/dist/packages/_es/index.js +45 -7
  100. package/dist/packages/_es/index.taro.js +719 -0
  101. package/dist/packages/_es/index2.js +2 -2
  102. package/dist/packages/_es/index3.js +57 -29
  103. package/dist/packages/_es/index4.js +414 -57
  104. package/dist/packages/_es/plugin-vue_export-helper.js +2 -2
  105. package/dist/packages/_es/pxCheck.js +2 -2
  106. package/dist/packages/_es/use-lock-scroll.js +23 -0
  107. package/dist/packages/_es/util.js +2 -2
  108. package/dist/packages/badge/index.scss +11 -13
  109. package/dist/packages/button/index.scss +1 -0
  110. package/dist/packages/calendar/index.scss +9 -4
  111. package/dist/packages/calendaritem/index.scss +0 -207
  112. package/dist/packages/cell/index.scss +6 -6
  113. package/dist/packages/checkbox/index.scss +4 -3
  114. package/dist/packages/collapseitem/index.scss +21 -11
  115. package/dist/packages/countdown/index.scss +3 -1
  116. package/dist/packages/divider/index.scss +8 -8
  117. package/dist/packages/elevator/index.scss +36 -36
  118. package/dist/packages/formitem/index.scss +15 -8
  119. package/dist/packages/indicator/index.scss +1 -1
  120. package/dist/packages/input/index.scss +70 -24
  121. package/dist/packages/inputnumber/index.scss +4 -2
  122. package/dist/packages/list/index.scss +24 -0
  123. package/dist/packages/menu/index.scss +3 -3
  124. package/dist/packages/navbar/index.scss +28 -8
  125. package/dist/packages/noticebar/index.scss +7 -8
  126. package/dist/packages/notify/index.scss +9 -0
  127. package/dist/packages/numberkeyboard/index.scss +22 -21
  128. package/dist/packages/oldpicker/index.scss +131 -0
  129. package/dist/packages/picker/index.scss +38 -32
  130. package/dist/packages/progress/index.scss +6 -5
  131. package/dist/packages/radio/index.scss +7 -6
  132. package/dist/packages/range/index.scss +109 -2
  133. package/dist/packages/searchbar/index.scss +7 -7
  134. package/dist/packages/sidenavbaritem/index.scss +5 -5
  135. package/dist/packages/step/index.scss +29 -29
  136. package/dist/packages/subsidenavbar/index.scss +10 -8
  137. package/dist/packages/tabbaritem/index.scss +15 -0
  138. package/dist/packages/timedetail/index.scss +13 -13
  139. package/dist/packages/timepannel/index.scss +7 -7
  140. package/dist/packages/timeselect/index.scss +3 -3
  141. package/dist/packages/uploader/index.scss +6 -6
  142. package/dist/style.css +1 -1
  143. package/dist/styles/themes/default.scss +64 -62
  144. package/dist/styles/themes/jdt.scss +91 -0
  145. package/dist/styles/variables-jdt.scss +728 -0
  146. package/dist/styles/variables.scss +250 -44
  147. package/package.json +2 -1
  148. package/dist/packages/_es/raf.js +0 -19
  149. package/dist/styles/themes/jdd.scss +0 -2
@@ -1,31 +1,13 @@
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.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
22
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
23
4
  * Released under the MIT License.
24
5
  */
25
- import { reactive, onMounted, watch, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, Fragment, createTextVNode, toDisplayString, vShow, createVNode, render } from "vue";
6
+ import { watch, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, Fragment, createTextVNode, toDisplayString, vShow } from "vue";
26
7
  import { c as createComponent } from "./component.js";
27
8
  import Popup from "./Popup.js";
28
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
+ import "./use-lock-scroll.js";
29
11
  import "./OverLay.js";
30
12
  import "./Icon.js";
31
13
  import "./pxCheck.js";
@@ -48,24 +30,16 @@ const _sfc_main = create({
48
30
  type: String,
49
31
  default: "danger"
50
32
  },
51
- showPopup: {
33
+ visible: {
52
34
  type: Boolean,
53
35
  default: false
54
- },
55
- onClose: Function,
56
- onClick: Function,
57
- unmount: Function
36
+ }
58
37
  },
59
- setup(props, { slots }) {
38
+ emits: ["update:visible", "closed", "click"],
39
+ setup(props, { emit }) {
60
40
  let timer = null;
61
- const state = reactive({
62
- mounted: false
63
- });
64
- onMounted(() => {
65
- state.mounted = true;
66
- });
67
- const clickCover = () => {
68
- props.onClick && props.onClick();
41
+ const onClick = () => {
42
+ emit("click");
69
43
  };
70
44
  const clearTimer = () => {
71
45
  if (timer) {
@@ -74,8 +48,14 @@ const _sfc_main = create({
74
48
  }
75
49
  };
76
50
  const hide = () => {
77
- state.mounted = false;
51
+ emit("update:visible", false);
52
+ emit("closed");
78
53
  };
54
+ watch(() => props.visible, (value) => {
55
+ if (value) {
56
+ show();
57
+ }
58
+ });
79
59
  const show = () => {
80
60
  clearTimer();
81
61
  if (props.duration) {
@@ -84,150 +64,35 @@ const _sfc_main = create({
84
64
  }, props.duration);
85
65
  }
86
66
  };
87
- if (props.duration) {
88
- show();
89
- }
90
- watch(() => props.duration, (val) => {
91
- if (val) {
92
- show();
93
- }
94
- });
95
67
  const onAfterLeave = () => {
96
- clearTimer();
97
- props.unmount && props.unmount(props.id);
98
- props.onClose && props.onClose();
68
+ if (props.visible) {
69
+ clearTimer();
70
+ hide();
71
+ }
99
72
  };
100
- return { state, hide, onAfterLeave, clickCover };
73
+ return { hide, onAfterLeave, onClick };
101
74
  }
102
75
  });
103
76
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
104
77
  return openBlock(), createBlock(Transition, {
105
- name: "toast-fade",
78
+ name: "nut-fade",
106
79
  onAfterLeave: _ctx.onAfterLeave
107
80
  }, {
108
81
  default: withCtx(() => [
109
82
  withDirectives(createElementVNode("view", {
110
- class: normalizeClass(["popup-top", "nut-notify", `nut-notify--${_ctx.type}`, [_ctx.className]]),
83
+ class: normalizeClass(["popup-top", "nut-notify", `nut-notify--${_ctx.type}`, { className: _ctx.className }]),
111
84
  style: normalizeStyle({ color: _ctx.color, background: _ctx.background }),
112
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clickCover && _ctx.clickCover(...args))
85
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
113
86
  }, [
114
87
  _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
115
88
  createTextVNode(toDisplayString(_ctx.msg), 1)
116
89
  ], 64))
117
90
  ], 6), [
118
- [vShow, _ctx.state.mounted]
91
+ [vShow, _ctx.visible]
119
92
  ])
120
93
  ]),
121
94
  _: 3
122
95
  }, 8, ["onAfterLeave"]);
123
96
  }
124
- var Notify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
125
- const defaultOptions = {
126
- type: "base",
127
- showPopup: false,
128
- msg: "",
129
- color: void 0,
130
- background: void 0,
131
- duration: 3e3,
132
- className: "",
133
- onClosed: null,
134
- onClick: null,
135
- onOpened: null,
136
- textTimer: null,
137
- unmount: null
138
- };
139
- let idsMap = [];
140
- let optsMap = [];
141
- const clearNotify = (id) => {
142
- if (id) {
143
- const container = document.getElementById(id);
144
- optsMap = optsMap.filter((item) => item.id !== id);
145
- idsMap = idsMap.filter((item) => item !== id);
146
- if (container) {
147
- document.body.removeChild(container);
148
- }
149
- } else {
150
- idsMap.forEach((item) => {
151
- const container = document.getElementById(item);
152
- if (container) {
153
- document.body.removeChild(container);
154
- }
155
- });
156
- optsMap = [];
157
- idsMap = [];
158
- }
159
- };
160
- const updateNotify = (opts) => {
161
- const container = document.getElementById(opts.id);
162
- if (container) {
163
- const currentOpt = optsMap.find((item) => item.id === opts.id);
164
- if (currentOpt) {
165
- opts = __spreadValues(__spreadValues(__spreadValues({}, defaultOptions), currentOpt), opts);
166
- } else {
167
- opts = __spreadValues(__spreadValues({}, defaultOptions), opts);
168
- }
169
- const instance = createVNode(Notify, opts);
170
- render(instance, container);
171
- return instance.component.ctx;
172
- }
173
- };
174
- const mountNotify = (opts) => {
175
- opts.unmount = clearNotify;
176
- let _id;
177
- if (opts.id) {
178
- _id = opts.id;
179
- if (idsMap.find((item) => item === opts.id)) {
180
- return updateNotify(opts);
181
- }
182
- } else {
183
- _id = new Date().getTime() + "";
184
- }
185
- opts = __spreadValues(__spreadValues({}, defaultOptions), opts);
186
- opts.id = _id;
187
- idsMap.push(opts.id);
188
- optsMap.push(opts);
189
- const container = document.createElement("view");
190
- container.id = opts.id;
191
- const instance = createVNode(Notify, opts);
192
- render(instance, container);
193
- document.body.appendChild(container);
194
- setTimeout(() => {
195
- instance.showPopup = true;
196
- }, 0);
197
- return instance.component.ctx;
198
- };
199
- const errorMsg = (msg) => {
200
- if (!msg) {
201
- console.warn("[NutUI Notify]: msg\u4E0D\u80FD\u4E3A\u7A7A");
202
- return;
203
- }
204
- };
205
- const NotifyFunction = {
206
- text(msg, obj = {}) {
207
- errorMsg(msg);
208
- return mountNotify(__spreadProps(__spreadValues({}, obj), { msg }));
209
- },
210
- primary(msg, obj = {}) {
211
- errorMsg(msg);
212
- return mountNotify(__spreadProps(__spreadValues({}, obj), { msg, type: "primary" }));
213
- },
214
- success(msg, obj = {}) {
215
- errorMsg(msg);
216
- return mountNotify(__spreadProps(__spreadValues({}, obj), { msg, type: "success" }));
217
- },
218
- danger(msg, obj = {}) {
219
- errorMsg(msg);
220
- return mountNotify(__spreadProps(__spreadValues({}, obj), { msg, type: "danger" }));
221
- },
222
- warn(msg, obj = {}) {
223
- errorMsg(msg);
224
- return mountNotify(__spreadProps(__spreadValues({}, obj), { msg, type: "warning" }));
225
- },
226
- hide() {
227
- clearNotify();
228
- },
229
- install(app) {
230
- app.config.globalProperties.$notify = NotifyFunction;
231
- }
232
- };
233
- export { Notify, NotifyFunction, NotifyFunction as default };
97
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
98
+ export { index_taro as default };
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { ref, computed, watch, onMounted, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, toDisplayString, createCommentVNode, Fragment, renderList, normalizeClass, createTextVNode } from "vue";
@@ -245,5 +245,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
245
245
  _: 1
246
246
  }, 8, ["visible", "overlay"]);
247
247
  }
248
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
249
- export { index as default };
248
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
249
+ export { index_taro as default };