@nutui/nutui 4.0.11 → 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 +2 -2
  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 +48 -48
  135. package/dist/styles/themes/jdb.scss +48 -48
  136. package/dist/styles/themes/jddkh.scss +48 -48
  137. package/dist/styles/themes/jdt.scss +48 -48
  138. package/dist/types/index.d.ts +1 -1
  139. package/package.json +3 -4
  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,20 +1,28 @@
1
- var V = Object.defineProperty, z = Object.defineProperties;
2
- var A = Object.getOwnPropertyDescriptors;
3
- var C = Object.getOwnPropertySymbols;
4
- var D = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
5
- var H = (e, l, o) => l in e ? V(e, l, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[l] = o, v = (e, l) => {
6
- for (var o in l || (l = {}))
7
- D.call(l, o) && H(e, o, l[o]);
8
- if (C)
9
- for (var o of C(l))
10
- I.call(l, o) && H(e, o, l[o]);
11
- return e;
12
- }, w = (e, l) => z(e, A(l));
13
- import { ref as S, reactive as L, computed as O, watch as R, onMounted as j, toRefs as q, openBlock as r, createElementBlock as u, normalizeClass as F, toDisplayString as m, createCommentVNode as x, createTextVNode as p, withModifiers as M } from "vue";
14
- import { c as G } from "./component-234624bc.js";
15
- import { _ as J } 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 { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createTextVNode, withModifiers } from "vue";
21
+ import { c as createComponent } from "./component-81a4c1d0.js";
22
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
16
23
  import "../locale/lang";
17
- const { componentName: K, create: Q } = G("ellipsis"), U = Q({
24
+ const { componentName, create } = createComponent("ellipsis");
25
+ const _sfc_main = create({
18
26
  props: {
19
27
  content: {
20
28
  type: String,
@@ -46,103 +54,178 @@ const { componentName: K, create: Q } = G("ellipsis"), U = Q({
46
54
  }
47
55
  },
48
56
  emits: ["click", "change"],
49
- setup(e, { emit: l }) {
50
- const o = S(null);
51
- let n = null, y = 0;
52
- const g = S(), s = L({
53
- exceeded: !1,
57
+ setup(props, { emit }) {
58
+ const root = ref(null);
59
+ let container = null;
60
+ let maxHeight = 0;
61
+ const ellipsis = ref();
62
+ const state = reactive({
63
+ exceeded: false,
54
64
  //是否超出
55
- expanded: !1
65
+ expanded: false
56
66
  //是否折叠
57
- }), N = O(() => ({
58
- [K]: !0
59
- }));
60
- R(
61
- () => e.content,
62
- (t, i) => {
63
- t != i && T();
67
+ });
68
+ const classes = computed(() => {
69
+ const prefixCls = componentName;
70
+ return {
71
+ [prefixCls]: true
72
+ };
73
+ });
74
+ watch(
75
+ () => props.content,
76
+ (newV, oldVal) => {
77
+ if (newV != oldVal) {
78
+ createContainer();
79
+ }
64
80
  }
65
- ), j(() => {
66
- T();
81
+ );
82
+ onMounted(() => {
83
+ createContainer();
67
84
  });
68
- const T = () => {
69
- if (!o.value)
85
+ const createContainer = () => {
86
+ if (!root.value)
70
87
  return;
71
- const t = window.getComputedStyle(o.value);
72
- n = document.createElement("div"), Array.prototype.slice.apply(t).forEach((a) => {
73
- n.style.setProperty(a, t.getPropertyValue(a));
74
- }), n.style.position = "fixed", n.style.left = "999999px", n.style.top = "999999px", n.style.zIndex = "-1000", n.style.height = "auto", n.style.minHeight = "auto", n.style.maxHeight = "auto", n.style.textOverflow = "clip", n.style.whiteSpace = "normal", n.style.webkitLineClamp = "unset", n.style.display = "block";
75
- const c = k(t.lineHeight === "normal" ? e.lineHeight : t.lineHeight);
76
- y = Math.floor(
77
- c * (Number(e.rows) + 0.5) + k(t.paddingTop) + k(t.paddingBottom)
78
- ), n.innerText = e.content, document.body.appendChild(n), $();
79
- }, $ = () => {
80
- if (n.offsetHeight <= y)
81
- s.exceeded = !1, document.body.removeChild(n);
82
- else {
83
- s.exceeded = !0;
84
- const t = e.content.length, i = Math.floor((0 + t) / 2), c = e.direction === "middle" ? h([0, i], [i, t]) : f(0, t);
85
- g.value = c, document.body.removeChild(n);
88
+ const originStyle = window.getComputedStyle(root.value);
89
+ container = document.createElement("div");
90
+ const styleNames = Array.prototype.slice.apply(originStyle);
91
+ styleNames.forEach((name) => {
92
+ container.style.setProperty(name, originStyle.getPropertyValue(name));
93
+ });
94
+ container.style.position = "fixed";
95
+ container.style.left = "999999px";
96
+ container.style.top = "999999px";
97
+ container.style.zIndex = "-1000";
98
+ container.style.height = "auto";
99
+ container.style.minHeight = "auto";
100
+ container.style.maxHeight = "auto";
101
+ container.style.textOverflow = "clip";
102
+ container.style.whiteSpace = "normal";
103
+ container.style.webkitLineClamp = "unset";
104
+ container.style.display = "block";
105
+ const lineHeight = pxToNumber(originStyle.lineHeight === "normal" ? props.lineHeight : originStyle.lineHeight);
106
+ maxHeight = Math.floor(
107
+ lineHeight * (Number(props.rows) + 0.5) + pxToNumber(originStyle.paddingTop) + pxToNumber(originStyle.paddingBottom)
108
+ );
109
+ container.innerText = props.content;
110
+ document.body.appendChild(container);
111
+ calcEllipse();
112
+ };
113
+ const calcEllipse = () => {
114
+ if (container.offsetHeight <= maxHeight) {
115
+ state.exceeded = false;
116
+ document.body.removeChild(container);
117
+ } else {
118
+ state.exceeded = true;
119
+ const end = props.content.length;
120
+ const middle = Math.floor((0 + end) / 2);
121
+ const ellipsised = props.direction === "middle" ? tailorMiddle([0, middle], [middle, end]) : tailor(0, end);
122
+ ellipsis.value = ellipsised;
123
+ document.body.removeChild(container);
86
124
  }
87
- }, f = (t, i) => {
88
- const c = s.expanded ? e.collapseText : e.expandText, a = e.content.length;
89
- if (i - t <= 1)
90
- return e.direction === "end" ? {
91
- leading: e.content.slice(0, t) + e.symbol
92
- } : {
93
- tailing: e.symbol + e.content.slice(i, a)
94
- };
95
- const d = Math.round((t + i) / 2);
96
- return e.direction === "end" ? n.innerText = e.content.slice(0, d) + e.symbol + c : n.innerText = c + e.symbol + e.content.slice(d, a), n.offsetHeight <= y ? e.direction === "end" ? f(d, i) : f(t, d) : e.direction === "end" ? f(t, d) : f(d, i);
97
- }, h = (t, i) => {
98
- const c = s.expanded ? e.collapseText : e.expandText, a = e.content.length;
99
- if (t[1] - t[0] <= 1 && i[1] - i[0] <= 1)
125
+ };
126
+ const tailor = (left, right) => {
127
+ const actionText = state.expanded ? props.collapseText : props.expandText;
128
+ const end = props.content.length;
129
+ if (right - left <= 1) {
130
+ if (props.direction === "end") {
131
+ return {
132
+ leading: props.content.slice(0, left) + props.symbol
133
+ };
134
+ } else {
135
+ return {
136
+ tailing: props.symbol + props.content.slice(right, end)
137
+ };
138
+ }
139
+ }
140
+ const middle = Math.round((left + right) / 2);
141
+ if (props.direction === "end") {
142
+ container.innerText = props.content.slice(0, middle) + props.symbol + actionText;
143
+ } else {
144
+ container.innerText = actionText + props.symbol + props.content.slice(middle, end);
145
+ }
146
+ if (container.offsetHeight <= maxHeight) {
147
+ if (props.direction === "end") {
148
+ return tailor(middle, right);
149
+ } else {
150
+ return tailor(left, middle);
151
+ }
152
+ } else {
153
+ if (props.direction === "end") {
154
+ return tailor(left, middle);
155
+ } else {
156
+ return tailor(middle, right);
157
+ }
158
+ }
159
+ };
160
+ const tailorMiddle = (leftPart, rightPart) => {
161
+ const actionText = state.expanded ? props.collapseText : props.expandText;
162
+ const end = props.content.length;
163
+ if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
100
164
  return {
101
- leading: e.content.slice(0, t[0]) + e.symbol,
102
- tailing: e.symbol + e.content.slice(i[1], a)
165
+ leading: props.content.slice(0, leftPart[0]) + props.symbol,
166
+ tailing: props.symbol + props.content.slice(rightPart[1], end)
103
167
  };
104
- const d = Math.floor((t[0] + t[1]) / 2), b = Math.ceil((i[0] + i[1]) / 2);
105
- return n.innerText = e.content.slice(0, d) + e.symbol + c + e.symbol + e.content.slice(b, a), n.offsetHeight <= y ? h([d, t[1]], [i[0], b]) : h([t[0], d], [b, i[1]]);
106
- }, k = (t) => {
107
- if (!t)
168
+ }
169
+ const leftPartMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
170
+ const rightPartMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
171
+ container.innerText = props.content.slice(0, leftPartMiddle) + props.symbol + actionText + props.symbol + props.content.slice(rightPartMiddle, end);
172
+ if (container.offsetHeight <= maxHeight) {
173
+ return tailorMiddle([leftPartMiddle, leftPart[1]], [rightPart[0], rightPartMiddle]);
174
+ } else {
175
+ return tailorMiddle([leftPart[0], leftPartMiddle], [rightPartMiddle, rightPart[1]]);
176
+ }
177
+ };
178
+ const pxToNumber = (value) => {
179
+ if (!value)
108
180
  return 0;
109
- const i = t.match(/^\d*(\.\d*)?/);
110
- return i ? Number(i[0]) : 0;
111
- }, E = (t) => {
112
- t == 1 ? (s.expanded = !0, l("change", "expand")) : (s.expanded = !1, l("change", "collapse"));
113
- }, B = () => {
114
- l("click");
181
+ const match = value.match(/^\d*(\.\d*)?/);
182
+ return match ? Number(match[0]) : 0;
183
+ };
184
+ const clickHandle = (type) => {
185
+ if (type == 1) {
186
+ state.expanded = true;
187
+ emit("change", "expand");
188
+ } else {
189
+ state.expanded = false;
190
+ emit("change", "collapse");
191
+ }
192
+ };
193
+ const handleClick = () => {
194
+ emit("click");
115
195
  };
116
- return w(v({}, q(s)), { root: o, ellipsis: g, classes: N, clickHandle: E, handleClick: B });
196
+ return __spreadProps(__spreadValues({}, toRefs(state)), { root, ellipsis, classes, clickHandle, handleClick });
117
197
  }
118
- }), W = { key: 0 }, X = { key: 1 }, Y = { key: 2 };
119
- function Z(e, l, o, n, y, g) {
120
- return r(), u("view", {
121
- class: F(e.classes),
122
- onClick: l[2] || (l[2] = (...s) => e.handleClick && e.handleClick(...s)),
198
+ });
199
+ const _hoisted_1 = { key: 0 };
200
+ const _hoisted_2 = { key: 1 };
201
+ const _hoisted_3 = { key: 2 };
202
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
203
+ return openBlock(), createElementBlock("view", {
204
+ class: normalizeClass(_ctx.classes),
205
+ onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleClick && _ctx.handleClick(...args)),
123
206
  ref: "root"
124
207
  }, [
125
- e.exceeded ? x("", !0) : (r(), u("view", W, m(e.content), 1)),
126
- e.exceeded && !e.expanded ? (r(), u("view", X, [
127
- p(m(e.ellipsis && e.ellipsis.leading), 1),
128
- e.expandText ? (r(), u("span", {
208
+ !_ctx.exceeded ? (openBlock(), createElementBlock("view", _hoisted_1, toDisplayString(_ctx.content), 1)) : createCommentVNode("", true),
209
+ _ctx.exceeded && !_ctx.expanded ? (openBlock(), createElementBlock("view", _hoisted_2, [
210
+ createTextVNode(toDisplayString(_ctx.ellipsis && _ctx.ellipsis.leading), 1),
211
+ _ctx.expandText ? (openBlock(), createElementBlock("span", {
129
212
  key: 0,
130
213
  class: "nut-ellipsis__text",
131
- onClick: l[0] || (l[0] = M((s) => e.clickHandle(1), ["stop"]))
132
- }, m(e.expandText), 1)) : x("", !0),
133
- p(m(e.ellipsis && e.ellipsis.tailing), 1)
134
- ])) : x("", !0),
135
- e.exceeded && e.expanded ? (r(), u("view", Y, [
136
- p(m(e.content) + " ", 1),
137
- e.expandText ? (r(), u("span", {
214
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.clickHandle(1), ["stop"]))
215
+ }, toDisplayString(_ctx.expandText), 1)) : createCommentVNode("", true),
216
+ createTextVNode(toDisplayString(_ctx.ellipsis && _ctx.ellipsis.tailing), 1)
217
+ ])) : createCommentVNode("", true),
218
+ _ctx.exceeded && _ctx.expanded ? (openBlock(), createElementBlock("view", _hoisted_3, [
219
+ createTextVNode(toDisplayString(_ctx.content) + " ", 1),
220
+ _ctx.expandText ? (openBlock(), createElementBlock("span", {
138
221
  key: 0,
139
222
  class: "nut-ellipsis__text",
140
- onClick: l[1] || (l[1] = M((s) => e.clickHandle(2), ["stop"]))
141
- }, m(e.collapseText), 1)) : x("", !0)
142
- ])) : x("", !0)
223
+ onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.clickHandle(2), ["stop"]))
224
+ }, toDisplayString(_ctx.collapseText), 1)) : createCommentVNode("", true)
225
+ ])) : createCommentVNode("", true)
143
226
  ], 2);
144
227
  }
145
- const le = /* @__PURE__ */ J(U, [["render", Z]]);
228
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
146
229
  export {
147
- le as default
230
+ index as default
148
231
  };
@@ -1,12 +1,14 @@
1
- import { toRefs as m, computed as c, openBlock as r, createElementBlock as a, createElementVNode as u, normalizeStyle as d, renderSlot as o, Fragment as f, createCommentVNode as n, toDisplayString as g } from "vue";
2
- import { c as y } from "./component-234624bc.js";
3
- import { _ as h } from "./_plugin-vue_export-helper-dad06003.js";
1
+ import { toRefs, computed, openBlock, createElementBlock, createElementVNode, normalizeStyle, renderSlot, Fragment, createCommentVNode, toDisplayString } from "vue";
2
+ import { c as createComponent } from "./component-81a4c1d0.js";
3
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
- const { componentName: B, create: v, translate: $ } = y("empty"), S = {
5
+ const { componentName, create, translate } = createComponent("empty");
6
+ const defaultStatus = {
6
7
  empty: "https://static-ftcms.jd.com/p/files/61a9e3183985005b3958672b.png",
7
8
  error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
8
9
  network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
9
- }, _ = v({
10
+ };
11
+ const _sfc_main = create({
10
12
  props: {
11
13
  image: {
12
14
  type: String,
@@ -24,37 +26,51 @@ const { componentName: B, create: v, translate: $ } = y("empty"), S = {
24
26
  default: ""
25
27
  }
26
28
  },
27
- setup(e) {
28
- const { image: s, imageSize: t } = m(e), i = c(() => t.value ? typeof t.value == "number" ? `width:${t.value}px;height:${t.value}px` : `width:${t.value};height:${t.value}` : "");
29
+ setup(props) {
30
+ const { image, imageSize } = toRefs(props);
31
+ const imgStyle = computed(() => {
32
+ if (!imageSize.value) {
33
+ return "";
34
+ }
35
+ if (typeof imageSize.value === "number") {
36
+ return `width:${imageSize.value}px;height:${imageSize.value}px`;
37
+ }
38
+ return `width:${imageSize.value};height:${imageSize.value}`;
39
+ });
40
+ const isHttpUrl = image.value.startsWith("https://") || image.value.startsWith("http://") || image.value.startsWith("//");
41
+ const imageUrl = isHttpUrl ? image.value : defaultStatus[image.value];
29
42
  return {
30
- imageUrl: s.value.startsWith("https://") || s.value.startsWith("http://") || s.value.startsWith("//") ? s.value : S[s.value],
31
- imgStyle: i,
32
- translate: $
43
+ imageUrl,
44
+ imgStyle,
45
+ translate
33
46
  };
34
47
  }
35
- }), k = { class: "nut-empty" }, b = ["src"], w = {
48
+ });
49
+ const _hoisted_1 = { class: "nut-empty" };
50
+ const _hoisted_2 = ["src"];
51
+ const _hoisted_3 = {
36
52
  key: 1,
37
53
  class: "nut-empty__description"
38
54
  };
39
- function U(e, s, t, i, l, p) {
40
- return r(), a("view", k, [
41
- u("view", {
55
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
56
+ return openBlock(), createElementBlock("view", _hoisted_1, [
57
+ createElementVNode("view", {
42
58
  class: "nut-empty__box",
43
- style: d(e.imgStyle)
59
+ style: normalizeStyle(_ctx.imgStyle)
44
60
  }, [
45
- e.$slots.image ? o(e.$slots, "image", { key: 0 }) : (r(), a(f, { key: 1 }, [
46
- e.imageUrl ? (r(), a("img", {
61
+ _ctx.$slots.image ? renderSlot(_ctx.$slots, "image", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
62
+ _ctx.imageUrl ? (openBlock(), createElementBlock("img", {
47
63
  key: 0,
48
64
  class: "nut-empty__box--img",
49
- src: e.imageUrl
50
- }, null, 8, b)) : n("", !0)
65
+ src: _ctx.imageUrl
66
+ }, null, 8, _hoisted_2)) : createCommentVNode("", true)
51
67
  ], 64))
52
68
  ], 4),
53
- e.$slots.description ? o(e.$slots, "description", { key: 0 }) : (r(), a("view", w, g(e.description || e.translate("noData")), 1)),
54
- e.$slots.default ? o(e.$slots, "default", { key: 2 }) : n("", !0)
69
+ _ctx.$slots.description ? renderSlot(_ctx.$slots, "description", { key: 0 }) : (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(_ctx.description || _ctx.translate("noData")), 1)),
70
+ _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 2 }) : createCommentVNode("", true)
55
71
  ]);
56
72
  }
57
- const C = /* @__PURE__ */ h(_, [["render", U]]);
73
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
58
74
  export {
59
- C as default
75
+ index as default
60
76
  };
@@ -1,112 +1,135 @@
1
- import { c as b } from "./component-234624bc.js";
2
- import { computed as g, ref as $, resolveComponent as p, openBlock as s, createElementBlock as i, normalizeClass as v, normalizeStyle as S, createBlock as V, createCommentVNode as f, renderSlot as m, createElementVNode as l, Fragment as w, renderList as L, toDisplayString as u, createVNode as T } from "vue";
3
- import y from "./Overlay.js";
4
- import { Left as B } from "@nutui/icons-vue";
5
- import { _ as h } from "./_plugin-vue_export-helper-dad06003.js";
1
+ import { c as createComponent } from "./component-81a4c1d0.js";
2
+ import { computed, ref, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, createCommentVNode, renderSlot, createElementVNode, Fragment, renderList, toDisplayString, createVNode } from "vue";
3
+ import Overlay from "./Overlay.js";
4
+ import { Left } from "@nutui/icons-vue";
5
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
6
6
  import "../locale/lang";
7
- const { componentName: x, translate: A } = b("fixed-nav"), N = (e) => ({
8
- components: e,
9
- props: {
10
- visible: {
11
- type: Boolean,
12
- default: !1
7
+ const { componentName, translate } = createComponent("fixed-nav");
8
+ const component = (components) => {
9
+ return {
10
+ components,
11
+ props: {
12
+ visible: {
13
+ type: Boolean,
14
+ default: false
15
+ },
16
+ overlay: {
17
+ type: Boolean,
18
+ default: true
19
+ },
20
+ navList: {
21
+ default: () => [],
22
+ type: Array
23
+ },
24
+ activeColor: {
25
+ default: "",
26
+ type: String
27
+ },
28
+ activeText: {
29
+ default: "",
30
+ type: String
31
+ },
32
+ unActiveText: {
33
+ default: "",
34
+ type: String
35
+ },
36
+ position: {
37
+ default: () => {
38
+ return {
39
+ top: "auto",
40
+ bottom: "auto"
41
+ };
42
+ },
43
+ type: Object
44
+ },
45
+ type: {
46
+ default: "right",
47
+ type: String
48
+ }
13
49
  },
14
- overlay: {
15
- type: Boolean,
16
- default: !0
17
- },
18
- navList: {
19
- default: () => [],
20
- type: Array
21
- },
22
- activeColor: {
23
- default: "",
24
- type: String
25
- },
26
- activeText: {
27
- default: "",
28
- type: String
29
- },
30
- unActiveText: {
31
- default: "",
32
- type: String
33
- },
34
- position: {
35
- default: () => ({
36
- top: "auto",
37
- bottom: "auto"
38
- }),
39
- type: Object
40
- },
41
- type: {
42
- default: "right",
43
- type: String
50
+ emits: ["update:visible", "selected"],
51
+ setup(props, { emit }) {
52
+ const classes = computed(() => {
53
+ const prefixCls = componentName;
54
+ return {
55
+ [prefixCls]: true,
56
+ active: props.visible,
57
+ [props.type]: true
58
+ };
59
+ });
60
+ const current = ref(-1);
61
+ const updateValue = (value = !props.visible) => {
62
+ emit("update:visible", value);
63
+ };
64
+ const selected = (item, event) => {
65
+ emit("selected", {
66
+ item,
67
+ event
68
+ });
69
+ current.value = item.id;
70
+ };
71
+ return { classes, updateValue, selected, translate, current };
44
72
  }
45
- },
46
- emits: ["update:visible", "selected"],
47
- setup(n, { emit: a }) {
48
- const c = g(() => ({
49
- [x]: !0,
50
- active: n.visible,
51
- [n.type]: !0
52
- })), r = $(-1);
53
- return { classes: c, updateValue: (o = !n.visible) => {
54
- a("update:visible", o);
55
- }, selected: (o, t) => {
56
- a("selected", {
57
- item: o,
58
- event: t
59
- }), r.value = o.id;
60
- }, translate: A, current: r };
61
- }
62
- }), { create: z } = b("fixed-nav"), E = z(
63
- N({
64
- [y.name]: y,
65
- Left: B
73
+ };
74
+ };
75
+ const { create } = createComponent("fixed-nav");
76
+ const _sfc_main = create(
77
+ component({
78
+ [Overlay.name]: Overlay,
79
+ Left
66
80
  })
67
- ), O = { class: "nut-fixed-nav__list" }, j = ["onClick"], D = ["src"], F = { class: "span" }, q = {
81
+ );
82
+ const _hoisted_1 = { class: "nut-fixed-nav__list" };
83
+ const _hoisted_2 = ["onClick"];
84
+ const _hoisted_3 = ["src"];
85
+ const _hoisted_4 = { class: "span" };
86
+ const _hoisted_5 = {
68
87
  key: 0,
69
88
  class: "b"
70
- }, G = { class: "text" };
71
- function H(e, n, a, c, r, C) {
72
- const d = p("nut-overlay"), o = p("Left");
73
- return s(), i("view", {
74
- class: v(e.classes),
75
- style: S(e.position)
89
+ };
90
+ const _hoisted_6 = { class: "text" };
91
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
92
+ const _component_nut_overlay = resolveComponent("nut-overlay");
93
+ const _component_Left = resolveComponent("Left");
94
+ return openBlock(), createElementBlock("view", {
95
+ class: normalizeClass(_ctx.classes),
96
+ style: normalizeStyle(_ctx.position)
76
97
  }, [
77
- e.overlay ? (s(), V(d, {
98
+ _ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, {
78
99
  key: 0,
79
- visible: e.visible,
100
+ visible: _ctx.visible,
80
101
  "z-index": 200,
81
- onClick: n[0] || (n[0] = (t) => e.updateValue(!1))
82
- }, null, 8, ["visible"])) : f("", !0),
83
- m(e.$slots, "list", {}, () => [
84
- l("view", O, [
85
- (s(!0), i(w, null, L(e.navList, (t, k) => (s(), i("view", {
86
- class: v(["nut-fixed-nav__list-item", { active: t.id == e.current }]),
87
- onClick: (_) => e.selected(t, _),
88
- key: t.id || k
89
- }, [
90
- l("img", {
91
- src: t.icon
92
- }, null, 8, D),
93
- l("view", F, u(t.text), 1),
94
- t.num ? (s(), i("view", q, u(t.num), 1)) : f("", !0)
95
- ], 10, j))), 128))
102
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.updateValue(false))
103
+ }, null, 8, ["visible"])) : createCommentVNode("", true),
104
+ renderSlot(_ctx.$slots, "list", {}, () => [
105
+ createElementVNode("view", _hoisted_1, [
106
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.navList, (item, index2) => {
107
+ return openBlock(), createElementBlock("view", {
108
+ class: normalizeClass(["nut-fixed-nav__list-item", { active: item.id == _ctx.current }]),
109
+ onClick: ($event) => _ctx.selected(item, $event),
110
+ key: item.id || index2
111
+ }, [
112
+ createElementVNode("img", {
113
+ src: item.icon
114
+ }, null, 8, _hoisted_3),
115
+ createElementVNode("view", _hoisted_4, toDisplayString(item.text), 1),
116
+ item.num ? (openBlock(), createElementBlock("view", _hoisted_5, toDisplayString(item.num), 1)) : createCommentVNode("", true)
117
+ ], 10, _hoisted_2);
118
+ }), 128))
96
119
  ])
97
120
  ]),
98
- l("div", {
121
+ createElementVNode("div", {
99
122
  class: "nut-fixed-nav__btn",
100
- onClick: n[1] || (n[1] = (t) => e.updateValue())
123
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.updateValue())
101
124
  }, [
102
- m(e.$slots, "btn", {}, () => [
103
- T(o, { color: "#fff" }),
104
- l("view", G, u(e.visible ? e.activeText || e.translate("activeText") : e.unActiveText || e.translate("unActiveText")), 1)
125
+ renderSlot(_ctx.$slots, "btn", {}, () => [
126
+ createVNode(_component_Left, { color: "#fff" }),
127
+ createElementVNode("view", _hoisted_6, toDisplayString(_ctx.visible ? _ctx.activeText || _ctx.translate("activeText") : _ctx.unActiveText || _ctx.translate("unActiveText")), 1)
105
128
  ])
106
129
  ])
107
130
  ], 6);
108
131
  }
109
- const R = /* @__PURE__ */ h(E, [["render", H]]);
132
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", render]]);
110
133
  export {
111
- R as default
134
+ index as default
112
135
  };