@nutui/nutui 3.1.12-beta.1 → 3.1.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/CHANGELOG.md +27 -0
- package/dist/nutui.d.ts +1 -1
- package/dist/nutui.es.js +3219 -2562
- package/dist/nutui.umd.js +3292 -2565
- package/dist/packages/_es/ActionSheet.js +12 -13
- package/dist/packages/_es/Address.js +49 -63
- package/dist/packages/_es/Avatar.js +5 -4
- package/dist/packages/_es/BackTop.js +109 -72
- package/dist/packages/_es/Badge.js +5 -4
- package/dist/packages/_es/Barrage.js +57 -63
- package/dist/packages/_es/Button.js +6 -5
- package/dist/packages/_es/Calendar.js +18 -27
- package/dist/packages/_es/Card.js +8 -7
- package/dist/packages/_es/Cell.js +13 -5
- package/dist/packages/_es/CellGroup.js +14 -7
- package/dist/packages/_es/Checkbox.js +3 -3
- package/dist/packages/_es/CheckboxGroup.js +4 -9
- package/dist/packages/_es/CircleProgress.js +46 -142
- package/dist/packages/_es/Col.js +5 -4
- package/dist/packages/_es/Collapse.js +10 -35
- package/dist/packages/_es/CollapseItem.js +35 -80
- package/dist/packages/_es/CountDown.js +5 -7
- package/dist/packages/_es/CountUp.js +31 -34
- package/dist/packages/_es/DatePicker.js +219 -451
- package/dist/packages/_es/Dialog.js +98 -46
- package/dist/packages/_es/Divider.js +6 -5
- package/dist/packages/_es/Drag.js +50 -76
- package/dist/packages/_es/Elevator.js +52 -81
- package/dist/packages/_es/FixedNav.js +9 -8
- package/dist/packages/_es/Form.js +6 -5
- package/dist/packages/_es/FormItem.js +5 -4
- package/dist/packages/_es/Icon.js +40 -6
- package/dist/packages/_es/ImagePreview.js +158 -44
- package/dist/packages/_es/InfiniteLoading.js +109 -95
- package/dist/packages/_es/Input.js +21 -22
- package/dist/packages/_es/InputNumber.js +18 -24
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/Menu.js +14 -16
- package/dist/packages/_es/MenuItem.js +11 -9
- package/dist/packages/_es/Navbar.js +7 -7
- package/dist/packages/_es/NoticeBar.js +26 -39
- package/dist/packages/_es/Notify.js +166 -30
- package/dist/packages/_es/NumberKeyboard.js +7 -9
- package/dist/packages/_es/OverLay.js +29 -22
- package/dist/packages/_es/Pagination.js +9 -8
- package/dist/packages/_es/Picker.js +447 -61
- package/dist/packages/_es/Popover.js +34 -161
- package/dist/packages/_es/Popup.js +77 -17
- package/dist/packages/_es/Price.js +7 -18
- package/dist/packages/_es/Progress.js +12 -23
- package/dist/packages/_es/Radio.js +3 -3
- package/dist/packages/_es/RadioGroup.js +2 -2
- package/dist/packages/_es/Range.js +31 -38
- package/dist/packages/_es/Rate.js +35 -17
- package/dist/packages/_es/Row.js +5 -4
- package/dist/packages/_es/SearchBar.js +5 -7
- package/dist/packages/_es/ShortPassword.js +59 -89
- package/dist/packages/_es/Signature.js +71 -70
- package/dist/packages/_es/Sku.js +43 -53
- package/dist/packages/_es/Step.js +8 -10
- package/dist/packages/_es/Steps.js +2 -2
- package/dist/packages/_es/Swipe.js +28 -43
- package/dist/packages/_es/Swiper.js +418 -17
- package/dist/packages/_es/SwiperItem.js +39 -14
- package/dist/packages/_es/Switch.js +32 -11
- package/dist/packages/_es/TabPane.js +5 -4
- package/dist/packages/_es/Tabbar.js +5 -4
- package/dist/packages/_es/TabbarItem.js +9 -8
- package/dist/packages/_es/Tabs.js +16 -22
- package/dist/packages/_es/Tag.js +6 -5
- package/dist/packages/_es/TextArea.js +12 -16
- package/dist/packages/_es/TimeDetail.js +5 -7
- package/dist/packages/_es/TimePannel.js +5 -7
- package/dist/packages/_es/TimeSelect.js +7 -12
- package/dist/packages/_es/Toast.js +178 -46
- package/dist/packages/_es/Uploader.js +149 -109
- package/dist/packages/_es/Video.js +405 -0
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +7 -58
- package/dist/packages/_es/index2.js +58 -43
- package/dist/packages/_es/index3.js +28 -411
- package/dist/packages/_es/plugin-vue_export-helper.js +13 -0
- 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/cellgroup/index.scss +9 -0
- package/dist/packages/dialog/index.scss +17 -0
- package/dist/packages/drag/index.scss +4 -0
- package/dist/packages/fixednav/index.scss +6 -1
- package/dist/packages/formitem/index.scss +3 -0
- package/dist/packages/icon/index.scss +2 -1
- package/dist/packages/numberkeyboard/index.scss +1 -1
- package/dist/packages/popover/index.scss +2 -2
- package/dist/packages/rate/index.scss +1 -0
- package/dist/packages/textarea/index.scss +1 -0
- package/dist/packages/timedetail/index.scss +1 -2
- package/dist/packages/timeselect/index.scss +3 -0
- package/dist/packages/toast/index.scss +6 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +2 -1
- package/dist/styles/font/config.json +2 -1
- package/dist/styles/font/demo_index.html +26 -3
- package/dist/styles/font/iconfont.css +7 -3
- package/dist/styles/font/iconfont.js +31 -32
- package/dist/styles/font/iconfont.json +7 -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 +38 -38
- package/dist/styles/variables.scss +5 -1
- package/package.json +1 -1
- package/dist/packages/_es/commonProps.js +0 -30
- package/dist/packages/_es/index.taro.vue_vue&type=script&lang.js +0 -44
- package/dist/packages/_es/use-lock-scroll.js +0 -23
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import { ref, reactive, watch, onMounted, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, toDisplayString } from "vue";
|
|
6
|
+
import { computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createTextVNode, toDisplayString } from "vue";
|
|
8
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
const { componentName, create } = createComponent("circleprogress");
|
|
10
|
-
|
|
10
|
+
const _sfc_main = create({
|
|
11
11
|
props: {
|
|
12
12
|
progress: {
|
|
13
13
|
type: [Number, String],
|
|
@@ -17,6 +17,10 @@ var _sfc_main = create({
|
|
|
17
17
|
type: [Number, String],
|
|
18
18
|
default: 10
|
|
19
19
|
},
|
|
20
|
+
isAuto: {
|
|
21
|
+
tyep: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
20
24
|
progressOption: {
|
|
21
25
|
type: Object,
|
|
22
26
|
default: () => {
|
|
@@ -24,79 +28,12 @@ var _sfc_main = create({
|
|
|
24
28
|
}
|
|
25
29
|
},
|
|
26
30
|
setup(props, { emit }) {
|
|
27
|
-
const rotateLeft = ref();
|
|
28
|
-
const rotateRight = ref();
|
|
29
|
-
const InnerWidth = ref(props.strokeInnerWidth);
|
|
30
|
-
const isMobile = ref(false);
|
|
31
|
-
const cricleData = reactive({
|
|
32
|
-
radius: 50,
|
|
33
|
-
strokeOutWidth: 10,
|
|
34
|
-
backColor: "#d9d9d9",
|
|
35
|
-
progressColor: "red"
|
|
36
|
-
});
|
|
37
|
-
const loadPercent = (x, y) => {
|
|
38
|
-
let rotate = x / y * 360;
|
|
39
|
-
let rotateRc = 0;
|
|
40
|
-
let rotateLc = 0;
|
|
41
|
-
if (rotate < 180) {
|
|
42
|
-
rotateRc = rotate + -45;
|
|
43
|
-
} else {
|
|
44
|
-
rotateRc = 135;
|
|
45
|
-
rotateLc = rotate - 180 - 45;
|
|
46
|
-
rotateLeft.value = rotateLc;
|
|
47
|
-
}
|
|
48
|
-
rotateRight.value = rotateRc;
|
|
49
|
-
};
|
|
50
|
-
watch(() => props.progress, (value) => {
|
|
51
|
-
loadPercent(value, 100);
|
|
52
|
-
});
|
|
53
|
-
onMounted(() => {
|
|
54
|
-
if (Taro.getEnv() === "WEB") {
|
|
55
|
-
isMobile.value = true;
|
|
56
|
-
} else {
|
|
57
|
-
isMobile.value = false;
|
|
58
|
-
loadPercent(props.progress, 100);
|
|
59
|
-
Object.assign(cricleData, props.progressOption);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
31
|
const classes = computed(() => {
|
|
63
32
|
const prefixCls = componentName;
|
|
64
33
|
return {
|
|
65
34
|
[prefixCls]: true
|
|
66
35
|
};
|
|
67
36
|
});
|
|
68
|
-
const pieStyle = computed(() => {
|
|
69
|
-
return {
|
|
70
|
-
width: (cricleData.radius + cricleData.strokeOutWidth) * 2 + "px",
|
|
71
|
-
height: (cricleData.radius + cricleData.strokeOutWidth) * 2 + "px"
|
|
72
|
-
};
|
|
73
|
-
});
|
|
74
|
-
const mobileStyle = computed(() => {
|
|
75
|
-
return {
|
|
76
|
-
width: "100%",
|
|
77
|
-
height: "100%"
|
|
78
|
-
};
|
|
79
|
-
});
|
|
80
|
-
const RightStyle = computed(() => {
|
|
81
|
-
return {
|
|
82
|
-
transform: `rotate(${rotateRight.value + "deg"})`,
|
|
83
|
-
transition: `all 0.3s`,
|
|
84
|
-
borderTop: `${InnerWidth.value + "px"} solid ${cricleData.backColor};`,
|
|
85
|
-
borderLeft: `${InnerWidth.value + "px"} solid ${cricleData.backColor};`,
|
|
86
|
-
borderBottom: `${InnerWidth.value + "px"} solid ${cricleData.progressColor};`,
|
|
87
|
-
borderRight: `${InnerWidth.value + "px"} solid ${cricleData.progressColor};`
|
|
88
|
-
};
|
|
89
|
-
});
|
|
90
|
-
const LeftStyle = computed(() => {
|
|
91
|
-
return {
|
|
92
|
-
transform: `rotate(${rotateLeft.value + "deg"})`,
|
|
93
|
-
transition: `all 0.3s`,
|
|
94
|
-
borderTop: `${InnerWidth.value + "px"} solid ${cricleData.backColor};`,
|
|
95
|
-
borderLeft: `${InnerWidth.value + "px"} solid ${cricleData.backColor};`,
|
|
96
|
-
borderBottom: `${InnerWidth.value + "px"} solid ${cricleData.progressColor};`,
|
|
97
|
-
borderRight: `${InnerWidth.value + "px"} solid ${cricleData.progressColor};`
|
|
98
|
-
};
|
|
99
|
-
});
|
|
100
37
|
const option = computed(() => {
|
|
101
38
|
let baseOption = {
|
|
102
39
|
radius: 50,
|
|
@@ -120,86 +57,53 @@ var _sfc_main = create({
|
|
|
120
57
|
return `${progressLength},${circleLength}`;
|
|
121
58
|
});
|
|
122
59
|
return {
|
|
123
|
-
isMobile,
|
|
124
|
-
rotateLeft,
|
|
125
|
-
InnerWidth,
|
|
126
|
-
rotateRight,
|
|
127
60
|
classes,
|
|
128
|
-
pieStyle,
|
|
129
|
-
RightStyle,
|
|
130
|
-
LeftStyle,
|
|
131
61
|
option,
|
|
132
|
-
arcLength
|
|
133
|
-
mobileStyle
|
|
62
|
+
arcLength
|
|
134
63
|
};
|
|
135
64
|
}
|
|
136
65
|
});
|
|
137
|
-
const _hoisted_1 =
|
|
138
|
-
const _hoisted_2 =
|
|
139
|
-
const _hoisted_3 =
|
|
140
|
-
const _hoisted_4 = { class: "nut-
|
|
141
|
-
const _hoisted_5 = { class: "nut-circleprogress__line nut-circleprogress__l" };
|
|
142
|
-
const _hoisted_6 = { key: 1 };
|
|
143
|
-
const _hoisted_7 = ["height", "width"];
|
|
144
|
-
const _hoisted_8 = ["r", "cx", "cy", "stroke", "stroke-width"];
|
|
145
|
-
const _hoisted_9 = ["r", "cx", "cy", "stroke", "stroke-dasharray", "stroke-width", "transform"];
|
|
146
|
-
const _hoisted_10 = { class: "nut-circleprogress__progress" };
|
|
66
|
+
const _hoisted_1 = ["height", "width"];
|
|
67
|
+
const _hoisted_2 = ["r", "cx", "cy", "stroke", "stroke-width"];
|
|
68
|
+
const _hoisted_3 = ["r", "cx", "cy", "stroke", "stroke-dasharray", "stroke-width", "transform"];
|
|
69
|
+
const _hoisted_4 = { class: "nut-circleprogress-content" };
|
|
147
70
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
148
71
|
return openBlock(), createElementBlock("div", {
|
|
149
72
|
class: normalizeClass(_ctx.classes),
|
|
150
|
-
style: normalizeStyle(_ctx.
|
|
73
|
+
style: normalizeStyle({ height: _ctx.option.size + "px", width: _ctx.option.size + "px" })
|
|
151
74
|
}, [
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
75
|
+
(openBlock(), createElementBlock("svg", {
|
|
76
|
+
height: _ctx.option.size,
|
|
77
|
+
width: _ctx.option.size,
|
|
78
|
+
"x-mlns": "http://www.w3.org/200/svg"
|
|
155
79
|
}, [
|
|
156
|
-
createElementVNode("
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
createElementVNode("
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}, [
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
cy: _ctx.option.cy,
|
|
183
|
-
stroke: _ctx.option.backColor,
|
|
184
|
-
"stroke-width": _ctx.option.strokeOutWidth,
|
|
185
|
-
fill: "none"
|
|
186
|
-
}, null, 8, _hoisted_8),
|
|
187
|
-
createElementVNode("circle", {
|
|
188
|
-
r: _ctx.option.radius,
|
|
189
|
-
cx: _ctx.option.cx,
|
|
190
|
-
cy: _ctx.option.cy,
|
|
191
|
-
stroke: _ctx.option.progressColor,
|
|
192
|
-
"stroke-dasharray": _ctx.arcLength,
|
|
193
|
-
"stroke-width": _ctx.strokeInnerWidth,
|
|
194
|
-
fill: "none",
|
|
195
|
-
transform: _ctx.option.startPosition,
|
|
196
|
-
"stroke-linecap": "round",
|
|
197
|
-
style: { "transition": "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease 0s" }
|
|
198
|
-
}, null, 8, _hoisted_9)
|
|
199
|
-
], 8, _hoisted_7)),
|
|
200
|
-
createElementVNode("div", _hoisted_10, toDisplayString(_ctx.progress) + "%", 1)
|
|
201
|
-
]))
|
|
80
|
+
createElementVNode("circle", {
|
|
81
|
+
r: _ctx.option.radius,
|
|
82
|
+
cx: _ctx.option.cx,
|
|
83
|
+
cy: _ctx.option.cy,
|
|
84
|
+
stroke: _ctx.option.backColor,
|
|
85
|
+
"stroke-width": _ctx.option.strokeOutWidth,
|
|
86
|
+
fill: "none"
|
|
87
|
+
}, null, 8, _hoisted_2),
|
|
88
|
+
createElementVNode("circle", {
|
|
89
|
+
r: _ctx.option.radius,
|
|
90
|
+
cx: _ctx.option.cx,
|
|
91
|
+
cy: _ctx.option.cy,
|
|
92
|
+
stroke: _ctx.option.progressColor,
|
|
93
|
+
"stroke-dasharray": _ctx.arcLength,
|
|
94
|
+
"stroke-width": _ctx.strokeInnerWidth,
|
|
95
|
+
fill: "none",
|
|
96
|
+
transform: _ctx.option.startPosition,
|
|
97
|
+
"stroke-linecap": "round",
|
|
98
|
+
style: { "transition": "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease 0s" }
|
|
99
|
+
}, null, 8, _hoisted_3)
|
|
100
|
+
], 8, _hoisted_1)),
|
|
101
|
+
createElementVNode("div", _hoisted_4, [
|
|
102
|
+
!_ctx.isAuto ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
|
|
103
|
+
createTextVNode(toDisplayString(_ctx.progress) + "%", 1)
|
|
104
|
+
]) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
105
|
+
])
|
|
202
106
|
], 6);
|
|
203
107
|
}
|
|
204
|
-
_sfc_main
|
|
205
|
-
export {
|
|
108
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
109
|
+
export { index as default };
|
package/dist/packages/_es/Col.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { inject, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
8
9
|
const { componentName, create } = createComponent("col");
|
|
9
|
-
|
|
10
|
+
const _sfc_main = create({
|
|
10
11
|
props: {
|
|
11
12
|
span: {
|
|
12
13
|
type: [String, Number],
|
|
@@ -48,5 +49,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
48
49
|
renderSlot(_ctx.$slots, "default")
|
|
49
50
|
], 6);
|
|
50
51
|
}
|
|
51
|
-
_sfc_main
|
|
52
|
-
export {
|
|
52
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
53
|
+
export { index as default };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { provide, openBlock, createElementBlock, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
8
9
|
const { create } = createComponent("collapse");
|
|
9
|
-
|
|
10
|
+
const _sfc_main = create({
|
|
10
11
|
props: {
|
|
11
12
|
active: {
|
|
12
13
|
type: [String, Number, Array]
|
|
@@ -48,20 +49,20 @@ var _sfc_main = create({
|
|
|
48
49
|
}
|
|
49
50
|
},
|
|
50
51
|
emits: ["update:active", "change"],
|
|
51
|
-
setup(props, { emit
|
|
52
|
+
setup(props, { emit }) {
|
|
52
53
|
const changeVal = (val) => {
|
|
53
54
|
emit("update:active", val);
|
|
54
55
|
emit("change", val);
|
|
55
56
|
};
|
|
56
57
|
const changeValAry = (name) => {
|
|
57
58
|
const activeItem = props.active instanceof Object ? Object.values(props.active) : props.active;
|
|
58
|
-
let
|
|
59
|
+
let index2 = -1;
|
|
59
60
|
activeItem.forEach((item, idx) => {
|
|
60
61
|
if (String(item) == String(name)) {
|
|
61
|
-
|
|
62
|
+
index2 = idx;
|
|
62
63
|
}
|
|
63
64
|
});
|
|
64
|
-
|
|
65
|
+
index2 > -1 ? activeItem.splice(index2, 1) : activeItem.push(name);
|
|
65
66
|
changeVal(activeItem);
|
|
66
67
|
};
|
|
67
68
|
const isExpanded = (name) => {
|
|
@@ -70,38 +71,12 @@ var _sfc_main = create({
|
|
|
70
71
|
return typeof active === "number" || typeof active === "string" ? active == name : false;
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
|
-
const activeIndex = () => {
|
|
74
|
-
var _a;
|
|
75
|
-
const activeCollapse = props.active;
|
|
76
|
-
const childrenList = (_a = slots.default) == null ? void 0 : _a.call(slots);
|
|
77
|
-
let act = [];
|
|
78
|
-
childrenList.forEach((item, index) => {
|
|
79
|
-
if (typeof activeCollapse == "number" || typeof activeCollapse == "string") {
|
|
80
|
-
if (item.props.name == activeCollapse) {
|
|
81
|
-
act.push(item.flag);
|
|
82
|
-
return act;
|
|
83
|
-
}
|
|
84
|
-
} else {
|
|
85
|
-
let ary = Array.from(activeCollapse);
|
|
86
|
-
if (ary.includes(String(item.props.name)) || ary.includes(Number(item.props.name))) {
|
|
87
|
-
act.push(item.flag);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
return act;
|
|
92
|
-
};
|
|
93
|
-
const getParentChildren = () => {
|
|
94
|
-
var _a;
|
|
95
|
-
return (_a = slots.default) == null ? void 0 : _a.call(slots);
|
|
96
|
-
};
|
|
97
74
|
provide("collapseParent", {
|
|
98
75
|
children: [],
|
|
99
76
|
props,
|
|
100
77
|
changeValAry,
|
|
101
78
|
changeVal,
|
|
102
|
-
isExpanded
|
|
103
|
-
activeIndex,
|
|
104
|
-
getParentChildren
|
|
79
|
+
isExpanded
|
|
105
80
|
});
|
|
106
81
|
}
|
|
107
82
|
});
|
|
@@ -110,5 +85,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
110
85
|
renderSlot(_ctx.$slots, "default")
|
|
111
86
|
]);
|
|
112
87
|
}
|
|
113
|
-
_sfc_main
|
|
114
|
-
export {
|
|
88
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
89
|
+
export { index as default };
|
|
@@ -17,19 +17,16 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
21
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
-
};
|
|
23
20
|
/*!
|
|
24
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
25
22
|
* (c) 2021 @jdf2e.
|
|
26
23
|
* Released under the MIT License.
|
|
27
24
|
*/
|
|
28
|
-
import { inject,
|
|
29
|
-
import Taro, { eventCenter, getCurrentInstance as getCurrentInstance$1 } from "@tarojs/taro";
|
|
25
|
+
import { inject, reactive, computed, getCurrentInstance, ref, watch, onMounted, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, createCommentVNode, renderSlot, normalizeStyle } from "vue";
|
|
30
26
|
import { c as createComponent } from "./component.js";
|
|
27
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
31
28
|
const { create, componentName } = createComponent("collapse-item");
|
|
32
|
-
|
|
29
|
+
const _sfc_main = create({
|
|
33
30
|
props: {
|
|
34
31
|
title: {
|
|
35
32
|
type: String,
|
|
@@ -54,7 +51,6 @@ var _sfc_main = create({
|
|
|
54
51
|
},
|
|
55
52
|
setup(props) {
|
|
56
53
|
const collapse = inject("collapseParent");
|
|
57
|
-
const conHeight = ref(0);
|
|
58
54
|
const parent = reactive(collapse);
|
|
59
55
|
const classes = computed(() => {
|
|
60
56
|
const prefixCls = componentName;
|
|
@@ -73,7 +69,7 @@ var _sfc_main = create({
|
|
|
73
69
|
icon: parent.props.icon,
|
|
74
70
|
iconSize: parent.props.iconSize,
|
|
75
71
|
iconColor: parent.props.iconColor,
|
|
76
|
-
openExpanded:
|
|
72
|
+
openExpanded: false,
|
|
77
73
|
iconStyle: {
|
|
78
74
|
transform: "rotate(0deg)",
|
|
79
75
|
marginTop: parent.props.iconHeght ? "-" + parent.props.iconHeght / 2 + "px" : "-10px"
|
|
@@ -88,33 +84,29 @@ var _sfc_main = create({
|
|
|
88
84
|
const wrapperRef = ref(null);
|
|
89
85
|
const contentRef = ref(null);
|
|
90
86
|
const onTransitionEnd = () => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
let ary = Array.from(item1.$el.children);
|
|
94
|
-
ary.forEach((item2, index2) => {
|
|
95
|
-
if (item2.className.includes("collapse-wrapper")) {
|
|
96
|
-
item2.style.willChange = "auto";
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
});
|
|
87
|
+
const wrapperRefEle = document.getElementsByClassName("collapse-wrapper")[0];
|
|
88
|
+
wrapperRefEle.style.willChange = "auto";
|
|
101
89
|
};
|
|
102
90
|
const animation = () => {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
91
|
+
const wrapperRefEle = wrapperRef.value;
|
|
92
|
+
const contentRefEle = contentRef.value;
|
|
93
|
+
if (!wrapperRefEle || !contentRefEle) {
|
|
94
|
+
return;
|
|
107
95
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
96
|
+
const offsetHeight = contentRefEle.offsetHeight;
|
|
97
|
+
if (offsetHeight) {
|
|
98
|
+
const contentHeight = `${offsetHeight}px`;
|
|
99
|
+
wrapperRefEle.style.willChange = "height";
|
|
100
|
+
wrapperRefEle.style.height = !proxyData.openExpanded ? 0 : contentHeight;
|
|
101
|
+
if (parent.props.icon && !proxyData.openExpanded) {
|
|
102
|
+
proxyData.iconStyle["transform"] = "rotate(0deg)";
|
|
103
|
+
} else {
|
|
104
|
+
proxyData.iconStyle["transform"] = "rotate(" + parent.props.rotate + "deg)";
|
|
116
105
|
}
|
|
117
|
-
}
|
|
106
|
+
}
|
|
107
|
+
if (!proxyData.openExpanded) {
|
|
108
|
+
onTransitionEnd();
|
|
109
|
+
}
|
|
118
110
|
};
|
|
119
111
|
const open = () => {
|
|
120
112
|
proxyData.openExpanded = !proxyData.openExpanded;
|
|
@@ -129,7 +121,7 @@ var _sfc_main = create({
|
|
|
129
121
|
const currentName = computed(() => props.name);
|
|
130
122
|
const toggleOpen = () => {
|
|
131
123
|
if (parent.props.accordion) {
|
|
132
|
-
parent.children.forEach((item,
|
|
124
|
+
parent.children.forEach((item, index2) => {
|
|
133
125
|
if (currentName.value == item.name) {
|
|
134
126
|
item.changeOpen(!item.openExpanded);
|
|
135
127
|
} else {
|
|
@@ -160,45 +152,9 @@ var _sfc_main = create({
|
|
|
160
152
|
proxyData.openExpanded = true;
|
|
161
153
|
}
|
|
162
154
|
});
|
|
163
|
-
const getH = (list) => {
|
|
164
|
-
parent.children.forEach((item1, index1) => {
|
|
165
|
-
let ary = Array.from(item1.$el.children);
|
|
166
|
-
let _uid = ary[1].children[0]["uid"];
|
|
167
|
-
let tm = list.filter((item2) => item2.id == _uid);
|
|
168
|
-
if (tm && tm.length > 0) {
|
|
169
|
-
let h = tm[0]["height"];
|
|
170
|
-
item1.conHeight = h;
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
};
|
|
174
|
-
const getH5 = () => {
|
|
175
|
-
parent.children.forEach((item1, index1) => {
|
|
176
|
-
let ary = Array.from(item1.$el.children);
|
|
177
|
-
let h = ary[1].children[0]["offsetHeight"];
|
|
178
|
-
item1.conHeight = h;
|
|
179
|
-
});
|
|
180
|
-
};
|
|
181
|
-
const getRefHeight = () => {
|
|
182
|
-
const query = Taro.createSelectorQuery();
|
|
183
|
-
query.selectAll(".collapse-content").boundingClientRect();
|
|
184
|
-
query.exec((res) => {
|
|
185
|
-
if (Taro.getEnv() === "WEB") {
|
|
186
|
-
getH5();
|
|
187
|
-
} else {
|
|
188
|
-
getH(res[0]);
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
};
|
|
192
155
|
onMounted(() => {
|
|
193
156
|
const { name } = props;
|
|
194
157
|
const active = parent && parent.props.active;
|
|
195
|
-
if (Taro.getEnv() === "WEB") {
|
|
196
|
-
getRefHeight();
|
|
197
|
-
} else {
|
|
198
|
-
eventCenter.once(getCurrentInstance$1().router.onReady, () => {
|
|
199
|
-
getRefHeight();
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
158
|
if (typeof active == "number" || typeof active == "string") {
|
|
203
159
|
if (name == active) {
|
|
204
160
|
defaultOpen();
|
|
@@ -213,7 +169,6 @@ var _sfc_main = create({
|
|
|
213
169
|
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({
|
|
214
170
|
classes
|
|
215
171
|
}, toRefs(proxyData)), toRefs(parent.props)), toRefs(titleIconStyle)), {
|
|
216
|
-
conHeight,
|
|
217
172
|
wrapperRef,
|
|
218
173
|
contentRef,
|
|
219
174
|
open,
|
|
@@ -232,6 +187,10 @@ const _hoisted_4 = {
|
|
|
232
187
|
};
|
|
233
188
|
const _hoisted_5 = ["innerHTML"];
|
|
234
189
|
const _hoisted_6 = {
|
|
190
|
+
class: "collapse-wrapper",
|
|
191
|
+
ref: "wrapperRef"
|
|
192
|
+
};
|
|
193
|
+
const _hoisted_7 = {
|
|
235
194
|
class: "collapse-content",
|
|
236
195
|
ref: "contentRef"
|
|
237
196
|
};
|
|
@@ -252,7 +211,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
252
211
|
name: _ctx.titleIcon,
|
|
253
212
|
size: _ctx.titleIconSize,
|
|
254
213
|
color: _ctx.titleIconColor,
|
|
255
|
-
class: normalizeClass([
|
|
214
|
+
class: normalizeClass([_ctx.titleIconPosition == "left" ? "titleIconLeft" : "titleIconRight"])
|
|
256
215
|
}, null, 8, ["name", "size", "color", "class"])) : createCommentVNode("", true),
|
|
257
216
|
_ctx.$slots.mTitle ? renderSlot(_ctx.$slots, "mTitle", { key: 1 }) : (openBlock(), createElementBlock("view", {
|
|
258
217
|
key: 2,
|
|
@@ -278,16 +237,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
278
237
|
style: normalizeStyle(_ctx.iconStyle)
|
|
279
238
|
}, null, 8, ["name", "size", "color", "class", "style"])) : createCommentVNode("", true)
|
|
280
239
|
], 2),
|
|
281
|
-
createElementVNode("view",
|
|
282
|
-
|
|
283
|
-
ref: "wrapperRef",
|
|
284
|
-
style: normalizeStyle({ height: _ctx.openExpanded ? _ctx.conHeight + "px" : 0 })
|
|
285
|
-
}, [
|
|
286
|
-
createElementVNode("view", _hoisted_6, [
|
|
240
|
+
createElementVNode("view", _hoisted_6, [
|
|
241
|
+
createElementVNode("view", _hoisted_7, [
|
|
287
242
|
renderSlot(_ctx.$slots, "default")
|
|
288
243
|
], 512)
|
|
289
|
-
],
|
|
244
|
+
], 512)
|
|
290
245
|
], 2);
|
|
291
246
|
}
|
|
292
|
-
_sfc_main
|
|
293
|
-
export {
|
|
247
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
248
|
+
export { index as default };
|
|
@@ -17,18 +17,16 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
21
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
-
};
|
|
23
20
|
/*!
|
|
24
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
25
22
|
* (c) 2021 @jdf2e.
|
|
26
23
|
* Released under the MIT License.
|
|
27
24
|
*/
|
|
28
25
|
import { reactive, computed, watch, toRefs, openBlock, createElementBlock, normalizeClass, renderSlot, toDisplayString, Fragment, createElementVNode, createCommentVNode } from "vue";
|
|
29
26
|
import { c as createComponent } from "./component.js";
|
|
27
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
30
28
|
const { componentName, create } = createComponent("countdown");
|
|
31
|
-
|
|
29
|
+
const _sfc_main = create({
|
|
32
30
|
props: {
|
|
33
31
|
modelValue: {
|
|
34
32
|
type: Object,
|
|
@@ -222,5 +220,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
222
220
|
], 64))
|
|
223
221
|
], 2);
|
|
224
222
|
}
|
|
225
|
-
_sfc_main
|
|
226
|
-
export {
|
|
223
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
224
|
+
export { index as default };
|