@nutui/nutui 3.1.22 → 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/dist/nutui.es.js +20418 -4214
- package/dist/nutui.umd.js +20524 -4216
- package/dist/packages/_es/ActionSheet.js +149 -17
- package/dist/packages/_es/Address.js +535 -110
- package/dist/packages/_es/AddressList.js +615 -113
- package/dist/packages/_es/Animate.js +59 -17
- package/dist/packages/_es/Audio.js +257 -53
- package/dist/packages/_es/AudioOperate.js +100 -13
- package/dist/packages/_es/Avatar.js +162 -38
- 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 -30
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +107 -10
- package/dist/packages/_es/Cascader.js +496 -147
- 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 +109 -32
- package/dist/packages/_es/CollapseItem.js +253 -59
- package/dist/packages/_es/Comment.js +434 -64
- package/dist/packages/_es/ConfigProvider.js +20 -8
- package/dist/packages/_es/CountDown.js +238 -56
- package/dist/packages/_es/CountUp.js +539 -140
- package/dist/packages/_es/DatePicker.js +315 -98
- package/dist/packages/_es/Dialog.js +289 -60
- package/dist/packages/_es/Divider.js +65 -13
- package/dist/packages/_es/Drag.js +197 -56
- package/dist/packages/_es/Ecard.js +159 -24
- package/dist/packages/_es/Elevator.js +255 -58
- package/dist/packages/_es/Ellipsis.js +200 -58
- 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 +137 -26
- package/dist/packages/_es/ImagePreview.js +547 -76
- package/dist/packages/_es/Indicator.js +62 -15
- package/dist/packages/_es/InfiniteLoading.js +249 -57
- 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 -18
- package/dist/packages/_es/Menu.js +168 -44
- package/dist/packages/_es/MenuItem.js +173 -37
- package/dist/packages/_es/Navbar.js +192 -30
- package/dist/packages/_es/NoticeBar.js +380 -74
- package/dist/packages/_es/Notify.js +227 -72
- package/dist/packages/_es/NumberKeyboard.js +272 -41
- package/dist/packages/_es/OldPicker.js +457 -130
- package/dist/packages/_es/OverLay.js +98 -24
- package/dist/packages/_es/Pagination.js +157 -39
- package/dist/packages/_es/Picker.js +460 -129
- package/dist/packages/_es/Popover.js +957 -318
- package/dist/packages/_es/Popup.js +299 -55
- package/dist/packages/_es/Price.js +118 -16
- package/dist/packages/_es/Progress.js +146 -14
- package/dist/packages/_es/PullRefresh.js +339 -84
- package/dist/packages/_es/Radio.js +90 -22
- package/dist/packages/_es/RadioGroup.js +37 -8
- package/dist/packages/_es/Range.js +408 -83
- package/dist/packages/_es/Rate.js +192 -36
- package/dist/packages/_es/Row.js +64 -22
- package/dist/packages/_es/SearchBar.js +238 -37
- package/dist/packages/_es/ShortPassword.js +225 -35
- package/dist/packages/_es/SideNavBar.js +81 -24
- package/dist/packages/_es/SideNavBarItem.js +46 -11
- package/dist/packages/_es/Signature.js +160 -41
- package/dist/packages/_es/Skeleton.js +136 -20
- package/dist/packages/_es/Sku.js +491 -84
- package/dist/packages/_es/Step.js +115 -20
- package/dist/packages/_es/Steps.js +53 -18
- package/dist/packages/_es/Sticky.js +138 -53
- package/dist/packages/_es/SubSideNavBar.js +82 -17
- package/dist/packages/_es/Swipe.js +178 -41
- 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 -18
- package/dist/packages/_es/Tabs.js +202 -43
- package/dist/packages/_es/Tag.js +97 -20
- package/dist/packages/_es/TextArea.js +160 -42
- package/dist/packages/_es/TimeDetail.js +79 -18
- package/dist/packages/_es/TimePannel.js +48 -14
- package/dist/packages/_es/TimeSelect.js +112 -15
- package/dist/packages/_es/Toast.js +310 -71
- package/dist/packages/_es/Uploader.js +455 -104
- package/dist/packages/_es/Video.js +332 -74
- 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 +780 -164
- 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/imagepreview/index.scss +6 -1
- 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/smartips/attributes.json +8 -0
- package/dist/smartips/tags.json +3 -1
- package/dist/smartips/web-types.json +19 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +41 -41
- package/dist/styles/themes/jdb.scss +41 -41
- package/dist/styles/themes/jdt.scss +41 -41
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +5 -5
- package/dist/types/__VUE/address/index.vue.d.ts +7 -7
- package/dist/types/__VUE/avatar/index.vue.d.ts +4 -4
- package/dist/types/__VUE/avatargroup/index.vue.d.ts +2 -2
- package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
- package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
- package/dist/types/__VUE/button/index.vue.d.ts +8 -8
- package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cascader/index.vue.d.ts +4 -4
- package/dist/types/__VUE/cell/index.vue.d.ts +6 -6
- package/dist/types/__VUE/checkbox/index.vue.d.ts +2 -2
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/comment/index.vue.d.ts +2 -2
- package/dist/types/__VUE/datepicker/index.vue.d.ts +4 -4
- package/dist/types/__VUE/dialog/index.vue.d.ts +4 -4
- package/dist/types/__VUE/fixednav/index.vue.d.ts +4 -4
- package/dist/types/__VUE/grid/index.vue.d.ts +4 -4
- package/dist/types/__VUE/image/index.vue.d.ts +4 -4
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +23 -25
- package/dist/types/__VUE/input/index.vue.d.ts +4 -4
- package/dist/types/__VUE/inputnumber/index.vue.d.ts +2 -2
- package/dist/types/__VUE/menu/index.vue.d.ts +2 -2
- package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/noticebar/index.vue.d.ts +3 -3
- package/dist/types/__VUE/notify/index.vue.d.ts +2 -2
- package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +5 -5
- package/dist/types/__VUE/picker/Column.vue.d.ts +1 -1
- package/dist/types/__VUE/picker/index.vue.d.ts +6 -6
- package/dist/types/__VUE/popover/index.vue.d.ts +8 -8
- package/dist/types/__VUE/popup/index.vue.d.ts +6 -6
- package/dist/types/__VUE/radio/index.vue.d.ts +4 -4
- package/dist/types/__VUE/range/index.vue.d.ts +4 -4
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +1 -1
- package/dist/types/__VUE/skeleton/index.vue.d.ts +4 -4
- package/dist/types/__VUE/sku/index.vue.d.ts +5 -5
- package/dist/types/__VUE/step/index.vue.d.ts +2 -2
- package/dist/types/__VUE/sticky/index.vue.d.ts +4 -4
- 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/tabbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tag/index.vue.d.ts +2 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +2 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +4 -4
- package/dist/types/__VUE/uploader/index.vue.d.ts +4 -4
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -2
|
@@ -1,47 +1,126 @@
|
|
|
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 { computed
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { computed, ref, onMounted, onUnmounted, onDeactivated, watch, nextTick, openBlock, createElementBlock, normalizeClass, createElementVNode } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
10
|
+
const { componentName, create } = createComponent("barrage");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
danmu: {
|
|
14
|
+
type: Array,
|
|
15
|
+
default: () => []
|
|
16
|
+
},
|
|
17
|
+
frequency: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 500
|
|
20
|
+
},
|
|
21
|
+
speeds: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 2e3
|
|
24
|
+
},
|
|
25
|
+
rows: {
|
|
26
|
+
type: Number,
|
|
27
|
+
default: 3
|
|
28
|
+
},
|
|
29
|
+
top: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 10
|
|
32
|
+
},
|
|
33
|
+
loop: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: true
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
emits: ["click"],
|
|
39
|
+
setup(props, { emit }) {
|
|
40
|
+
const classes = computed(() => {
|
|
41
|
+
const prefixCls = componentName;
|
|
42
|
+
return {
|
|
43
|
+
[prefixCls]: true
|
|
44
|
+
};
|
|
37
45
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
let dmBody = ref(document.createElement("div"));
|
|
47
|
+
let dmContainer = ref(document.createElement("div"));
|
|
48
|
+
let timer = 0;
|
|
49
|
+
const danmuList = ref(props.danmu);
|
|
50
|
+
const rows = ref(props.rows);
|
|
51
|
+
const top = ref(props.top);
|
|
52
|
+
const index2 = ref(0);
|
|
53
|
+
const speeds = props.speeds;
|
|
54
|
+
const danmuCWidth = ref(0);
|
|
55
|
+
onMounted(() => {
|
|
56
|
+
danmuCWidth.value = dmBody.value.offsetWidth;
|
|
57
|
+
run();
|
|
58
|
+
});
|
|
59
|
+
onUnmounted(() => {
|
|
60
|
+
clearInterval(timer);
|
|
61
|
+
timer = 0;
|
|
62
|
+
});
|
|
63
|
+
onDeactivated(() => {
|
|
64
|
+
clearInterval(timer);
|
|
65
|
+
timer = 0;
|
|
66
|
+
});
|
|
67
|
+
watch(() => props.danmu, (newValue, oldVlaue) => {
|
|
68
|
+
danmuList.value = [...newValue];
|
|
69
|
+
});
|
|
70
|
+
const add = (word) => {
|
|
71
|
+
const _index = index2.value % danmuList.value.length;
|
|
72
|
+
if (!props.loop && index2.value === danmuList.value.length) {
|
|
73
|
+
danmuList.value.splice(danmuList.value.length, 0, word);
|
|
74
|
+
} else {
|
|
75
|
+
danmuList.value.splice(_index, 0, word);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const run = () => {
|
|
79
|
+
clearInterval(timer);
|
|
80
|
+
timer = 0;
|
|
81
|
+
timer = setInterval(() => {
|
|
82
|
+
play();
|
|
83
|
+
run();
|
|
84
|
+
}, props.frequency);
|
|
85
|
+
};
|
|
86
|
+
const play = () => {
|
|
87
|
+
if (!props.loop && index2.value >= danmuList.value.length) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const _index = props.loop ? index2.value % danmuList.value.length : index2.value;
|
|
91
|
+
let el = document.createElement(`view`);
|
|
92
|
+
el.innerHTML = danmuList.value[_index];
|
|
93
|
+
el.classList.add("dmitem");
|
|
94
|
+
dmContainer.value.appendChild(el);
|
|
95
|
+
nextTick(() => {
|
|
96
|
+
const width = el.offsetWidth;
|
|
97
|
+
const height = el.offsetHeight;
|
|
98
|
+
el.classList.add("move");
|
|
99
|
+
el.style.animationDuration = `${speeds}ms`;
|
|
100
|
+
el.style.top = _index % rows.value * (height + top.value) + 20 + "px";
|
|
101
|
+
el.style.width = width + 20 + "px";
|
|
102
|
+
el.style.setProperty("--move-distance", `-${danmuCWidth.value}px`);
|
|
103
|
+
el.dataset.index = `${_index}`;
|
|
104
|
+
el.addEventListener("animationend", () => {
|
|
105
|
+
dmContainer.value.removeChild(el);
|
|
106
|
+
});
|
|
107
|
+
index2.value++;
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
return { classes, danmuList, dmBody, dmContainer, add };
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
const _hoisted_1 = {
|
|
114
|
+
ref: "dmContainer",
|
|
115
|
+
class: "dmContainer"
|
|
116
|
+
};
|
|
117
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
118
|
+
return openBlock(), createElementBlock("view", {
|
|
119
|
+
ref: "dmBody",
|
|
120
|
+
class: normalizeClass(_ctx.classes)
|
|
121
|
+
}, [
|
|
122
|
+
createElementVNode("view", _hoisted_1, null, 512)
|
|
123
|
+
], 2);
|
|
124
|
+
}
|
|
125
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
126
|
+
export { index as default };
|
|
@@ -1,29 +1,134 @@
|
|
|
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 { toRefs
|
|
7
|
-
import { c as
|
|
8
|
-
import
|
|
9
|
-
import { _ as
|
|
6
|
+
import { toRefs, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, createBlock, createCommentVNode, renderSlot } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import _sfc_main$1 from "./Icon.js";
|
|
9
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
10
|
import "../locale/lang";
|
|
11
11
|
import "./pxCheck.js";
|
|
12
|
-
const { componentName
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
12
|
+
const { componentName, create } = createComponent("button");
|
|
13
|
+
const _sfc_main = create({
|
|
14
|
+
components: {
|
|
15
|
+
[_sfc_main$1.name]: _sfc_main$1
|
|
16
|
+
},
|
|
17
|
+
props: {
|
|
18
|
+
color: String,
|
|
19
|
+
shape: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "round"
|
|
22
|
+
},
|
|
23
|
+
plain: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
},
|
|
27
|
+
loading: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
},
|
|
31
|
+
disabled: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false
|
|
34
|
+
},
|
|
35
|
+
type: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: "default"
|
|
38
|
+
},
|
|
39
|
+
size: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: "normal"
|
|
42
|
+
},
|
|
43
|
+
block: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
icon: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: ""
|
|
50
|
+
},
|
|
51
|
+
iconClassPrefix: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: "nut-icon"
|
|
54
|
+
},
|
|
55
|
+
iconFontClassName: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: "nutui-iconfont"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
emits: ["click"],
|
|
61
|
+
setup(props, { emit, slots }) {
|
|
62
|
+
const { type, size, shape, disabled, loading, color, plain, block } = toRefs(props);
|
|
63
|
+
const handleClick = (event) => {
|
|
64
|
+
if (!loading.value && !disabled.value) {
|
|
65
|
+
emit("click", event);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const classes = computed(() => {
|
|
69
|
+
const prefixCls = componentName;
|
|
70
|
+
return {
|
|
71
|
+
[prefixCls]: true,
|
|
72
|
+
[`${prefixCls}--${type.value}`]: type.value,
|
|
73
|
+
[`${prefixCls}--${size.value}`]: size.value,
|
|
74
|
+
[`${prefixCls}--${shape.value}`]: shape.value,
|
|
75
|
+
[`${prefixCls}--plain`]: plain.value,
|
|
76
|
+
[`${prefixCls}--block`]: block.value,
|
|
77
|
+
[`${prefixCls}--disabled`]: disabled.value,
|
|
78
|
+
[`${prefixCls}--loading`]: loading.value
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
const getStyle = computed(() => {
|
|
82
|
+
var _a;
|
|
83
|
+
const style = {};
|
|
84
|
+
if (color == null ? void 0 : color.value) {
|
|
85
|
+
if (plain.value) {
|
|
86
|
+
style.color = color.value;
|
|
87
|
+
style.background = "#fff";
|
|
88
|
+
if (!((_a = color.value) == null ? void 0 : _a.includes("gradient"))) {
|
|
89
|
+
style.borderColor = color.value;
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
92
|
+
style.color = "#fff";
|
|
93
|
+
style.background = color.value;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return style;
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
handleClick,
|
|
100
|
+
classes,
|
|
101
|
+
getStyle
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
const _hoisted_1 = { class: "nut-button__warp" };
|
|
106
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
107
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
108
|
+
return openBlock(), createElementBlock("view", {
|
|
109
|
+
class: normalizeClass(_ctx.classes),
|
|
110
|
+
style: normalizeStyle(_ctx.getStyle),
|
|
111
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
112
|
+
}, [
|
|
113
|
+
createElementVNode("view", _hoisted_1, [
|
|
114
|
+
_ctx.loading ? (openBlock(), createBlock(_component_nut_icon, {
|
|
115
|
+
key: 0,
|
|
116
|
+
class: "nut-icon-loading"
|
|
117
|
+
})) : createCommentVNode("", true),
|
|
118
|
+
_ctx.icon && !_ctx.loading ? (openBlock(), createBlock(_component_nut_icon, {
|
|
119
|
+
key: 1,
|
|
120
|
+
name: _ctx.icon,
|
|
121
|
+
"class-prefix": _ctx.iconClassPrefix,
|
|
122
|
+
"font-class-name": _ctx.iconFontClassName
|
|
123
|
+
}, null, 8, ["name", "class-prefix", "font-class-name"])) : createCommentVNode("", true),
|
|
124
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("view", {
|
|
125
|
+
key: 2,
|
|
126
|
+
class: normalizeClass({ text: _ctx.icon || _ctx.loading })
|
|
127
|
+
}, [
|
|
128
|
+
renderSlot(_ctx.$slots, "default")
|
|
129
|
+
], 2)) : createCommentVNode("", true)
|
|
130
|
+
])
|
|
131
|
+
], 6);
|
|
132
|
+
}
|
|
133
|
+
var Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
134
|
+
export { Button as default };
|
|
@@ -1,36 +1,252 @@
|
|
|
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 { computed
|
|
7
|
-
import { c as
|
|
8
|
-
import { C as
|
|
9
|
-
import { u } from "./index3.js";
|
|
10
|
-
import { _ as
|
|
6
|
+
import { computed, ref, resolveComponent, openBlock, createBlock, withCtx, createSlots, renderSlot, createCommentVNode } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { C as CalendarItem, U as Utils } from "./index5.js";
|
|
9
|
+
import { u as useExpose } from "./index3.js";
|
|
10
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
11
11
|
import "../locale/lang";
|
|
12
12
|
import "./raf.js";
|
|
13
|
-
const { create
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
13
|
+
const { create } = createComponent("calendar");
|
|
14
|
+
const _sfc_main = create({
|
|
15
|
+
components: {
|
|
16
|
+
[CalendarItem.name]: CalendarItem
|
|
17
|
+
},
|
|
18
|
+
props: {
|
|
19
|
+
type: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "one"
|
|
22
|
+
},
|
|
23
|
+
isAutoBackFill: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
},
|
|
27
|
+
poppable: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true
|
|
30
|
+
},
|
|
31
|
+
showTitle: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: true
|
|
34
|
+
},
|
|
35
|
+
showSubTitle: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: true
|
|
38
|
+
},
|
|
39
|
+
visible: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
43
|
+
showToday: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: true
|
|
46
|
+
},
|
|
47
|
+
title: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: ""
|
|
50
|
+
},
|
|
51
|
+
confirmText: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: ""
|
|
54
|
+
},
|
|
55
|
+
startText: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: ""
|
|
58
|
+
},
|
|
59
|
+
endText: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ""
|
|
62
|
+
},
|
|
63
|
+
defaultValue: {
|
|
64
|
+
type: [String, Array]
|
|
65
|
+
},
|
|
66
|
+
startDate: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: Utils.getDay(0)
|
|
69
|
+
},
|
|
70
|
+
endDate: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: Utils.getDay(365)
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
emits: ["choose", "close", "update:visible", "select"],
|
|
76
|
+
setup(props, { emit, slots }) {
|
|
77
|
+
const showTopBtn = computed(() => {
|
|
78
|
+
return slots.btn;
|
|
79
|
+
});
|
|
80
|
+
const topInfo = computed(() => {
|
|
81
|
+
return slots.topInfo;
|
|
82
|
+
});
|
|
83
|
+
const dayInfo = computed(() => {
|
|
84
|
+
return slots.day;
|
|
85
|
+
});
|
|
86
|
+
const bottomInfo = computed(() => {
|
|
87
|
+
return slots.bottomInfo;
|
|
88
|
+
});
|
|
89
|
+
const calendarRef = ref(null);
|
|
90
|
+
const scrollToDate = (date) => {
|
|
91
|
+
var _a;
|
|
92
|
+
(_a = calendarRef.value) == null ? void 0 : _a.scrollToDate(date);
|
|
93
|
+
};
|
|
94
|
+
useExpose({
|
|
95
|
+
scrollToDate
|
|
96
|
+
});
|
|
97
|
+
const update = () => {
|
|
98
|
+
emit("update:visible", false);
|
|
99
|
+
};
|
|
100
|
+
const close = () => {
|
|
101
|
+
emit("close");
|
|
102
|
+
emit("update:visible", false);
|
|
103
|
+
};
|
|
104
|
+
const choose = (param) => {
|
|
105
|
+
close();
|
|
106
|
+
emit("choose", param);
|
|
107
|
+
};
|
|
108
|
+
const select = (param) => {
|
|
109
|
+
emit("select", param);
|
|
110
|
+
};
|
|
111
|
+
const closePopup = () => {
|
|
112
|
+
close();
|
|
113
|
+
};
|
|
114
|
+
return {
|
|
115
|
+
closePopup,
|
|
116
|
+
update,
|
|
117
|
+
close,
|
|
118
|
+
choose,
|
|
119
|
+
select,
|
|
120
|
+
calendarRef,
|
|
121
|
+
showTopBtn,
|
|
122
|
+
topInfo,
|
|
123
|
+
dayInfo,
|
|
124
|
+
bottomInfo
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
129
|
+
const _component_nut_calendar_item = resolveComponent("nut-calendar-item");
|
|
130
|
+
const _component_nut_popup = resolveComponent("nut-popup");
|
|
131
|
+
return _ctx.poppable ? (openBlock(), createBlock(_component_nut_popup, {
|
|
132
|
+
key: 0,
|
|
133
|
+
visible: _ctx.visible,
|
|
134
|
+
position: "bottom",
|
|
135
|
+
round: "",
|
|
136
|
+
closeable: true,
|
|
137
|
+
onClickOverlay: _ctx.closePopup,
|
|
138
|
+
onClickCloseIcon: _ctx.closePopup,
|
|
139
|
+
"destroy-on-close": true,
|
|
140
|
+
style: { height: "85vh" }
|
|
141
|
+
}, {
|
|
142
|
+
default: withCtx(() => [
|
|
143
|
+
_ctx.visible ? (openBlock(), createBlock(_component_nut_calendar_item, {
|
|
144
|
+
key: 0,
|
|
145
|
+
props: "",
|
|
146
|
+
ref: "calendarRef",
|
|
147
|
+
type: _ctx.type,
|
|
148
|
+
"is-auto-back-fill": _ctx.isAutoBackFill,
|
|
149
|
+
poppable: _ctx.poppable,
|
|
150
|
+
title: _ctx.title,
|
|
151
|
+
"confirm-text": _ctx.confirmText,
|
|
152
|
+
"start-text": _ctx.startText,
|
|
153
|
+
"end-text": _ctx.endText,
|
|
154
|
+
"default-value": _ctx.defaultValue,
|
|
155
|
+
"start-date": _ctx.startDate,
|
|
156
|
+
"end-date": _ctx.endDate,
|
|
157
|
+
onUpdate: _ctx.update,
|
|
158
|
+
onClose: _ctx.close,
|
|
159
|
+
onChoose: _ctx.choose,
|
|
160
|
+
onSelect: _ctx.select,
|
|
161
|
+
"show-today": _ctx.showToday,
|
|
162
|
+
"show-title": _ctx.showTitle,
|
|
163
|
+
"show-sub-title": _ctx.showSubTitle
|
|
164
|
+
}, createSlots({ _: 2 }, [
|
|
165
|
+
_ctx.showTopBtn ? {
|
|
166
|
+
name: "btn",
|
|
167
|
+
fn: withCtx(() => [
|
|
168
|
+
renderSlot(_ctx.$slots, "btn")
|
|
169
|
+
])
|
|
170
|
+
} : void 0,
|
|
171
|
+
_ctx.dayInfo ? {
|
|
172
|
+
name: "day",
|
|
173
|
+
fn: withCtx((date) => [
|
|
174
|
+
renderSlot(_ctx.$slots, "day", {
|
|
175
|
+
date: date.date
|
|
176
|
+
})
|
|
177
|
+
])
|
|
178
|
+
} : void 0,
|
|
179
|
+
_ctx.topInfo ? {
|
|
180
|
+
name: "topInfo",
|
|
181
|
+
fn: withCtx((date) => [
|
|
182
|
+
renderSlot(_ctx.$slots, "topInfo", {
|
|
183
|
+
date: date.date
|
|
184
|
+
})
|
|
185
|
+
])
|
|
186
|
+
} : void 0,
|
|
187
|
+
_ctx.bottomInfo ? {
|
|
188
|
+
name: "bottomInfo",
|
|
189
|
+
fn: withCtx((date) => [
|
|
190
|
+
renderSlot(_ctx.$slots, "bottomInfo", {
|
|
191
|
+
date: date.date
|
|
192
|
+
})
|
|
193
|
+
])
|
|
194
|
+
} : void 0
|
|
195
|
+
]), 1032, ["type", "is-auto-back-fill", "poppable", "title", "confirm-text", "start-text", "end-text", "default-value", "start-date", "end-date", "onUpdate", "onClose", "onChoose", "onSelect", "show-today", "show-title", "show-sub-title"])) : createCommentVNode("", true)
|
|
196
|
+
]),
|
|
197
|
+
_: 3
|
|
198
|
+
}, 8, ["visible", "onClickOverlay", "onClickCloseIcon"])) : (openBlock(), createBlock(_component_nut_calendar_item, {
|
|
199
|
+
key: 1,
|
|
200
|
+
type: _ctx.type,
|
|
201
|
+
"is-auto-back-fill": _ctx.isAutoBackFill,
|
|
202
|
+
poppable: _ctx.poppable,
|
|
203
|
+
title: _ctx.title,
|
|
204
|
+
"confirm-text": _ctx.confirmText,
|
|
205
|
+
"start-text": _ctx.startText,
|
|
206
|
+
"end-text": _ctx.endText,
|
|
207
|
+
"default-value": _ctx.defaultValue,
|
|
208
|
+
"start-date": _ctx.startDate,
|
|
209
|
+
"end-date": _ctx.endDate,
|
|
210
|
+
onUpdate: _ctx.update,
|
|
211
|
+
onClose: _ctx.close,
|
|
212
|
+
onChoose: _ctx.choose,
|
|
213
|
+
onSelect: _ctx.select,
|
|
214
|
+
"show-today": _ctx.showToday,
|
|
215
|
+
"show-title": _ctx.showTitle,
|
|
216
|
+
"show-sub-title": _ctx.showSubTitle,
|
|
217
|
+
ref: "calendarRef"
|
|
218
|
+
}, createSlots({ _: 2 }, [
|
|
219
|
+
_ctx.showTopBtn ? {
|
|
220
|
+
name: "btn",
|
|
221
|
+
fn: withCtx(() => [
|
|
222
|
+
renderSlot(_ctx.$slots, "btn")
|
|
223
|
+
])
|
|
224
|
+
} : void 0,
|
|
225
|
+
_ctx.dayInfo ? {
|
|
226
|
+
name: "day",
|
|
227
|
+
fn: withCtx((date) => [
|
|
228
|
+
renderSlot(_ctx.$slots, "day", {
|
|
229
|
+
date: date.date
|
|
230
|
+
})
|
|
231
|
+
])
|
|
232
|
+
} : void 0,
|
|
233
|
+
_ctx.topInfo ? {
|
|
234
|
+
name: "topInfo",
|
|
235
|
+
fn: withCtx((date) => [
|
|
236
|
+
renderSlot(_ctx.$slots, "topInfo", {
|
|
237
|
+
date: date.date
|
|
238
|
+
})
|
|
239
|
+
])
|
|
240
|
+
} : void 0,
|
|
241
|
+
_ctx.bottomInfo ? {
|
|
242
|
+
name: "bottomInfo",
|
|
243
|
+
fn: withCtx((date) => [
|
|
244
|
+
renderSlot(_ctx.$slots, "bottomInfo", {
|
|
245
|
+
date: date.date
|
|
246
|
+
})
|
|
247
|
+
])
|
|
248
|
+
} : void 0
|
|
249
|
+
]), 1032, ["type", "is-auto-back-fill", "poppable", "title", "confirm-text", "start-text", "end-text", "default-value", "start-date", "end-date", "onUpdate", "onClose", "onChoose", "onSelect", "show-today", "show-title", "show-sub-title"]));
|
|
250
|
+
}
|
|
251
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
252
|
+
export { index as default };
|