@nutui/nutui 3.1.12-beta.1 → 3.1.14
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 +56 -0
- package/README.md +139 -37
- package/dist/nutui.d.ts +9 -2
- package/dist/nutui.es.js +4830 -2950
- package/dist/nutui.umd.js +4910 -2953
- package/dist/packages/_es/ActionSheet.js +12 -13
- package/dist/packages/_es/Address.js +64 -77
- 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/Cascader.js +547 -0
- 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 +7 -10
- package/dist/packages/_es/CountUp.js +33 -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 +53 -81
- package/dist/packages/_es/Empty.js +74 -0
- package/dist/packages/_es/FixedNav.js +9 -8
- package/dist/packages/_es/Form.js +23 -9
- package/dist/packages/_es/FormItem.js +5 -4
- package/dist/packages/_es/Grid.js +12 -0
- package/dist/packages/_es/GridItem.js +149 -0
- package/dist/packages/_es/Icon.js +40 -6
- package/dist/packages/_es/ImagePreview.js +158 -44
- package/dist/packages/_es/Indicator.js +66 -0
- 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 +31 -46
- 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/Skeleton.js +138 -0
- 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 +47 -16
- 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/Table.js +191 -0
- package/dist/packages/_es/Tabs.js +21 -23
- 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/common.js +136 -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/cascader/index.scss +81 -0
- 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/empty/index.scss +33 -0
- package/dist/packages/fixednav/index.scss +6 -1
- package/dist/packages/formitem/index.scss +4 -1
- package/dist/packages/grid/index.scss +10 -0
- package/dist/packages/griditem/index.scss +92 -0
- package/dist/packages/icon/index.scss +2 -1
- package/dist/packages/indicator/index.scss +48 -0
- 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/skeleton/index.scss +57 -0
- package/dist/packages/table/index.scss +81 -0
- package/dist/packages/tabs/index.scss +16 -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 +40 -33
- package/dist/styles/variables.scss +54 -1
- package/package.json +2 -3
- 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,49 +1,64 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { ref } from "vue";
|
|
7
|
+
const MIN_DISTANCE = 10;
|
|
8
|
+
function getDirection(x, y) {
|
|
9
|
+
if (x > y && x > MIN_DISTANCE) {
|
|
10
|
+
return "horizontal";
|
|
11
|
+
}
|
|
12
|
+
if (y > x && y > MIN_DISTANCE) {
|
|
13
|
+
return "vertical";
|
|
14
|
+
}
|
|
15
|
+
return "";
|
|
9
16
|
}
|
|
10
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} else {
|
|
41
|
-
const query = Taro.createSelectorQuery();
|
|
42
|
-
query.select(`#${element.id}`).boundingClientRect();
|
|
43
|
-
query.exec(function(res) {
|
|
44
|
-
resolve(res[0]);
|
|
45
|
-
});
|
|
17
|
+
function useTouch() {
|
|
18
|
+
const startX = ref(0);
|
|
19
|
+
const startY = ref(0);
|
|
20
|
+
const deltaX = ref(0);
|
|
21
|
+
const deltaY = ref(0);
|
|
22
|
+
const offsetX = ref(0);
|
|
23
|
+
const offsetY = ref(0);
|
|
24
|
+
const direction = ref("");
|
|
25
|
+
const isVertical = () => direction.value === "vertical";
|
|
26
|
+
const isHorizontal = () => direction.value === "horizontal";
|
|
27
|
+
const reset = () => {
|
|
28
|
+
deltaX.value = 0;
|
|
29
|
+
deltaY.value = 0;
|
|
30
|
+
offsetX.value = 0;
|
|
31
|
+
offsetY.value = 0;
|
|
32
|
+
direction.value = "";
|
|
33
|
+
};
|
|
34
|
+
const start = (event) => {
|
|
35
|
+
reset();
|
|
36
|
+
startX.value = event.touches[0].clientX;
|
|
37
|
+
startY.value = event.touches[0].clientY;
|
|
38
|
+
};
|
|
39
|
+
const move = (event) => {
|
|
40
|
+
const touch = event.touches[0];
|
|
41
|
+
deltaX.value = touch.clientX - startX.value;
|
|
42
|
+
deltaY.value = touch.clientY - startY.value;
|
|
43
|
+
offsetX.value = Math.abs(deltaX.value);
|
|
44
|
+
offsetY.value = Math.abs(deltaY.value);
|
|
45
|
+
if (!direction.value) {
|
|
46
|
+
direction.value = getDirection(offsetX.value, offsetY.value);
|
|
46
47
|
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
move,
|
|
51
|
+
start,
|
|
52
|
+
reset,
|
|
53
|
+
startX,
|
|
54
|
+
startY,
|
|
55
|
+
deltaX,
|
|
56
|
+
deltaY,
|
|
57
|
+
offsetX,
|
|
58
|
+
offsetY,
|
|
59
|
+
direction,
|
|
60
|
+
isVertical,
|
|
61
|
+
isHorizontal
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export { useTouch as u };
|
|
@@ -1,419 +1,36 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
21
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
-
};
|
|
23
1
|
/*!
|
|
24
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
|
|
25
3
|
* (c) 2021 @jdf2e.
|
|
26
4
|
* Released under the MIT License.
|
|
27
5
|
*/
|
|
28
|
-
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
import { p as pxCheck } from "./pxCheck.js";
|
|
32
|
-
const { componentName: componentName$2, create: create$2 } = createComponent("overlay");
|
|
33
|
-
const overlayProps = {
|
|
34
|
-
visible: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: false
|
|
37
|
-
},
|
|
38
|
-
zIndex: {
|
|
39
|
-
type: [Number, String],
|
|
40
|
-
default: 2e3
|
|
41
|
-
},
|
|
42
|
-
duration: {
|
|
43
|
-
type: [Number, String],
|
|
44
|
-
default: 0.3
|
|
45
|
-
},
|
|
46
|
-
overlayClass: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: ""
|
|
49
|
-
},
|
|
50
|
-
lockScroll: {
|
|
51
|
-
type: Boolean,
|
|
52
|
-
default: true
|
|
53
|
-
},
|
|
54
|
-
overlayStyle: {
|
|
55
|
-
type: Object
|
|
56
|
-
},
|
|
57
|
-
closeOnClickOverlay: {
|
|
58
|
-
type: Boolean,
|
|
59
|
-
default: true
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
var _sfc_main$2 = create$2({
|
|
63
|
-
props: overlayProps,
|
|
64
|
-
emits: ["click", "update:visible"],
|
|
65
|
-
setup(props, { emit }) {
|
|
66
|
-
const classes = computed(() => {
|
|
67
|
-
const prefixCls = componentName$2;
|
|
68
|
-
return {
|
|
69
|
-
[prefixCls]: true,
|
|
70
|
-
[props.overlayClass]: true
|
|
71
|
-
};
|
|
72
|
-
});
|
|
73
|
-
watch(() => props.visible, (value) => {
|
|
74
|
-
value ? lock() : unlock();
|
|
75
|
-
});
|
|
76
|
-
const lock = () => {
|
|
77
|
-
if (props.lockScroll && props.visible) {
|
|
78
|
-
document.body.classList.add("nut-overflow-hidden");
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
const unlock = () => {
|
|
82
|
-
document.body.classList.remove("nut-overflow-hidden");
|
|
83
|
-
};
|
|
84
|
-
onDeactivated(unlock);
|
|
85
|
-
onBeforeUnmount(unlock);
|
|
86
|
-
onMounted(lock);
|
|
87
|
-
onActivated(lock);
|
|
88
|
-
const style = computed(() => {
|
|
89
|
-
return __spreadValues({
|
|
90
|
-
animationDuration: `${props.duration}s`,
|
|
91
|
-
zIndex: props.zIndex
|
|
92
|
-
}, props.overlayStyle);
|
|
93
|
-
});
|
|
94
|
-
const touchmove = (e) => {
|
|
95
|
-
if (props.lockScroll)
|
|
96
|
-
e.preventDefault();
|
|
97
|
-
};
|
|
98
|
-
const onClick = (e) => {
|
|
99
|
-
emit("click", e);
|
|
100
|
-
if (props.closeOnClickOverlay) {
|
|
101
|
-
emit("update:visible", false);
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
return { classes, style, touchmove, onClick };
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
108
|
-
return openBlock(), createBlock(Transition, { name: "overlay-fade" }, {
|
|
109
|
-
default: withCtx(() => [
|
|
110
|
-
withDirectives(createElementVNode("view", {
|
|
111
|
-
class: normalizeClass(_ctx.classes),
|
|
112
|
-
onTouchmove: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.touchmove && _ctx.touchmove(...args), ["stop"])),
|
|
113
|
-
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClick && _ctx.onClick(...args)),
|
|
114
|
-
style: normalizeStyle(_ctx.style)
|
|
115
|
-
}, [
|
|
116
|
-
renderSlot(_ctx.$slots, "default")
|
|
117
|
-
], 38), [
|
|
118
|
-
[vShow, _ctx.visible]
|
|
119
|
-
])
|
|
120
|
-
]),
|
|
121
|
-
_: 3
|
|
122
|
-
});
|
|
6
|
+
import { unref } from "vue";
|
|
7
|
+
function isWindow(val) {
|
|
8
|
+
return val === window;
|
|
123
9
|
}
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
setup(props, { emit, slots }) {
|
|
137
|
-
const handleClick = (event) => {
|
|
138
|
-
emit("click", event);
|
|
139
|
-
};
|
|
140
|
-
const isImage = () => {
|
|
141
|
-
return props.name ? props.name.indexOf("/") !== -1 : false;
|
|
142
|
-
};
|
|
143
|
-
return () => {
|
|
144
|
-
var _a;
|
|
145
|
-
const _isImage = isImage();
|
|
146
|
-
return h(_isImage ? "img" : props.tag, {
|
|
147
|
-
class: _isImage ? `${componentName$1}__img` : `${props.fontClassName} ${componentName$1} ${props.classPrefix}-${props.name}`,
|
|
148
|
-
style: {
|
|
149
|
-
color: props.color,
|
|
150
|
-
fontSize: pxCheck(props.size),
|
|
151
|
-
width: pxCheck(props.size),
|
|
152
|
-
height: pxCheck(props.size)
|
|
153
|
-
},
|
|
154
|
-
onClick: handleClick,
|
|
155
|
-
src: _isImage ? props.name : ""
|
|
156
|
-
}, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
10
|
+
const useRect = (elementRef) => {
|
|
11
|
+
const element = unref(elementRef);
|
|
12
|
+
if (isWindow(element)) {
|
|
13
|
+
const width = element.innerWidth;
|
|
14
|
+
const height = element.innerHeight;
|
|
15
|
+
return {
|
|
16
|
+
top: 0,
|
|
17
|
+
left: 0,
|
|
18
|
+
right: width,
|
|
19
|
+
bottom: height,
|
|
20
|
+
width,
|
|
21
|
+
height
|
|
157
22
|
};
|
|
158
23
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
let _zIndex = 2e3;
|
|
162
|
-
const popupProps = __spreadProps(__spreadValues({}, overlayProps), {
|
|
163
|
-
position: {
|
|
164
|
-
type: String,
|
|
165
|
-
default: "center"
|
|
166
|
-
},
|
|
167
|
-
transition: String,
|
|
168
|
-
style: {
|
|
169
|
-
type: Object
|
|
170
|
-
},
|
|
171
|
-
popClass: {
|
|
172
|
-
type: String,
|
|
173
|
-
default: ""
|
|
174
|
-
},
|
|
175
|
-
closeable: {
|
|
176
|
-
type: Boolean,
|
|
177
|
-
default: false
|
|
178
|
-
},
|
|
179
|
-
closeIconPosition: {
|
|
180
|
-
type: String,
|
|
181
|
-
default: "top-right"
|
|
182
|
-
},
|
|
183
|
-
closeIcon: {
|
|
184
|
-
type: String,
|
|
185
|
-
default: "close"
|
|
186
|
-
},
|
|
187
|
-
destroyOnClose: {
|
|
188
|
-
type: Boolean,
|
|
189
|
-
default: true
|
|
190
|
-
},
|
|
191
|
-
teleport: {
|
|
192
|
-
type: [String, Element],
|
|
193
|
-
default: "body"
|
|
194
|
-
},
|
|
195
|
-
overlay: {
|
|
196
|
-
type: Boolean,
|
|
197
|
-
default: true
|
|
198
|
-
},
|
|
199
|
-
round: {
|
|
200
|
-
type: Boolean,
|
|
201
|
-
default: false
|
|
202
|
-
},
|
|
203
|
-
isWrapTeleport: {
|
|
204
|
-
type: Boolean,
|
|
205
|
-
default: true
|
|
24
|
+
if (element && element.getBoundingClientRect) {
|
|
25
|
+
return element.getBoundingClientRect();
|
|
206
26
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
zIndex: props.zIndex ? props.zIndex : _zIndex,
|
|
218
|
-
showSlot: true,
|
|
219
|
-
transitionName: `popup-fade-${props.position}`,
|
|
220
|
-
overLayCount: 1,
|
|
221
|
-
keepAlive: false
|
|
222
|
-
});
|
|
223
|
-
const [lockScroll, unlockScroll] = useLockScroll(() => props.lockScroll);
|
|
224
|
-
const classes = computed(() => {
|
|
225
|
-
const prefixCls = componentName;
|
|
226
|
-
return {
|
|
227
|
-
[prefixCls]: true,
|
|
228
|
-
["round"]: props.round,
|
|
229
|
-
[`popup-${props.position}`]: true,
|
|
230
|
-
[props.popClass]: true
|
|
231
|
-
};
|
|
232
|
-
});
|
|
233
|
-
const popStyle = computed(() => {
|
|
234
|
-
return __spreadValues({
|
|
235
|
-
zIndex: state.zIndex,
|
|
236
|
-
animationDuration: props.duration ? `${props.duration}s` : "initial"
|
|
237
|
-
}, props.style);
|
|
238
|
-
});
|
|
239
|
-
const open = () => {
|
|
240
|
-
if (!props.visible) {
|
|
241
|
-
if (props.zIndex !== void 0) {
|
|
242
|
-
_zIndex = Number(props.zIndex);
|
|
243
|
-
}
|
|
244
|
-
emit("update:visible", true);
|
|
245
|
-
lockScroll();
|
|
246
|
-
state.zIndex = ++_zIndex;
|
|
247
|
-
}
|
|
248
|
-
if (props.destroyOnClose) {
|
|
249
|
-
state.showSlot = true;
|
|
250
|
-
}
|
|
251
|
-
emit("open");
|
|
252
|
-
};
|
|
253
|
-
const close = () => {
|
|
254
|
-
if (props.visible) {
|
|
255
|
-
unlockScroll();
|
|
256
|
-
emit("update:visible", false);
|
|
257
|
-
if (props.destroyOnClose) {
|
|
258
|
-
setTimeout(() => {
|
|
259
|
-
state.showSlot = false;
|
|
260
|
-
emit("close");
|
|
261
|
-
}, +props.duration * 1e3);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
};
|
|
265
|
-
const onClick = (e) => {
|
|
266
|
-
emit("click", e);
|
|
267
|
-
};
|
|
268
|
-
const onClickCloseIcon = (e) => {
|
|
269
|
-
emit("click-close-icon", e);
|
|
270
|
-
close();
|
|
271
|
-
};
|
|
272
|
-
const onClickOverlay = (e) => {
|
|
273
|
-
if (props.closeOnClickOverlay) {
|
|
274
|
-
emit("click-overlay", e);
|
|
275
|
-
close();
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
const onOpened = (e) => {
|
|
279
|
-
emit("opend", e);
|
|
280
|
-
};
|
|
281
|
-
const onClosed = (e) => {
|
|
282
|
-
emit("closed", e);
|
|
283
|
-
};
|
|
284
|
-
onMounted(() => {
|
|
285
|
-
props.transition ? state.transitionName = props.transition : state.transitionName = `popup-slide-${props.position}`;
|
|
286
|
-
props.visible && open();
|
|
287
|
-
});
|
|
288
|
-
onBeforeUnmount(() => {
|
|
289
|
-
props.visible && close();
|
|
290
|
-
});
|
|
291
|
-
onBeforeMount(() => {
|
|
292
|
-
if (props.visible) {
|
|
293
|
-
unlockScroll();
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
onActivated(() => {
|
|
297
|
-
if (state.keepAlive) {
|
|
298
|
-
emit("update:visible", true);
|
|
299
|
-
state.keepAlive = false;
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
onDeactivated(() => {
|
|
303
|
-
if (props.visible) {
|
|
304
|
-
close();
|
|
305
|
-
state.keepAlive = true;
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
watch(() => props.visible, (value) => {
|
|
309
|
-
if (value) {
|
|
310
|
-
open();
|
|
311
|
-
} else {
|
|
312
|
-
close();
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
watch(() => props.position, (value) => {
|
|
316
|
-
value === "center" ? state.transitionName = "popup-fade" : state.transitionName = `popup-slide-${value}`;
|
|
317
|
-
});
|
|
318
|
-
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
319
|
-
popStyle,
|
|
320
|
-
classes,
|
|
321
|
-
onClick,
|
|
322
|
-
onClickCloseIcon,
|
|
323
|
-
onClickOverlay,
|
|
324
|
-
onOpened,
|
|
325
|
-
onClosed
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
const _hoisted_1 = { key: 1 };
|
|
330
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
331
|
-
const _component_nut_overlay = resolveComponent("nut-overlay");
|
|
332
|
-
const _component_nut_icon = resolveComponent("nut-icon");
|
|
333
|
-
return _ctx.isWrapTeleport ? (openBlock(), createBlock(Teleport, {
|
|
334
|
-
key: 0,
|
|
335
|
-
to: _ctx.teleport
|
|
336
|
-
}, [
|
|
337
|
-
_ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, {
|
|
338
|
-
key: 0,
|
|
339
|
-
visible: _ctx.visible,
|
|
340
|
-
"close-on-click-overlay": _ctx.closeOnClickOverlay,
|
|
341
|
-
class: normalizeClass(_ctx.overlayClass),
|
|
342
|
-
style: normalizeStyle(_ctx.overlayStyle),
|
|
343
|
-
"z-index": _ctx.zIndex,
|
|
344
|
-
"lock-scroll": _ctx.lockScroll,
|
|
345
|
-
duration: _ctx.duration,
|
|
346
|
-
onClick: _ctx.onClickOverlay
|
|
347
|
-
}, null, 8, ["visible", "close-on-click-overlay", "class", "style", "z-index", "lock-scroll", "duration", "onClick"])) : createCommentVNode("", true),
|
|
348
|
-
createVNode(Transition, {
|
|
349
|
-
name: _ctx.transitionName,
|
|
350
|
-
onAfterEnter: _ctx.onOpened,
|
|
351
|
-
onAfterLeave: _ctx.onClosed
|
|
352
|
-
}, {
|
|
353
|
-
default: withCtx(() => [
|
|
354
|
-
withDirectives(createElementVNode("view", {
|
|
355
|
-
class: normalizeClass(_ctx.classes),
|
|
356
|
-
style: normalizeStyle(_ctx.popStyle),
|
|
357
|
-
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClick && _ctx.onClick(...args))
|
|
358
|
-
}, [
|
|
359
|
-
_ctx.showSlot ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true),
|
|
360
|
-
_ctx.closeable ? (openBlock(), createElementBlock("view", {
|
|
361
|
-
key: 1,
|
|
362
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClickCloseIcon && _ctx.onClickCloseIcon(...args)),
|
|
363
|
-
class: normalizeClass(["nutui-popup__close-icon", "nutui-popup__close-icon--" + _ctx.closeIconPosition])
|
|
364
|
-
}, [
|
|
365
|
-
createVNode(_component_nut_icon, {
|
|
366
|
-
name: _ctx.closeIcon,
|
|
367
|
-
size: "12px"
|
|
368
|
-
}, null, 8, ["name"])
|
|
369
|
-
], 2)) : createCommentVNode("", true)
|
|
370
|
-
], 6), [
|
|
371
|
-
[vShow, _ctx.visible]
|
|
372
|
-
])
|
|
373
|
-
]),
|
|
374
|
-
_: 3
|
|
375
|
-
}, 8, ["name", "onAfterEnter", "onAfterLeave"])
|
|
376
|
-
], 8, ["to"])) : (openBlock(), createElementBlock("view", _hoisted_1, [
|
|
377
|
-
_ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, {
|
|
378
|
-
key: 0,
|
|
379
|
-
visible: _ctx.visible,
|
|
380
|
-
"close-on-click-overlay": _ctx.closeOnClickOverlay,
|
|
381
|
-
class: normalizeClass(_ctx.overlayClass),
|
|
382
|
-
style: normalizeStyle(_ctx.overlayStyle),
|
|
383
|
-
"z-index": _ctx.zIndex,
|
|
384
|
-
"lock-scroll": _ctx.lockScroll,
|
|
385
|
-
duration: _ctx.duration,
|
|
386
|
-
onClick: _ctx.onClickOverlay
|
|
387
|
-
}, null, 8, ["visible", "close-on-click-overlay", "class", "style", "z-index", "lock-scroll", "duration", "onClick"])) : createCommentVNode("", true),
|
|
388
|
-
createVNode(Transition, {
|
|
389
|
-
name: _ctx.transitionName,
|
|
390
|
-
onAfterEnter: _ctx.onOpened,
|
|
391
|
-
onAfterLeave: _ctx.onClosed
|
|
392
|
-
}, {
|
|
393
|
-
default: withCtx(() => [
|
|
394
|
-
withDirectives(createElementVNode("view", {
|
|
395
|
-
class: normalizeClass(_ctx.classes),
|
|
396
|
-
style: normalizeStyle(_ctx.popStyle),
|
|
397
|
-
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.onClick && _ctx.onClick(...args))
|
|
398
|
-
}, [
|
|
399
|
-
_ctx.showSlot ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true),
|
|
400
|
-
_ctx.closeable ? (openBlock(), createElementBlock("view", {
|
|
401
|
-
key: 1,
|
|
402
|
-
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.onClickCloseIcon && _ctx.onClickCloseIcon(...args)),
|
|
403
|
-
class: normalizeClass(["nutui-popup__close-icon", "nutui-popup__close-icon--" + _ctx.closeIconPosition])
|
|
404
|
-
}, [
|
|
405
|
-
createVNode(_component_nut_icon, {
|
|
406
|
-
name: _ctx.closeIcon,
|
|
407
|
-
size: "12px"
|
|
408
|
-
}, null, 8, ["name"])
|
|
409
|
-
], 2)) : createCommentVNode("", true)
|
|
410
|
-
], 6), [
|
|
411
|
-
[vShow, _ctx.visible]
|
|
412
|
-
])
|
|
413
|
-
]),
|
|
414
|
-
_: 3
|
|
415
|
-
}, 8, ["name", "onAfterEnter", "onAfterLeave"])
|
|
416
|
-
]));
|
|
417
|
-
}
|
|
418
|
-
_sfc_main.render = _sfc_render;
|
|
419
|
-
export { _sfc_main$1 as _, _sfc_main as a, popupProps as p };
|
|
27
|
+
return {
|
|
28
|
+
top: 0,
|
|
29
|
+
left: 0,
|
|
30
|
+
right: 0,
|
|
31
|
+
bottom: 0,
|
|
32
|
+
width: 0,
|
|
33
|
+
height: 0
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export { useRect as u };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2021 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
var _export_sfc = (sfc, props) => {
|
|
7
|
+
const target = sfc.__vccOpts || sfc;
|
|
8
|
+
for (const [key, val] of props) {
|
|
9
|
+
target[key] = val;
|
|
10
|
+
}
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
export { _export_sfc as _ };
|
package/dist/packages/_es/raf.js
CHANGED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
.nut-cascader {
|
|
2
|
+
width: 100%;
|
|
3
|
+
font-size: $nut-cascader-font-size;
|
|
4
|
+
line-height: $nut-cascader-line-height;
|
|
5
|
+
|
|
6
|
+
.nut-tabpane {
|
|
7
|
+
padding: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.nut-tabs__titles-item {
|
|
11
|
+
flex: initial;
|
|
12
|
+
min-width: auto;
|
|
13
|
+
padding: $nut-cascader-tabs-item-padding;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.nut-tabs__titles {
|
|
18
|
+
padding: $nut-cascader-tabs-item-padding;
|
|
19
|
+
background: #fff;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__bar {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
align-items: center;
|
|
26
|
+
padding: $nut-cascader-bar-padding;
|
|
27
|
+
text-align: center;
|
|
28
|
+
font-weight: bold;
|
|
29
|
+
line-height: $nut-cascader-bar-line-height;
|
|
30
|
+
color: $nut-cascader-bar-color;
|
|
31
|
+
font-size: $nut-cascader-bar-font-size;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&-pane {
|
|
35
|
+
display: block;
|
|
36
|
+
padding: 0;
|
|
37
|
+
margin: 0;
|
|
38
|
+
width: 100%;
|
|
39
|
+
padding-top: 10px;
|
|
40
|
+
height: 342px;
|
|
41
|
+
overflow-y: auto;
|
|
42
|
+
-webkit-overflow-scrolling: touch;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&-item {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
padding: $nut-cascader-item-padding;
|
|
49
|
+
margin: 0;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
font-size: $nut-cascader-item-font-size;
|
|
52
|
+
color: $nut-cascader-item-color;
|
|
53
|
+
|
|
54
|
+
&__title {
|
|
55
|
+
flex: 1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&__icon-check {
|
|
59
|
+
margin-left: 10px;
|
|
60
|
+
visibility: hidden;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&__icon-loading {
|
|
64
|
+
margin-left: 10px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&.active:not(.disabled) {
|
|
68
|
+
color: $nut-cascader-item-active-color;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&.active &__icon-check {
|
|
72
|
+
visibility: visible;
|
|
73
|
+
color: $nut-cascader-item-active-color;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&.disabled {
|
|
77
|
+
opacity: 0.6;
|
|
78
|
+
cursor: not-allowed;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -9,6 +9,15 @@
|
|
|
9
9
|
margin-top: 30px;
|
|
10
10
|
margin-bottom: 10px;
|
|
11
11
|
}
|
|
12
|
+
&__desc {
|
|
13
|
+
display: inherit;
|
|
14
|
+
padding: $cell-group-desc-padding;
|
|
15
|
+
color: $cell-group-desc-color;
|
|
16
|
+
font-size: $cell-group-desc-font-size;
|
|
17
|
+
line-height: $cell-group-desc-line-height;
|
|
18
|
+
margin-top: 10px;
|
|
19
|
+
margin-bottom: 10px;
|
|
20
|
+
}
|
|
12
21
|
&__warp {
|
|
13
22
|
display: inherit;
|
|
14
23
|
border-radius: $cell-border-radius;
|