stellar-ui-plus 1.24.25 → 1.24.26
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/components/ste-dropdown-menu/props.ts +1 -0
- package/components/ste-dropdown-menu/ste-dropdown-menu.vue +1 -0
- package/components/ste-filter-tool/ATTRIBUTES.md +1 -0
- package/components/ste-filter-tool/props.ts +1 -0
- package/components/ste-filter-tool/ste-filter-tool.easycom.json +6 -0
- package/components/ste-filter-tool/ste-filter-tool.vue +6 -2
- package/components/ste-filter-tool/useData.ts +8 -0
- package/package.json +1 -1
|
@@ -26,6 +26,7 @@ export default dropDownMenuProps;
|
|
|
26
26
|
export const dropDownMenuEmits = {
|
|
27
27
|
close: () => true,
|
|
28
28
|
open: () => true,
|
|
29
|
+
maskClick: () => true,
|
|
29
30
|
change: (value: Array<any>) => Array.isArray(value),
|
|
30
31
|
'item-choose': (item: any) => item,
|
|
31
32
|
'update:modelValue': (value: Array<any>) => Array.isArray(value),
|
|
@@ -35,6 +35,7 @@ export const filterToolEmits = {
|
|
|
35
35
|
// 值变化(实时)
|
|
36
36
|
'update:value': (values: FilterValue[]) => Array.isArray(values),
|
|
37
37
|
itemClick: (item: FilterValue) => item instanceof Object,
|
|
38
|
+
maskClose: () => true,
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
export type FilterToolProps = ExtractPropTypes<typeof props>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="ste-filter-tool--root" :style="[rootStyleVar, { '--category-count': categoryData.length }]">
|
|
3
|
-
<ste-dropdown-menu ref="steDropMenu" class="filter-box-menu" :activeColor="activeColor" dropDownIconColor="#000" v-model:showPopup="showMenu">
|
|
3
|
+
<ste-dropdown-menu ref="steDropMenu" class="filter-box-menu" :activeColor="activeColor" dropDownIconColor="#000" v-model:showPopup="showMenu" @maskClick="handleMaskClick">
|
|
4
4
|
<template #title>
|
|
5
5
|
<slot>
|
|
6
6
|
<view></view>
|
|
@@ -146,7 +146,7 @@ const rootStyleVar = computed(() => ({
|
|
|
146
146
|
}));
|
|
147
147
|
|
|
148
148
|
// 使用简化的筛选逻辑组合式函数
|
|
149
|
-
const { handleFilterClick, handleCheckboxChange, handleReset, handleConfirm } = useData(props, emits, filtersData);
|
|
149
|
+
const { handleFilterClick, handleCheckboxChange, handleReset, handleConfirm, handleMaskClose } = useData(props, emits, filtersData);
|
|
150
150
|
|
|
151
151
|
// 工具类实例
|
|
152
152
|
const calculator = new ScrollCalculator(instance, filtersData);
|
|
@@ -217,6 +217,10 @@ const toggleExpand = (item: FilterItem) => {
|
|
|
217
217
|
item.expand = !item.expand;
|
|
218
218
|
};
|
|
219
219
|
|
|
220
|
+
function handleMaskClick() {
|
|
221
|
+
handleMaskClose();
|
|
222
|
+
}
|
|
223
|
+
|
|
220
224
|
// 监听器
|
|
221
225
|
watch(
|
|
222
226
|
() => props.data,
|
|
@@ -138,6 +138,13 @@ export default function useSimpleFilterLogic(props: FilterToolProps, emits: Setu
|
|
|
138
138
|
emits('confirm', currentValues);
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
+
/**
|
|
142
|
+
* 点击蒙层关闭了弹窗后触发
|
|
143
|
+
*/
|
|
144
|
+
const handleMaskClose = () => {
|
|
145
|
+
emits('maskClose');
|
|
146
|
+
};
|
|
147
|
+
|
|
141
148
|
// 监听props.value变化,同步到组件内部状态
|
|
142
149
|
watch(
|
|
143
150
|
() => props.value,
|
|
@@ -156,6 +163,7 @@ export default function useSimpleFilterLogic(props: FilterToolProps, emits: Setu
|
|
|
156
163
|
handleCheckboxChange,
|
|
157
164
|
handleReset,
|
|
158
165
|
handleConfirm,
|
|
166
|
+
handleMaskClose,
|
|
159
167
|
collectCurrentValues,
|
|
160
168
|
setValuesFromProps,
|
|
161
169
|
};
|