@kyfe/fms-vue2-components 0.0.3 → 0.0.5
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/assets/css/fms-ks-clamp-text.css +1 -0
- package/dist/assets/css/fms-ks-components.css +1 -0
- package/dist/assets/css/fms-ks-popover.css +1 -0
- package/dist/assets/css/fms-ks-search-tips-new.css +1 -0
- package/dist/assets/css/fms-ks-search-tips.css +1 -0
- package/dist/assets/css/fms-ks-select-box.css +1 -0
- package/dist/assets/css/fms-ks-select.css +1 -0
- package/dist/date-picker-bottom.17e75dc0.js +45 -0
- package/dist/date-picker-dropdown.1d8e9f00.js +34 -0
- package/dist/date-picker-right.b939e886.js +23 -0
- package/dist/date-picker-top.c38046f7.js +23 -0
- package/dist/date-range-select.647edaf6.js +69 -0
- package/dist/date-select.96eb3a9d.js +60 -0
- package/dist/date-week-month.169b98bc.js +57 -0
- package/dist/datetime-popup/index.js +411 -0
- package/dist/filter.c93f4ddb.js +45 -0
- package/dist/fms-copy-box/index.js +1 -1
- package/dist/fms-ks-block-title/index.js +38 -0
- package/dist/fms-ks-block-title/style.css +1 -0
- package/dist/fms-ks-clamp-text/index.js +9 -0
- package/dist/fms-ks-clamp-text.24eb5e8d.js +53 -0
- package/dist/fms-ks-components/index.js +9 -0
- package/dist/fms-ks-components.a5d9329b.js +4392 -0
- package/dist/fms-ks-decrypt/index.js +2 -2
- package/dist/fms-ks-decrypt.2f88e659.js +312 -0
- package/dist/fms-ks-file-upload/index.js +32 -31
- package/dist/fms-ks-file-upload/style.css +1 -1
- package/dist/fms-ks-form-grid/index.js +101 -0
- package/dist/fms-ks-form-grid/style.css +1 -0
- package/dist/fms-ks-more-lines/index.js +31 -0
- package/dist/fms-ks-more-lines/style.css +1 -0
- package/dist/fms-ks-page-popup/index.js +68 -0
- package/dist/fms-ks-page-popup/style.css +1 -0
- package/dist/fms-ks-picker/index.js +9 -0
- package/dist/fms-ks-picker.766b55f9.js +61 -0
- package/dist/fms-ks-popover/index.js +9 -0
- package/dist/fms-ks-popover.55ab4b82.js +95 -0
- package/dist/fms-ks-search-tips/index.js +9 -0
- package/dist/fms-ks-search-tips-new/index.js +9 -0
- package/dist/fms-ks-search-tips-new.7d08f710.js +125 -0
- package/dist/fms-ks-search-tips.d36859c3.js +142 -0
- package/dist/fms-ks-select/index.js +9 -0
- package/dist/fms-ks-select-box/index.js +9 -0
- package/dist/fms-ks-select-box.a00f0f08.js +43 -0
- package/dist/fms-ks-select.59416fd8.js +157 -0
- package/dist/fms-ks-warn-drawer/index.js +37 -0
- package/dist/fms-ks-warn-drawer/style.css +1 -0
- package/dist/fms-scroll-list/index.js +3 -1
- package/dist/index.js +30 -30
- package/dist/mixin.f4bc60f0.js +59 -0
- package/dist/month-range-select.374653da.js +97 -0
- package/dist/month-select.30ae7335.js +71 -0
- package/dist/oa-datetime-picker-new/style.css +1 -0
- package/dist/quarter-select.b6256880.js +73 -0
- package/dist/utils.159fba19.js +64 -0
- package/dist/week-select.27efca5c.js +70 -0
- package/package.json +31 -31
- package/src/assets/images/attachment/icon_default.svg +23 -0
- package/src/assets/images/attachment/icon_default_new.png +0 -0
- package/src/assets/images/attachment/icon_excel.svg +20 -0
- package/src/assets/images/attachment/icon_excel_new.png +0 -0
- package/src/assets/images/attachment/icon_file.png +0 -0
- package/src/assets/images/attachment/icon_pdf_new.png +0 -0
- package/src/assets/images/attachment/icon_ppt.svg +20 -0
- package/src/assets/images/attachment/icon_ppt_new.png +0 -0
- package/src/assets/images/attachment/icon_preview_file.png +0 -0
- package/src/assets/images/attachment/icon_txt.png +0 -0
- package/src/assets/images/attachment/icon_word.svg +19 -0
- package/src/assets/images/attachment/icon_word_new.png +0 -0
- package/src/assets/images/attachment/icon_xmind.png +0 -0
- package/src/assets/images/icon-arrow.png +0 -0
- package/src/assets/images/icon-forewarning.svg +1 -0
- package/src/components/date-picker/index.vue +205 -0
- package/src/components/datetime-picker-general/index.vue +161 -0
- package/src/components/datetime-popup/date-picker.js +217 -0
- package/src/components/datetime-popup/index.js +37 -0
- package/src/components/datetime-popup/index.vue +111 -0
- package/src/components/datetime-popup/mixin.js +125 -0
- package/src/components/datetime-popup/time-picker.js +102 -0
- package/src/components/datetime-popup/utils.js +124 -0
- package/src/components/datetime-popup//347/244/272/344/276/213/345/233/276.png +0 -0
- package/src/components/decrypt/README.md +0 -0
- package/src/components/decrypt/index.vue +73 -0
- package/src/components/fms-ks-block-title/fms-ks-block-title.vue +75 -0
- package/src/components/fms-ks-block-title/index.js +7 -0
- package/src/components/fms-ks-block-title//346/240/207/351/242/230.md +0 -0
- package/src/components/fms-ks-clamp-text/fms-ks-clamp-text.vue +66 -0
- package/src/components/fms-ks-clamp-text/images/icon-clamp.png +0 -0
- package/src/components/fms-ks-clamp-text/index.js +7 -0
- package/src/components/fms-ks-clamp-text//346/226/207/346/234/254/346/224/266/350/265/267/345/261/225/345/274/200.md +0 -0
- package/src/components/fms-ks-components/fms-ks-components.vue +699 -0
- package/src/components/fms-ks-components/index.js +7 -0
- package/src/components/fms-ks-components/money-directive.js +73 -0
- package/src/components/fms-ks-components//350/241/250/345/215/225/351/205/215/347/275/256/347/273/204/344/273/266/350/257/264/346/230/216.md +10 -0
- package/src/components/fms-ks-file-upload/fms-ks-file-upload.vue +8 -1
- package/src/components/fms-ks-form-grid/fields-conversion.js +107 -0
- package/src/components/fms-ks-form-grid/fms-ks-form-grid.vue +127 -0
- package/src/components/fms-ks-form-grid/index.js +7 -0
- package/src/components/fms-ks-more-lines/fms-ks-more-lines.vue +108 -0
- package/src/components/fms-ks-more-lines/index.js +7 -0
- package/src/components/fms-ks-more-lines//346/233/264/345/244/232.md +0 -0
- package/src/components/fms-ks-page-popup/fms-ks-page-popup.vue +153 -0
- package/src/components/fms-ks-page-popup/index.js +7 -0
- package/src/components/fms-ks-page-popup//345/274/271/345/207/272/345/261/202.md +0 -0
- package/src/components/fms-ks-picker/fms-ks-picker.vue +67 -0
- package/src/components/fms-ks-picker/index.js +7 -0
- package/src/components/fms-ks-picker//351/200/211/346/213/251/345/274/271/345/207/272/345/261/202.md +0 -0
- package/src/components/fms-ks-popover/click-outside.js +68 -0
- package/src/components/fms-ks-popover/fms-ks-popover.vue +89 -0
- package/src/components/fms-ks-popover/index.js +7 -0
- package/src/components/fms-ks-popover//345/274/271/345/207/272/345/261/202.md +0 -0
- package/src/components/fms-ks-search-tips/fms-ks-search-tips.vue +296 -0
- package/src/components/fms-ks-search-tips/index.js +7 -0
- package/src/components/fms-ks-search-tips//350/277/234/347/250/213/346/220/234/347/264/242.md +118 -0
- package/src/components/fms-ks-search-tips-new/fms-ks-search-tips-new.vue +242 -0
- package/src/components/fms-ks-search-tips-new/index.js +7 -0
- package/src/components/fms-ks-search-tips-new/style.less +137 -0
- package/src/components/fms-ks-search-tips-new//350/277/234/347/250/213/346/220/234/347/264/242-/346/226/260.md +118 -0
- package/src/components/fms-ks-select/fms-ks-select.vue +421 -0
- package/src/components/fms-ks-select/index.js +7 -0
- package/src/components/fms-ks-select//351/200/211/346/213/251/346/241/206.md +0 -0
- package/src/components/fms-ks-select-box/fms-ks-select-box.vue +84 -0
- package/src/components/fms-ks-select-box/index.js +7 -0
- package/src/components/fms-ks-select-box//344/270/215/351/234/200/350/246/201popup/347/232/204select.md +0 -0
- package/src/components/fms-ks-warn-drawer/fms-ks-warn-drawer.vue +111 -0
- package/src/components/fms-ks-warn-drawer/index.js +7 -0
- package/src/components/fms-ks-warn-drawer//351/242/204/350/255/246/346/217/220/347/244/272.md +0 -0
- package/src/components/ks-decrypt/README.md +140 -0
- package/src/components/ks-decrypt/index.vue +155 -0
- package/src/components/ks-popover/index.vue +483 -0
- package/src/components/ks-popover/mixin.js +28 -0
- package/src/components/ks-popover/utils.js +60 -0
- package/src/components/oa-datetime-picker/index.vue +169 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/README.md +21 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker-bottom.vue +121 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker-dropdown.vue +78 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker-right.vue +86 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker-top.vue +82 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker.js +12 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-range-select.vue +106 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-select.vue +66 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-week-month.vue +131 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/index.js +39 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/mixin.js +85 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/month-range-select.vue +127 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/month-select.vue +87 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/quarter-select.vue +95 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/style.less +117 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/utils.js +109 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/week-select.vue +100 -0
- package/src/components/oa-datetime-picker-new/index.vue +212 -0
- package/src/index.js +8 -2
- package/vite.config.js +12 -1
- package/dist/fms-ks-decrypt.bcc12f44.js +0 -335
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="wrapper"
|
|
3
|
+
:class="bem('wrapper')"
|
|
4
|
+
@click.stop="onClickWrapper">
|
|
5
|
+
<van-popup ref="popover"
|
|
6
|
+
:value="value"
|
|
7
|
+
:class="bem([theme])"
|
|
8
|
+
:overlay="overlay"
|
|
9
|
+
:position="null"
|
|
10
|
+
transition="van-popover-zoom"
|
|
11
|
+
:lockScroll="false"
|
|
12
|
+
:getContainer="getContainer"
|
|
13
|
+
@open="onOpen"
|
|
14
|
+
@close="onClose"
|
|
15
|
+
@input="onToggle"
|
|
16
|
+
@opened="onOpened"
|
|
17
|
+
@touchstart.native="onTouchstart">
|
|
18
|
+
<div :class="bem('arrow')" />
|
|
19
|
+
<div :class="bem('content')"
|
|
20
|
+
:style="popoverContentStyle"
|
|
21
|
+
role="menu">
|
|
22
|
+
<slot>
|
|
23
|
+
<div role="menuitem"
|
|
24
|
+
v-for="(action, index) in actions"
|
|
25
|
+
:key="'action' + index"
|
|
26
|
+
:class="[...bem('action', { disabled: action.disabled, 'with-icon': action.icon }), action.className]"
|
|
27
|
+
@click="onClickAction(action, index)">
|
|
28
|
+
<van-icon v-if="action.icon"
|
|
29
|
+
:name="action.icon"
|
|
30
|
+
:class="bem('action-icon')" />
|
|
31
|
+
<div :class="[...bem('action-text'), 'van-hairline--bottom']">{{ action.text }}</div>
|
|
32
|
+
</div>
|
|
33
|
+
</slot>
|
|
34
|
+
</div>
|
|
35
|
+
</van-popup>
|
|
36
|
+
<slot name="reference"></slot>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import { createPopper, offsetModifier } from '@vant/popperjs'
|
|
42
|
+
import { ClickOutsideMixin } from './mixin'
|
|
43
|
+
import { createBEM } from './utils'
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
name: 'ks-popover',
|
|
47
|
+
data () {
|
|
48
|
+
this.bem = createBEM('van-popover')
|
|
49
|
+
return {
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
mixins: [
|
|
53
|
+
ClickOutsideMixin({
|
|
54
|
+
event: 'touchstart',
|
|
55
|
+
method: 'onClickOutside',
|
|
56
|
+
}),
|
|
57
|
+
],
|
|
58
|
+
props: {
|
|
59
|
+
value: Boolean,
|
|
60
|
+
trigger: String,
|
|
61
|
+
overlay: Boolean,
|
|
62
|
+
offset: {
|
|
63
|
+
type: Array,
|
|
64
|
+
default: () => [0, 8],
|
|
65
|
+
},
|
|
66
|
+
theme: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: 'light',
|
|
69
|
+
},
|
|
70
|
+
actions: {
|
|
71
|
+
type: Array,
|
|
72
|
+
default: () => [],
|
|
73
|
+
},
|
|
74
|
+
placement: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: 'bottom',
|
|
77
|
+
},
|
|
78
|
+
getContainer: {
|
|
79
|
+
type: [String, Function],
|
|
80
|
+
default: 'body',
|
|
81
|
+
},
|
|
82
|
+
closeOnClickAction: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: true,
|
|
85
|
+
},
|
|
86
|
+
popoverContentStyle: {
|
|
87
|
+
type: Object,
|
|
88
|
+
default: () => {},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
watch: {
|
|
92
|
+
value: 'updateLocation',
|
|
93
|
+
placement: 'updateLocation',
|
|
94
|
+
},
|
|
95
|
+
mounted () {
|
|
96
|
+
this.updateLocation()
|
|
97
|
+
},
|
|
98
|
+
beforeDestroy () {
|
|
99
|
+
if (this.popper) {
|
|
100
|
+
this.popper.destroy()
|
|
101
|
+
this.popper = null
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
methods: {
|
|
105
|
+
createPopper () {
|
|
106
|
+
const data = createPopper(this.$refs.wrapper, this.$refs.popover.$el, {
|
|
107
|
+
placement: this.placement,
|
|
108
|
+
modifiers: [
|
|
109
|
+
{
|
|
110
|
+
name: 'computeStyles',
|
|
111
|
+
options: {
|
|
112
|
+
adaptive: false,
|
|
113
|
+
gpuAcceleration: false,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
...offsetModifier,
|
|
118
|
+
options: {
|
|
119
|
+
offset: this.offset,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
})
|
|
124
|
+
return data
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
updateLocation () {
|
|
128
|
+
this.$nextTick(() => {
|
|
129
|
+
if (!this.value) {
|
|
130
|
+
return
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (!this.popper) {
|
|
134
|
+
this.popper = this.createPopper()
|
|
135
|
+
} else {
|
|
136
|
+
this.popper.setOptions({
|
|
137
|
+
placement: this.placement,
|
|
138
|
+
modifiers: [
|
|
139
|
+
{
|
|
140
|
+
name: 'computeStyles',
|
|
141
|
+
options: {
|
|
142
|
+
adaptive: false,
|
|
143
|
+
gpuAcceleration: false,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
...offsetModifier,
|
|
148
|
+
options: {
|
|
149
|
+
offset: this.offset,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
})
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
onToggle (value) {
|
|
159
|
+
this.$emit('input', value)
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
onClickWrapper () {
|
|
163
|
+
if (this.trigger === 'click') {
|
|
164
|
+
this.onToggle(!this.value)
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
onTouchstart (event) {
|
|
169
|
+
event.stopPropagation()
|
|
170
|
+
this.$emit('touchstart', event)
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
onClickAction (action, index) {
|
|
174
|
+
if (action.disabled) {
|
|
175
|
+
return
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
this.$emit('select', action, index)
|
|
179
|
+
|
|
180
|
+
if (this.closeOnClickAction) {
|
|
181
|
+
this.$emit('input', false)
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
onClickOutside () {
|
|
186
|
+
this.$emit('input', false)
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
onOpen () {
|
|
190
|
+
this.$emit('open')
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
onOpened () {
|
|
194
|
+
this.$emit('opened')
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
onClose () {
|
|
198
|
+
this.$emit('close')
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
onClosed () {
|
|
202
|
+
this.$emit('closed')
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
// watch: {
|
|
206
|
+
// offset() {
|
|
207
|
+
// console.log('ddd')
|
|
208
|
+
// this.popper = this.createPopper()
|
|
209
|
+
// }
|
|
210
|
+
// }
|
|
211
|
+
}
|
|
212
|
+
</script>
|
|
213
|
+
|
|
214
|
+
<style lang="less">
|
|
215
|
+
.van-popover {
|
|
216
|
+
position: absolute;
|
|
217
|
+
overflow: visible;
|
|
218
|
+
background-color: transparent;
|
|
219
|
+
transition: opacity 0.15s, transform 0.15s;
|
|
220
|
+
|
|
221
|
+
&__wrapper {
|
|
222
|
+
display: inline-block;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&__arrow {
|
|
226
|
+
position: absolute;
|
|
227
|
+
width: 0;
|
|
228
|
+
height: 0;
|
|
229
|
+
border-color: transparent;
|
|
230
|
+
border-style: solid;
|
|
231
|
+
border-width: 6px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
&__content {
|
|
235
|
+
overflow: hidden;
|
|
236
|
+
border-radius: 8px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
&__action {
|
|
240
|
+
position: relative;
|
|
241
|
+
display: flex;
|
|
242
|
+
align-items: center;
|
|
243
|
+
box-sizing: border-box;
|
|
244
|
+
width: 128px;
|
|
245
|
+
height: 44px;
|
|
246
|
+
padding: 0 16px;
|
|
247
|
+
font-size: 14px;
|
|
248
|
+
line-height: 20px;
|
|
249
|
+
cursor: pointer;
|
|
250
|
+
|
|
251
|
+
&:last-child {
|
|
252
|
+
.van-popover__action-text::after {
|
|
253
|
+
display: none;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
&-text {
|
|
258
|
+
display: flex;
|
|
259
|
+
flex: 1;
|
|
260
|
+
align-items: center;
|
|
261
|
+
justify-content: center;
|
|
262
|
+
height: 100%;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
&-icon {
|
|
266
|
+
margin-right: 8px;
|
|
267
|
+
font-size: 20px;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
&--with-icon {
|
|
271
|
+
.van-popover__action-text {
|
|
272
|
+
justify-content: flex-start;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
&[data-popper-placement^='top'] {
|
|
278
|
+
.van-popover__arrow {
|
|
279
|
+
bottom: 0;
|
|
280
|
+
border-top-color: currentColor;
|
|
281
|
+
border-bottom-width: 0;
|
|
282
|
+
transform: translate(-50%, 100%);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
&[data-popper-placement='top'] {
|
|
287
|
+
transform-origin: 50% 100%;
|
|
288
|
+
|
|
289
|
+
.van-popover__arrow {
|
|
290
|
+
left: 50%;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
&[data-popper-placement='top-start'] {
|
|
295
|
+
transform-origin: 0 100%;
|
|
296
|
+
|
|
297
|
+
.van-popover__arrow {
|
|
298
|
+
left: 16px;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
&[data-popper-placement='top-end'] {
|
|
303
|
+
transform-origin: 100% 100%;
|
|
304
|
+
|
|
305
|
+
.van-popover__arrow {
|
|
306
|
+
right: 16px;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
&[data-popper-placement^='left'] {
|
|
311
|
+
.van-popover__arrow {
|
|
312
|
+
right: 0;
|
|
313
|
+
border-right-width: 0;
|
|
314
|
+
border-left-color: currentColor;
|
|
315
|
+
transform: translate(100%, -50%);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
&[data-popper-placement='left'] {
|
|
320
|
+
transform-origin: 100% 50%;
|
|
321
|
+
|
|
322
|
+
.van-popover__arrow {
|
|
323
|
+
top: 50%;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
&[data-popper-placement='left-start'] {
|
|
328
|
+
transform-origin: 100% 0;
|
|
329
|
+
|
|
330
|
+
.van-popover__arrow {
|
|
331
|
+
top: 16px;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
&[data-popper-placement='left-end'] {
|
|
336
|
+
transform-origin: 100% 100%;
|
|
337
|
+
|
|
338
|
+
.van-popover__arrow {
|
|
339
|
+
bottom: 16px;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
&[data-popper-placement^='right'] {
|
|
344
|
+
.van-popover__arrow {
|
|
345
|
+
left: 0;
|
|
346
|
+
border-right-color: currentColor;
|
|
347
|
+
border-left-width: 0;
|
|
348
|
+
transform: translate(-100%, -50%);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
&[data-popper-placement='right'] {
|
|
353
|
+
transform-origin: 0 50%;
|
|
354
|
+
|
|
355
|
+
.van-popover__arrow {
|
|
356
|
+
top: 50%;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
&[data-popper-placement='right-start'] {
|
|
361
|
+
transform-origin: 0 0;
|
|
362
|
+
|
|
363
|
+
.van-popover__arrow {
|
|
364
|
+
top: 16px;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
&[data-popper-placement='right-end'] {
|
|
369
|
+
transform-origin: 0 100%;
|
|
370
|
+
|
|
371
|
+
.van-popover__arrow {
|
|
372
|
+
bottom: 16px;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
&[data-popper-placement^='bottom'] {
|
|
377
|
+
.van-popover__arrow {
|
|
378
|
+
top: 0;
|
|
379
|
+
border-top-width: 0;
|
|
380
|
+
border-bottom-color: currentColor;
|
|
381
|
+
transform: translate(-50%, -100%);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
&[data-popper-placement='bottom'] {
|
|
386
|
+
transform-origin: 50% 0;
|
|
387
|
+
|
|
388
|
+
.van-popover__arrow {
|
|
389
|
+
left: 50%;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
&[data-popper-placement='bottom-start'] {
|
|
394
|
+
transform-origin: 0 0;
|
|
395
|
+
|
|
396
|
+
.van-popover__arrow {
|
|
397
|
+
left: 16px;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
&[data-popper-placement='bottom-end'] {
|
|
402
|
+
transform-origin: 100% 0;
|
|
403
|
+
|
|
404
|
+
.van-popover__arrow {
|
|
405
|
+
right: 16px;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
&--light {
|
|
410
|
+
color: #323233;
|
|
411
|
+
|
|
412
|
+
.van-popover__content {
|
|
413
|
+
background-color: #fff;
|
|
414
|
+
box-shadow: 0 2px 12px rgba(50, 50, 51, 0.12);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.van-popover__arrow {
|
|
418
|
+
color: #fff;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.van-popover__action {
|
|
422
|
+
&:active {
|
|
423
|
+
background-color: #f2f3f5;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
&--disabled {
|
|
427
|
+
color: #c8c9cc;
|
|
428
|
+
cursor: not-allowed;
|
|
429
|
+
|
|
430
|
+
&:active {
|
|
431
|
+
background-color: transparent;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
&--dark {
|
|
438
|
+
color: #fff;
|
|
439
|
+
|
|
440
|
+
.van-popover__content {
|
|
441
|
+
background-color: #4a4a4a;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.van-popover__arrow {
|
|
445
|
+
color: #4a4a4a;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.van-popover__action {
|
|
449
|
+
&:active {
|
|
450
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
&--disabled {
|
|
454
|
+
color: #969799;
|
|
455
|
+
|
|
456
|
+
&:active {
|
|
457
|
+
background-color: transparent;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.van-popover__action-text {
|
|
463
|
+
&::after {
|
|
464
|
+
border-color: #646566;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
&-zoom-enter,
|
|
470
|
+
&-zoom-leave-active {
|
|
471
|
+
transform: scale(0.8);
|
|
472
|
+
opacity: 0;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
&-zoom-enter-active {
|
|
476
|
+
transition-timing-function: ease-out;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
&-zoom-leave-active {
|
|
480
|
+
transition-timing-function: ease-in;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { on, off } from './utils'
|
|
2
|
+
|
|
3
|
+
export const ClickOutsideMixin = config => ({
|
|
4
|
+
props: {
|
|
5
|
+
closeOnClickOutside: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
default: true,
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
data() {
|
|
12
|
+
const clickOutsideHandler = event => {
|
|
13
|
+
if (this.closeOnClickOutside && !this.$el.contains(event.target)) {
|
|
14
|
+
this[config.method]()
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return { clickOutsideHandler }
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
mounted() {
|
|
22
|
+
on(document, config.event, this.clickOutsideHandler)
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
beforeDestroy() {
|
|
26
|
+
off(document, config.event, this.clickOutsideHandler)
|
|
27
|
+
},
|
|
28
|
+
})
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
let supportsPassive = false
|
|
2
|
+
try {
|
|
3
|
+
const opts = {}
|
|
4
|
+
Object.defineProperty(opts, 'passive', {
|
|
5
|
+
// eslint-disable-next-line getter-return
|
|
6
|
+
get() {
|
|
7
|
+
supportsPassive = true
|
|
8
|
+
},
|
|
9
|
+
})
|
|
10
|
+
window.addEventListener('test-passive', null, opts)
|
|
11
|
+
// eslint-disable-next-line no-empty
|
|
12
|
+
} catch (e) {}
|
|
13
|
+
|
|
14
|
+
export function on(target, event, handler, passive = false) {
|
|
15
|
+
target.addEventListener(event, handler, supportsPassive ? { capture: false, passive } : false)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function off(target, event, handler) {
|
|
19
|
+
target.removeEventListener(event, handler)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const ELEMENT = '__'
|
|
23
|
+
const MODS = '--'
|
|
24
|
+
|
|
25
|
+
function join(name, el, symbol) {
|
|
26
|
+
return el ? name + symbol + el : name
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function prefix(name, mods) {
|
|
30
|
+
if (typeof mods === 'string') {
|
|
31
|
+
return [join(name, mods, MODS)]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (Array.isArray(mods)) {
|
|
35
|
+
return mods.map(item => prefix(name, item))
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const res = []
|
|
39
|
+
if (mods) {
|
|
40
|
+
Object.keys(mods).forEach(key => {
|
|
41
|
+
if (mods[key]) {
|
|
42
|
+
res.push(name + MODS + key)
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return res
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function createBEM(name) {
|
|
51
|
+
return function (el, mods) {
|
|
52
|
+
if (el && typeof el !== 'string') {
|
|
53
|
+
mods = el
|
|
54
|
+
el = ''
|
|
55
|
+
}
|
|
56
|
+
el = join(name, el, ELEMENT)
|
|
57
|
+
const bemClass = mods ? [el, ...prefix(el, mods)] : [el]
|
|
58
|
+
return bemClass
|
|
59
|
+
}
|
|
60
|
+
}
|