@nutui/nutui 4.0.10-beta.1 → 4.0.11

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 (160) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/nutui.es.js +1 -1
  3. package/dist/nutui.js +6316 -7237
  4. package/dist/nutui.umd.js +1 -1
  5. package/dist/packages/_es/ActionSheet.js +78 -111
  6. package/dist/packages/_es/Address.js +250 -375
  7. package/dist/packages/_es/AddressList.js +269 -354
  8. package/dist/packages/_es/Animate.js +41 -58
  9. package/dist/packages/_es/Audio.js +128 -197
  10. package/dist/packages/_es/AudioOperate.js +60 -71
  11. package/dist/packages/_es/Avatar.js +66 -89
  12. package/dist/packages/_es/AvatarGroup.js +23 -31
  13. package/dist/packages/_es/Backtop.js +59 -99
  14. package/dist/packages/_es/Badge.js +36 -47
  15. package/dist/packages/_es/Barrage.js +68 -147
  16. package/dist/packages/_es/Button.js +47 -66
  17. package/dist/packages/_es/Calendar.js +135 -157
  18. package/dist/packages/_es/CalendarItem.js +6 -6
  19. package/dist/packages/_es/Card.js +42 -56
  20. package/dist/packages/_es/Cascader.js +315 -474
  21. package/dist/packages/_es/Category.js +29 -39
  22. package/dist/packages/_es/CategoryPane.js +57 -83
  23. package/dist/packages/_es/Cell.js +56 -71
  24. package/dist/packages/_es/CellGroup.js +19 -27
  25. package/dist/packages/_es/Checkbox.js +109 -156
  26. package/dist/packages/_es/CheckboxGroup.js +38 -59
  27. package/dist/packages/_es/CircleProgress.js +67 -96
  28. package/dist/packages/_es/Col.js +23 -31
  29. package/dist/packages/_es/Collapse.js +33 -58
  30. package/dist/packages/_es/CollapseItem.js +78 -108
  31. package/dist/packages/_es/Comment.js +207 -279
  32. package/dist/packages/_es/ConfigProvider.js +37 -55
  33. package/dist/packages/_es/Countdown.js +100 -212
  34. package/dist/packages/_es/Countup.js +232 -445
  35. package/dist/packages/_es/DatePicker.js +162 -265
  36. package/dist/packages/_es/Dialog.js +161 -213
  37. package/dist/packages/_es/Divider.js +42 -57
  38. package/dist/packages/_es/Drag.js +70 -153
  39. package/dist/packages/_es/Ecard.js +64 -104
  40. package/dist/packages/_es/Elevator.js +143 -219
  41. package/dist/packages/_es/Ellipsis.js +95 -178
  42. package/dist/packages/_es/Empty.js +23 -39
  43. package/dist/packages/_es/FixedNav.js +93 -116
  44. package/dist/packages/_es/Form.js +107 -178
  45. package/dist/packages/_es/FormItem.js +48 -61
  46. package/dist/packages/_es/Grid.js +5 -6
  47. package/dist/packages/_es/GridItem.js +58 -84
  48. package/dist/packages/_es/Image.js +90 -129
  49. package/dist/packages/_es/ImagePreview.js +256 -412
  50. package/dist/packages/_es/Indicator.js +30 -34
  51. package/dist/packages/_es/InfiniteLoading.js +83 -136
  52. package/dist/packages/_es/Input.js +160 -264
  53. package/dist/packages/_es/InputNumber.js +81 -117
  54. package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
  55. package/dist/packages/_es/Invoice.js +104 -130
  56. package/dist/packages/_es/Layout.js +3 -4
  57. package/dist/packages/_es/List.js +117 -215
  58. package/dist/packages/_es/Menu.js +95 -150
  59. package/dist/packages/_es/MenuItem.js +109 -154
  60. package/dist/packages/_es/Navbar.js +103 -119
  61. package/dist/packages/_es/Noticebar.js +197 -312
  62. package/dist/packages/_es/Notify.js +110 -166
  63. package/dist/packages/_es/NumberKeyboard.js +127 -202
  64. package/dist/packages/_es/Overlay.js +52 -80
  65. package/dist/packages/_es/Pagination.js +70 -100
  66. package/dist/packages/_es/Picker.js +275 -437
  67. package/dist/packages/_es/Popover.js +122 -225
  68. package/dist/packages/_es/Popup.js +4 -4
  69. package/dist/packages/_es/Price.js +44 -82
  70. package/dist/packages/_es/Progress.js +63 -79
  71. package/dist/packages/_es/PullRefresh.js +95 -173
  72. package/dist/packages/_es/Radio.js +4 -4
  73. package/dist/packages/_es/RadioGroup.js +3 -3
  74. package/dist/packages/_es/Range.js +204 -347
  75. package/dist/packages/_es/Rate.js +92 -141
  76. package/dist/packages/_es/Row.js +21 -27
  77. package/dist/packages/_es/Searchbar.js +123 -174
  78. package/dist/packages/_es/ShortPassword.js +69 -93
  79. package/dist/packages/_es/SideNavbar.js +49 -80
  80. package/dist/packages/_es/SideNavbarItem.js +22 -32
  81. package/dist/packages/_es/Signature.js +83 -146
  82. package/dist/packages/_es/Skeleton.js +110 -130
  83. package/dist/packages/_es/Sku.js +250 -343
  84. package/dist/packages/_es/Step.js +59 -86
  85. package/dist/packages/_es/Steps.js +26 -31
  86. package/dist/packages/_es/Sticky.js +4 -4
  87. package/dist/packages/_es/SubSideNavbar.js +52 -74
  88. package/dist/packages/_es/Swipe.js +83 -155
  89. package/dist/packages/_es/Swiper.js +174 -311
  90. package/dist/packages/_es/SwiperItem.js +28 -44
  91. package/dist/packages/_es/Switch.js +55 -68
  92. package/dist/packages/_es/TabPane.js +30 -41
  93. package/dist/packages/_es/Tabbar.js +41 -52
  94. package/dist/packages/_es/TabbarItem.js +61 -82
  95. package/dist/packages/_es/Table.js +109 -165
  96. package/dist/packages/_es/Tabs.js +240 -388
  97. package/dist/packages/_es/Tag.js +44 -61
  98. package/dist/packages/_es/Textarea.js +80 -124
  99. package/dist/packages/_es/TimeDetail.js +49 -76
  100. package/dist/packages/_es/TimePannel.js +34 -48
  101. package/dist/packages/_es/TimeSelect.js +47 -68
  102. package/dist/packages/_es/Toast.js +144 -218
  103. package/dist/packages/_es/Tour.js +138 -192
  104. package/dist/packages/_es/TrendArrow.js +57 -77
  105. package/dist/packages/_es/Uploader.js +234 -359
  106. package/dist/packages/_es/Video.js +191 -316
  107. package/dist/packages/_es/Watermark.js +84 -117
  108. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
  109. package/dist/packages/_es/common-d218746f.js +116 -0
  110. package/dist/packages/_es/component-234624bc.js +89 -0
  111. package/dist/packages/_es/index-14dfadc4.js +561 -0
  112. package/dist/packages/_es/index-192a3ef6.js +29 -0
  113. package/dist/packages/_es/index-360c5092.js +210 -0
  114. package/dist/packages/_es/index-496e6e05.js +24 -0
  115. package/dist/packages/_es/index-50eed3d9.js +7 -0
  116. package/dist/packages/_es/index-53ec2d4d.js +34 -0
  117. package/dist/packages/_es/index-fadb0974.js +8 -0
  118. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
  120. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
  121. package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
  122. package/dist/packages/_es/pxCheck-38173291.js +4 -0
  123. package/dist/packages/_es/raf-a74f1a06.js +16 -0
  124. package/dist/packages/_es/renderIcon-47498b32.js +5 -0
  125. package/dist/smartips/web-types.json +1 -1
  126. package/dist/style.css +1 -1
  127. package/dist/styles/themes/default.scss +148 -45
  128. package/dist/styles/themes/jdb.scss +148 -45
  129. package/dist/styles/themes/jddkh.scss +148 -45
  130. package/dist/styles/themes/jdt.scss +148 -45
  131. package/dist/types/__VUE/address/index.vue.d.ts +1 -1
  132. package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
  133. package/dist/types/__VUE/image/index.vue.d.ts +2 -2
  134. package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
  135. package/dist/types/__VUE/searchbar/index.vue.d.ts +110 -3
  136. package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
  137. package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
  138. package/dist/types/__VUE/table/common.d.ts +55 -2
  139. package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
  140. package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
  141. package/dist/types/index.d.ts +1 -1
  142. package/package.json +2 -2
  143. package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
  144. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
  145. package/dist/packages/_es/common-b9a5e726.js +0 -145
  146. package/dist/packages/_es/component-81a4c1d0.js +0 -145
  147. package/dist/packages/_es/index-29892cda.js +0 -33
  148. package/dist/packages/_es/index-43c34ac6.js +0 -30
  149. package/dist/packages/_es/index-54d03fc1.js +0 -8
  150. package/dist/packages/_es/index-79c5dc33.js +0 -10
  151. package/dist/packages/_es/index-7a7385e4.js +0 -67
  152. package/dist/packages/_es/index-87422be8.js +0 -942
  153. package/dist/packages/_es/index-da0a7662.js +0 -259
  154. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
  155. package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
  156. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
  157. package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
  158. package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
  159. package/dist/packages/_es/raf-729dad54.js +0 -25
  160. package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
