@neatui/vue 5.6.0 → 5.6.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/package.json +2 -2
- package/src/components/form/Cascader.vue +2 -2
- package/src/components/form/MoreSelect.vue +3 -3
- package/src/components/form/PageMoreSelect.vue +2 -2
- package/src/components/form/PageSelect.vue +1 -1
- package/src/components/form/SearchMoreSelect.vue +2 -2
- package/src/components/form/SearchSelect.vue +1 -1
- package/src/components/form/Select.vue +2 -2
- package/src/components/form/MoreSelectPanel.vue +0 -190
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neatui/vue",
|
|
3
|
-
"version": "5.6.
|
|
3
|
+
"version": "5.6.1",
|
|
4
4
|
"description": "basic component ui",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@fekit/scrollto": "^3.0.3",
|
|
37
37
|
"@fekit/toast": "^2.7.2",
|
|
38
38
|
"@fekit/utils": "^6.0.0",
|
|
39
|
-
"@neatui/css": "^5.6.
|
|
39
|
+
"@neatui/css": "^5.6.1",
|
|
40
40
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
41
41
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
42
42
|
"@vue/compiler-sfc": "^3.4.30",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<ul v-if="opt?.length" class="min-h-ms*s max-h-xl*s" :class="`nx-sm lh-ml ${optIndex === 0 ? '' : 'bl-xs b-back b-solid'}`" ui-scroll=":y s">
|
|
16
16
|
<!-- 多选 -->
|
|
17
17
|
<template v-if="multiple">
|
|
18
|
-
<li v-for="(item, idx) of opt" :key="idx" class="ux-hover nx-sm r-ss" ui-wrap="no" @click="multiSelect(item, optIndex)">
|
|
18
|
+
<li v-for="(item, idx) of opt" :key="idx" class="ux-hover nx-sm mob:ny-ss r-ss" ui-wrap="no" @click="multiSelect(item, optIndex)">
|
|
19
19
|
<div ui-flex="row xm">
|
|
20
20
|
<div :ui-form="`${theme} type:checkbox :block`">
|
|
21
21
|
<input
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
v-for="(item, idx) of opt"
|
|
39
39
|
:key="idx"
|
|
40
40
|
:class="item.value === state.transSelected?.value ? 'co-main' : ''"
|
|
41
|
-
class="ux-hover nx-sm r-ss" ui-wrap="no"
|
|
41
|
+
class="ux-hover nx-sm mob:ny-ss r-ss" ui-wrap="no"
|
|
42
42
|
@click="select(item, optIndex)"
|
|
43
43
|
>
|
|
44
44
|
<IFollowView :ui-tips="uiTips" v-if="item.optTips" event="hover">
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
<ul v-if="state.filter?.length" ui-scroll=":y s" class="nx-sm lh-ml" style="min-width: 100%; max-height: 15em">
|
|
24
24
|
<template v-for="(item, idx) of state.filter" :key="idx">
|
|
25
|
-
<li v-if="item.disabled" class="ux-hover nx-sm r-ss o-ms" ui-wrap="no">
|
|
25
|
+
<li v-if="item.disabled" class="ux-hover nx-sm mob:ny-ss r-ss o-ms" ui-wrap="no">
|
|
26
26
|
<label style="pointer-events: none" :ui-form="`${theme} type:checkbox :block`">
|
|
27
27
|
<input type="checkbox" :name="state.name" :checked="state.processedValue?.some((i: any) => `${i}` === `${item.value}`)" />
|
|
28
28
|
<del class="ml-sm">{{ item.label || item }}</del>
|
|
29
29
|
</label>
|
|
30
30
|
</li>
|
|
31
|
-
<li v-else class="ux-hover nx-sm r-ss" ui-wrap="no" @click.stop="select(item.value)">
|
|
31
|
+
<li v-else class="ux-hover nx-sm mob:ny-ss r-ss" ui-wrap="no" @click.stop="select(item.value)">
|
|
32
32
|
<label style="pointer-events: none" :ui-form="`${theme} type:checkbox :block`">
|
|
33
33
|
<input type="checkbox" :name="state.name" :checked="state.processedValue?.some((i: any) => `${i}` === `${item.value}`)" />
|
|
34
34
|
<span class="ml-sm">{{ item.label || item }}</span>
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<ul class="nx-sm lh-sl" v-if="tools">
|
|
41
41
|
<li class="my-ss"><div class="o-mm" ui-line="@a"></div></li>
|
|
42
42
|
<li ui-flex="row xm">
|
|
43
|
-
<div class="ux-hover nx-sm ny-ss r-ss co-main" ui-wrap="no" @click.stop="allselect()">
|
|
43
|
+
<div class="ux-hover nx-sm ny-ss mob:ny-sm r-ss co-main" ui-wrap="no" @click.stop="allselect()">
|
|
44
44
|
<label style="pointer-events: none" :ui-form="`${theme} type:checkbox :block`">
|
|
45
45
|
<input type="checkbox" :name="state.name" :checked="state.all" />
|
|
46
46
|
<span class="ml-sm">全选({{ state.selectedCount }}/{{ state.availableCount }})</span>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</div>
|
|
18
18
|
</div>
|
|
19
19
|
<ul v-if="props.options?.length" ui-form-dropdown="" ui-scroll=":y s" class="nx-sm lh-ml" style="min-width: 100%; max-height: 15em">
|
|
20
|
-
<li class="ux-hover nx-sm r-ss" ui-wrap="no" v-for="(item, idx) of props.options" :key="idx" @click.stop="select(item.value)">
|
|
20
|
+
<li class="ux-hover nx-sm mob:ny-ss r-ss" ui-wrap="no" v-for="(item, idx) of props.options" :key="idx" @click.stop="select(item.value)">
|
|
21
21
|
<label style="pointer-events: none" :ui-form="`${theme} type:checkbox :block`">
|
|
22
22
|
<input type="checkbox" :name="formName" :checked="modelValue?.some((i: any) => `${i}` === `${item.value}`)" />
|
|
23
23
|
<span class="ml-sm">{{ item.label || item }}</span>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<ul class="nx-sm lh-ml" v-if="tools">
|
|
29
29
|
<li class="my-ss"><div class="o-mm" ui-line="@a"></div></li>
|
|
30
30
|
<li ui-flex="row xm">
|
|
31
|
-
<div class="ux-hover nx-sm r-ss co-main" ui-wrap="no" @click.stop="allselect()">
|
|
31
|
+
<div class="ux-hover nx-sm mob:ny-ss r-ss co-main" ui-wrap="no" @click.stop="allselect()">
|
|
32
32
|
<label style="pointer-events: none" :ui-form="`${theme} type:checkbox :block`">
|
|
33
33
|
<input type="checkbox" :name="formName" :checked="state.all" />
|
|
34
34
|
<!-- <span class="ml-sm">全选({{ props.options?.length || 0 }})</span> -->
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|
|
17
17
|
<ul v-if="props.options?.length" ui-scroll=":y s" class="nx-sm lh-ml" style="min-width: 100%; max-height: 16em">
|
|
18
|
-
<li class="ux-hover nx-sm r-ss" ui-wrap="no" :class="item.value === state.selectd?.value ? 'co-main' : ''" v-for="(item, idx) of options" :key="idx" @click="select(item)">
|
|
18
|
+
<li class="ux-hover nx-sm mob:ny-ss r-ss" ui-wrap="no" :class="item.value === state.selectd?.value ? 'co-main' : ''" v-for="(item, idx) of options" :key="idx" @click="select(item)">
|
|
19
19
|
{{ item.label || item }}
|
|
20
20
|
</li>
|
|
21
21
|
</ul>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|
|
17
17
|
<ul v-if="props.options?.length" ui-form-dropdown="" ui-scroll=":y s" class="nx-sm lh-ml" style="min-width: 100%; max-height: 15em">
|
|
18
|
-
<li class="ux-hover nx-sm r-ss" ui-wrap="no" v-for="(item, idx) of state.filter" :key="idx" @click.stop="select(item.value)">
|
|
18
|
+
<li class="ux-hover nx-sm mob:ny-ss r-ss" ui-wrap="no" v-for="(item, idx) of state.filter" :key="idx" @click.stop="select(item.value)">
|
|
19
19
|
<label style="pointer-events: none" :ui-form="`${theme} type:checkbox :block`">
|
|
20
20
|
<input type="checkbox" :name="formName" :checked="modelValue?.some((i: any) => `${i}` === `${item.value}`)" />
|
|
21
21
|
<span class="ml-sm">{{ item.label || item }}</span>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<ul class="nx-sm lh-ml" v-if="tools">
|
|
27
27
|
<li class="my-ss"><div class="o-mm" ui-line="@a"></div></li>
|
|
28
28
|
<li ui-flex="row xm">
|
|
29
|
-
<div class="ux-hover nx-sm r-ss co-main" ui-wrap="no" @click.stop="allselect()">
|
|
29
|
+
<div class="ux-hover nx-sm mob:ny-ss r-ss co-main" ui-wrap="no" @click.stop="allselect()">
|
|
30
30
|
<label style="pointer-events: none" :ui-form="`${theme} type:checkbox :block`">
|
|
31
31
|
<input type="checkbox" :name="formName" :checked="state.all" />
|
|
32
32
|
<span class="ml-sm">全选({{ state.filter?.length || 0 }})</span>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</div>
|
|
19
19
|
<ul v-if="props.options?.length" ui-scroll=":y s" class="nx-sm lh-sl" style="min-width: 100%; max-height: 16em">
|
|
20
20
|
<li
|
|
21
|
-
class="ux-hover nx-sm ny-ss r-ss" ui-wrap="no"
|
|
21
|
+
class="ux-hover nx-sm ny-ss mob:ny-sm r-ss" ui-wrap="no"
|
|
22
22
|
:class="item.value === state.selectd?.value ? 'co-main' : ''"
|
|
23
23
|
v-for="(item, idx) of state.filter"
|
|
24
24
|
:key="idx"
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
</div>
|
|
22
22
|
<ul v-if="state.filter?.length" ui-scroll=":y s" class="nx-sm lh-sl" style="min-width: 100%; max-height: 16em">
|
|
23
23
|
<template v-for="(item, idx) of state.filter" :key="idx">
|
|
24
|
-
<li v-if="item.disabled" class="ux-hover nx-sm ny-ss r-ss o-ms" ui-wrap="no" :class="isItemSelected(item) ? 'co-main' : ''">
|
|
24
|
+
<li v-if="item.disabled" class="ux-hover nx-sm ny-ss mob:ny-sm r-ss o-ms" ui-wrap="no" :class="isItemSelected(item) ? 'co-main' : ''">
|
|
25
25
|
<del>{{ item.label || item }}</del>
|
|
26
26
|
</li>
|
|
27
|
-
<li v-else class="ux-hover nx-sm ny-ss r-ss" ui-wrap="no" :class="isItemSelected(item) ? 'co-main' : ''" @click="select(item)">
|
|
27
|
+
<li v-else class="ux-hover nx-sm ny-ss mob:ny-sm r-ss" ui-wrap="no" :class="isItemSelected(item) ? 'co-main' : ''" @click="select(item)">
|
|
28
28
|
<span>{{ item.label || item }}</span>
|
|
29
29
|
</li>
|
|
30
30
|
</template>
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :ui-form="`${theme} type:select ${sz ? 'sz:' + sz : ''}`">
|
|
3
|
-
<IPickerView ref="ipicker" tipBoxClass="ny-sm nx-no" tipBoxStyle="min-width: 100%">
|
|
4
|
-
<slot>
|
|
5
|
-
<Input
|
|
6
|
-
v-bind="{ placeholder, rules, theme, sz, co, block, ready: true, type: 'text', tips, disabled, readonly, clearable: false, verify, prefix, suffix, interacted }"
|
|
7
|
-
:clearable="false"
|
|
8
|
-
readonly
|
|
9
|
-
v-model="state.value"
|
|
10
|
-
:interacted="interacted"
|
|
11
|
-
>
|
|
12
|
-
<template #suffix><i ui-form-select=""></i></template>
|
|
13
|
-
</Input>
|
|
14
|
-
</slot>
|
|
15
|
-
<template #options>
|
|
16
|
-
<ul v-if="props.options?.length" ui-scroll=":y s" class="nx-sm lh-ml" style="min-width: 100%; max-height: 15em">
|
|
17
|
-
<template v-for="(item, idx) of props.options" :key="idx">
|
|
18
|
-
<li v-if="item.disable" class="ux-hover nx-sm r-ss o-ms">
|
|
19
|
-
<label style="pointer-events: none" :ui-form="`${theme} type:checkbox :block`">
|
|
20
|
-
<input type="checkbox" :name="state.name" :checked="modelValue?.some((i: any) => `${i}` === `${item.value}`)" />
|
|
21
|
-
<del class="ml-sm">{{ item.label || item }}</del>
|
|
22
|
-
</label>
|
|
23
|
-
</li>
|
|
24
|
-
<li v-else class="ux-hover nx-sm r-ss" @click.stop="select(item.value)">
|
|
25
|
-
<label style="pointer-events: none" :ui-form="`${theme} type:checkbox :block`">
|
|
26
|
-
<input type="checkbox" :name="state.name" :checked="modelValue?.some((i: any) => `${i}` === `${item.value}`)" />
|
|
27
|
-
<span class="ml-sm">{{ item.label || item }}</span>
|
|
28
|
-
</label>
|
|
29
|
-
</li>
|
|
30
|
-
</template>
|
|
31
|
-
</ul>
|
|
32
|
-
<div v-else class="w-full ny-ms" ui-flex="col cm" v-html="spare"></div>
|
|
33
|
-
<ul class="nx-sm lh-ml" v-if="tools">
|
|
34
|
-
<li class="my-ss"><div class="o-mm" ui-line="@a"></div></li>
|
|
35
|
-
<li ui-flex="row xm">
|
|
36
|
-
<div class="ux-hover nx-sm r-ss co-main" ui-wrap="no" @click.stop="allselect()">
|
|
37
|
-
<label style="pointer-events: none" :ui-form="`${theme} type:checkbox :block`">
|
|
38
|
-
<input type="checkbox" :name="state.name" :checked="state.all" />
|
|
39
|
-
<span class="ml-sm">全选({{ props.options?.length || 0 }})</span>
|
|
40
|
-
</label>
|
|
41
|
-
</div>
|
|
42
|
-
<div>
|
|
43
|
-
<button v-show="state.has" class="co-risk" ui-btn="@a none s" @click="remove">清空</button>
|
|
44
|
-
</div>
|
|
45
|
-
</li>
|
|
46
|
-
</ul>
|
|
47
|
-
</template>
|
|
48
|
-
</IPickerView>
|
|
49
|
-
</div>
|
|
50
|
-
</template>
|
|
51
|
-
|
|
52
|
-
<script setup lang="ts">
|
|
53
|
-
import { reactive, ref, computed, watch } from 'vue';
|
|
54
|
-
import Input from './Input.vue';
|
|
55
|
-
import { IFollowView, IPickerView } from '../basic';
|
|
56
|
-
const ipicker: any = ref(null);
|
|
57
|
-
|
|
58
|
-
const emits = defineEmits(['update:modelValue']);
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* 入参说明
|
|
62
|
-
*
|
|
63
|
-
* modelValue 值
|
|
64
|
-
* options 枚举列表
|
|
65
|
-
* tools 是否显示工具栏
|
|
66
|
-
* spare 空闲兜底内容
|
|
67
|
-
* search 是否显示搜索框
|
|
68
|
-
*
|
|
69
|
-
* -----------------------------------------
|
|
70
|
-
* theme 主题
|
|
71
|
-
* sz 尺寸
|
|
72
|
-
* co 颜色
|
|
73
|
-
* block 撑满
|
|
74
|
-
* ready 准备就绪
|
|
75
|
-
* type 类型
|
|
76
|
-
* tips 提示文案
|
|
77
|
-
* placeholder 内容占位
|
|
78
|
-
* maxlength 最大长度
|
|
79
|
-
* minlength 最小长度
|
|
80
|
-
* disabled 是否禁用
|
|
81
|
-
* readonly 是否只读
|
|
82
|
-
* clearable 是否显示清除按钮
|
|
83
|
-
* rules 校验规则
|
|
84
|
-
* verify 是否是示校验图标
|
|
85
|
-
* prefix 前缀内容
|
|
86
|
-
* suffix 后缀内容
|
|
87
|
-
* interacted 用户是否交互
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
// 类型
|
|
91
|
-
interface Props {
|
|
92
|
-
modelValue?: Array<string | number>;
|
|
93
|
-
options: Array<object>;
|
|
94
|
-
tools?: boolean;
|
|
95
|
-
spare?: string;
|
|
96
|
-
|
|
97
|
-
// Input
|
|
98
|
-
placeholder?: string;
|
|
99
|
-
rules?: Array<object>;
|
|
100
|
-
theme?: string;
|
|
101
|
-
sz?: '' | 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
102
|
-
co?: string;
|
|
103
|
-
block?: boolean;
|
|
104
|
-
ready?: boolean;
|
|
105
|
-
type?: string;
|
|
106
|
-
tips?: string;
|
|
107
|
-
maxlength?: null | number;
|
|
108
|
-
minlength?: null | number;
|
|
109
|
-
disabled?: boolean;
|
|
110
|
-
readonly?: boolean;
|
|
111
|
-
clearable?: boolean;
|
|
112
|
-
verify?: boolean;
|
|
113
|
-
prefix?: Array<any>;
|
|
114
|
-
suffix?: Array<any>;
|
|
115
|
-
interacted?: boolean;
|
|
116
|
-
}
|
|
117
|
-
// 入参
|
|
118
|
-
const props: any = withDefaults(defineProps<Props>(), {
|
|
119
|
-
modelValue: () => [],
|
|
120
|
-
options: () => [],
|
|
121
|
-
tools: true,
|
|
122
|
-
spare: '当前没有可选项',
|
|
123
|
-
|
|
124
|
-
// Input
|
|
125
|
-
placeholder: '',
|
|
126
|
-
rules: () => [],
|
|
127
|
-
theme: '@a',
|
|
128
|
-
sz: '',
|
|
129
|
-
co: '',
|
|
130
|
-
block: true,
|
|
131
|
-
ready: false,
|
|
132
|
-
type: 'text',
|
|
133
|
-
tips: '',
|
|
134
|
-
maxlength: null,
|
|
135
|
-
minlength: null,
|
|
136
|
-
disabled: false,
|
|
137
|
-
readonly: false,
|
|
138
|
-
clearable: true,
|
|
139
|
-
verify: false,
|
|
140
|
-
prefix: () => [],
|
|
141
|
-
suffix: () => [],
|
|
142
|
-
interacted: false,
|
|
143
|
-
});
|
|
144
|
-
// 内部数据
|
|
145
|
-
const state: any = reactive({
|
|
146
|
-
name: computed(() => {
|
|
147
|
-
return Array.from({ length: 8 }, () => String.fromCharCode(97 + Math.floor(Math.random() * 26))).join('');
|
|
148
|
-
}),
|
|
149
|
-
show: 0,
|
|
150
|
-
value: '',
|
|
151
|
-
all: computed(() => {
|
|
152
|
-
return props.options?.every((item: any) => props.modelValue?.some((i: any) => `${i}` === `${item.value}`));
|
|
153
|
-
}),
|
|
154
|
-
has: computed(() => {
|
|
155
|
-
return props.options?.some((item: any) => props.modelValue?.some((i: any) => `${i}` === `${item.value}`));
|
|
156
|
-
}),
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
// 监听外部数据
|
|
160
|
-
watch(
|
|
161
|
-
[() => props.modelValue, () => props.options],
|
|
162
|
-
([v = [], o = []]: any = []) => {
|
|
163
|
-
const selectd: any = o?.filter((item: any) => v?.some((i: any) => `${i}` === `${item.value}`))?.map((item: any) => item.label) || [];
|
|
164
|
-
state.value = selectd.join(' Ι ') || '';
|
|
165
|
-
},
|
|
166
|
-
{ deep: true, immediate: true },
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
// 更新
|
|
170
|
-
const change = (item: any) => {
|
|
171
|
-
emits('update:modelValue', item);
|
|
172
|
-
};
|
|
173
|
-
// 选中
|
|
174
|
-
const select = (item: any) => {
|
|
175
|
-
const s = [...props.modelValue];
|
|
176
|
-
s?.indexOf(item) !== -1 ? s?.splice(s?.indexOf(item), 1) : s?.push(item);
|
|
177
|
-
change(s);
|
|
178
|
-
};
|
|
179
|
-
// 全选
|
|
180
|
-
const allselect = () => {
|
|
181
|
-
const s = state.all ? [] : props.options?.map((item: any) => item.value);
|
|
182
|
-
change(s);
|
|
183
|
-
};
|
|
184
|
-
// 清除
|
|
185
|
-
const remove = () => {
|
|
186
|
-
change([]);
|
|
187
|
-
ipicker.value.cancel();
|
|
188
|
-
};
|
|
189
|
-
</script>
|
|
190
|
-
. .
|