stellar-ui-v2 1.40.21 → 1.40.23
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/components/ste-app-share/ste-app-share.vue +4 -4
- package/components/ste-app-update/ste-app-update.vue +1 -1
- package/components/{ste-pate-container → ste-page-container}/README.md +149 -149
- package/components/{ste-pate-container → ste-page-container}/config.json +5 -5
- package/components/{ste-pate-container/ste-pate-container.vue → ste-page-container/ste-page-container.vue} +220 -220
- package/components/ste-search/ste-search.vue +576 -590
- package/package.json +1 -1
- package/static/app_update_img.png +0 -0
- package/static/haibao.png +0 -0
- package/static/lianjie.png +0 -0
- package/static/qq.png +0 -0
- package/static/qqkj.png +0 -0
- package/static/shoucang.png +0 -0
- package/static/weixin.png +0 -0
- package/static/wxpyq.png +0 -0
|
@@ -1,220 +1,220 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- #ifdef MP-WEIXIN -->
|
|
3
|
-
<page-container
|
|
4
|
-
v-if="useWxNative"
|
|
5
|
-
:show="show"
|
|
6
|
-
:duration="duration"
|
|
7
|
-
:z-index="zIndex"
|
|
8
|
-
:overlay="overlay"
|
|
9
|
-
:position="position"
|
|
10
|
-
:round="round"
|
|
11
|
-
:close-on-slide-down="closeOnSlideDown"
|
|
12
|
-
:overlay-style="overlayStyle"
|
|
13
|
-
:custom-style="customStyle"
|
|
14
|
-
:safe-area-inset-bottom="safeAreaInsetBottom"
|
|
15
|
-
@beforeenter="emitEvent('beforeenter', $event)"
|
|
16
|
-
@enter="emitEvent('enter', $event)"
|
|
17
|
-
@afterenter="emitEvent('afterenter', $event)"
|
|
18
|
-
@beforeleave="emitEvent('beforeleave', $event)"
|
|
19
|
-
@leave="emitEvent('leave', $event)"
|
|
20
|
-
@afterleave="emitEvent('afterleave', $event)"
|
|
21
|
-
@clickoverlay="onClickOverlay"
|
|
22
|
-
>
|
|
23
|
-
<slot></slot>
|
|
24
|
-
</page-container>
|
|
25
|
-
|
|
26
|
-
<ste-popup
|
|
27
|
-
v-else
|
|
28
|
-
:show.sync="innerShow"
|
|
29
|
-
:duration="duration"
|
|
30
|
-
:zIndex="zIndex"
|
|
31
|
-
:showMask="overlay"
|
|
32
|
-
:position="popupPosition"
|
|
33
|
-
:round="round"
|
|
34
|
-
:isMaskClick="overlay"
|
|
35
|
-
:showClose="false"
|
|
36
|
-
@clickMask="onClickOverlay"
|
|
37
|
-
@open-after="onPopupOpenAfter"
|
|
38
|
-
>
|
|
39
|
-
<view class="ste-
|
|
40
|
-
<slot></slot>
|
|
41
|
-
</view>
|
|
42
|
-
</ste-popup>
|
|
43
|
-
<!-- #endif -->
|
|
44
|
-
|
|
45
|
-
<!-- #ifndef MP-WEIXIN -->
|
|
46
|
-
<ste-popup
|
|
47
|
-
:show.sync="innerShow"
|
|
48
|
-
:duration="duration"
|
|
49
|
-
:zIndex="zIndex"
|
|
50
|
-
:showMask="overlay"
|
|
51
|
-
:position="popupPosition"
|
|
52
|
-
:round="round"
|
|
53
|
-
:isMaskClick="overlay"
|
|
54
|
-
:showClose="false"
|
|
55
|
-
@clickMask="onClickOverlay"
|
|
56
|
-
@open-after="onPopupOpenAfter"
|
|
57
|
-
>
|
|
58
|
-
<view class="ste-
|
|
59
|
-
<slot></slot>
|
|
60
|
-
</view>
|
|
61
|
-
</ste-popup>
|
|
62
|
-
<!-- #endif -->
|
|
63
|
-
</template>
|
|
64
|
-
|
|
65
|
-
<script>
|
|
66
|
-
/**
|
|
67
|
-
* ste-
|
|
68
|
-
* @description 微信小程序下使用原生 page-container,其他平台使用 ste-popup 兼容实现
|
|
69
|
-
* @property {Boolean} show 是否显示容器
|
|
70
|
-
* @property {Number} duration 动画时长,单位 ms
|
|
71
|
-
* @property {Number} zIndex 层级
|
|
72
|
-
* @property {Boolean} overlay 是否显示遮罩
|
|
73
|
-
* @property {String} position 弹出位置,top/bottom/right/center
|
|
74
|
-
* @property {Boolean} round 是否展示圆角
|
|
75
|
-
* @property {Boolean} closeOnSlideDown 是否允许下滑关闭(仅微信小程序)
|
|
76
|
-
* @property {String} overlayStyle 遮罩层样式(仅微信小程序)
|
|
77
|
-
* @property {String} customStyle 容器样式
|
|
78
|
-
* @property {Boolean} safeAreaInsetBottom 是否适配底部安全区
|
|
79
|
-
*/
|
|
80
|
-
export default {
|
|
81
|
-
group: '基础组件',
|
|
82
|
-
title: 'PageContainer 页面容器',
|
|
83
|
-
name: 'ste-
|
|
84
|
-
props: {
|
|
85
|
-
show: { type:
|
|
86
|
-
duration: { type:
|
|
87
|
-
zIndex: { type: [Number, String
|
|
88
|
-
overlay: { type:
|
|
89
|
-
position: {
|
|
90
|
-
type:
|
|
91
|
-
default: 'bottom',
|
|
92
|
-
validator(value) {
|
|
93
|
-
return ['top', 'bottom', 'right', 'center'].includes(value);
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
round: { type:
|
|
97
|
-
closeOnSlideDown: { type:
|
|
98
|
-
overlayStyle: { type:
|
|
99
|
-
customStyle: { type:
|
|
100
|
-
safeAreaInsetBottom: { type:
|
|
101
|
-
},
|
|
102
|
-
data() {
|
|
103
|
-
return {
|
|
104
|
-
innerShow: this.show,
|
|
105
|
-
leaveTimer: null,
|
|
106
|
-
useWxNative: false,
|
|
107
|
-
};
|
|
108
|
-
},
|
|
109
|
-
computed: {
|
|
110
|
-
popupPosition() {
|
|
111
|
-
if (['top', 'bottom', 'right', 'center'].includes(this.position)) {
|
|
112
|
-
return this.position;
|
|
113
|
-
}
|
|
114
|
-
return 'bottom';
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
watch: {
|
|
118
|
-
show(newVal) {
|
|
119
|
-
if (!this.useWxNative) {
|
|
120
|
-
if (this.innerShow !== newVal) {
|
|
121
|
-
this.innerShow = newVal;
|
|
122
|
-
}
|
|
123
|
-
this.triggerTransition(newVal);
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
innerShow(newVal) {
|
|
127
|
-
if (!this.useWxNative && newVal !== this.show) {
|
|
128
|
-
this.$emit('update:show', newVal);
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
beforeDestroy() {
|
|
133
|
-
this.clearTimers();
|
|
134
|
-
this.releaseWxNativeOwner();
|
|
135
|
-
},
|
|
136
|
-
created() {
|
|
137
|
-
this.initMode();
|
|
138
|
-
if (!this.useWxNative && this.show) {
|
|
139
|
-
this.triggerTransition(true);
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
methods: {
|
|
143
|
-
getGlobalScope() {
|
|
144
|
-
if (typeof globalThis !== 'undefined') return globalThis;
|
|
145
|
-
if (typeof global !== 'undefined') return global;
|
|
146
|
-
return {};
|
|
147
|
-
},
|
|
148
|
-
initMode() {
|
|
149
|
-
// #ifdef MP-WEIXIN
|
|
150
|
-
const scope = this.getGlobalScope();
|
|
151
|
-
if (!scope.
|
|
152
|
-
scope.
|
|
153
|
-
this.useWxNative = true;
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
this.useWxNative = scope.
|
|
157
|
-
// #endif
|
|
158
|
-
// #ifndef MP-WEIXIN
|
|
159
|
-
this.useWxNative = false;
|
|
160
|
-
// #endif
|
|
161
|
-
},
|
|
162
|
-
releaseWxNativeOwner() {
|
|
163
|
-
// #ifdef MP-WEIXIN
|
|
164
|
-
const scope = this.getGlobalScope();
|
|
165
|
-
if (scope.
|
|
166
|
-
scope.
|
|
167
|
-
}
|
|
168
|
-
// #endif
|
|
169
|
-
},
|
|
170
|
-
emitEvent(eventName, e) {
|
|
171
|
-
this.$emit(eventName, e);
|
|
172
|
-
},
|
|
173
|
-
onClickOverlay(e) {
|
|
174
|
-
this.$emit('clickoverlay', e);
|
|
175
|
-
},
|
|
176
|
-
onPopupOpenAfter(e) {
|
|
177
|
-
this.$emit('afterenter', e);
|
|
178
|
-
},
|
|
179
|
-
open() {
|
|
180
|
-
this.$emit('update:show', true);
|
|
181
|
-
},
|
|
182
|
-
close() {
|
|
183
|
-
this.$emit('update:show', false);
|
|
184
|
-
},
|
|
185
|
-
clearTimers() {
|
|
186
|
-
if (this.leaveTimer) {
|
|
187
|
-
clearTimeout(this.leaveTimer);
|
|
188
|
-
this.leaveTimer = null;
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
triggerTransition(show) {
|
|
192
|
-
this.clearTimers();
|
|
193
|
-
if (show) {
|
|
194
|
-
this.$emit('beforeenter');
|
|
195
|
-
this.$emit('enter');
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
this.$emit('beforeleave');
|
|
199
|
-
this.$emit('leave');
|
|
200
|
-
this.leaveTimer = setTimeout(() => {
|
|
201
|
-
this.$emit('afterleave');
|
|
202
|
-
this.leaveTimer = null;
|
|
203
|
-
}, this.duration);
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
};
|
|
207
|
-
</script>
|
|
208
|
-
|
|
209
|
-
<style lang="scss" scoped>
|
|
210
|
-
.ste-
|
|
211
|
-
width: 100%;
|
|
212
|
-
height: 100%;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.safe-area-bottom {
|
|
216
|
-
padding-bottom: constant(safe-area-inset-bottom);
|
|
217
|
-
padding-bottom: env(safe-area-inset-bottom);
|
|
218
|
-
box-sizing: border-box;
|
|
219
|
-
}
|
|
220
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<!-- #ifdef MP-WEIXIN -->
|
|
3
|
+
<page-container
|
|
4
|
+
v-if="useWxNative"
|
|
5
|
+
:show="show"
|
|
6
|
+
:duration="duration"
|
|
7
|
+
:z-index="zIndex"
|
|
8
|
+
:overlay="overlay"
|
|
9
|
+
:position="position"
|
|
10
|
+
:round="round"
|
|
11
|
+
:close-on-slide-down="closeOnSlideDown"
|
|
12
|
+
:overlay-style="overlayStyle"
|
|
13
|
+
:custom-style="customStyle"
|
|
14
|
+
:safe-area-inset-bottom="safeAreaInsetBottom"
|
|
15
|
+
@beforeenter="emitEvent('beforeenter', $event)"
|
|
16
|
+
@enter="emitEvent('enter', $event)"
|
|
17
|
+
@afterenter="emitEvent('afterenter', $event)"
|
|
18
|
+
@beforeleave="emitEvent('beforeleave', $event)"
|
|
19
|
+
@leave="emitEvent('leave', $event)"
|
|
20
|
+
@afterleave="emitEvent('afterleave', $event)"
|
|
21
|
+
@clickoverlay="onClickOverlay"
|
|
22
|
+
>
|
|
23
|
+
<slot></slot>
|
|
24
|
+
</page-container>
|
|
25
|
+
|
|
26
|
+
<ste-popup
|
|
27
|
+
v-else
|
|
28
|
+
:show.sync="innerShow"
|
|
29
|
+
:duration="duration"
|
|
30
|
+
:zIndex="zIndex"
|
|
31
|
+
:showMask="overlay"
|
|
32
|
+
:position="popupPosition"
|
|
33
|
+
:round="round"
|
|
34
|
+
:isMaskClick="overlay"
|
|
35
|
+
:showClose="false"
|
|
36
|
+
@clickMask="onClickOverlay"
|
|
37
|
+
@open-after="onPopupOpenAfter"
|
|
38
|
+
>
|
|
39
|
+
<view class="ste-page-container-content" :class="{ 'safe-area-bottom': safeAreaInsetBottom && position === 'bottom' }" :style="customStyle">
|
|
40
|
+
<slot></slot>
|
|
41
|
+
</view>
|
|
42
|
+
</ste-popup>
|
|
43
|
+
<!-- #endif -->
|
|
44
|
+
|
|
45
|
+
<!-- #ifndef MP-WEIXIN -->
|
|
46
|
+
<ste-popup
|
|
47
|
+
:show.sync="innerShow"
|
|
48
|
+
:duration="duration"
|
|
49
|
+
:zIndex="zIndex"
|
|
50
|
+
:showMask="overlay"
|
|
51
|
+
:position="popupPosition"
|
|
52
|
+
:round="round"
|
|
53
|
+
:isMaskClick="overlay"
|
|
54
|
+
:showClose="false"
|
|
55
|
+
@clickMask="onClickOverlay"
|
|
56
|
+
@open-after="onPopupOpenAfter"
|
|
57
|
+
>
|
|
58
|
+
<view class="ste-page-container-content" :class="{ 'safe-area-bottom': safeAreaInsetBottom && position === 'bottom' }" :style="customStyle">
|
|
59
|
+
<slot></slot>
|
|
60
|
+
</view>
|
|
61
|
+
</ste-popup>
|
|
62
|
+
<!-- #endif -->
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script>
|
|
66
|
+
/**
|
|
67
|
+
* ste-page-container 页面容器
|
|
68
|
+
* @description 微信小程序下使用原生 page-container,其他平台使用 ste-popup 兼容实现
|
|
69
|
+
* @property {Boolean} show 是否显示容器
|
|
70
|
+
* @property {Number} duration 动画时长,单位 ms
|
|
71
|
+
* @property {Number} zIndex 层级
|
|
72
|
+
* @property {Boolean} overlay 是否显示遮罩
|
|
73
|
+
* @property {String} position 弹出位置,top/bottom/right/center
|
|
74
|
+
* @property {Boolean} round 是否展示圆角
|
|
75
|
+
* @property {Boolean} closeOnSlideDown 是否允许下滑关闭(仅微信小程序)
|
|
76
|
+
* @property {String} overlayStyle 遮罩层样式(仅微信小程序)
|
|
77
|
+
* @property {String} customStyle 容器样式
|
|
78
|
+
* @property {Boolean} safeAreaInsetBottom 是否适配底部安全区
|
|
79
|
+
*/
|
|
80
|
+
export default {
|
|
81
|
+
group: '基础组件',
|
|
82
|
+
title: 'PageContainer 页面容器',
|
|
83
|
+
name: 'ste-page-container',
|
|
84
|
+
props: {
|
|
85
|
+
show: { type: Boolean, default: false },
|
|
86
|
+
duration: { type: Number, default: 300 },
|
|
87
|
+
zIndex: { type: [Number, String], default: 100 },
|
|
88
|
+
overlay: { type: Boolean, default: true },
|
|
89
|
+
position: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: 'bottom',
|
|
92
|
+
validator(value) {
|
|
93
|
+
return ['top', 'bottom', 'right', 'center'].includes(value);
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
round: { type: Boolean, default: false },
|
|
97
|
+
closeOnSlideDown: { type: Boolean, default: false },
|
|
98
|
+
overlayStyle: { type: String, default: '' },
|
|
99
|
+
customStyle: { type: String, default: '' },
|
|
100
|
+
safeAreaInsetBottom: { type: Boolean, default: false },
|
|
101
|
+
},
|
|
102
|
+
data() {
|
|
103
|
+
return {
|
|
104
|
+
innerShow: this.show,
|
|
105
|
+
leaveTimer: null,
|
|
106
|
+
useWxNative: false,
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
computed: {
|
|
110
|
+
popupPosition() {
|
|
111
|
+
if (['top', 'bottom', 'right', 'center'].includes(this.position)) {
|
|
112
|
+
return this.position;
|
|
113
|
+
}
|
|
114
|
+
return 'bottom';
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
watch: {
|
|
118
|
+
show(newVal) {
|
|
119
|
+
if (!this.useWxNative) {
|
|
120
|
+
if (this.innerShow !== newVal) {
|
|
121
|
+
this.innerShow = newVal;
|
|
122
|
+
}
|
|
123
|
+
this.triggerTransition(newVal);
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
innerShow(newVal) {
|
|
127
|
+
if (!this.useWxNative && newVal !== this.show) {
|
|
128
|
+
this.$emit('update:show', newVal);
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
beforeDestroy() {
|
|
133
|
+
this.clearTimers();
|
|
134
|
+
this.releaseWxNativeOwner();
|
|
135
|
+
},
|
|
136
|
+
created() {
|
|
137
|
+
this.initMode();
|
|
138
|
+
if (!this.useWxNative && this.show) {
|
|
139
|
+
this.triggerTransition(true);
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
methods: {
|
|
143
|
+
getGlobalScope() {
|
|
144
|
+
if (typeof globalThis !== 'undefined') return globalThis;
|
|
145
|
+
if (typeof global !== 'undefined') return global;
|
|
146
|
+
return {};
|
|
147
|
+
},
|
|
148
|
+
initMode() {
|
|
149
|
+
// #ifdef MP-WEIXIN
|
|
150
|
+
const scope = this.getGlobalScope();
|
|
151
|
+
if (!scope.__stePageContainerOwnerUid) {
|
|
152
|
+
scope.__stePageContainerOwnerUid = this._uid;
|
|
153
|
+
this.useWxNative = true;
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
this.useWxNative = scope.__stePageContainerOwnerUid === this._uid;
|
|
157
|
+
// #endif
|
|
158
|
+
// #ifndef MP-WEIXIN
|
|
159
|
+
this.useWxNative = false;
|
|
160
|
+
// #endif
|
|
161
|
+
},
|
|
162
|
+
releaseWxNativeOwner() {
|
|
163
|
+
// #ifdef MP-WEIXIN
|
|
164
|
+
const scope = this.getGlobalScope();
|
|
165
|
+
if (scope.__stePageContainerOwnerUid === this._uid) {
|
|
166
|
+
scope.__stePageContainerOwnerUid = null;
|
|
167
|
+
}
|
|
168
|
+
// #endif
|
|
169
|
+
},
|
|
170
|
+
emitEvent(eventName, e) {
|
|
171
|
+
this.$emit(eventName, e);
|
|
172
|
+
},
|
|
173
|
+
onClickOverlay(e) {
|
|
174
|
+
this.$emit('clickoverlay', e);
|
|
175
|
+
},
|
|
176
|
+
onPopupOpenAfter(e) {
|
|
177
|
+
this.$emit('afterenter', e);
|
|
178
|
+
},
|
|
179
|
+
open() {
|
|
180
|
+
this.$emit('update:show', true);
|
|
181
|
+
},
|
|
182
|
+
close() {
|
|
183
|
+
this.$emit('update:show', false);
|
|
184
|
+
},
|
|
185
|
+
clearTimers() {
|
|
186
|
+
if (this.leaveTimer) {
|
|
187
|
+
clearTimeout(this.leaveTimer);
|
|
188
|
+
this.leaveTimer = null;
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
triggerTransition(show) {
|
|
192
|
+
this.clearTimers();
|
|
193
|
+
if (show) {
|
|
194
|
+
this.$emit('beforeenter');
|
|
195
|
+
this.$emit('enter');
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
this.$emit('beforeleave');
|
|
199
|
+
this.$emit('leave');
|
|
200
|
+
this.leaveTimer = setTimeout(() => {
|
|
201
|
+
this.$emit('afterleave');
|
|
202
|
+
this.leaveTimer = null;
|
|
203
|
+
}, this.duration);
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
</script>
|
|
208
|
+
|
|
209
|
+
<style lang="scss" scoped>
|
|
210
|
+
.ste-page-container-content {
|
|
211
|
+
width: 100%;
|
|
212
|
+
height: 100%;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.safe-area-bottom {
|
|
216
|
+
padding-bottom: constant(safe-area-inset-bottom);
|
|
217
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
218
|
+
box-sizing: border-box;
|
|
219
|
+
}
|
|
220
|
+
</style>
|