@@ -1,9 +1,8 @@
1
- import { toRefs, computed, watchEffect, openBlock, createElementBlock, createElementVNode, normalizeClass, renderSlot, createTextVNode, toDisplayString, Fragment, renderList, createCommentVNode } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ import { toRefs as b, computed as k, watchEffect as E, openBlock as m, createElementBlock as d, createElementVNode as y, normalizeClass as S, renderSlot as V, createTextVNode as w, toDisplayString as f, Fragment as T, renderList as z, createCommentVNode as N } from "vue";
2
+ import { c as M } from "./component-234624bc.js";
3
+ import { _ as R } from "./_plugin-vue_export-helper-dad06003.js";
4
4
  import "../locale/lang";
5
- const { create, translate } = createComponent("pagination");
6
- const _sfc_main = create({
5
+ const { create: B, translate: I } = M("pagination"), D = B({
7
6
  props: {
8
7
  modelValue: {
9
8
  type: Number,
@@ -39,124 +38,95 @@ const _sfc_main = create({
39
38
  },
40
39
  forceEllipses: {
41
40
  type: Boolean,
42
- default: false
41
+ default: !1
43
42
  }
44
43
  },
45
44
  components: {},
46
45
  emits: ["change", "update:modelValue"],
47
- setup(props, { emit }) {
48
- const { modelValue, mode, showPageSize, forceEllipses } = toRefs(props);
49
- const countRef = computed(() => {
50
- const { pageCount, totalItems, itemsPerPage } = toRefs(props);
51
- const num = +pageCount.value || Math.ceil(+totalItems.value / +itemsPerPage.value);
52
- return Math.max(1, num);
53
- });
54
- const select = (curPage, isSelect) => {
55
- if (curPage > countRef.value || curPage < 1)
46
+ setup(e, { emit: l }) {
47
+ const { modelValue: r, mode: v, showPageSize: C, forceEllipses: h } = b(e), n = k(() => {
48
+ const { pageCount: t, totalItems: a, itemsPerPage: o } = b(e), s = +t.value || Math.ceil(+a.value / +o.value);
49
+ return Math.max(1, s);
50
+ }), c = (t, a) => {
51
+ t > n.value || t < 1 || (t != r.value && l("update:modelValue", t), a && l("change", t));
52
+ }, g = (t, a, o = !1) => ({ number: t, text: a, active: o }), P = k(() => {
53
+ if (v.value == "simple")
56
54
  return;
57
- if (curPage != modelValue.value)
58
- emit("update:modelValue", curPage);
59
- if (isSelect)
60
- emit("change", curPage);
61
- };
62
- const setPage = (number, text, active = false) => {
63
- return { number, text, active };
64
- };
65
- const pages = computed(() => {
66
- if (mode.value == "simple")
67
- return;
68
- let items = [];
69
- const pageCount = countRef.value;
70
- const pageSize = +showPageSize.value;
71
- let startPage = 1;
72
- let endPage = pageCount;
73
- const partialShow = pageCount > pageSize;
74
- if (partialShow) {
75
- startPage = Math.max(modelValue.value - Math.floor(pageSize / 2), 1);
76
- endPage = startPage + +pageSize - 1;
77
- if (endPage > pageCount) {
78
- endPage = pageCount;
79
- startPage = endPage - +pageSize + 1;
80
- }
55
+ let t = [];
56
+ const a = n.value, o = +C.value;
57
+ let s = 1, i = a;
58
+ const $ = a > o;
59
+ $ && (s = Math.max(r.value - Math.floor(o / 2), 1), i = s + +o - 1, i > a && (i = a, s = i - +o + 1));
60
+ for (var u = s; u <= i; u++) {
61
+ const p = g(u, u, r.value == u);
62
+ t.push(p);
81
63
  }
82
- for (var i = startPage; i <= endPage; i++) {
83
- const page = setPage(i, i, modelValue.value == i);
84
- items.push(page);
85
- }
86
- if (partialShow && pageSize > 0 && forceEllipses.value) {
87
- if (startPage > 1) {
88
- const prevPage = setPage(startPage - 1, "...");
89
- items.unshift(prevPage);
64
+ if ($ && o > 0 && h.value) {
65
+ if (s > 1) {
66
+ const p = g(s - 1, "...");
67
+ t.unshift(p);
90
68
  }
91
- if (endPage < pageCount) {
92
- const nextPage = setPage(endPage + 1, "...");
93
- items.push(nextPage);
69
+ if (i < a) {
70
+ const p = g(i + 1, "...");
71
+ t.push(p);
94
72
  }
95
73
  }
96
- return items;
97
- });
98
- watchEffect(() => {
99
- select(modelValue.value, false);
74
+ return t;
100
75
  });
101
- return {
102
- modelValue,
103
- select,
104
- countRef,
105
- mode,
106
- pages,
107
- forceEllipses,
108
- translate
76
+ return E(() => {
77
+ c(r.value, !1);
78
+ }), {
79
+ modelValue: r,
80
+ select: c,
81
+ countRef: n,
82
+ mode: v,
83
+ pages: P,
84
+ forceEllipses: h,
85
+ translate: I
109
86
  };
110
87
  }
111
- });
112
- const _hoisted_1 = { class: "nut-pagination" };
113
- const _hoisted_2 = {
88
+ }), F = { class: "nut-pagination" }, L = {
114
89
  key: 0,
115
90
  class: "nut-pagination-contain"
116
- };
117
- const _hoisted_3 = ["onClick"];
118
- const _hoisted_4 = {
91
+ }, j = ["onClick"], q = {
119
92
  key: 1,
120
93
  class: "nut-pagination-contain"
121
- };
122
- const _hoisted_5 = { class: "nut-pagination-simple" };
123
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
124
- return openBlock(), createElementBlock("view", _hoisted_1, [
125
- createElementVNode("view", {
126
- class: normalizeClass(["nut-pagination-prev", _ctx.mode == "multi" ? "" : "simple-border", _ctx.modelValue == 1 ? "disabled" : ""]),
127
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.select(_ctx.modelValue - 1, true))
94
+ }, A = { class: "nut-pagination-simple" };
95
+ function G(e, l, r, v, C, h) {
96
+ return m(), d("view", F, [
97
+ y("view", {
98
+ class: S(["nut-pagination-prev", e.mode == "multi" ? "" : "simple-border", e.modelValue == 1 ? "disabled" : ""]),
99
+ onClick: l[0] || (l[0] = (n) => e.select(e.modelValue - 1, !0))
128
100
  }, [
129
- renderSlot(_ctx.$slots, "prev-text", {}, () => [
130
- createTextVNode(toDisplayString(_ctx.prevText || _ctx.translate("prev")), 1)
101
+ V(e.$slots, "prev-text", {}, () => [
102
+ w(f(e.prevText || e.translate("prev")), 1)
131
103
  ])
132
104
  ], 2),
133
- _ctx.mode == "multi" ? (openBlock(), createElementBlock("view", _hoisted_2, [
134
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.pages, (item, index2) => {
135
- return openBlock(), createElementBlock("view", {
136
- key: index2 + "pagination",
137
- class: normalizeClass(["nut-pagination-item", item.active ? "active" : ""]),
138
- onClick: ($event) => _ctx.select(item.number, true)
139
- }, [
140
- renderSlot(_ctx.$slots, "page", { item }, () => [
141
- createTextVNode(toDisplayString(item.text), 1)
142
- ])
143
- ], 10, _hoisted_3);
144
- }), 128))
145
- ])) : createCommentVNode("", true),
146
- _ctx.mode == "simple" ? (openBlock(), createElementBlock("view", _hoisted_4, [
147
- createElementVNode("view", _hoisted_5, toDisplayString(_ctx.modelValue) + "/" + toDisplayString(_ctx.countRef), 1)
148
- ])) : createCommentVNode("", true),
149
- createElementVNode("view", {
150
- class: normalizeClass(["nut-pagination-next", _ctx.modelValue >= _ctx.countRef ? "disabled" : ""]),
151
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.select(_ctx.modelValue + 1, true))
105
+ e.mode == "multi" ? (m(), d("view", L, [
106
+ (m(!0), d(T, null, z(e.pages, (n, c) => (m(), d("view", {
107
+ key: c + "pagination",
108
+ class: S(["nut-pagination-item", n.active ? "active" : ""]),
109
+ onClick: (g) => e.select(n.number, !0)
110
+ }, [
111
+ V(e.$slots, "page", { item: n }, () => [
112
+ w(f(n.text), 1)
113
+ ])
114
+ ], 10, j))), 128))
115
+ ])) : N("", !0),
116
+ e.mode == "simple" ? (m(), d("view", q, [
117
+ y("view", A, f(e.modelValue) + "/" + f(e.countRef), 1)
118
+ ])) : N("", !0),
119
+ y("view", {
120
+ class: S(["nut-pagination-next", e.modelValue >= e.countRef ? "disabled" : ""]),
121
+ onClick: l[1] || (l[1] = (n) => e.select(e.modelValue + 1, !0))
152
122
  }, [
153
- renderSlot(_ctx.$slots, "next-text", {}, () => [
154
- createTextVNode(toDisplayString(_ctx.nextText || _ctx.translate("next")), 1)
123
+ V(e.$slots, "next-text", {}, () => [
124
+ w(f(e.nextText || e.translate("next")), 1)
155
125
  ])
156
126
  ], 2)
157
127
  ]);
158
128
  }
159
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
129
+ const Q = /* @__PURE__ */ R(D, [["render", G]]);
160
130
  export {
161
- index as default
131
+ Q as default
162
132
  };