@nutui/nutui 3.1.22-beta.3 → 3.1.23-beta.0
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 +48 -0
- package/README.md +3 -4
- package/dist/nutui.es.js +20426 -4050
- package/dist/nutui.umd.js +20529 -4049
- package/dist/packages/_es/ActionSheet.js +149 -36
- package/dist/packages/_es/Address.js +535 -129
- package/dist/packages/_es/AddressList.js +615 -113
- package/dist/packages/_es/Animate.js +64 -0
- package/dist/packages/_es/Audio.js +257 -72
- package/dist/packages/_es/AudioOperate.js +100 -32
- package/dist/packages/_es/Avatar.js +162 -54
- package/dist/packages/_es/AvatarGroup.js +73 -14
- package/dist/packages/_es/BackTop.js +156 -43
- package/dist/packages/_es/Badge.js +86 -14
- package/dist/packages/_es/Barrage.js +120 -41
- package/dist/packages/_es/Button.js +128 -23
- package/dist/packages/_es/Calendar.js +246 -24
- package/dist/packages/_es/CalendarItem.js +2 -1
- package/dist/packages/_es/Card.js +107 -10
- package/dist/packages/_es/Cascader.js +496 -179
- package/dist/packages/_es/Category.js +58 -15
- package/dist/packages/_es/CategoryPane.js +111 -11
- package/dist/packages/_es/Cell.js +108 -21
- package/dist/packages/_es/CellGroup.js +44 -9
- package/dist/packages/_es/Checkbox.js +134 -29
- package/dist/packages/_es/CheckboxGroup.js +79 -29
- package/dist/packages/_es/CircleProgress.js +150 -28
- package/dist/packages/_es/Col.js +56 -14
- package/dist/packages/_es/Collapse.js +110 -24
- package/dist/packages/_es/CollapseItem.js +252 -80
- package/dist/packages/_es/Comment.js +434 -64
- package/dist/packages/_es/ConfigProvider.js +25 -0
- package/dist/packages/_es/CountDown.js +238 -75
- package/dist/packages/_es/CountUp.js +539 -159
- package/dist/packages/_es/DatePicker.js +315 -117
- package/dist/packages/_es/Dialog.js +289 -79
- package/dist/packages/_es/Divider.js +65 -32
- package/dist/packages/_es/Drag.js +197 -56
- package/dist/packages/_es/Ecard.js +159 -24
- package/dist/packages/_es/Elevator.js +255 -77
- package/dist/packages/_es/Ellipsis.js +206 -0
- package/dist/packages/_es/Empty.js +71 -12
- package/dist/packages/_es/FixedNav.js +122 -15
- package/dist/packages/_es/Form.js +151 -64
- package/dist/packages/_es/FormItem.js +114 -15
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +144 -33
- package/dist/packages/_es/Icon.js +40 -15
- package/dist/packages/_es/Image.js +142 -0
- package/dist/packages/_es/ImagePreview.js +547 -84
- package/dist/packages/_es/Indicator.js +62 -15
- package/dist/packages/_es/InfiniteLoading.js +249 -76
- package/dist/packages/_es/Input.js +433 -51
- package/dist/packages/_es/InputNumber.js +160 -41
- package/dist/packages/_es/Layout.js +5 -4
- package/dist/packages/_es/List.js +106 -37
- package/dist/packages/_es/Menu.js +168 -29
- package/dist/packages/_es/MenuItem.js +173 -34
- package/dist/packages/_es/Navbar.js +192 -30
- package/dist/packages/_es/NoticeBar.js +380 -93
- package/dist/packages/_es/Notify.js +227 -91
- package/dist/packages/_es/NumberKeyboard.js +272 -41
- package/dist/packages/_es/OldPicker.js +457 -149
- package/dist/packages/_es/OverLay.js +98 -40
- package/dist/packages/_es/Pagination.js +157 -39
- package/dist/packages/_es/Picker.js +460 -148
- package/dist/packages/_es/Popover.js +957 -337
- package/dist/packages/_es/Popup.js +299 -74
- package/dist/packages/_es/Price.js +118 -16
- package/dist/packages/_es/Progress.js +146 -14
- package/dist/packages/_es/PullRefresh.js +339 -100
- package/dist/packages/_es/Radio.js +90 -22
- package/dist/packages/_es/RadioGroup.js +37 -8
- package/dist/packages/_es/Range.js +408 -102
- package/dist/packages/_es/Rate.js +193 -16
- package/dist/packages/_es/Row.js +64 -22
- package/dist/packages/_es/SearchBar.js +238 -56
- package/dist/packages/_es/ShortPassword.js +225 -35
- package/dist/packages/_es/SideNavBar.js +81 -43
- package/dist/packages/_es/SideNavBarItem.js +46 -11
- package/dist/packages/_es/Signature.js +160 -60
- package/dist/packages/_es/Skeleton.js +136 -20
- package/dist/packages/_es/Sku.js +491 -103
- package/dist/packages/_es/Step.js +115 -39
- package/dist/packages/_es/Steps.js +53 -18
- package/dist/packages/_es/Sticky.js +138 -53
- package/dist/packages/_es/SubSideNavBar.js +82 -36
- package/dist/packages/_es/Swipe.js +178 -60
- package/dist/packages/_es/Swiper.js +433 -121
- package/dist/packages/_es/SwiperItem.js +53 -22
- package/dist/packages/_es/Switch.js +116 -21
- package/dist/packages/_es/TabPane.js +39 -12
- package/dist/packages/_es/Tabbar.js +72 -17
- package/dist/packages/_es/TabbarItem.js +151 -29
- package/dist/packages/_es/Table.js +178 -37
- package/dist/packages/_es/Tabs.js +202 -59
- package/dist/packages/_es/Tag.js +97 -20
- package/dist/packages/_es/TextArea.js +160 -42
- package/dist/packages/_es/TimeDetail.js +79 -37
- package/dist/packages/_es/TimePannel.js +48 -33
- package/dist/packages/_es/TimeSelect.js +112 -15
- package/dist/packages/_es/Toast.js +310 -90
- package/dist/packages/_es/Uploader.js +455 -120
- package/dist/packages/_es/Video.js +332 -93
- package/dist/packages/_es/common.js +128 -38
- package/dist/packages/_es/component.js +76 -35
- package/dist/packages/_es/index.js +6 -5
- package/dist/packages/_es/index2.js +30 -9
- package/dist/packages/_es/index3.js +8 -6
- package/dist/packages/_es/index4.js +64 -13
- package/dist/packages/_es/index5.js +783 -130
- package/dist/packages/_es/plugin-vue_export-helper.js +8 -7
- package/dist/packages/_es/pxCheck.js +5 -3
- package/dist/packages/_es/raf.js +15 -8
- package/dist/packages/animate/index.scss +299 -0
- package/dist/packages/cell/index.scss +7 -1
- package/dist/packages/checkbox/index.scss +10 -0
- package/dist/packages/configprovider/index.scss +2 -0
- package/dist/packages/ellipsis/index.scss +12 -0
- package/dist/packages/formitem/index.scss +12 -0
- package/dist/packages/griditem/index.scss +11 -0
- package/dist/packages/image/index.scss +39 -0
- package/dist/packages/imagepreview/index.scss +26 -2
- package/dist/packages/input/index.scss +13 -0
- package/dist/packages/inputnumber/index.scss +21 -0
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.js +105 -5
- package/dist/packages/locale/lang/id-ID.js +105 -5
- package/dist/packages/locale/lang/index.js +38 -16
- package/dist/packages/locale/lang/zh-CN.js +105 -5
- package/dist/packages/locale/lang/zh-TW.js +105 -5
- package/dist/packages/menu/index.scss +45 -36
- package/dist/packages/menuitem/index.scss +4 -0
- package/dist/packages/navbar/index.scss +9 -0
- package/dist/packages/pagination/index.scss +19 -0
- package/dist/packages/radio/index.scss +18 -0
- package/dist/packages/range/index.scss +19 -0
- package/dist/packages/rate/index.scss +1 -1
- package/dist/packages/searchbar/index.scss +21 -0
- package/dist/packages/switch/index.scss +1 -0
- package/dist/packages/tabbar/index.scss +5 -0
- package/dist/packages/tabbaritem/index.scss +7 -0
- package/dist/packages/tabpane/index.scss +5 -0
- package/dist/packages/tabs/index.scss +22 -0
- package/dist/packages/textarea/index.scss +8 -0
- package/dist/smartips/attributes.json +140 -4
- package/dist/smartips/tags.json +55 -6
- package/dist/smartips/web-types.json +6963 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/font/config.json +3 -1
- package/dist/styles/font/demo_index.html +49 -3
- package/dist/styles/font/iconfont.css +11 -3
- package/dist/styles/font/iconfont.js +15 -15
- package/dist/styles/font/iconfont.json +14 -0
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/themes/default.scss +54 -50
- package/dist/styles/themes/jdb.scss +54 -50
- package/dist/styles/themes/jdt.scss +54 -50
- package/dist/styles/variables-jdb.scss +12 -0
- package/dist/styles/variables-jdt.scss +12 -0
- package/dist/styles/variables.scss +12 -0
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
- package/dist/types/__VUE/address/index.vue.d.ts +7 -7
- package/dist/types/__VUE/animate/index.vue.d.ts +48 -0
- package/dist/types/__VUE/animate/type.d.ts +6 -0
- package/dist/types/__VUE/avatar/index.vue.d.ts +3 -3
- package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/calendaritem/index.vue.d.ts +10 -2
- package/dist/types/__VUE/cascader/index.vue.d.ts +2 -2
- package/dist/types/__VUE/circleprogress/index.vue.d.ts +2 -2
- package/dist/types/__VUE/collapse/index.vue.d.ts +3 -1
- package/dist/types/__VUE/configprovider/common.d.ts +20 -0
- package/dist/types/__VUE/configprovider/index.vue.d.ts +33 -0
- package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +2 -2
- package/dist/types/__VUE/ellipsis/index.vue.d.ts +72 -0
- package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
- package/dist/types/__VUE/grid/index.vue.d.ts +2 -2
- package/dist/types/__VUE/image/index.vue.d.ts +105 -0
- package/dist/types/__VUE/image/type.d.ts +6 -0
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +56 -24
- package/dist/types/__VUE/menu/index.vue.d.ts +31 -4
- package/dist/types/__VUE/menuitem/index.vue.d.ts +12 -3
- package/dist/types/__VUE/noticebar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +4 -4
- package/dist/types/__VUE/picker/index.vue.d.ts +4 -4
- package/dist/types/__VUE/popover/index.vue.d.ts +8 -8
- package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/common.d.ts +149 -0
- package/dist/types/__VUE/rate/index.vue.d.ts +17 -7
- package/dist/types/__VUE/row/index.vue.d.ts +2 -2
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +2 -2
- package/dist/types/__VUE/sku/index.vue.d.ts +3 -3
- package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +3 -2
- package/dist/types/__VUE/uploader/uploader.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +5 -1
- package/package.json +5 -4
|
@@ -1,66 +1,166 @@
|
|
|
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 = (a2, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a2, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a2, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a2;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a2, b) => __defProps(a2, __getOwnPropDescs(b));
|
|
20
1
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.0 Mon Jun 27 2022 17:55:50 GMT+0800 (中国标准时间)
|
|
22
3
|
* (c) 2022 @jdf2e.
|
|
23
4
|
* Released under the MIT License.
|
|
24
5
|
*/
|
|
25
|
-
import { ref
|
|
26
|
-
import { c as
|
|
27
|
-
import { _ as
|
|
6
|
+
import { ref, computed, reactive, onMounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createVNode, withCtx, createTextVNode } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
28
9
|
import "../locale/lang";
|
|
29
|
-
const { componentName
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
case "jpg":
|
|
52
|
-
t2 = e2.toDataURL("image/jpeg", 0.8);
|
|
10
|
+
const { componentName, create, translate } = createComponent("signature");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
customClass: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
lineWidth: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 2
|
|
20
|
+
},
|
|
21
|
+
strokeStyle: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "#000"
|
|
24
|
+
},
|
|
25
|
+
type: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "png"
|
|
28
|
+
},
|
|
29
|
+
unSupportTpl: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ""
|
|
53
32
|
}
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
33
|
+
},
|
|
34
|
+
components: {},
|
|
35
|
+
emits: ["confirm", "clear"],
|
|
36
|
+
setup(props, { emit }) {
|
|
37
|
+
const canvas = ref(null);
|
|
38
|
+
const wrap = ref(null);
|
|
39
|
+
const classes = computed(() => {
|
|
40
|
+
const prefixCls = componentName;
|
|
41
|
+
return {
|
|
42
|
+
[prefixCls]: true,
|
|
43
|
+
[`${props.customClass}`]: props.customClass
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
const state = reactive({
|
|
47
|
+
canvasHeight: 0,
|
|
48
|
+
canvasWidth: 0,
|
|
49
|
+
ctx: null,
|
|
50
|
+
isSupportTouch: "ontouchstart" in window,
|
|
51
|
+
events: "ontouchstart" in window ? ["touchstart", "touchmove", "touchend", "touchleave"] : ["mousedown", "mousemove", "mouseup", "mouseleave"]
|
|
52
|
+
});
|
|
53
|
+
const isCanvasSupported = () => {
|
|
54
|
+
let elem = document.createElement("canvas");
|
|
55
|
+
return !!(elem.getContext && elem.getContext("2d"));
|
|
56
|
+
};
|
|
57
|
+
const addEvent = () => {
|
|
58
|
+
canvas.value.addEventListener(state.events[0], startEventHandler, false);
|
|
59
|
+
};
|
|
60
|
+
const startEventHandler = (event) => {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
state.ctx.beginPath();
|
|
63
|
+
state.ctx.lineWidth = props.lineWidth;
|
|
64
|
+
state.ctx.strokeStyle = props.strokeStyle;
|
|
65
|
+
canvas.value.addEventListener(state.events[1], moveEventHandler, false);
|
|
66
|
+
canvas.value.addEventListener(state.events[2], endEventHandler, false);
|
|
67
|
+
canvas.value.addEventListener(state.events[3], leaveEventHandler, false);
|
|
68
|
+
};
|
|
69
|
+
const moveEventHandler = (event) => {
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
let evt = state.isSupportTouch ? event.touches[0] : event;
|
|
72
|
+
let coverPos = canvas.value.getBoundingClientRect();
|
|
73
|
+
let mouseX = evt.clientX - coverPos.left;
|
|
74
|
+
let mouseY = evt.clientY - coverPos.top;
|
|
75
|
+
state.ctx.lineTo(mouseX, mouseY);
|
|
76
|
+
state.ctx.stroke();
|
|
77
|
+
};
|
|
78
|
+
const endEventHandler = (event) => {
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
canvas.value.removeEventListener(state.events[1], moveEventHandler, false);
|
|
81
|
+
canvas.value.removeEventListener(state.events[2], endEventHandler, false);
|
|
82
|
+
};
|
|
83
|
+
const leaveEventHandler = (event) => {
|
|
84
|
+
event.preventDefault();
|
|
85
|
+
canvas.value.removeEventListener(state.events[1], moveEventHandler, false);
|
|
86
|
+
canvas.value.removeEventListener(state.events[2], endEventHandler, false);
|
|
87
|
+
};
|
|
88
|
+
const clear = () => {
|
|
89
|
+
canvas.value.addEventListener(state.events[2], endEventHandler, false);
|
|
90
|
+
state.ctx.clearRect(0, 0, state.canvasWidth, state.canvasHeight);
|
|
91
|
+
state.ctx.closePath();
|
|
92
|
+
emit("clear");
|
|
93
|
+
};
|
|
94
|
+
const confirm = () => {
|
|
95
|
+
onSave(canvas.value);
|
|
96
|
+
};
|
|
97
|
+
const onSave = (canvas2) => {
|
|
98
|
+
let dataurl;
|
|
99
|
+
switch (props.type) {
|
|
100
|
+
case "png":
|
|
101
|
+
dataurl = canvas2.toDataURL("image/png");
|
|
102
|
+
break;
|
|
103
|
+
case "jpg":
|
|
104
|
+
dataurl = canvas2.toDataURL("image/jpeg", 0.8);
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
clear();
|
|
108
|
+
emit("confirm", canvas2, dataurl);
|
|
109
|
+
};
|
|
110
|
+
onMounted(() => {
|
|
111
|
+
if (isCanvasSupported()) {
|
|
112
|
+
state.ctx = canvas.value.getContext("2d");
|
|
113
|
+
state.canvasWidth = wrap.value.offsetWidth;
|
|
114
|
+
state.canvasHeight = wrap.value.offsetHeight;
|
|
115
|
+
addEvent();
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
return { ...toRefs(state), canvas, wrap, isCanvasSupported, confirm, clear, classes, translate };
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
const _hoisted_1 = {
|
|
122
|
+
class: "nut-signature-inner",
|
|
123
|
+
ref: "wrap"
|
|
124
|
+
};
|
|
125
|
+
const _hoisted_2 = ["height", "width"];
|
|
126
|
+
const _hoisted_3 = {
|
|
127
|
+
key: 1,
|
|
128
|
+
class: "nut-signature-unsopport"
|
|
129
|
+
};
|
|
130
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
131
|
+
const _component_nut_button = resolveComponent("nut-button");
|
|
132
|
+
return openBlock(), createElementBlock("div", {
|
|
133
|
+
class: normalizeClass(_ctx.classes)
|
|
134
|
+
}, [
|
|
135
|
+
createElementVNode("div", _hoisted_1, [
|
|
136
|
+
(() => _ctx.isCanvasSupported()) ? (openBlock(), createElementBlock("canvas", {
|
|
137
|
+
key: 0,
|
|
138
|
+
ref: "canvas",
|
|
139
|
+
height: _ctx.canvasHeight,
|
|
140
|
+
width: _ctx.canvasWidth
|
|
141
|
+
}, null, 8, _hoisted_2)) : (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(_ctx.unSupportTpl || _ctx.translate("unSupportTpl")), 1))
|
|
142
|
+
], 512),
|
|
143
|
+
createVNode(_component_nut_button, {
|
|
144
|
+
class: "nut-signature-btn",
|
|
145
|
+
type: "default",
|
|
146
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.clear())
|
|
147
|
+
}, {
|
|
148
|
+
default: withCtx(() => [
|
|
149
|
+
createTextVNode(toDisplayString(_ctx.translate("reSign")), 1)
|
|
150
|
+
]),
|
|
151
|
+
_: 1
|
|
152
|
+
}),
|
|
153
|
+
createVNode(_component_nut_button, {
|
|
154
|
+
class: "nut-signature-btn",
|
|
155
|
+
type: "primary",
|
|
156
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirm())
|
|
157
|
+
}, {
|
|
158
|
+
default: withCtx(() => [
|
|
159
|
+
createTextVNode(toDisplayString(_ctx.translate("confirm")), 1)
|
|
160
|
+
]),
|
|
161
|
+
_: 1
|
|
162
|
+
})
|
|
163
|
+
], 2);
|
|
164
|
+
}
|
|
165
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
166
|
+
export { index as default };
|
|
@@ -1,25 +1,141 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.0 Mon Jun 27 2022 17:55:50 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { c as
|
|
7
|
-
import { toRefs
|
|
8
|
-
import { _ as
|
|
6
|
+
import { c as createComponent } from "./component.js";
|
|
7
|
+
import { toRefs, computed, onMounted, resolveComponent, openBlock, createElementBlock, renderSlot, createCommentVNode, createElementVNode, createBlock, normalizeClass, normalizeStyle, Fragment, renderList } from "vue";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
const component = {
|
|
11
|
+
props: {
|
|
12
|
+
width: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "100px"
|
|
15
|
+
},
|
|
16
|
+
height: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "100px"
|
|
19
|
+
},
|
|
20
|
+
animated: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
24
|
+
avatar: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false
|
|
27
|
+
},
|
|
28
|
+
avatarShape: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "round"
|
|
31
|
+
},
|
|
32
|
+
avatarSize: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "50px"
|
|
35
|
+
},
|
|
36
|
+
loading: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: true
|
|
39
|
+
},
|
|
40
|
+
round: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
row: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: "1"
|
|
47
|
+
},
|
|
48
|
+
title: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
setup(props) {
|
|
54
|
+
const { avatarShape, round, avatarSize } = toRefs(props);
|
|
55
|
+
const avatarClass = computed(() => {
|
|
56
|
+
const prefixCls = "avatarClass";
|
|
57
|
+
return {
|
|
58
|
+
[prefixCls]: true,
|
|
59
|
+
[`${prefixCls}--${avatarShape.value}`]: avatarShape.value
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
const blockClass = computed(() => {
|
|
63
|
+
const prefixCls = "blockClass";
|
|
64
|
+
return {
|
|
65
|
+
[prefixCls]: true,
|
|
66
|
+
[`${prefixCls}--round`]: round.value
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
const getStyle = () => {
|
|
70
|
+
if (avatarSize.value) {
|
|
71
|
+
return {
|
|
72
|
+
width: avatarSize.value,
|
|
73
|
+
height: avatarSize.value
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
width: "50px",
|
|
78
|
+
height: "50px"
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
onMounted(() => {
|
|
82
|
+
});
|
|
83
|
+
return {
|
|
84
|
+
avatarShape,
|
|
85
|
+
avatarClass,
|
|
86
|
+
blockClass,
|
|
87
|
+
getStyle
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const { create } = createComponent("skeleton");
|
|
92
|
+
const _sfc_main = create(component);
|
|
93
|
+
const _hoisted_1 = { key: 0 };
|
|
94
|
+
const _hoisted_2 = {
|
|
95
|
+
key: 1,
|
|
96
|
+
class: "skeleton"
|
|
97
|
+
};
|
|
98
|
+
const _hoisted_3 = {
|
|
99
|
+
key: 0,
|
|
100
|
+
class: "skeleton-animation"
|
|
101
|
+
};
|
|
102
|
+
const _hoisted_4 = { class: "content" };
|
|
103
|
+
const _hoisted_5 = { class: "content-line" };
|
|
104
|
+
const _hoisted_6 = {
|
|
105
|
+
key: 0,
|
|
106
|
+
class: "title"
|
|
107
|
+
};
|
|
108
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
109
|
+
const _component_nut_avatar = resolveComponent("nut-avatar");
|
|
110
|
+
return !_ctx.loading ? (openBlock(), createElementBlock("view", _hoisted_1, [
|
|
111
|
+
renderSlot(_ctx.$slots, "default")
|
|
112
|
+
])) : (openBlock(), createElementBlock("view", _hoisted_2, [
|
|
113
|
+
_ctx.animated ? (openBlock(), createElementBlock("view", _hoisted_3)) : createCommentVNode("", true),
|
|
114
|
+
createElementVNode("view", _hoisted_4, [
|
|
115
|
+
_ctx.avatar ? (openBlock(), createBlock(_component_nut_avatar, {
|
|
116
|
+
key: 0,
|
|
117
|
+
class: normalizeClass(_ctx.avatarClass),
|
|
118
|
+
shape: _ctx.avatarShape,
|
|
119
|
+
style: normalizeStyle(_ctx.getStyle()),
|
|
120
|
+
"bg-color": "rgb(239, 239, 239)"
|
|
121
|
+
}, null, 8, ["class", "shape", "style"])) : createCommentVNode("", true),
|
|
122
|
+
Number(_ctx.row) == 1 ? (openBlock(), createElementBlock("view", {
|
|
123
|
+
key: 1,
|
|
124
|
+
class: normalizeClass(_ctx.blockClass),
|
|
125
|
+
style: normalizeStyle({ width: _ctx.width, height: _ctx.height })
|
|
126
|
+
}, null, 6)) : createCommentVNode("", true),
|
|
127
|
+
createElementVNode("view", _hoisted_5, [
|
|
128
|
+
_ctx.title ? (openBlock(), createElementBlock("view", _hoisted_6)) : createCommentVNode("", true),
|
|
129
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(Number(_ctx.row), (item, index2) => {
|
|
130
|
+
return openBlock(), createElementBlock("view", {
|
|
131
|
+
key: index2,
|
|
132
|
+
class: normalizeClass(_ctx.blockClass),
|
|
133
|
+
style: normalizeStyle({ width: _ctx.width, height: _ctx.height })
|
|
134
|
+
}, null, 6);
|
|
135
|
+
}), 128))
|
|
136
|
+
])
|
|
137
|
+
])
|
|
138
|
+
]));
|
|
139
|
+
}
|
|
140
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
141
|
+
export { index as default };
|