@nutui/nutui 4.0.9 → 4.0.10

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 (168) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/nutui.es.js +1 -1
  3. package/dist/nutui.js +15382 -0
  4. package/dist/nutui.umd.js +1 -7
  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 +96 -152
  59. package/dist/packages/_es/MenuItem.js +117 -172
  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 -441
  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 +130 -179
  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/packages/col/index.scss +2 -2
  126. package/dist/packages/menuitem/index.scss +7 -10
  127. package/dist/packages/searchbar/index.scss +4 -0
  128. package/dist/smartips/web-types.json +2 -2
  129. package/dist/style.css +1 -1
  130. package/dist/styles/themes/default.scss +158 -55
  131. package/dist/styles/themes/jdb.scss +158 -55
  132. package/dist/styles/themes/jddkh.scss +158 -55
  133. package/dist/styles/themes/jdt.scss +158 -55
  134. package/dist/types/__VUE/address/index.vue.d.ts +1 -1
  135. package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
  136. package/dist/types/__VUE/image/index.vue.d.ts +2 -2
  137. package/dist/types/__VUE/menu/index.vue.d.ts +0 -2
  138. package/dist/types/__VUE/menuitem/index.vue.d.ts +9 -17
  139. package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
  140. package/dist/types/__VUE/picker/usePicker.d.ts +1 -1
  141. package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
  142. package/dist/types/__VUE/row/index.vue.d.ts +1 -1
  143. package/dist/types/__VUE/searchbar/index.vue.d.ts +121 -5
  144. package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
  145. package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
  146. package/dist/types/__VUE/table/common.d.ts +55 -2
  147. package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
  148. package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
  149. package/dist/types/index.d.ts +1 -1
  150. package/package.json +2 -2
  151. package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
  152. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
  153. package/dist/packages/_es/common-b9a5e726.js +0 -145
  154. package/dist/packages/_es/component-81a4c1d0.js +0 -145
  155. package/dist/packages/_es/index-29892cda.js +0 -33
  156. package/dist/packages/_es/index-43c34ac6.js +0 -30
  157. package/dist/packages/_es/index-54d03fc1.js +0 -8
  158. package/dist/packages/_es/index-79c5dc33.js +0 -10
  159. package/dist/packages/_es/index-7a7385e4.js +0 -67
  160. package/dist/packages/_es/index-87422be8.js +0 -942
  161. package/dist/packages/_es/index-da0a7662.js +0 -259
  162. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
  163. package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
  164. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
  165. package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
  166. package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
  167. package/dist/packages/_es/raf-729dad54.js +0 -25
  168. package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
@@ -1,28 +1,20 @@
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";
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";
23
16
  import "../locale/lang";
24
- const { componentName, create } = createComponent("ellipsis");
25
- const _sfc_main = create({
17
+ const { componentName: K, create: Q } = G("ellipsis"), U = Q({
26
18
  props: {
27
19
  content: {
28
20
  type: String,
@@ -54,178 +46,103 @@ const _sfc_main = create({
54
46
  }
55
47
  },
56
48
  emits: ["click", "change"],
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,
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,
64
54
  //是否超出
65
- expanded: false
55
+ expanded: !1
66
56
  //是否折叠
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
- }
57
+ }), N = O(() => ({
58
+ [K]: !0
59
+ }));
60
+ R(
61
+ () => e.content,
62
+ (t, i) => {
63
+ t != i && T();
80
64
  }
81
- );
82
- onMounted(() => {
83
- createContainer();
65
+ ), j(() => {
66
+ T();
84
67
  });
85
- const createContainer = () => {
86
- if (!root.value)
68
+ const T = () => {
69
+ if (!o.value)
87
70
  return;
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);
124
- }
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
- }
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);
158
86
  }
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) {
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)
164
100
  return {
165
- leading: props.content.slice(0, leftPart[0]) + props.symbol,
166
- tailing: props.symbol + props.content.slice(rightPart[1], end)
101
+ leading: e.content.slice(0, t[0]) + e.symbol,
102
+ tailing: e.symbol + e.content.slice(i[1], a)
167
103
  };
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)
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)
180
108
  return 0;
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");
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");
195
115
  };
196
- return __spreadProps(__spreadValues({}, toRefs(state)), { root, ellipsis, classes, clickHandle, handleClick });
116
+ return w(v({}, q(s)), { root: o, ellipsis: g, classes: N, clickHandle: E, handleClick: B });
197
117
  }
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)),
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)),
206
123
  ref: "root"
