bm-admin-ui 1.0.82-alpha → 1.0.84-alpha
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/es/components/attachment/index.js +273 -0
- package/es/components/breadcrumb/index.js +158 -0
- package/es/components/button/index.js +49 -0
- package/es/components/edit-form/index.js +1186 -0
- package/es/components/editor/index.js +12554 -0
- package/es/components/feedback/index.js +295 -0
- package/es/components/float-table/index.js +3511 -0
- package/es/components/flow-designer/index.js +1317 -0
- package/es/components/form-create/index.js +20978 -0
- package/es/components/form-designer/index.js +4514 -0
- package/es/components/index.js +19 -0
- package/es/components/input-tags-display/index.js +226 -0
- package/es/components/over-tooltips/index.js +133 -0
- package/es/components/search-filter/index.js +449 -0
- package/es/components/select-all/index.js +172 -0
- package/es/components/shops-filter/index.js +453 -0
- package/es/components/staffs-selector/index.js +728 -0
- package/es/components/timeline/index.js +168 -0
- package/es/components/upload/index.js +909 -0
- package/es/components/videoView/index.js +100 -0
- package/lib/components/attachment/index.js +278 -0
- package/lib/components/breadcrumb/index.js +168 -0
- package/lib/components/button/index.js +58 -0
- package/lib/components/edit-form/index.js +1195 -0
- package/lib/components/editor/index.js +12559 -0
- package/lib/components/feedback/index.js +309 -0
- package/lib/components/float-table/index.js +3516 -0
- package/lib/components/flow-designer/index.js +1329 -0
- package/lib/components/form-create/index.js +20990 -0
- package/lib/components/form-designer/index.js +4525 -0
- package/lib/components/index.js +140 -0
- package/lib/components/input-tags-display/index.js +237 -0
- package/lib/components/over-tooltips/index.js +138 -0
- package/lib/components/search-filter/index.js +459 -0
- package/lib/components/select-all/index.js +181 -0
- package/lib/components/shops-filter/index.js +465 -0
- package/lib/components/staffs-selector/index.js +733 -0
- package/lib/components/timeline/index.js +174 -0
- package/lib/components/upload/index.js +914 -0
- package/lib/components/videoView/index.js +105 -0
- package/package.json +1 -1
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var button = require('./button');
|
|
6
|
+
var formCreate = require('./form-create');
|
|
7
|
+
var formDesigner = require('./form-designer');
|
|
8
|
+
var flowDesigner = require('./flow-designer');
|
|
9
|
+
var feedback = require('./feedback');
|
|
10
|
+
var searchFilter = require('./search-filter');
|
|
11
|
+
var shopsFilter = require('./shops-filter');
|
|
12
|
+
var index = require('./staffs-selector/index');
|
|
13
|
+
var floatTable = require('./float-table');
|
|
14
|
+
var overTooltips = require('./over-tooltips');
|
|
15
|
+
var upload = require('./upload');
|
|
16
|
+
var timeline = require('./timeline');
|
|
17
|
+
var inputTagsDisplay = require('./input-tags-display');
|
|
18
|
+
var selectAll = require('./select-all');
|
|
19
|
+
var breadcrumb = require('./breadcrumb');
|
|
20
|
+
var editor = require('./editor');
|
|
21
|
+
var videoView = require('./videoView');
|
|
22
|
+
var attachment = require('./attachment');
|
|
23
|
+
var editForm = require('./edit-form');
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
Object.keys(button).forEach(function (k) {
|
|
28
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return button[k]; }
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
Object.keys(formCreate).forEach(function (k) {
|
|
34
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () { return formCreate[k]; }
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
Object.keys(formDesigner).forEach(function (k) {
|
|
40
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () { return formDesigner[k]; }
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
Object.keys(flowDesigner).forEach(function (k) {
|
|
46
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () { return flowDesigner[k]; }
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
Object.keys(feedback).forEach(function (k) {
|
|
52
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () { return feedback[k]; }
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
Object.keys(searchFilter).forEach(function (k) {
|
|
58
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () { return searchFilter[k]; }
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
Object.keys(shopsFilter).forEach(function (k) {
|
|
64
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () { return shopsFilter[k]; }
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
Object.keys(index).forEach(function (k) {
|
|
70
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
get: function () { return index[k]; }
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
Object.keys(floatTable).forEach(function (k) {
|
|
76
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () { return floatTable[k]; }
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
Object.keys(overTooltips).forEach(function (k) {
|
|
82
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function () { return overTooltips[k]; }
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
Object.keys(upload).forEach(function (k) {
|
|
88
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: function () { return upload[k]; }
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
Object.keys(timeline).forEach(function (k) {
|
|
94
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
95
|
+
enumerable: true,
|
|
96
|
+
get: function () { return timeline[k]; }
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
Object.keys(inputTagsDisplay).forEach(function (k) {
|
|
100
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
get: function () { return inputTagsDisplay[k]; }
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
Object.keys(selectAll).forEach(function (k) {
|
|
106
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function () { return selectAll[k]; }
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
Object.keys(breadcrumb).forEach(function (k) {
|
|
112
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
113
|
+
enumerable: true,
|
|
114
|
+
get: function () { return breadcrumb[k]; }
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
Object.keys(editor).forEach(function (k) {
|
|
118
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () { return editor[k]; }
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
Object.keys(videoView).forEach(function (k) {
|
|
124
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
125
|
+
enumerable: true,
|
|
126
|
+
get: function () { return videoView[k]; }
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
Object.keys(attachment).forEach(function (k) {
|
|
130
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
get: function () { return attachment[k]; }
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
Object.keys(editForm).forEach(function (k) {
|
|
136
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
get: function () { return editForm[k]; }
|
|
139
|
+
});
|
|
140
|
+
});
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var withInstall = require('bm-admin-ui/lib/utils/with-install');
|
|
6
|
+
var vue = require('vue');
|
|
7
|
+
var ToolTip = require('ant-design-vue/lib/tooltip');
|
|
8
|
+
var Button = require('ant-design-vue/lib/button');
|
|
9
|
+
var Tag = require('ant-design-vue/lib/tag');
|
|
10
|
+
var iconsVue = require('@ant-design/icons-vue');
|
|
11
|
+
|
|
12
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
+
|
|
14
|
+
var ToolTip__default = /*#__PURE__*/_interopDefaultLegacy(ToolTip);
|
|
15
|
+
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
16
|
+
var Tag__default = /*#__PURE__*/_interopDefaultLegacy(Tag);
|
|
17
|
+
|
|
18
|
+
var _export_sfc = (sfc, props) => {
|
|
19
|
+
const target = sfc.__vccOpts || sfc;
|
|
20
|
+
for (const [key, val] of props) {
|
|
21
|
+
target[key] = val;
|
|
22
|
+
}
|
|
23
|
+
return target;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const _sfc_main = vue.defineComponent({
|
|
27
|
+
components: { ToolTip: ToolTip__default["default"], CloseCircleFilled: iconsVue.CloseCircleFilled, Button: Button__default["default"], Tag: Tag__default["default"] },
|
|
28
|
+
props: {
|
|
29
|
+
disabled: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
33
|
+
list: {
|
|
34
|
+
type: Array,
|
|
35
|
+
default: () => []
|
|
36
|
+
},
|
|
37
|
+
showEmpty: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false
|
|
40
|
+
},
|
|
41
|
+
placeholder: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: "\u8BF7\u9009\u62E9"
|
|
44
|
+
},
|
|
45
|
+
showEmptyBtn: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
48
|
+
},
|
|
49
|
+
unitStr: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "\u9879"
|
|
52
|
+
},
|
|
53
|
+
btnText: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "\u6DFB\u52A0"
|
|
56
|
+
},
|
|
57
|
+
toolTipProps: {
|
|
58
|
+
type: Object,
|
|
59
|
+
default: () => {
|
|
60
|
+
return {};
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
placement: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "bottom"
|
|
66
|
+
},
|
|
67
|
+
fieldNames: {
|
|
68
|
+
type: Object,
|
|
69
|
+
default: () => ({ key: "key", title: "title" })
|
|
70
|
+
},
|
|
71
|
+
alwaysInvoke: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: true
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
emits: ["clear", "update:list", "addClick"],
|
|
77
|
+
setup(props, { emit }) {
|
|
78
|
+
const containId = `bm-tags-display${Date.now()}`;
|
|
79
|
+
function getPopupContainer() {
|
|
80
|
+
return document.querySelector(`#${containId}`);
|
|
81
|
+
}
|
|
82
|
+
function clear() {
|
|
83
|
+
if (props.disabled) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
emit("update:list", []);
|
|
87
|
+
emit("clear");
|
|
88
|
+
if (!props.showEmptyBtn && !props.showEmpty) {
|
|
89
|
+
console.error(
|
|
90
|
+
"\u4E0D\u5E94\u5C06showEmptyBtn\u4E0EshowEmpty\u90FD\u7F6E\u4E3Afalse,\u8282\u70B9\u5E76\u672A\u5B9E\u9645\u9500\u6BC1"
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function toAddTags() {
|
|
95
|
+
if (props.disabled) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (!props.list.length || props.alwaysInvoke)
|
|
99
|
+
emit("addClick");
|
|
100
|
+
}
|
|
101
|
+
const tooltipConfig = vue.ref({
|
|
102
|
+
align: void 0,
|
|
103
|
+
arrowPointAtCenter: false,
|
|
104
|
+
autoAdjustOverflow: true,
|
|
105
|
+
color: "#fff",
|
|
106
|
+
defaultVisible: false,
|
|
107
|
+
destroyTooltipOnHide: false,
|
|
108
|
+
getPopupContainer,
|
|
109
|
+
mouseEnterDelay: 0.1,
|
|
110
|
+
mouseLeaveDelay: 0.1,
|
|
111
|
+
overlayClassName: "__list-filter-popover",
|
|
112
|
+
overlayStyle: null,
|
|
113
|
+
placement: props.placement,
|
|
114
|
+
trigger: "hover"
|
|
115
|
+
});
|
|
116
|
+
vue.watch(
|
|
117
|
+
() => props.toolTipProps,
|
|
118
|
+
(tooltipprop) => {
|
|
119
|
+
tooltipConfig.value = {
|
|
120
|
+
...tooltipConfig.value,
|
|
121
|
+
...tooltipprop
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
immediate: true,
|
|
126
|
+
deep: true
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
return {
|
|
130
|
+
containId,
|
|
131
|
+
clear,
|
|
132
|
+
toAddTags,
|
|
133
|
+
tooltipConfig
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
const _hoisted_1 = { class: "bm-tags-display" };
|
|
138
|
+
const _hoisted_2 = ["id"];
|
|
139
|
+
const _hoisted_3 = { class: "pop-seleted" };
|
|
140
|
+
const _hoisted_4 = { class: "pop-seleted-title" };
|
|
141
|
+
const _hoisted_5 = { key: 1 };
|
|
142
|
+
const _hoisted_6 = { key: 2 };
|
|
143
|
+
const _hoisted_7 = /* @__PURE__ */ vue.createElementVNode("div", null, null, -1);
|
|
144
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
145
|
+
const _component_Tag = vue.resolveComponent("Tag");
|
|
146
|
+
const _component_CloseCircleFilled = vue.resolveComponent("CloseCircleFilled");
|
|
147
|
+
const _component_ToolTip = vue.resolveComponent("ToolTip");
|
|
148
|
+
const _component_Button = vue.resolveComponent("Button");
|
|
149
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
150
|
+
_ctx.list && _ctx.list.length ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
151
|
+
key: 0,
|
|
152
|
+
id: _ctx.containId,
|
|
153
|
+
class: "bm-tags-display-wrapper"
|
|
154
|
+
}, [
|
|
155
|
+
vue.createVNode(_component_ToolTip, vue.normalizeProps(vue.guardReactiveProps(_ctx.tooltipConfig)), {
|
|
156
|
+
title: vue.withCtx(() => [
|
|
157
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
158
|
+
vue.createElementVNode("div", _hoisted_4, [
|
|
159
|
+
vue.createTextVNode(" \u5DF2\u9009\u62E9"),
|
|
160
|
+
vue.createElementVNode("span", null, vue.toDisplayString(_ctx.list.length), 1),
|
|
161
|
+
vue.createTextVNode("\u9879 ")
|
|
162
|
+
])
|
|
163
|
+
]),
|
|
164
|
+
vue.createElementVNode("div", {
|
|
165
|
+
class: "pop-seleted-list",
|
|
166
|
+
onWheel: _cache[0] || (_cache[0] = vue.withModifiers(() => {
|
|
167
|
+
}, ["stop"]))
|
|
168
|
+
}, [
|
|
169
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.list, (item) => {
|
|
170
|
+
return vue.openBlock(), vue.createBlock(_component_Tag, {
|
|
171
|
+
key: item[_ctx.fieldNames.key],
|
|
172
|
+
class: "pop-seleted-item"
|
|
173
|
+
}, {
|
|
174
|
+
default: vue.withCtx(() => [
|
|
175
|
+
vue.createTextVNode(vue.toDisplayString(item[_ctx.fieldNames.title]), 1)
|
|
176
|
+
]),
|
|
177
|
+
_: 2
|
|
178
|
+
}, 1024);
|
|
179
|
+
}), 128))
|
|
180
|
+
], 32)
|
|
181
|
+
]),
|
|
182
|
+
default: vue.withCtx(() => [
|
|
183
|
+
vue.createElementVNode("div", {
|
|
184
|
+
class: "select-input-wrapper",
|
|
185
|
+
onClick: _cache[4] || (_cache[4] = vue.withModifiers((...args) => _ctx.toAddTags && _ctx.toAddTags(...args), ["stop"]))
|
|
186
|
+
}, [
|
|
187
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.list, (item) => {
|
|
188
|
+
return vue.openBlock(), vue.createBlock(_component_Tag, {
|
|
189
|
+
key: item[_ctx.fieldNames.key]
|
|
190
|
+
}, {
|
|
191
|
+
default: vue.withCtx(() => [
|
|
192
|
+
vue.createTextVNode(vue.toDisplayString(item[_ctx.fieldNames.title]), 1)
|
|
193
|
+
]),
|
|
194
|
+
_: 2
|
|
195
|
+
}, 1024);
|
|
196
|
+
}), 128)),
|
|
197
|
+
!_ctx.disabled ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
198
|
+
key: 0,
|
|
199
|
+
class: "list-clear",
|
|
200
|
+
onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => _ctx.clear && _ctx.clear(...args), ["stop"])),
|
|
201
|
+
onMouseenter: _cache[2] || (_cache[2] = vue.withModifiers(() => {
|
|
202
|
+
}, ["stop"])),
|
|
203
|
+
onMouseover: _cache[3] || (_cache[3] = vue.withModifiers(() => {
|
|
204
|
+
}, ["stop"]))
|
|
205
|
+
}, [
|
|
206
|
+
vue.createVNode(_component_CloseCircleFilled)
|
|
207
|
+
], 32)) : vue.createCommentVNode("v-if", true)
|
|
208
|
+
])
|
|
209
|
+
]),
|
|
210
|
+
_: 1
|
|
211
|
+
}, 16)
|
|
212
|
+
], 8, _hoisted_2)) : vue.createCommentVNode("v-if", true),
|
|
213
|
+
_ctx.showEmptyBtn && !_ctx.list.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
|
|
214
|
+
vue.createVNode(_component_Button, {
|
|
215
|
+
onClick: vue.withModifiers(_ctx.toAddTags, ["stop"])
|
|
216
|
+
}, {
|
|
217
|
+
default: vue.withCtx(() => [
|
|
218
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.btnText), 1)
|
|
219
|
+
]),
|
|
220
|
+
_: 1
|
|
221
|
+
}, 8, ["onClick"])
|
|
222
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
223
|
+
_ctx.showEmpty && !_ctx.list.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
|
|
224
|
+
vue.createElementVNode("div", {
|
|
225
|
+
class: vue.normalizeClass(["selector-empty-input", { "empty-disabled": _ctx.disabled }]),
|
|
226
|
+
onClick: _cache[5] || (_cache[5] = vue.withModifiers((...args) => _ctx.toAddTags && _ctx.toAddTags(...args), ["stop"]))
|
|
227
|
+
}, " \xA0\xA0" + vue.toDisplayString(_ctx.placeholder), 3)
|
|
228
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
229
|
+
_hoisted_7
|
|
230
|
+
]);
|
|
231
|
+
}
|
|
232
|
+
var InputTagsDisplay = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "input-tags-display.vue"]]);
|
|
233
|
+
|
|
234
|
+
const BmTagsDisplay = withInstall.withInstall(InputTagsDisplay);
|
|
235
|
+
|
|
236
|
+
exports.BmTagsDisplay = BmTagsDisplay;
|
|
237
|
+
exports["default"] = BmTagsDisplay;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var withInstall = require('bm-admin-ui/lib/utils/with-install');
|
|
6
|
+
var vue = require('vue');
|
|
7
|
+
|
|
8
|
+
var _export_sfc = (sfc, props) => {
|
|
9
|
+
const target = sfc.__vccOpts || sfc;
|
|
10
|
+
for (const [key, val] of props) {
|
|
11
|
+
target[key] = val;
|
|
12
|
+
}
|
|
13
|
+
return target;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const _sfc_main = {
|
|
17
|
+
name: "BmOverTooltips",
|
|
18
|
+
props: {
|
|
19
|
+
title: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: void 0
|
|
22
|
+
},
|
|
23
|
+
labelTitle: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: void 0
|
|
26
|
+
},
|
|
27
|
+
line: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: 1
|
|
30
|
+
},
|
|
31
|
+
width: {
|
|
32
|
+
type: [Number, String],
|
|
33
|
+
default: 0
|
|
34
|
+
},
|
|
35
|
+
showAlways: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
setup(props, context) {
|
|
41
|
+
const state = vue.reactive({
|
|
42
|
+
mSlots: {},
|
|
43
|
+
isShow: false,
|
|
44
|
+
openShow: false
|
|
45
|
+
});
|
|
46
|
+
const observer = new IntersectionObserver(
|
|
47
|
+
(entries) => {
|
|
48
|
+
entries.forEach((item) => {
|
|
49
|
+
if (item.intersectionRatio > 0.3) {
|
|
50
|
+
observerDom();
|
|
51
|
+
observer.disconnect();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
threshold: 0.3
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
function observerDom() {
|
|
60
|
+
if (props.line === 1) {
|
|
61
|
+
if (mySelf.value.scrollWidth > mySelf.value.clientWidth) {
|
|
62
|
+
state.openShow = true;
|
|
63
|
+
}
|
|
64
|
+
} else if (props.line > 1) {
|
|
65
|
+
if (mySelf.value.scrollHeight > mySelf.value.clientHeight) {
|
|
66
|
+
state.openShow = true;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
vue.onBeforeUnmount(function() {
|
|
71
|
+
observer.disconnect();
|
|
72
|
+
});
|
|
73
|
+
let mySelf = vue.ref();
|
|
74
|
+
vue.watch(
|
|
75
|
+
() => props.showAlways,
|
|
76
|
+
function(showAlways) {
|
|
77
|
+
if (showAlways)
|
|
78
|
+
state.openShow = showAlways;
|
|
79
|
+
mySelf.value && observer.unobserve(mySelf.value);
|
|
80
|
+
vue.nextTick(function() {
|
|
81
|
+
mySelf.value && observer.observe(mySelf.value);
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
immediate: true
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
const handleVisibleChange = (val) => {
|
|
89
|
+
state.isShow = !state.openShow ? false : val;
|
|
90
|
+
};
|
|
91
|
+
const getPopupContainer = () => {
|
|
92
|
+
return document.body;
|
|
93
|
+
};
|
|
94
|
+
return {
|
|
95
|
+
...vue.toRefs(state),
|
|
96
|
+
mySelf,
|
|
97
|
+
handleVisibleChange,
|
|
98
|
+
getPopupContainer
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
103
|
+
const _component_a_tooltip = vue.resolveComponent("a-tooltip");
|
|
104
|
+
return vue.openBlock(), vue.createBlock(_component_a_tooltip, {
|
|
105
|
+
visible: _ctx.isShow,
|
|
106
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.isShow = $event),
|
|
107
|
+
title: $props.labelTitle || $props.title,
|
|
108
|
+
"get-popup-container": $setup.getPopupContainer,
|
|
109
|
+
onVisibleChange: $setup.handleVisibleChange
|
|
110
|
+
}, {
|
|
111
|
+
title: vue.withCtx(() => [
|
|
112
|
+
vue.renderSlot(_ctx.$slots, "title")
|
|
113
|
+
]),
|
|
114
|
+
default: vue.withCtx(() => [
|
|
115
|
+
vue.createElementVNode("div", {
|
|
116
|
+
ref: "mySelf",
|
|
117
|
+
style: vue.normalizeStyle({
|
|
118
|
+
width: $props.width ? $props.width + "px" : "100%",
|
|
119
|
+
WebkitLineClamp: $props.line
|
|
120
|
+
}),
|
|
121
|
+
class: vue.normalizeClass($props.line === 1 ? `bm-over-tooltip` : `bm-over-tooltip-multi`)
|
|
122
|
+
}, [
|
|
123
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
124
|
+
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
125
|
+
vue.createTextVNode(vue.toDisplayString($props.title), 1)
|
|
126
|
+
])
|
|
127
|
+
])
|
|
128
|
+
], 6)
|
|
129
|
+
]),
|
|
130
|
+
_: 3
|
|
131
|
+
}, 8, ["visible", "title", "get-popup-container", "onVisibleChange"]);
|
|
132
|
+
}
|
|
133
|
+
var OverTooltips = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "over-tooltips.vue"]]);
|
|
134
|
+
|
|
135
|
+
const BmOverTooltips = withInstall.withInstall(OverTooltips);
|
|
136
|
+
|
|
137
|
+
exports.BmOverTooltips = BmOverTooltips;
|
|
138
|
+
exports["default"] = BmOverTooltips;
|