@nutui/nutui 4.0.12-beta.1 → 4.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.js +1 -1
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +111 -78
- package/dist/packages/_es/Address.js +375 -250
- package/dist/packages/_es/AddressList.js +354 -269
- package/dist/packages/_es/Animate.js +58 -41
- package/dist/packages/_es/Audio.js +197 -128
- package/dist/packages/_es/AudioOperate.js +71 -60
- package/dist/packages/_es/Avatar.js +89 -66
- package/dist/packages/_es/AvatarGroup.js +31 -23
- package/dist/packages/_es/Backtop.js +99 -59
- package/dist/packages/_es/Badge.js +47 -36
- package/dist/packages/_es/Barrage.js +147 -68
- package/dist/packages/_es/Button.js +66 -47
- package/dist/packages/_es/Calendar.js +157 -135
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +56 -42
- package/dist/packages/_es/Cascader.js +474 -315
- package/dist/packages/_es/Category.js +39 -29
- package/dist/packages/_es/CategoryPane.js +83 -57
- package/dist/packages/_es/Cell.js +71 -56
- package/dist/packages/_es/CellGroup.js +27 -19
- package/dist/packages/_es/Checkbox.js +156 -109
- package/dist/packages/_es/CheckboxGroup.js +59 -38
- package/dist/packages/_es/CircleProgress.js +96 -67
- package/dist/packages/_es/Col.js +31 -23
- package/dist/packages/_es/Collapse.js +58 -33
- package/dist/packages/_es/CollapseItem.js +108 -78
- package/dist/packages/_es/Comment.js +279 -207
- package/dist/packages/_es/ConfigProvider.js +55 -37
- package/dist/packages/_es/Countdown.js +212 -100
- package/dist/packages/_es/Countup.js +445 -232
- package/dist/packages/_es/DatePicker.js +265 -162
- package/dist/packages/_es/Dialog.js +213 -161
- package/dist/packages/_es/Divider.js +57 -42
- package/dist/packages/_es/Drag.js +153 -70
- package/dist/packages/_es/Ecard.js +104 -64
- package/dist/packages/_es/Elevator.js +219 -143
- package/dist/packages/_es/Ellipsis.js +178 -95
- package/dist/packages/_es/Empty.js +39 -23
- package/dist/packages/_es/FixedNav.js +116 -93
- package/dist/packages/_es/Form.js +178 -107
- package/dist/packages/_es/FormItem.js +61 -48
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +84 -58
- package/dist/packages/_es/Image.js +130 -90
- package/dist/packages/_es/ImagePreview.js +412 -256
- package/dist/packages/_es/Indicator.js +34 -30
- package/dist/packages/_es/InfiniteLoading.js +136 -83
- package/dist/packages/_es/Input.js +264 -160
- package/dist/packages/_es/InputNumber.js +117 -81
- package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
- package/dist/packages/_es/Invoice.js +130 -104
- package/dist/packages/_es/Layout.js +4 -3
- package/dist/packages/_es/List.js +215 -117
- package/dist/packages/_es/Menu.js +150 -95
- package/dist/packages/_es/MenuItem.js +154 -109
- package/dist/packages/_es/Navbar.js +119 -103
- package/dist/packages/_es/Noticebar.js +312 -197
- package/dist/packages/_es/Notify.js +166 -110
- package/dist/packages/_es/NumberKeyboard.js +202 -127
- package/dist/packages/_es/Overlay.js +80 -52
- package/dist/packages/_es/Pagination.js +100 -70
- package/dist/packages/_es/Picker.js +437 -275
- package/dist/packages/_es/Popover.js +225 -122
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +82 -44
- package/dist/packages/_es/Progress.js +79 -63
- package/dist/packages/_es/PullRefresh.js +173 -95
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +347 -204
- package/dist/packages/_es/Rate.js +141 -92
- package/dist/packages/_es/Row.js +27 -21
- package/dist/packages/_es/Searchbar.js +174 -123
- package/dist/packages/_es/ShortPassword.js +93 -69
- package/dist/packages/_es/SideNavbar.js +80 -49
- package/dist/packages/_es/SideNavbarItem.js +32 -22
- package/dist/packages/_es/Signature.js +146 -83
- package/dist/packages/_es/Skeleton.js +130 -110
- package/dist/packages/_es/Sku.js +343 -250
- package/dist/packages/_es/Step.js +86 -59
- package/dist/packages/_es/Steps.js +31 -26
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +74 -52
- package/dist/packages/_es/Swipe.js +155 -83
- package/dist/packages/_es/Swiper.js +311 -174
- package/dist/packages/_es/SwiperItem.js +44 -28
- package/dist/packages/_es/Switch.js +68 -55
- package/dist/packages/_es/TabPane.js +41 -30
- package/dist/packages/_es/Tabbar.js +52 -41
- package/dist/packages/_es/TabbarItem.js +82 -61
- package/dist/packages/_es/Table.js +165 -109
- package/dist/packages/_es/Tabs.js +388 -240
- package/dist/packages/_es/Tag.js +61 -44
- package/dist/packages/_es/Textarea.js +124 -80
- package/dist/packages/_es/TimeDetail.js +76 -49
- package/dist/packages/_es/TimePannel.js +48 -34
- package/dist/packages/_es/TimeSelect.js +68 -47
- package/dist/packages/_es/Toast.js +218 -144
- package/dist/packages/_es/Tour.js +192 -138
- package/dist/packages/_es/TrendArrow.js +77 -57
- package/dist/packages/_es/Uploader.js +359 -234
- package/dist/packages/_es/Video.js +316 -191
- package/dist/packages/_es/Watermark.js +117 -84
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
- package/dist/packages/_es/common-b9a5e726.js +145 -0
- package/dist/packages/_es/component-81a4c1d0.js +145 -0
- package/dist/packages/_es/index-29892cda.js +33 -0
- package/dist/packages/_es/index-43c34ac6.js +30 -0
- package/dist/packages/_es/index-54d03fc1.js +8 -0
- package/dist/packages/_es/index-79c5dc33.js +10 -0
- package/dist/packages/_es/index-7a7385e4.js +67 -0
- package/dist/packages/_es/index-87422be8.js +942 -0
- package/dist/packages/_es/index-da0a7662.js +259 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
- package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
- package/dist/packages/_es/raf-729dad54.js +25 -0
- package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
- package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
- package/dist/packages/locale/lang/en-US.js +39 -36
- package/dist/packages/locale/lang/id-ID.js +39 -36
- package/dist/packages/locale/lang/index.js +44 -22
- package/dist/packages/locale/lang/zh-CN.js +38 -35
- package/dist/packages/locale/lang/zh-TW.js +38 -35
- package/dist/resolver/index.js +26 -1
- package/dist/resolver/index.mjs +17 -14
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +50 -50
- package/dist/styles/themes/jdb.scss +50 -50
- package/dist/styles/themes/jddkh.scss +50 -50
- package/dist/styles/themes/jdt.scss +50 -50
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
- package/dist/packages/_es/common-d218746f.js +0 -116
- package/dist/packages/_es/component-234624bc.js +0 -89
- package/dist/packages/_es/index-14dfadc4.js +0 -561
- package/dist/packages/_es/index-192a3ef6.js +0 -29
- package/dist/packages/_es/index-360c5092.js +0 -210
- package/dist/packages/_es/index-496e6e05.js +0 -24
- package/dist/packages/_es/index-50eed3d9.js +0 -7
- package/dist/packages/_es/index-53ec2d4d.js +0 -34
- package/dist/packages/_es/index-fadb0974.js +0 -8
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
- package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
- package/dist/packages/_es/pxCheck-38173291.js +0 -4
- package/dist/packages/_es/raf-a74f1a06.js +0 -16
- package/dist/packages/_es/renderIcon-47498b32.js +0 -5
- package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
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(
|
|
50
|
-
const
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
|
|
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:
|
|
65
|
+
expanded: false
|
|
56
66
|
//是否折叠
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
)
|
|
66
|
-
|
|
81
|
+
);
|
|
82
|
+
onMounted(() => {
|
|
83
|
+
createContainer();
|
|
67
84
|
});
|
|
68
|
-
const
|
|
69
|
-
if (!
|
|
85
|
+
const createContainer = () => {
|
|
86
|
+
if (!root.value)
|
|
70
87
|
return;
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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:
|
|
102
|
-
tailing:
|
|
165
|
+
leading: props.content.slice(0, leftPart[0]) + props.symbol,
|
|
166
|
+
tailing: props.symbol + props.content.slice(rightPart[1], end)
|
|
103
167
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
|
110
|
-
return
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
|
196
|
+
return __spreadProps(__spreadValues({}, toRefs(state)), { root, ellipsis, classes, clickHandle, handleClick });
|
|
117
197
|
}
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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:
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
])) :
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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:
|
|
141
|
-
},
|
|
142
|
-
])) :
|
|
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
|
|
228
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
146
229
|
export {
|
|
147
|
-
|
|
230
|
+
index as default
|
|
148
231
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { toRefs
|
|
2
|
-
import { c as
|
|
3
|
-
import { _ as
|
|
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
|
|
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
|
-
}
|
|
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(
|
|
28
|
-
const { image
|
|
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
|
|
31
|
-
imgStyle
|
|
32
|
-
translate
|
|
43
|
+
imageUrl,
|
|
44
|
+
imgStyle,
|
|
45
|
+
translate
|
|
33
46
|
};
|
|
34
47
|
}
|
|
35
|
-
})
|
|
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
|
|
40
|
-
return
|
|
41
|
-
|
|
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:
|
|
59
|
+
style: normalizeStyle(_ctx.imgStyle)
|
|
44
60
|
}, [
|
|
45
|
-
|
|
46
|
-
|
|
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:
|
|
50
|
-
}, null, 8,
|
|
65
|
+
src: _ctx.imageUrl
|
|
66
|
+
}, null, 8, _hoisted_2)) : createCommentVNode("", true)
|
|
51
67
|
], 64))
|
|
52
68
|
], 4),
|
|
53
|
-
|
|
54
|
-
|
|
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
|
|
73
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
58
74
|
export {
|
|
59
|
-
|
|
75
|
+
index as default
|
|
60
76
|
};
|
|
@@ -1,112 +1,135 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { computed
|
|
3
|
-
import
|
|
4
|
-
import { Left
|
|
5
|
-
import { _ as
|
|
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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
)
|
|
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
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
98
|
+
_ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, {
|
|
78
99
|
key: 0,
|
|
79
|
-
visible:
|
|
100
|
+
visible: _ctx.visible,
|
|
80
101
|
"z-index": 200,
|
|
81
|
-
onClick:
|
|
82
|
-
}, null, 8, ["visible"])) :
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
-
|
|
121
|
+
createElementVNode("div", {
|
|
99
122
|
class: "nut-fixed-nav__btn",
|
|
100
|
-
onClick:
|
|
123
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.updateValue())
|
|
101
124
|
}, [
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
|
132
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", render]]);
|
|
110
133
|
export {
|
|
111
|
-
|
|
134
|
+
index as default
|
|
112
135
|
};
|