@nutui/nutui 3.1.13-beta.1 → 3.1.15-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/README.md +10 -19
- package/dist/nutui.d.ts +12 -5
- package/dist/nutui.es.js +1586 -859
- package/dist/nutui.umd.js +1600 -866
- package/dist/packages/_es/ActionSheet.js +1 -1
- package/dist/packages/_es/Address.js +19 -22
- package/dist/packages/_es/Avatar.js +1 -1
- package/dist/packages/_es/BackTop.js +1 -1
- package/dist/packages/_es/Badge.js +1 -1
- package/dist/packages/_es/Barrage.js +1 -1
- package/dist/packages/_es/Button.js +1 -1
- package/dist/packages/_es/Calendar.js +1 -1
- package/dist/packages/_es/Card.js +1 -1
- package/dist/packages/_es/Cascader.js +1 -1
- package/dist/packages/_es/Cell.js +1 -1
- package/dist/packages/_es/CellGroup.js +1 -1
- package/dist/packages/_es/Checkbox.js +1 -1
- package/dist/packages/_es/CheckboxGroup.js +1 -1
- package/dist/packages/_es/CircleProgress.js +1 -1
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +1 -1
- package/dist/packages/_es/CollapseItem.js +1 -1
- package/dist/packages/_es/CountDown.js +2 -3
- package/dist/packages/_es/CountUp.js +1 -1
- package/dist/packages/_es/DatePicker.js +1 -1
- package/dist/packages/_es/Dialog.js +1 -1
- package/dist/packages/_es/Divider.js +1 -1
- package/dist/packages/_es/Drag.js +1 -1
- package/dist/packages/_es/Elevator.js +1 -1
- package/dist/packages/_es/Empty.js +74 -0
- package/dist/packages/_es/FixedNav.js +1 -1
- package/dist/packages/_es/Form.js +21 -5
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +1 -1
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/ImagePreview.js +104 -10
- package/dist/packages/_es/Indicator.js +66 -0
- package/dist/packages/_es/InfiniteLoading.js +1 -1
- package/dist/packages/_es/Input.js +1 -1
- package/dist/packages/_es/InputNumber.js +2 -2
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/Menu.js +3 -3
- package/dist/packages/_es/MenuItem.js +1 -1
- package/dist/packages/_es/Navbar.js +1 -1
- package/dist/packages/_es/NoticeBar.js +1 -1
- package/dist/packages/_es/Notify.js +1 -1
- package/dist/packages/_es/NumberKeyboard.js +1 -1
- package/dist/packages/_es/OverLay.js +1 -1
- package/dist/packages/_es/Pagination.js +1 -1
- package/dist/packages/_es/Picker.js +1 -1
- package/dist/packages/_es/Popover.js +1 -1
- package/dist/packages/_es/Popup.js +8 -4
- package/dist/packages/_es/Price.js +1 -1
- package/dist/packages/_es/Progress.js +1 -1
- package/dist/packages/_es/Radio.js +1 -1
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +1 -1
- package/dist/packages/_es/Rate.js +1 -1
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +1 -1
- package/dist/packages/_es/ShortPassword.js +1 -1
- package/dist/packages/_es/SideNavBar.js +104 -0
- package/dist/packages/_es/SideNavBarItem.js +50 -0
- package/dist/packages/_es/Signature.js +1 -1
- package/dist/packages/_es/Skeleton.js +138 -0
- package/dist/packages/_es/Sku.js +1 -1
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/SubSideNavBar.js +104 -0
- package/dist/packages/_es/Swipe.js +1 -1
- package/dist/packages/_es/Swiper.js +1 -1
- package/dist/packages/_es/SwiperItem.js +1 -1
- package/dist/packages/_es/Switch.js +16 -6
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +1 -1
- package/dist/packages/_es/TabbarItem.js +1 -1
- package/dist/packages/_es/Table.js +191 -0
- package/dist/packages/_es/Tabs.js +1 -1
- package/dist/packages/_es/Tag.js +1 -1
- package/dist/packages/_es/TextArea.js +2 -2
- package/dist/packages/_es/TimeDetail.js +1 -1
- package/dist/packages/_es/TimePannel.js +1 -1
- package/dist/packages/_es/TimeSelect.js +1 -1
- package/dist/packages/_es/Toast.js +1 -1
- package/dist/packages/_es/Uploader.js +1 -1
- package/dist/packages/_es/Video.js +1 -1
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index2.js +1 -1
- package/dist/packages/_es/index3.js +1 -1
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/util.js +1 -1
- package/dist/packages/actionsheet/index.scss +2 -2
- package/dist/packages/address/index.scss +2 -0
- package/dist/packages/cascader/index.scss +13 -13
- package/dist/packages/empty/index.scss +33 -0
- package/dist/packages/formitem/index.scss +1 -1
- package/dist/packages/imagepreview/index.scss +1 -0
- package/dist/packages/indicator/index.scss +48 -0
- package/dist/packages/menu/index.scss +10 -6
- package/dist/packages/menuitem/index.scss +8 -7
- package/dist/packages/noticebar/index.scss +11 -11
- package/dist/packages/picker/index.scss +2 -6
- package/dist/packages/progress/index.scss +2 -8
- package/dist/packages/shortpassword/index.scss +6 -6
- package/dist/packages/sidenavbar/index.scss +14 -0
- package/dist/packages/sidenavbaritem/index.scss +10 -0
- package/dist/packages/skeleton/index.scss +57 -0
- package/dist/packages/sku/index.scss +1 -1
- package/dist/packages/subsidenavbar/index.scss +39 -0
- package/dist/packages/table/index.scss +81 -0
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +44 -37
- package/dist/styles/themes/jdd.scss +2 -0
- package/dist/styles/variables.scss +95 -68
- package/package.json +5 -2
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -15,11 +15,11 @@ var __spreadValues = (a, b) => {
|
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
17
|
/*!
|
|
18
|
-
* @nutui/nutui v3.1.
|
|
18
|
+
* @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
|
|
19
19
|
* (c) 2021 @jdf2e.
|
|
20
20
|
* Released under the MIT License.
|
|
21
21
|
*/
|
|
22
|
-
import { ref,
|
|
22
|
+
import { ref, computed, reactive, watch, toRefs, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, withDirectives, createVNode, vShow, toDisplayString, createCommentVNode, createElementBlock, Fragment, renderList, normalizeClass, normalizeStyle, createTextVNode, nextTick } from "vue";
|
|
23
23
|
import { c as createComponent } from "./component.js";
|
|
24
24
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
25
25
|
const { componentName, create } = createComponent("address");
|
|
@@ -94,12 +94,7 @@ const _sfc_main = create({
|
|
|
94
94
|
emits: ["update:visible", "type", "change", "selected", "close", "close-mask", "switch-module"],
|
|
95
95
|
setup(props, { emit }) {
|
|
96
96
|
const regionLine = ref(null);
|
|
97
|
-
const
|
|
98
|
-
province: ref(null),
|
|
99
|
-
city: ref(null),
|
|
100
|
-
country: ref(null),
|
|
101
|
-
town: ref(null)
|
|
102
|
-
});
|
|
97
|
+
const tabRegion = ref(null);
|
|
103
98
|
const showPopup = ref(props.visible);
|
|
104
99
|
const privateType = ref(props.type);
|
|
105
100
|
const tabIndex = ref(0);
|
|
@@ -170,8 +165,9 @@ const _sfc_main = create({
|
|
|
170
165
|
closeWay.value = "mask";
|
|
171
166
|
};
|
|
172
167
|
const lineAnimation = () => {
|
|
173
|
-
|
|
168
|
+
console.log("\u6ED1\u52A8\u7EA2\u7EBF");
|
|
174
169
|
nextTick(() => {
|
|
170
|
+
const name = tabRegion.value && tabRegion.value.getElementsByClassName("active")[0];
|
|
175
171
|
if (name) {
|
|
176
172
|
const distance = name.offsetLeft;
|
|
177
173
|
lineDistance.value = distance ? distance : 20;
|
|
@@ -299,7 +295,7 @@ const _sfc_main = create({
|
|
|
299
295
|
}
|
|
300
296
|
});
|
|
301
297
|
});
|
|
302
|
-
return __spreadValues(
|
|
298
|
+
return __spreadValues({
|
|
303
299
|
showPopup,
|
|
304
300
|
privateType,
|
|
305
301
|
tabIndex,
|
|
@@ -313,13 +309,14 @@ const _sfc_main = create({
|
|
|
313
309
|
getTabName,
|
|
314
310
|
nextAreaList,
|
|
315
311
|
regionLine,
|
|
312
|
+
tabRegion,
|
|
316
313
|
lineDistance,
|
|
317
314
|
changeRegionTab,
|
|
318
315
|
selectedExist,
|
|
319
316
|
clickOverlay,
|
|
320
317
|
handClose,
|
|
321
318
|
handleElevatorItem
|
|
322
|
-
}, toRefs(props))
|
|
319
|
+
}, toRefs(props));
|
|
323
320
|
}
|
|
324
321
|
});
|
|
325
322
|
const _hoisted_1 = { class: "nut-address" };
|
|
@@ -329,7 +326,10 @@ const _hoisted_4 = {
|
|
|
329
326
|
key: 0,
|
|
330
327
|
class: "custom-address"
|
|
331
328
|
};
|
|
332
|
-
const _hoisted_5 = {
|
|
329
|
+
const _hoisted_5 = {
|
|
330
|
+
class: "region-tab",
|
|
331
|
+
ref: "tabRegion"
|
|
332
|
+
};
|
|
333
333
|
const _hoisted_6 = ["onClick"];
|
|
334
334
|
const _hoisted_7 = { class: "region-con" };
|
|
335
335
|
const _hoisted_8 = { class: "region-group" };
|
|
@@ -338,7 +338,10 @@ const _hoisted_10 = {
|
|
|
338
338
|
key: 1,
|
|
339
339
|
class: "custom-address"
|
|
340
340
|
};
|
|
341
|
-
const _hoisted_11 = {
|
|
341
|
+
const _hoisted_11 = {
|
|
342
|
+
class: "region-tab",
|
|
343
|
+
ref: "tabRegion"
|
|
344
|
+
};
|
|
342
345
|
const _hoisted_12 = ["onClick"];
|
|
343
346
|
const _hoisted_13 = { class: "elevator-group" };
|
|
344
347
|
const _hoisted_14 = {
|
|
@@ -402,8 +405,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
402
405
|
return openBlock(), createElementBlock("view", {
|
|
403
406
|
class: normalizeClass(["tab-item", [index2 == _ctx.tabIndex ? "active" : ""]]),
|
|
404
407
|
key: index2,
|
|
405
|
-
ref_for: true,
|
|
406
|
-
ref: key,
|
|
407
408
|
onClick: ($event) => _ctx.changeRegionTab(item, key, index2)
|
|
408
409
|
}, [
|
|
409
410
|
createElementVNode("view", null, toDisplayString(_ctx.getTabName(item, index2)), 1)
|
|
@@ -414,7 +415,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
414
415
|
ref: "regionLine",
|
|
415
416
|
style: normalizeStyle({ left: _ctx.lineDistance + "px" })
|
|
416
417
|
}, null, 4)
|
|
417
|
-
]),
|
|
418
|
+
], 512),
|
|
418
419
|
createElementVNode("view", _hoisted_7, [
|
|
419
420
|
createElementVNode("ul", _hoisted_8, [
|
|
420
421
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.regionList[_ctx.tabName[_ctx.tabIndex]], (item, index2) => {
|
|
@@ -428,7 +429,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
428
429
|
class: "region-item-icon",
|
|
429
430
|
type: "self",
|
|
430
431
|
name: _ctx.selectedIcon,
|
|
431
|
-
color: "#FA2C19",
|
|
432
432
|
size: "13px"
|
|
433
433
|
}, null, 8, ["name"])) : createCommentVNode("", true),
|
|
434
434
|
createTextVNode(toDisplayString(item.name), 1)
|
|
@@ -442,8 +442,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
442
442
|
return openBlock(), createElementBlock("view", {
|
|
443
443
|
class: normalizeClass(["tab-item", [index2 == _ctx.tabIndex ? "active" : ""]]),
|
|
444
444
|
key: index2,
|
|
445
|
-
ref_for: true,
|
|
446
|
-
ref: key,
|
|
447
445
|
onClick: ($event) => _ctx.changeRegionTab(item, key, index2)
|
|
448
446
|
}, [
|
|
449
447
|
createElementVNode("view", null, toDisplayString(_ctx.getTabName(item, index2)), 1)
|
|
@@ -454,7 +452,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
454
452
|
ref: "regionLine",
|
|
455
453
|
style: normalizeStyle({ left: _ctx.lineDistance + "px" })
|
|
456
454
|
}, null, 4)
|
|
457
|
-
]),
|
|
455
|
+
], 512),
|
|
458
456
|
createElementVNode("view", _hoisted_13, [
|
|
459
457
|
createVNode(_component_nut_elevator, {
|
|
460
458
|
height: _ctx.height,
|
|
@@ -475,9 +473,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
475
473
|
class: "exist-item-icon",
|
|
476
474
|
type: "self",
|
|
477
475
|
name: item.selectedAddress ? _ctx.selectedIcon : _ctx.defaultIcon,
|
|
478
|
-
color: item.selectedAddress ? "#FA2C19" : "",
|
|
479
476
|
size: "13px"
|
|
480
|
-
}, null, 8, ["name"
|
|
477
|
+
}, null, 8, ["name"]),
|
|
481
478
|
createElementVNode("div", _hoisted_18, [
|
|
482
479
|
item.name && item.phone ? (openBlock(), createElementBlock("div", _hoisted_19, [
|
|
483
480
|
createElementVNode("div", _hoisted_20, toDisplayString(item.name), 1),
|
|
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
|
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
17
|
/*!
|
|
18
|
-
* @nutui/nutui v3.1.
|
|
18
|
+
* @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
|
|
19
19
|
* (c) 2021 @jdf2e.
|
|
20
20
|
* Released under the MIT License.
|
|
21
21
|
*/
|
|
@@ -35,7 +35,7 @@ var __publicField = (obj, key, value) => {
|
|
|
35
35
|
return value;
|
|
36
36
|
};
|
|
37
37
|
/*!
|
|
38
|
-
* @nutui/nutui v3.1.
|
|
38
|
+
* @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
|
|
39
39
|
* (c) 2021 @jdf2e.
|
|
40
40
|
* Released under the MIT License.
|
|
41
41
|
*/
|
package/dist/packages/_es/Col.js
CHANGED
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -64,7 +64,6 @@ const _sfc_main = create({
|
|
|
64
64
|
components: {},
|
|
65
65
|
emits: ["input", "on-end", "on-restart", "on-paused", "update:modelValue"],
|
|
66
66
|
setup(props, { emit, slots }) {
|
|
67
|
-
console.log("componentName", componentName);
|
|
68
67
|
const state = reactive({
|
|
69
68
|
restTime: 0,
|
|
70
69
|
p: 0,
|
|
@@ -130,7 +129,7 @@ const _sfc_main = create({
|
|
|
130
129
|
if (!props.paused) {
|
|
131
130
|
let restTime2 = end - (Date.now() - state.p + diffTime);
|
|
132
131
|
state.restTime = restTime2;
|
|
133
|
-
if (restTime2 <
|
|
132
|
+
if (restTime2 < 0) {
|
|
134
133
|
state.restTime = 0;
|
|
135
134
|
emit("on-end");
|
|
136
135
|
clearInterval(state.timer);
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -22,7 +22,7 @@ var __publicField = (obj, key, value) => {
|
|
|
22
22
|
return value;
|
|
23
23
|
};
|
|
24
24
|
/*!
|
|
25
|
-
* @nutui/nutui v3.1.
|
|
25
|
+
* @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
|
|
26
26
|
* (c) 2021 @jdf2e.
|
|
27
27
|
* Released under the MIT License.
|
|
28
28
|
*/
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2021 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import { toRefs, computed, openBlock, createElementBlock, createElementVNode, normalizeStyle, renderSlot, Fragment, createCommentVNode, toDisplayString } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
|
+
const { componentName, create } = createComponent("empty");
|
|
10
|
+
const defaultStatus = {
|
|
11
|
+
empty: "https://static-ftcms.jd.com/p/files/61a9e3183985005b3958672b.png",
|
|
12
|
+
error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
|
|
13
|
+
network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
|
|
14
|
+
};
|
|
15
|
+
const _sfc_main = create({
|
|
16
|
+
props: {
|
|
17
|
+
image: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: "empty"
|
|
20
|
+
},
|
|
21
|
+
imageSize: {
|
|
22
|
+
type: [Number, String],
|
|
23
|
+
default: ""
|
|
24
|
+
},
|
|
25
|
+
description: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "\u65E0\u5185\u5BB9"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
setup(props) {
|
|
31
|
+
const { image, imageSize } = toRefs(props);
|
|
32
|
+
const imgStyle = computed(() => {
|
|
33
|
+
if (!imageSize.value) {
|
|
34
|
+
return "";
|
|
35
|
+
}
|
|
36
|
+
if (typeof imageSize.value === "number") {
|
|
37
|
+
return `width:${imageSize.value}px;height:${imageSize.value}px`;
|
|
38
|
+
}
|
|
39
|
+
return `width:${imageSize.value};height:${imageSize.value}`;
|
|
40
|
+
});
|
|
41
|
+
const isHttpUrl = image.value.startsWith("https://") || image.value.startsWith("http://") || image.value.startsWith("//");
|
|
42
|
+
const imageUrl = isHttpUrl ? image.value : defaultStatus[image.value];
|
|
43
|
+
return {
|
|
44
|
+
imageUrl,
|
|
45
|
+
imgStyle
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const _hoisted_1 = { class: "nut-empty" };
|
|
50
|
+
const _hoisted_2 = ["src"];
|
|
51
|
+
const _hoisted_3 = {
|
|
52
|
+
key: 1,
|
|
53
|
+
class: "nut-empty-description"
|
|
54
|
+
};
|
|
55
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
56
|
+
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
57
|
+
createElementVNode("view", {
|
|
58
|
+
class: "nut-empty-image",
|
|
59
|
+
style: normalizeStyle(_ctx.imgStyle)
|
|
60
|
+
}, [
|
|
61
|
+
_ctx.$slots.image ? renderSlot(_ctx.$slots, "image", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
62
|
+
_ctx.imageUrl ? (openBlock(), createElementBlock("img", {
|
|
63
|
+
key: 0,
|
|
64
|
+
class: "img",
|
|
65
|
+
src: _ctx.imageUrl
|
|
66
|
+
}, null, 8, _hoisted_2)) : createCommentVNode("", true)
|
|
67
|
+
], 64))
|
|
68
|
+
], 4),
|
|
69
|
+
_ctx.$slots.description ? renderSlot(_ctx.$slots, "description", { key: 0 }) : (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(_ctx.description), 1)),
|
|
70
|
+
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 2 }) : createCommentVNode("", true)
|
|
71
|
+
]);
|
|
72
|
+
}
|
|
73
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
74
|
+
export { index as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -33,7 +33,7 @@ const component = {
|
|
|
33
33
|
const findFormItem = (vnodes) => {
|
|
34
34
|
let task = [];
|
|
35
35
|
vnodes.forEach((vnode, index2) => {
|
|
36
|
-
var _a, _b;
|
|
36
|
+
var _a, _b, _c;
|
|
37
37
|
let type = vnode.type;
|
|
38
38
|
type = type.name || type;
|
|
39
39
|
if (type == "nut-form-item") {
|
|
@@ -41,6 +41,8 @@ const component = {
|
|
|
41
41
|
prop: (_a = vnode.props) == null ? void 0 : _a["prop"],
|
|
42
42
|
rules: ((_b = vnode.props) == null ? void 0 : _b["rules"]) || []
|
|
43
43
|
});
|
|
44
|
+
} else if (Array.isArray(vnode.children) && ((_c = vnode.children) == null ? void 0 : _c.length)) {
|
|
45
|
+
task = task.concat(findFormItem(vnode.children));
|
|
44
46
|
}
|
|
45
47
|
});
|
|
46
48
|
return task;
|
|
@@ -59,7 +61,13 @@ const component = {
|
|
|
59
61
|
resolve(errorMsg);
|
|
60
62
|
});
|
|
61
63
|
};
|
|
62
|
-
const
|
|
64
|
+
const getPropByPath = (obj, keyPath) => {
|
|
65
|
+
return keyPath.split(".").reduce((prev, curr) => prev[curr], obj);
|
|
66
|
+
};
|
|
67
|
+
if (!prop) {
|
|
68
|
+
console.warn("[NutUI] <FormItem> \u4F7F\u7528 rules \u6821\u9A8C\u89C4\u5219\u65F6 , \u5FC5\u987B\u8BBE\u7F6E prop \u53C2\u6570");
|
|
69
|
+
}
|
|
70
|
+
let value = getPropByPath(props.modelValue, prop || "");
|
|
63
71
|
tipMessage({ prop, message: "" });
|
|
64
72
|
while (rules.length) {
|
|
65
73
|
const { required, validator, regex, message } = rules.shift();
|
|
@@ -94,11 +102,19 @@ const component = {
|
|
|
94
102
|
}
|
|
95
103
|
return Promise.resolve(true);
|
|
96
104
|
};
|
|
97
|
-
const validate = () => {
|
|
105
|
+
const validate = (customProp = "") => {
|
|
98
106
|
return new Promise((resolve, reject) => {
|
|
99
107
|
let task = findFormItem(slots.default());
|
|
100
108
|
let errors = task.map((item) => {
|
|
101
|
-
|
|
109
|
+
if (customProp) {
|
|
110
|
+
if (customProp == item.prop) {
|
|
111
|
+
return checkRule(item);
|
|
112
|
+
} else {
|
|
113
|
+
return Promise.resolve(true);
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
return checkRule(item);
|
|
117
|
+
}
|
|
102
118
|
});
|
|
103
119
|
Promise.all(errors).then((errorRes) => {
|
|
104
120
|
errorRes = errorRes.filter((item) => item != true);
|