sh-view 1.7.6 → 2.0.1
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/.eslintrc.js +20 -21
- package/dist/css/227.45fab5b7.css +1 -0
- package/dist/css/291.e7facf7d.css +1 -0
- package/dist/css/299.e98df6ce.css +1 -0
- package/dist/css/358.e641c5d1.css +1 -0
- package/dist/css/534.726e6699.css +1 -0
- package/dist/css/769.8008ac6c.css +1 -0
- package/dist/css/index.2bd4fb37.css +1 -0
- package/dist/css/index.2bd4fb37.css.gz +0 -0
- package/dist/fonts/iconfont.03e5a9f9.ttf +0 -0
- package/dist/fonts/iconfont.03e5a9f9.ttf.gz +0 -0
- package/dist/fonts/ionicons.31fd4446.ttf +0 -0
- package/dist/fonts/ionicons.31fd4446.ttf.gz +0 -0
- package/dist/fonts/ionicons.d03f2836.woff2 +0 -0
- package/dist/fonts/ionicons.dacd136b.woff +0 -0
- package/dist/fonts/ionicons.dacd136b.woff.gz +0 -0
- package/dist/img/ionicons.6e8059e8.svg +870 -0
- package/dist/img/ionicons.6e8059e8.svg.gz +0 -0
- package/dist/js/152.588ca5b4.js +1 -0
- package/dist/js/165.f026fdcd.js +1 -0
- package/dist/js/227.6d340a71.js +1 -0
- package/dist/js/257.285f071f.js +1 -0
- package/dist/js/264.32b3a9a5.js +1 -0
- package/dist/js/291.e100da5e.js +1 -0
- package/dist/js/299.2062f9ff.js +1 -0
- package/dist/js/322.ff97ab5e.js +1 -0
- package/dist/js/333.da633859.js +1 -0
- package/dist/js/341.d4433549.js +1 -0
- package/dist/js/358.81429379.js +1 -0
- package/dist/js/387.7b1e3b8a.js +1 -0
- package/dist/js/392.c53bf6c9.js +1 -0
- package/dist/js/400.03e3be15.js +1 -0
- package/dist/js/41.fca2504e.js +1 -0
- package/dist/js/444.a0350517.js +1 -0
- package/dist/js/452.7f75d556.js +2 -0
- package/dist/js/452.7f75d556.js.gz +0 -0
- package/dist/js/497.06080ae1.js +1 -0
- package/dist/js/514.2ea0055a.js +1 -0
- package/dist/js/534.40a67536.js +1 -0
- package/dist/js/558.6175bf20.js +15 -0
- package/dist/js/558.6175bf20.js.gz +0 -0
- package/dist/js/586.098ab36d.js +1 -0
- package/dist/js/593.df7d7c2e.js +1 -0
- package/dist/js/601.abf6f256.js +1 -0
- package/dist/js/654.99b45cd4.js +18 -0
- package/dist/js/654.99b45cd4.js.gz +0 -0
- package/dist/js/668.a15a0058.js +1 -0
- package/dist/js/704.52e87fec.js +1 -0
- package/dist/js/720.aceca876.js +1 -0
- package/dist/js/769.1376ca7f.js +1 -0
- package/dist/js/875.975891f5.js +1 -0
- package/dist/js/89.c7317ccb.js +1 -0
- package/dist/js/94.d54e8b09.js +1 -0
- package/dist/js/chunk-vendors.e05ef0ac.js +438 -0
- package/dist/js/chunk-vendors.e05ef0ac.js.gz +0 -0
- package/dist/js/index.b31868df.js +1 -0
- package/dist/js/index.b31868df.js.gz +0 -0
- package/package.json +10 -10
- package/packages/assets/css/animated.scss +167 -2
- package/packages/assets/css/loader.scss +42 -42
- package/packages/assets/css/main.scss +41 -21
- package/packages/assets/css/theme.scss +83 -44
- package/packages/components/global-components/sh-alert/index.vue +173 -0
- package/packages/components/global-components/sh-badge/index.vue +227 -0
- package/packages/components/global-components/sh-card/index.vue +140 -122
- package/packages/components/global-components/sh-code-editor/index.vue +260 -260
- package/packages/components/global-components/sh-col/css/index.scss +76 -0
- package/packages/components/global-components/sh-col/index.vue +83 -0
- package/packages/components/global-components/sh-corner/index.vue +1 -9
- package/packages/components/global-components/sh-count-to/index.vue +102 -46
- package/packages/components/global-components/sh-date/index.vue +40 -0
- package/packages/components/global-components/sh-drawer/index.vue +518 -0
- package/packages/components/global-components/sh-drawer/scrollbar.js +76 -0
- package/packages/components/global-components/sh-empty/index.vue +43 -43
- package/packages/components/global-components/{sh-vxe-form → sh-form}/css/index.scss +6 -6
- package/packages/components/global-components/{sh-vxe-form → sh-form}/index.vue +114 -115
- package/packages/components/global-components/{sh-vxe-form → sh-form}/js/methods.js +146 -157
- package/packages/components/global-components/{sh-vxe-form → sh-form}/mixin/defaultData.js +32 -33
- package/packages/components/global-components/sh-header/index.vue +293 -269
- package/packages/components/global-components/sh-icon/css/default/fonts/ionicons.svg +870 -0
- package/packages/components/global-components/sh-icon/css/default/fonts/ionicons.ttf +0 -0
- package/packages/components/global-components/sh-icon/css/default/fonts/ionicons.woff +0 -0
- package/packages/components/global-components/sh-icon/css/default/fonts/ionicons.woff2 +0 -0
- package/packages/components/global-components/sh-icon/css/default/icons.scss +2583 -0
- package/packages/components/global-components/sh-icon/css/default/index.scss +27 -0
- package/packages/components/global-components/sh-icon/css/font/fonts/iconfont.js +1 -0
- package/packages/components/global-components/sh-icon/css/font/fonts/iconfont.json +247 -0
- package/packages/components/global-components/sh-icon/css/font/fonts/iconfont.ttf +0 -0
- package/packages/components/global-components/sh-icon/css/font/fonts/iconfont.woff +0 -0
- package/packages/components/global-components/sh-icon/css/font/fonts/iconfont.woff2 +0 -0
- package/packages/components/global-components/sh-icon/css/font/icons.scss +135 -0
- package/packages/components/global-components/sh-icon/css/font/index.scss +16 -0
- package/packages/components/global-components/sh-icon/icon-default.vue +32 -0
- package/packages/components/global-components/sh-icon/{icons.vue → icon-font.vue} +32 -32
- package/packages/components/global-components/sh-icon/index.vue +28 -27
- package/packages/components/global-components/sh-image/index.vue +123 -0
- package/packages/components/global-components/sh-list/index.vue +141 -0
- package/packages/components/global-components/sh-loading/index.vue +49 -42
- package/packages/components/global-components/{sh-vxe-modal → sh-modal}/index.vue +209 -209
- package/packages/components/global-components/sh-noticebar/index.vue +201 -201
- package/packages/components/global-components/sh-poptip/index.vue +479 -0
- package/packages/components/global-components/sh-poptip/popper.js +115 -0
- package/packages/components/global-components/sh-progress/index.vue +290 -0
- package/packages/components/global-components/sh-pull-refresh/index.vue +290 -290
- package/packages/components/global-components/{sh-vxe-query → sh-query}/index.vue +317 -310
- package/packages/components/global-components/sh-result/index.vue +110 -88
- package/packages/components/global-components/sh-row/css/index.scss +21 -0
- package/packages/components/global-components/sh-row/index.vue +63 -0
- package/packages/components/global-components/sh-split/components/trigger.vue +33 -0
- package/packages/components/global-components/sh-split/index.vue +334 -142
- package/packages/components/global-components/sh-table/components/importModal.vue +351 -0
- package/packages/components/global-components/{sh-vxe-table → sh-table}/css/index.scss +4 -22
- package/packages/components/global-components/{sh-vxe-table → sh-table}/index.vue +329 -351
- package/packages/components/global-components/{sh-vxe-table → sh-table}/js/methods.js +33 -88
- package/packages/components/global-components/{sh-vxe-table → sh-table}/js/props.js +304 -313
- package/packages/components/global-components/{sh-vxe-table → sh-table}/mixin/defaultData.js +94 -116
- package/packages/components/global-components/sh-tabs/index.vue +322 -0
- package/packages/components/global-components/sh-tag/index.vue +163 -0
- package/packages/components/global-components/{sh-vxe-toolbar → sh-toolbar}/index.vue +177 -172
- package/packages/components/global-components/sh-tree/components/table-tree.vue +280 -0
- package/packages/components/global-components/sh-tree/css/index.scss +54 -0
- package/packages/components/global-components/sh-tree/index.vue +195 -0
- package/packages/components/global-components/sh-tree/mixin/treeProps.js +124 -0
- package/packages/components/global-components/sh-upload/index.vue +278 -275
- package/packages/components/global-components/sh-water-fall/index.vue +87 -87
- package/packages/components/index.js +85 -59
- package/packages/components/other-components/sh-cron-modal/css/index.scss +2 -2
- package/packages/components/other-components/sh-menu-card/index.vue +224 -224
- package/packages/css/index.js +4 -6
- package/packages/directive/index.js +19 -19
- package/packages/directive/module/click-out.js +14 -0
- package/packages/directive/module/draggable.js +42 -42
- package/packages/directive/module/line-clamp.js +22 -0
- package/packages/directive/module/prevent-click.js +18 -0
- package/packages/directive/module/resize.js +19 -0
- package/packages/directive/module/ripple.js +166 -0
- package/packages/index.js +39 -40
- package/packages/utils/transfer-queue.js +12 -0
- package/packages/vxeTable/css/index.scss +12 -98
- package/packages/vxeTable/css/variable.scss +7 -265
- package/packages/vxeTable/index.js +184 -183
- package/packages/vxeTable/plugins/export.js +450 -0
- package/packages/vxeTable/render/cell/vxe-render-checkgroup.vue +36 -36
- package/packages/vxeTable/render/cell/vxe-render-goption.vue +94 -93
- package/packages/vxeTable/render/cell/vxe-render-img.vue +21 -28
- package/packages/vxeTable/render/cell/vxe-render-input.vue +51 -51
- package/packages/vxeTable/render/cell/vxe-render-progress.vue +19 -19
- package/packages/vxeTable/render/cell/vxe-render-radiogroup.vue +36 -36
- package/packages/vxeTable/render/cell/vxe-render-select.vue +36 -36
- package/packages/vxeTable/render/cell/vxe-render-tree.vue +59 -59
- package/packages/vxeTable/render/globalRenders.jsx +498 -491
- package/packages/assets/icons/demo.css +0 -539
- package/packages/assets/icons/iconfont.css +0 -415
- package/packages/assets/icons/iconfont.js +0 -1
- package/packages/assets/icons/iconfont.json +0 -709
- package/packages/assets/icons/iconfont.ttf +0 -0
- package/packages/assets/icons/iconfont.woff +0 -0
- package/packages/assets/icons/iconfont.woff2 +0 -0
- package/packages/assets/img/image-error.png +0 -0
- package/packages/assets/img/square-image.png +0 -0
- package/packages/components/global-components/sh-iv-form/components/iv-group-item.vue +0 -57
- package/packages/components/global-components/sh-iv-form/components/iv-single-item.vue +0 -76
- package/packages/components/global-components/sh-iv-form/index.vue +0 -255
- package/packages/components/global-components/sh-vxe-list/index.vue +0 -149
- package/packages/components/global-components/sh-vxe-table/components/importModal.vue +0 -377
- package/packages/components/global-components/sh-vxe-tree/components/table-tree.vue +0 -233
- package/packages/components/global-components/sh-vxe-tree/css/index.scss +0 -20
- package/packages/components/global-components/sh-vxe-tree/index.vue +0 -85
- package/packages/components/global-components/sh-vxe-tree/js/props.js +0 -120
- package/packages/components/global-components/sh-vxe-tree/js/treeMethods.js +0 -169
- package/packages/components/global-components/sh-vxe-tree/mixin/defaultData.js +0 -54
- package/packages/components/global-components/sh-vxe-tree/vxe-direct-tree.vue +0 -203
- package/packages/components/global-components/sh-vxe-tree/vxe-select-tree.vue +0 -291
- package/packages/components/other-components/sh-markdown/tinymce/langs/ar.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/az.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/bg_BG.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/bn_BD.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/ca.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/cs.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/cy.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/da.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/de.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/dv.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/el.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/eo.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/es.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/es_MX.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/et.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/eu.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/fa.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/fi.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/fr_FR.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/ga.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/gl.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/he_IL.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/hi.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/hr.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/hu_HU.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/hy.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/id.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/is_IS.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/it.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/ja.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/kab.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/kk.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/ko_KR.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/ku.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/lt.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/lv.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/nb_NO.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/ne.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/nl.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/nl_BE.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/oc.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/pl.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/pt_BR.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/ro.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/ru.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/sk.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/sl_SI.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/sq.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/sr.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/sv_SE.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/ta.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/tg.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/th_TH.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/tr.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/ug.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/uk.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/langs/vi.js +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/dark/content.css +0 -72
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/dark/content.min.css +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/default/content.min.css +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/document/content.css +0 -72
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/document/content.min.css +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/writer/content.css +0 -68
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/writer/content.min.css +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.css +0 -714
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.inline.css +0 -726
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.inline.min.css +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.min.css +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.mobile.css +0 -29
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.mobile.min.css +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.css +0 -3047
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.min.css +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.mobile.css +0 -673
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +0 -7
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +0 -37
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +0 -7
- package/packages/directive/directives.js +0 -27
- package/packages/iview/css/index.scss +0 -32
- package/packages/iview/index.js +0 -25
- /package/packages/components/global-components/{sh-vxe-form → sh-form}/components/form-item.vue +0 -0
- /package/packages/components/global-components/{sh-vxe-form → sh-form}/js/props.js +0 -0
- /package/packages/components/global-components/{sh-vxe-table → sh-table}/js/excel_to_json.js +0 -0
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-clickout="handleClose" class="sh-poptip" :class="classes" @mouseenter="handleMouseenter" @mouseleave="handleMouseleave">
|
|
3
|
+
<div ref="reference" class="sh-poptip-rel" @click="handleClick" @mousedown="handleFocus(false)" @mouseup="handleBlur(false)"><slot></slot></div>
|
|
4
|
+
<teleport to="body" :disabled="!transfer">
|
|
5
|
+
<transition name="fade">
|
|
6
|
+
<div v-show="visible" ref="popper" :class="popperClasses" :style="styles" @click="handleTransferClick" @mouseenter="handleMouseenter" @mouseleave="handleMouseleave">
|
|
7
|
+
<div class="sh-poptip-content">
|
|
8
|
+
<div class="sh-poptip-arrow"></div>
|
|
9
|
+
<div v-if="confirm" class="sh-poptip-inner">
|
|
10
|
+
<div class="sh-poptip-body">
|
|
11
|
+
<i class="ivu-icon ivu-icon-ios-help-circle"></i>
|
|
12
|
+
<div class="sh-poptip-body-message">
|
|
13
|
+
<slot name="title">{{ title }}</slot>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="sh-poptip-footer">
|
|
17
|
+
<vxe-button type="text" size="small" @click="cancel">{{ cancelText }}</vxe-button>
|
|
18
|
+
<vxe-button status="primary" size="small" @click="ok">{{ comfirmText }}</vxe-button>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<div v-if="!confirm" class="sh-poptip-inner">
|
|
22
|
+
<div v-if="showTitle" ref="title" class="sh-poptip-title" :style="contentPaddingStyle">
|
|
23
|
+
<slot name="title">
|
|
24
|
+
<div class="sh-poptip-title-inner">{{ title }}</div>
|
|
25
|
+
</slot>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="sh-poptip-body" :style="contentPaddingStyle">
|
|
28
|
+
<div :class="contentClasses">
|
|
29
|
+
<slot name="content">
|
|
30
|
+
<div class="sh-poptip-body-content-inner">{{ content }}</div>
|
|
31
|
+
</slot>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</transition>
|
|
38
|
+
</teleport>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script>
|
|
43
|
+
import Popper from './popper'
|
|
44
|
+
import { transferIndex, transferIncrease } from '../../../utils/transfer-queue'
|
|
45
|
+
export default {
|
|
46
|
+
name: 'ShPoptip',
|
|
47
|
+
mixins: [Popper],
|
|
48
|
+
props: {
|
|
49
|
+
trigger: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: 'click' // 'click', 'focus', 'hover'
|
|
52
|
+
},
|
|
53
|
+
placement: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: 'top' // 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'
|
|
56
|
+
},
|
|
57
|
+
title: {
|
|
58
|
+
type: [String, Number]
|
|
59
|
+
},
|
|
60
|
+
content: {
|
|
61
|
+
type: [String, Number],
|
|
62
|
+
default: ''
|
|
63
|
+
},
|
|
64
|
+
width: {
|
|
65
|
+
type: [String, Number]
|
|
66
|
+
},
|
|
67
|
+
confirm: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false
|
|
70
|
+
},
|
|
71
|
+
comfirmText: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: '确认'
|
|
74
|
+
},
|
|
75
|
+
cancelText: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: '取消'
|
|
78
|
+
},
|
|
79
|
+
transfer: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: false
|
|
82
|
+
},
|
|
83
|
+
popperClass: {
|
|
84
|
+
type: String
|
|
85
|
+
},
|
|
86
|
+
wordWrap: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: false
|
|
89
|
+
},
|
|
90
|
+
padding: {
|
|
91
|
+
type: String
|
|
92
|
+
},
|
|
93
|
+
disabled: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: false
|
|
96
|
+
},
|
|
97
|
+
capture: {
|
|
98
|
+
type: Boolean
|
|
99
|
+
},
|
|
100
|
+
transferClassName: {
|
|
101
|
+
type: String
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
emits: ['confirm', 'cancel'],
|
|
105
|
+
data() {
|
|
106
|
+
return {
|
|
107
|
+
showTitle: true,
|
|
108
|
+
isInput: false,
|
|
109
|
+
disableCloseUnderTransfer: false, // transfer 模式下,点击 slot 也会触发关闭
|
|
110
|
+
tIndex: this.handleGetIndex()
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
computed: {
|
|
114
|
+
classes() {
|
|
115
|
+
return {
|
|
116
|
+
'sh-poptip-confirm': this.confirm
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
popperClasses() {
|
|
120
|
+
return {
|
|
121
|
+
'sh-poptip-popper': true,
|
|
122
|
+
'sh-poptip-confirm': this.transfer && this.confirm,
|
|
123
|
+
'sh-poptip-transfer': this.transfer,
|
|
124
|
+
[`${this.popperClass}`]: this.popperClass,
|
|
125
|
+
[`${this.transferClassName}`]: this.transferClassName
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
styles() {
|
|
129
|
+
let style = {}
|
|
130
|
+
if (this.width) {
|
|
131
|
+
style.width = `${this.width}px`
|
|
132
|
+
}
|
|
133
|
+
if (this.transfer) style['z-index'] = 1060 + this.tIndex
|
|
134
|
+
return style
|
|
135
|
+
},
|
|
136
|
+
contentClasses() {
|
|
137
|
+
return {
|
|
138
|
+
'sh-poptip-body-content': true,
|
|
139
|
+
'sh-poptip-body-content-word-wrap': this.wordWrap
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
contentPaddingStyle() {
|
|
143
|
+
const styles = {}
|
|
144
|
+
if (this.padding !== '') styles.padding = this.padding
|
|
145
|
+
return styles
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
mounted() {
|
|
149
|
+
if (!this.confirm) {
|
|
150
|
+
this.showTitle = this.$slots.title !== undefined || this.title
|
|
151
|
+
}
|
|
152
|
+
if (this.trigger === 'focus') {
|
|
153
|
+
this.$nextTick(() => {
|
|
154
|
+
const $children = this.getInputChildren()
|
|
155
|
+
if ($children) {
|
|
156
|
+
this.isInput = true
|
|
157
|
+
$children.addEventListener('focus', this.handleFocus, false)
|
|
158
|
+
$children.addEventListener('blur', this.handleBlur, false)
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
beforeUnmount() {
|
|
164
|
+
const $children = this.getInputChildren()
|
|
165
|
+
if ($children) {
|
|
166
|
+
$children.removeEventListener('focus', this.handleFocus, false)
|
|
167
|
+
$children.removeEventListener('blur', this.handleBlur, false)
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
methods: {
|
|
171
|
+
handleClick() {
|
|
172
|
+
if (this.disabled) return
|
|
173
|
+
if (this.confirm) {
|
|
174
|
+
this.visible = !this.visible
|
|
175
|
+
return true
|
|
176
|
+
}
|
|
177
|
+
if (this.trigger !== 'click') {
|
|
178
|
+
return false
|
|
179
|
+
}
|
|
180
|
+
this.visible = !this.visible
|
|
181
|
+
},
|
|
182
|
+
handleTransferClick() {
|
|
183
|
+
if (this.transfer) this.disableCloseUnderTransfer = true
|
|
184
|
+
},
|
|
185
|
+
handleClose() {
|
|
186
|
+
if (this.disableCloseUnderTransfer) {
|
|
187
|
+
this.disableCloseUnderTransfer = false
|
|
188
|
+
return false
|
|
189
|
+
}
|
|
190
|
+
if (this.confirm) {
|
|
191
|
+
this.visible = false
|
|
192
|
+
return true
|
|
193
|
+
}
|
|
194
|
+
if (this.trigger !== 'click') {
|
|
195
|
+
return false
|
|
196
|
+
}
|
|
197
|
+
this.visible = false
|
|
198
|
+
},
|
|
199
|
+
handleFocus(fromInput = true) {
|
|
200
|
+
if (this.disabled) return
|
|
201
|
+
|
|
202
|
+
if (this.trigger !== 'focus' || this.confirm || (this.isInput && !fromInput)) {
|
|
203
|
+
return false
|
|
204
|
+
}
|
|
205
|
+
this.visible = true
|
|
206
|
+
},
|
|
207
|
+
handleBlur(fromInput = true) {
|
|
208
|
+
if (this.trigger !== 'focus' || this.confirm || (this.isInput && !fromInput)) {
|
|
209
|
+
return false
|
|
210
|
+
}
|
|
211
|
+
this.visible = false
|
|
212
|
+
},
|
|
213
|
+
handleMouseenter() {
|
|
214
|
+
if (this.disabled) return
|
|
215
|
+
if (this.trigger !== 'hover' || this.confirm) {
|
|
216
|
+
return false
|
|
217
|
+
}
|
|
218
|
+
if (this.enterTimer) clearTimeout(this.enterTimer)
|
|
219
|
+
this.enterTimer = setTimeout(() => {
|
|
220
|
+
this.visible = true
|
|
221
|
+
}, 100)
|
|
222
|
+
},
|
|
223
|
+
handleMouseleave() {
|
|
224
|
+
if (this.trigger !== 'hover' || this.confirm) {
|
|
225
|
+
return false
|
|
226
|
+
}
|
|
227
|
+
if (this.enterTimer) {
|
|
228
|
+
clearTimeout(this.enterTimer)
|
|
229
|
+
this.enterTimer = setTimeout(() => {
|
|
230
|
+
this.visible = false
|
|
231
|
+
}, 100)
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
cancel() {
|
|
235
|
+
this.visible = false
|
|
236
|
+
this.$emit('cancel')
|
|
237
|
+
},
|
|
238
|
+
ok() {
|
|
239
|
+
this.visible = false
|
|
240
|
+
this.$emit('confirm')
|
|
241
|
+
},
|
|
242
|
+
getInputChildren() {
|
|
243
|
+
const $input = this.$refs.reference.querySelectorAll('input')
|
|
244
|
+
const $textarea = this.$refs.reference.querySelectorAll('textarea')
|
|
245
|
+
let $children = null
|
|
246
|
+
if ($input.length) {
|
|
247
|
+
$children = $input[0]
|
|
248
|
+
} else if ($textarea.length) {
|
|
249
|
+
$children = $textarea[0]
|
|
250
|
+
}
|
|
251
|
+
return $children
|
|
252
|
+
},
|
|
253
|
+
handleGetIndex() {
|
|
254
|
+
transferIncrease()
|
|
255
|
+
return transferIndex
|
|
256
|
+
},
|
|
257
|
+
handleIndexIncrease() {
|
|
258
|
+
this.tIndex = this.handleGetIndex()
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
</script>
|
|
263
|
+
|
|
264
|
+
<style scoped lang="scss">
|
|
265
|
+
$poptip-arrow: sh-poptip-arrow;
|
|
266
|
+
$poptip-arrow-width: 7px;
|
|
267
|
+
$poptip-arrow-outer-width: ($poptip-arrow-width + 1);
|
|
268
|
+
$poptip-distance: $poptip-arrow-width - 1 + 4;
|
|
269
|
+
$poptip-arrow-color: hsla(0, 0%, 85%, 0.5);
|
|
270
|
+
@mixin popper($arrow, $arrow-width, $arrow-distance, $bg) {
|
|
271
|
+
display: block;
|
|
272
|
+
visibility: visible;
|
|
273
|
+
position: absolute;
|
|
274
|
+
z-index: 2000;
|
|
275
|
+
&[x-placement^='top'] {
|
|
276
|
+
padding: $arrow-width 0 $arrow-distance 0;
|
|
277
|
+
}
|
|
278
|
+
&[x-placement^='right'] {
|
|
279
|
+
padding: 0 $arrow-width 0 $arrow-distance;
|
|
280
|
+
}
|
|
281
|
+
&[x-placement^='bottom'] {
|
|
282
|
+
padding: $arrow-distance 0 $arrow-width 0;
|
|
283
|
+
}
|
|
284
|
+
&[x-placement^='left'] {
|
|
285
|
+
padding: 0 $arrow-distance 0 $arrow-width;
|
|
286
|
+
}
|
|
287
|
+
&[x-placement^='top'] .#{$arrow} {
|
|
288
|
+
bottom: $arrow-distance - $arrow-width;
|
|
289
|
+
border-width: $arrow-width $arrow-width 0;
|
|
290
|
+
border-top-color: $bg;
|
|
291
|
+
}
|
|
292
|
+
&[x-placement='top'] .#{$arrow} {
|
|
293
|
+
left: 50%;
|
|
294
|
+
margin-left: -$arrow-width;
|
|
295
|
+
}
|
|
296
|
+
&[x-placement='top-start'] .#{$arrow} {
|
|
297
|
+
left: 16px;
|
|
298
|
+
}
|
|
299
|
+
&[x-placement='top-end'] .#{$arrow} {
|
|
300
|
+
right: 16px;
|
|
301
|
+
}
|
|
302
|
+
&[x-placement^='right'] .#{$arrow} {
|
|
303
|
+
left: $arrow-distance - $arrow-width;
|
|
304
|
+
border-width: $arrow-width $arrow-width $arrow-width 0;
|
|
305
|
+
border-right-color: $bg;
|
|
306
|
+
}
|
|
307
|
+
&[x-placement='right'] .#{$arrow} {
|
|
308
|
+
top: 50%;
|
|
309
|
+
margin-top: -$arrow-width;
|
|
310
|
+
}
|
|
311
|
+
&[x-placement='right-start'] .#{$arrow} {
|
|
312
|
+
top: 8px;
|
|
313
|
+
}
|
|
314
|
+
&[x-placement='right-end'] .#{$arrow} {
|
|
315
|
+
bottom: 8px;
|
|
316
|
+
}
|
|
317
|
+
&[x-placement^='left'] .#{$arrow} {
|
|
318
|
+
right: $arrow-distance - $arrow-width;
|
|
319
|
+
border-width: $arrow-width 0 $arrow-width $arrow-width;
|
|
320
|
+
border-left-color: $bg;
|
|
321
|
+
}
|
|
322
|
+
&[x-placement='left'] .#{$arrow} {
|
|
323
|
+
top: 50%;
|
|
324
|
+
margin-top: -$arrow-width;
|
|
325
|
+
}
|
|
326
|
+
&[x-placement='left-start'] .#{$arrow} {
|
|
327
|
+
top: 8px;
|
|
328
|
+
}
|
|
329
|
+
&[x-placement='left-end'] .#{$arrow} {
|
|
330
|
+
bottom: 8px;
|
|
331
|
+
}
|
|
332
|
+
&[x-placement^='bottom'] .#{$arrow} {
|
|
333
|
+
top: $arrow-distance - $arrow-width;
|
|
334
|
+
border-width: 0 $arrow-width $arrow-width;
|
|
335
|
+
border-bottom-color: $bg;
|
|
336
|
+
}
|
|
337
|
+
&[x-placement='bottom'] .#{$arrow} {
|
|
338
|
+
left: 50%;
|
|
339
|
+
margin-left: -$arrow-width;
|
|
340
|
+
}
|
|
341
|
+
&[x-placement='bottom-start'] .#{$arrow} {
|
|
342
|
+
left: 16px;
|
|
343
|
+
}
|
|
344
|
+
&[x-placement='bottom-end'] .#{$arrow} {
|
|
345
|
+
right: 16px;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
.sh-poptip {
|
|
349
|
+
display: inline-block;
|
|
350
|
+
&-rel {
|
|
351
|
+
display: inline-block;
|
|
352
|
+
position: relative;
|
|
353
|
+
}
|
|
354
|
+
&-title {
|
|
355
|
+
margin: 0;
|
|
356
|
+
padding: 8px 16px;
|
|
357
|
+
position: relative;
|
|
358
|
+
&:after {
|
|
359
|
+
content: '';
|
|
360
|
+
display: block;
|
|
361
|
+
height: 1px;
|
|
362
|
+
position: absolute;
|
|
363
|
+
left: 8px;
|
|
364
|
+
right: 8px;
|
|
365
|
+
bottom: 0;
|
|
366
|
+
background-color: var(--vxe-table-border-color);
|
|
367
|
+
}
|
|
368
|
+
&-inner {
|
|
369
|
+
color: var(--vxe-font-color);
|
|
370
|
+
font-size: var(--vxe-font-size);
|
|
371
|
+
font-weight: 500;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
&-body {
|
|
375
|
+
padding: 8px 16px;
|
|
376
|
+
&-content {
|
|
377
|
+
overflow: auto;
|
|
378
|
+
&-word-wrap {
|
|
379
|
+
white-space: pre-wrap;
|
|
380
|
+
text-align: justify;
|
|
381
|
+
}
|
|
382
|
+
&-inner {
|
|
383
|
+
color: var(--vxe-font-color);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
&-inner {
|
|
388
|
+
width: 100%;
|
|
389
|
+
background-color: #fff;
|
|
390
|
+
background-clip: padding-box;
|
|
391
|
+
border-radius: var(--vxe-border-radius);
|
|
392
|
+
box-shadow: var(--box-shadow);
|
|
393
|
+
white-space: nowrap;
|
|
394
|
+
}
|
|
395
|
+
&-popper {
|
|
396
|
+
min-width: 150px;
|
|
397
|
+
font-size: var(--vxe-font-size);
|
|
398
|
+
z-index: 100;
|
|
399
|
+
@include popper($poptip-arrow, $poptip-arrow-width, $poptip-distance, $poptip-arrow-color);
|
|
400
|
+
&[x-placement^='top'] .sh-poptip-arrow:after {
|
|
401
|
+
content: ' ';
|
|
402
|
+
bottom: 1px;
|
|
403
|
+
margin-left: -$poptip-arrow-width;
|
|
404
|
+
border-bottom-width: 0;
|
|
405
|
+
border-top-width: $poptip-arrow-width;
|
|
406
|
+
border-top-color: #fff;
|
|
407
|
+
}
|
|
408
|
+
&[x-placement^='right'] .sh-poptip-arrow:after {
|
|
409
|
+
content: ' ';
|
|
410
|
+
left: 1px;
|
|
411
|
+
bottom: -$poptip-arrow-width;
|
|
412
|
+
border-left-width: 0;
|
|
413
|
+
border-right-width: $poptip-arrow-width;
|
|
414
|
+
border-right-color: #fff;
|
|
415
|
+
}
|
|
416
|
+
&[x-placement^='bottom'] .sh-poptip-arrow:after {
|
|
417
|
+
content: ' ';
|
|
418
|
+
top: 1px;
|
|
419
|
+
margin-left: -$poptip-arrow-width;
|
|
420
|
+
border-top-width: 0;
|
|
421
|
+
border-bottom-width: $poptip-arrow-width;
|
|
422
|
+
border-bottom-color: #fff;
|
|
423
|
+
}
|
|
424
|
+
&[x-placement^='left'] .sh-poptip-arrow:after {
|
|
425
|
+
content: ' ';
|
|
426
|
+
right: 1px;
|
|
427
|
+
border-right-width: 0;
|
|
428
|
+
border-left-width: $poptip-arrow-width;
|
|
429
|
+
border-left-color: #fff;
|
|
430
|
+
bottom: -$poptip-arrow-width;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
&-arrow {
|
|
434
|
+
display: block;
|
|
435
|
+
width: 0;
|
|
436
|
+
height: 0;
|
|
437
|
+
position: absolute;
|
|
438
|
+
border-color: transparent;
|
|
439
|
+
border-style: solid;
|
|
440
|
+
border-width: 8px;
|
|
441
|
+
&:after {
|
|
442
|
+
display: block;
|
|
443
|
+
width: 0;
|
|
444
|
+
height: 0;
|
|
445
|
+
position: absolute;
|
|
446
|
+
border-color: transparent;
|
|
447
|
+
border-style: solid;
|
|
448
|
+
content: '';
|
|
449
|
+
border-width: 7px;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
&-confirm &-popper {
|
|
453
|
+
max-width: 300px;
|
|
454
|
+
}
|
|
455
|
+
&-confirm &-inner {
|
|
456
|
+
white-space: normal;
|
|
457
|
+
}
|
|
458
|
+
&-confirm &-body {
|
|
459
|
+
padding: 12px 12px 8px;
|
|
460
|
+
.ivu-icon {
|
|
461
|
+
font-size: 16px;
|
|
462
|
+
color: var(--vxe-warning-color);
|
|
463
|
+
line-height: 18px;
|
|
464
|
+
position: absolute;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
&-message {
|
|
468
|
+
padding-left: 20px;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
&-confirm &-footer {
|
|
472
|
+
text-align: right;
|
|
473
|
+
padding: 8px 12px 12px;
|
|
474
|
+
button {
|
|
475
|
+
margin-left: 4px;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
</style>
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { nextTick } from 'vue'
|
|
2
|
+
import Popper from 'popper.js'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
emits: ['popper-show', 'popper-hide', 'created', 'update:modelValue'],
|
|
6
|
+
props: {
|
|
7
|
+
eventsEnabled: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: false
|
|
10
|
+
},
|
|
11
|
+
placement: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: 'bottom'
|
|
14
|
+
},
|
|
15
|
+
boundariesPadding: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 5
|
|
18
|
+
},
|
|
19
|
+
reference: Object,
|
|
20
|
+
popper: Object,
|
|
21
|
+
offset: {
|
|
22
|
+
default: 0
|
|
23
|
+
},
|
|
24
|
+
modelValue: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false
|
|
27
|
+
},
|
|
28
|
+
transition: String,
|
|
29
|
+
options: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default() {
|
|
32
|
+
return {
|
|
33
|
+
modifiers: {
|
|
34
|
+
computeStyle: {
|
|
35
|
+
gpuAcceleration: false
|
|
36
|
+
},
|
|
37
|
+
preventOverflow: {
|
|
38
|
+
boundariesElement: 'window'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
data() {
|
|
46
|
+
return {
|
|
47
|
+
visible: this.modelValue
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
watch: {
|
|
51
|
+
modelValue: {
|
|
52
|
+
immediate: true,
|
|
53
|
+
handler(val) {
|
|
54
|
+
this.visible = val
|
|
55
|
+
this.$emit('update:modelValue', val)
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
visible(val) {
|
|
59
|
+
if (val) {
|
|
60
|
+
if (this.handleIndexIncrease) this.handleIndexIncrease() // just use for Poptip
|
|
61
|
+
this.updatePopper()
|
|
62
|
+
this.$emit('popper-show')
|
|
63
|
+
} else {
|
|
64
|
+
this.$emit('popper-hide')
|
|
65
|
+
}
|
|
66
|
+
this.$emit('update:modelValue', val)
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
methods: {
|
|
70
|
+
createPopper() {
|
|
71
|
+
if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.placement)) {
|
|
72
|
+
return
|
|
73
|
+
}
|
|
74
|
+
const options = this.options
|
|
75
|
+
const popper = this.popper || this.$refs.popper
|
|
76
|
+
const reference = this.reference || this.$refs.reference
|
|
77
|
+
|
|
78
|
+
if (!popper || !reference) return
|
|
79
|
+
|
|
80
|
+
if (this.popperJS && this.popperJS.hasOwnProperty('destroy')) {
|
|
81
|
+
this.popperJS.destroy()
|
|
82
|
+
}
|
|
83
|
+
options.eventsEnabled = this.eventsEnabled
|
|
84
|
+
|
|
85
|
+
options.placement = this.placement
|
|
86
|
+
|
|
87
|
+
if (!options.modifiers.offset) {
|
|
88
|
+
options.modifiers.offset = {}
|
|
89
|
+
}
|
|
90
|
+
options.modifiers.offset.offset = this.offset
|
|
91
|
+
options.onCreate = () => {
|
|
92
|
+
nextTick(this.updatePopper)
|
|
93
|
+
this.$emit('created', this)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
this.popperJS = new Popper(reference, popper, options)
|
|
97
|
+
},
|
|
98
|
+
updatePopper() {
|
|
99
|
+
this.popperJS ? this.popperJS.update() : this.createPopper()
|
|
100
|
+
},
|
|
101
|
+
doDestroy() {
|
|
102
|
+
if (this.visible) return
|
|
103
|
+
this.popperJS.destroy()
|
|
104
|
+
this.popperJS = null
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
updated() {
|
|
108
|
+
nextTick(() => this.updatePopper())
|
|
109
|
+
},
|
|
110
|
+
beforeUnmount() {
|
|
111
|
+
if (this.popperJS) {
|
|
112
|
+
this.popperJS.destroy()
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|