207
124
  }, [
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", {
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", {
212
129
  key: 0,
213
130
  class: "nut-ellipsis__text",
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", {
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", {
221
138
  key: 0,
222
139
  class: "nut-ellipsis__text",
223
- onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.clickHandle(2), ["stop"]))
224
- }, toDisplayString(_ctx.collapseText), 1)) : createCommentVNode("", true)
225
- ])) : createCommentVNode("", true)
140
+ onClick: l[1] || (l[1] = M((s) => e.clickHandle(2), ["stop"]))
141
+ }, m(e.collapseText), 1)) : x("", !0)
142
+ ])) : x("", !0)
226
143
  ], 2);
227
144
  }
228
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
145
+ const le = /* @__PURE__ */ J(U, [["render", Z]]);
229
146
  export {
230
- index as default
147
+ le as default
231
148
  };
@@ -1,14 +1,12 @@
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";
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";
4
4
  import "../locale/lang";
5
- const { componentName, create, translate } = createComponent("empty");
6
- const defaultStatus = {
5
+ const { componentName: B, create: v, translate: $ } = y("empty"), S = {
7
6
  empty: "https://static-ftcms.jd.com/p/files/61a9e3183985005b3958672b.png",
8
7
  error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
9
8
  network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
10
- };
11
- const _sfc_main = create({
9
+ }, _ = v({
12
10
  props: {
13
11
  image: {
14
12
  type: String,
@@ -26,51 +24,37 @@ const _sfc_main = create({
26
24
  default: ""
27
25
  }
28
26
  },
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];
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}` : "");
42
29
  return {
43
- imageUrl,
44
- imgStyle,
45
- translate
30
+ imageUrl: s.value.startsWith("https://") || s.value.startsWith("http://") || s.value.startsWith("//") ? s.value : S[s.value],
31
+ imgStyle: i,
32
+ translate: $
46
33
  };
47
34
  }
48
- });
49
- const _hoisted_1 = { class: "nut-empty" };
50
- const _hoisted_2 = ["src"];
51
- const _hoisted_3 = {
35
+ }), k = { class: "nut-empty" }, b = ["src"], w = {
52
36
  key: 1,
53
37
  class: "nut-empty__description"
54
38
  };
55
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
56
- return openBlock(), createElementBlock("view", _hoisted_1, [
57
- createElementVNode("view", {
39
+ function U(e, s, t, i, l, p) {
40
+ return r(), a("view", k, [
41
+ u("view", {
58
42
  class: "nut-empty__box",
59
- style: normalizeStyle(_ctx.imgStyle)
43
+ style: d(e.imgStyle)
60
44
  }, [
61
- _ctx.$slots.image ? renderSlot(_ctx.$slots, "image", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
62
- _ctx.imageUrl ? (openBlock(), createElementBlock("img", {
45
+ e.$slots.image ? o(e.$slots, "image", { key: 0 }) : (r(), a(f, { key: 1 }, [
46
+ e.imageUrl ? (r(), a("img", {
63
47
  key: 0,
64
48
  class: "nut-empty__box--img",
65
- src: _ctx.imageUrl
66
- }, null, 8, _hoisted_2)) : createCommentVNode("", true)
49
+ src: e.imageUrl
50
+ }, null, 8, b)) : n("", !0)
67
51
  ], 64))
68
52
  ], 4),
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)
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)
71
55
  ]);
72
56
  }
73
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
57
+ const C = /* @__PURE__ */ h(_, [["render", U]]);
74
58
  export {
75
- index as default
59
+ C as default
76
60
  };
@@ -1,135 +1,112 @@
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";
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";
6
6
  import "../locale/lang";
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
- }
7
+ const { componentName: x, translate: A } = b("fixed-nav"), N = (e) => ({
8
+ components: e,
9
+ props: {
10
+ visible: {
11
+ type: Boolean,
12
+ default: !1
49
13
  },
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 };
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
72
44
  }
73
- };
74
- };
75
- const { create } = createComponent("fixed-nav");
76
- const _sfc_main = create(
77
- component({
78
- [Overlay.name]: Overlay,
79
- Left
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
80
66
  })
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 = {
67
+ ), O = { class: "nut-fixed-nav__list" }, j = ["onClick"], D = ["src"], F = { class: "span" }, q = {
87
68
  key: 0,
88
69
  class: "b"
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)
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)
97
76
  }, [
98
- _ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, {
77
+ e.overlay ? (s(), V(d, {
99
78
  key: 0,
100
- visible: _ctx.visible,
79
+ visible: e.visible,
101
80
  "z-index": 200,
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))
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))
119
96
  ])
120
97
  ]),
121
- createElementVNode("div", {
98
+ l("div", {
122
99
  class: "nut-fixed-nav__btn",
123
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.updateValue())
100
+ onClick: n[1] || (n[1] = (t) => e.updateValue())
124
101
  }, [
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)
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)
128
105
  ])
129
106
  ])
130
107
  ], 6);
131
108
  }
132
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", render]]);
109
+ const R = /* @__PURE__ */ h(E, [["render", H]]);
133
110
  export {
134
- index as default
111
+ R as default
135
112
  };