消息
This commit is contained in:
99
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-more/index.js
vendored
Normal file
99
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-more/index.js
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
require("../../../adapter-vue.js");
|
||||
const common_assets = require("../../../../common/assets.js");
|
||||
const TUIKit_utils_env = require("../../../utils/env.js");
|
||||
if (!Math) {
|
||||
Icon();
|
||||
}
|
||||
const Icon = () => "../../common/Icon.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
props: {
|
||||
searchType: {
|
||||
type: String,
|
||||
default: "global",
|
||||
// "global" / "conversation"
|
||||
validator(value) {
|
||||
return ["global", "conversation"].includes(value);
|
||||
}
|
||||
}
|
||||
},
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const searchMoreRef = common_vendor.ref();
|
||||
const isListShow = common_vendor.ref(false);
|
||||
const toggleMore = () => {
|
||||
isListShow.value = !isListShow.value;
|
||||
if (!TUIKit_utils_env.isUniFrameWork && isListShow.value) {
|
||||
common_vendor.O.listen({
|
||||
domRefs: searchMoreRef.value,
|
||||
handler: closeSearchMore
|
||||
});
|
||||
}
|
||||
};
|
||||
const extensionList = common_vendor.ref([]);
|
||||
const handleMenu = (item) => {
|
||||
var _a;
|
||||
const { listener = { onClicked: () => {
|
||||
} } } = item;
|
||||
(_a = listener == null ? void 0 : listener.onClicked) == null ? void 0 : _a.call(listener, item);
|
||||
toggleMore();
|
||||
};
|
||||
const closeSearchMore = () => {
|
||||
isListShow.value = false;
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
extensionList.value = [
|
||||
...common_vendor.R.getExtensionList(common_vendor.E.TUISearch.EXTENSION.SEARCH_MORE.EXT_ID)
|
||||
];
|
||||
common_vendor.R.callService({
|
||||
serviceName: common_vendor.E.TUIConversation.SERVICE.NAME,
|
||||
method: common_vendor.E.TUIConversation.SERVICE.METHOD.HIDE_CONVERSATION_HEADER,
|
||||
params: {}
|
||||
});
|
||||
});
|
||||
common_vendor.watch(
|
||||
() => isListShow.value,
|
||||
() => {
|
||||
if (isListShow.value) {
|
||||
common_vendor.Jt.update(common_vendor.o.SEARCH, "currentSearchingStatus", {
|
||||
isSearching: false,
|
||||
searchType: props.searchType
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.p({
|
||||
file: common_vendor.unref(common_assets.searchMoreSVG),
|
||||
width: common_vendor.unref(TUIKit_utils_env.isPC) ? "28px" : "34px",
|
||||
height: common_vendor.unref(TUIKit_utils_env.isPC) ? "28px" : "34px"
|
||||
}),
|
||||
b: common_vendor.o$1(($event) => toggleMore()),
|
||||
c: common_vendor.unref(isListShow)
|
||||
}, common_vendor.unref(isListShow) ? {
|
||||
d: common_vendor.f(common_vendor.unref(extensionList), (extension, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: extension.icon
|
||||
}, extension.icon ? {
|
||||
b: "ea46662f-1-" + i0,
|
||||
c: common_vendor.p({
|
||||
file: extension.icon
|
||||
})
|
||||
} : {}, {
|
||||
d: common_vendor.t(extension.text),
|
||||
e: index,
|
||||
f: common_vendor.o$1(($event) => handleMenu(extension), index)
|
||||
});
|
||||
})
|
||||
} : {}, {
|
||||
e: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-search-more-h5")
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ea46662f"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUISearch/search-more/index.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-more/index.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-more/index.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"icon": "../../common/Icon"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-more/index.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-more/index.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view ref="searchMoreRef" class="{{['data-v-ea46662f', 'tui-search-more', e]}}"><view class="more data-v-ea46662f" bindtap="{{b}}"><icon wx:if="{{a}}" class="more-icon data-v-ea46662f" u-i="ea46662f-0" bind:__l="__l" u-p="{{a}}"/></view><view wx:if="{{c}}" class="tui-search-more-list data-v-ea46662f"><view wx:for="{{d}}" wx:for-item="extension" wx:key="e" class="list-item data-v-ea46662f" bindtap="{{extension.f}}"><icon wx:if="{{extension.a}}" class="list-item-icon data-v-ea46662f" u-i="{{extension.b}}" bind:__l="__l" u-p="{{extension.c}}"/><view class="list-item-title data-v-ea46662f">{{extension.d}}</view></view></view></view>
|
||||
71
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-more/index.wxss
vendored
Normal file
71
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-more/index.wxss
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.tui-search-more.data-v-ea46662f {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
}
|
||||
.tui-search-more .more.data-v-ea46662f {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
.tui-search-more-list.data-v-ea46662f {
|
||||
margin: 10px 0;
|
||||
position: absolute;
|
||||
list-style: none;
|
||||
cursor: pointer;
|
||||
right: 6px;
|
||||
top: 20px;
|
||||
z-index: 1000;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
padding: 0;
|
||||
box-shadow: rgba(0, 0, 0, 0.16) 0 3px 6px, rgba(0, 0, 0, 0.23) 0 3px 6px;
|
||||
}
|
||||
.tui-search-more-list .list-item.data-v-ea46662f {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 40px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
.tui-search-more-list .list-item-icon.data-v-ea46662f {
|
||||
margin-right: 2px;
|
||||
}
|
||||
.tui-search-more-list .list-item-title.data-v-ea46662f {
|
||||
font-size: 14px;
|
||||
text-wrap: nowrap;
|
||||
word-break: keep-all;
|
||||
}
|
||||
.tui-search-more-h5 .more.data-v-ea46662f {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
}
|
||||
Reference in New Issue
Block a user