diff --git a/dist/index.common.js b/dist/index.common.js
index 1dd8b6b..804ed3c 100644
--- a/dist/index.common.js
+++ b/dist/index.common.js
@@ -3187,6 +3187,13 @@ module.exports = {
};
+/***/ }),
+
+/***/ "8bbf":
+/***/ (function(module, exports) {
+
+module.exports = require("vue");
+
/***/ }),
/***/ "8e60":
@@ -5566,7 +5573,7 @@ var tabs_render, staticRenderFns
/* normalize component */
-var component = normalizeComponent(
+var tabs_component = normalizeComponent(
components_tabsvue_type_script_lang_js_,
tabs_render,
staticRenderFns,
@@ -5577,7 +5584,7 @@ var component = normalizeComponent(
)
-/* harmony default export */ var tabs = (component.exports);
+/* harmony default export */ var tabs = (tabs_component.exports);
// EXTERNAL MODULE: ./node_modules/regenerator-runtime/runtime.js
var runtime = __webpack_require__("96cf");
@@ -5712,7 +5719,7 @@ var triggerEvents = {
"style": "position:relative"
}, [h("transition", {
"attrs": {
- "name": "slide-top"
+ "name": "lemon-slide-top"
}
}, [this.visible && h("div", {
"class": "lemon-popover",
@@ -6184,6 +6191,10 @@ function arrayIntersect(a, b) {
function clearHtml(str) {
return str.replace(/<.*?>/ig, "");
+} //清除字符串内的所有HTML标签,除了IMG
+
+function clearHtmlExcludeImg(str) {
+ return str.replace(/<(?!img).*?>/ig, "");
}
function error(text) {
throw new Error(text);
@@ -6249,6 +6260,14 @@ function generateUUID() {
/* harmony default export */ var contactvue_type_script_lang_js_ = ({
name: "LemonContact",
components: {},
+ inject: {
+ IMUI: {
+ from: 'IMUI',
+ default: function _default() {
+ return this;
+ }
+ }
+ },
data: function data() {
return {};
},
@@ -6283,24 +6302,16 @@ function generateUUID() {
watch: {},
methods: {
_renderInner: function _renderInner() {
- var _this2 = this;
-
var h = this.$createElement;
var contact = this.contact;
return [h("lemon-badge", {
"attrs": {
- "count": !this.simple ? contact.unread : 0,
- "native-on-click": function nativeOnClick(e) {
- return _this2._handleBubbleClick(e, contact);
- }
+ "count": !this.simple ? contact.unread : 0
},
"class": "lemon-contact__avatar"
}, [h("lemon-avatar", {
"attrs": {
"size": 40,
- "native-on-click": function nativeOnClick(e) {
- return _this2._handleAvatarClick(e, contact);
- },
"src": contact.avatar
}
})]), h("div", {
@@ -6321,14 +6332,6 @@ function generateUUID() {
},
_handleClick: function _handleClick(e, data) {
this.$emit("click", data);
- },
- _handleAvatarClick: function _handleAvatarClick(e, data) {
- e.stopPropagation();
- this.$emit("avatar-click", data);
- },
- _handleBubbleClick: function _handleBubbleClick(e, data) {
- e.stopPropagation();
- this.$emit("bubble-click", data);
}
}
});
@@ -6662,6 +6665,8 @@ var isInitTool = false;
exec(""));
+ this._checkSubmitDisabled();
+
this._saveLastRange();
},
selectFile: function () {
@@ -6724,7 +6729,7 @@ var isInitTool = false;
return toEmojiName(this.$refs.textarea.innerHTML);
},
_checkSubmitDisabled: function _checkSubmitDisabled() {
- this.submitDisabled = !this.$refs.textarea.innerText.trim();
+ this.submitDisabled = !clearHtmlExcludeImg(this.$refs.textarea.innerHTML.trim());
},
_handleSend: function _handleSend(e) {
var text = this.getFormatValue();
@@ -6748,6 +6753,11 @@ var isInitTool = false;
initEmoji: function initEmoji(data) {
emojiData = data;
this.$forceUpdate();
+ },
+ setValue: function setValue(val) {
+ this.$refs.textarea.innerHTML = val;
+
+ this._checkSubmitDisabled();
}
}
});
@@ -6777,6 +6787,86 @@ var editor_component = normalizeComponent(
)
/* harmony default export */ var editor = (editor_component.exports);
+// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
+var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf");
+var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_);
+
+// CONCATENATED MODULE: ./packages/directives/dropdown.js
+
+
+
+var dropdown_popover;
+
+var hidePopover = function hidePopover() {
+ if (dropdown_popover) dropdown_popover.style.display = 'none';
+};
+
+var showPopover = function showPopover() {
+ if (dropdown_popover) dropdown_popover.style.display = 'block';
+};
+
+document.addEventListener('click', function (e) {
+ hidePopover();
+});
+/* harmony default export */ var dropdown = ({
+ hide: hidePopover,
+ bind: function bind(el, binding, vnode) {
+ el.addEventListener('contextmenu', function (e) {
+ if (isEmpty(binding.value) || !Array.isArray(binding.value)) return;
+ e.preventDefault();
+ var component;
+ var visibleItems = [];
+ if (binding.modifiers.message) component = vnode.context;else if (binding.modifiers.contact) component = vnode.child;
+
+ if (!dropdown_popover) {
+ dropdown_popover = document.createElement('div');
+ dropdown_popover.className = 'lemon-dropdown';
+ document.body.appendChild(dropdown_popover);
+ }
+
+ dropdown_popover.innerHTML = binding.value.map(function (item) {
+ var visible;
+
+ if (isFunction(item.visible)) {
+ visible = item.visible(component);
+ } else {
+ visible = item.visible === undefined ? true : item.visible;
+ }
+
+ if (visible) {
+ visibleItems.push(item);
+ var icon = item.icon ? "") : '';
+ return "
自定义封面 Lemon IMUI
+| 名称 | +说明 | +类型 | +示例 | +|
|---|---|---|---|---|
| text | +显示文字 | +String | +- | ++ |
| color | +颜色 | +String | +- | ++ |
| icon | +图标 class | +String | +- | ++ |
| click | +点击事件,调用hide方法隐藏右键菜单。 | +Function(e,instance,hide) | +- | ++ |
| visible | +是否显示的判断函数 | +Function(instance) | +- | ++ |
| render | +负责样式的渲染函数,使用render的时候text属性会失去作用,调用hide方法隐藏右键菜单。 | +Function(e,instance,hide) | +- | ++ |
| false | ||||
| contextmenu | +聊天消息右键菜单配置 | +[ContextmenuItem] | +- | ++ |
| contactContextmenu | +联系人右键菜单配置 | +[ContextmenuItem] | +- | ++ |