@94ai/nf-popup-lazy-select 3.2.72
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/.eslintrc.cjs +49 -0
- package/README.md +11 -0
- package/components.d.ts +8 -0
- package/lib/index.d.ts +1631 -0
- package/lib/nf-popup-lazy-select.cjs.js +491 -0
- package/lib/nf-popup-lazy-select.esm-bundler.js +491 -0
- package/lib/nf-popup-lazy-select.vue.d.ts +570 -0
- package/lib/style/css.d.ts +1 -0
- package/lib/style/css.js +1 -0
- package/lib/style/index.d.ts +1 -0
- package/lib/style/index.js +1 -0
- package/package/index.ts +8 -0
- package/package/nf-popup-lazy-select.vue +291 -0
- package/package/style/css.ts +1 -0
- package/package/style/index.ts +1 -0
- package/package.json +35 -0
- package/postcss.config.js +8 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="nf-popup-lazy-select">
|
|
3
|
+
<el-popover
|
|
4
|
+
:placement="placement"
|
|
5
|
+
:width="lazySelectPopWidth"
|
|
6
|
+
:trigger="trigger"
|
|
7
|
+
:disabled="lazySelectPopDisabled"
|
|
8
|
+
:popper-class="(lazySelectPopperClass || '') + ' nf-popup-lazy-select-popover'"
|
|
9
|
+
:offset="lazySelectPopOffset"
|
|
10
|
+
:transition="transition"
|
|
11
|
+
:visible-arrow="visibleArrow"
|
|
12
|
+
:popper-options="popperOptions"
|
|
13
|
+
:open-delay="openDelay"
|
|
14
|
+
:close-delay="closeDelay"
|
|
15
|
+
:tabindex="tabindex"
|
|
16
|
+
|
|
17
|
+
@after-enter="(e) => $emit('after-enter', e)"
|
|
18
|
+
@after-leave="(e) => $emit('after-leave', e)"
|
|
19
|
+
@hide="(e) => $emit('hide', e)"
|
|
20
|
+
@show="(e) => $emit('show', e)"
|
|
21
|
+
>
|
|
22
|
+
<span slot="reference">
|
|
23
|
+
<slot />
|
|
24
|
+
</span>
|
|
25
|
+
<nf-virtual-select
|
|
26
|
+
v-model="keyword"
|
|
27
|
+
|
|
28
|
+
:request="request"
|
|
29
|
+
:page-size="pageSize"
|
|
30
|
+
:page-no-alias="pageNoAlias"
|
|
31
|
+
:page-size-alias="pageSizeAlias"
|
|
32
|
+
:value-alias="valueAlias"
|
|
33
|
+
:keyword-alias="keywordAlias"
|
|
34
|
+
|
|
35
|
+
:loading-desc="loadingDesc"
|
|
36
|
+
:no-data-text="noDataText"
|
|
37
|
+
:placeholder="placeholder"
|
|
38
|
+
|
|
39
|
+
:multiple-limit="multipleLimit"
|
|
40
|
+
:collapse-tags="collapseTags"
|
|
41
|
+
|
|
42
|
+
:disabled="disabled"
|
|
43
|
+
:popper-class="popperClass"
|
|
44
|
+
|
|
45
|
+
:multiple="multiple"
|
|
46
|
+
:reserve-keyword="reserveKeyword"
|
|
47
|
+
:default-first-option="defaultFirstOption"
|
|
48
|
+
:popper-append-to-body="popperAppendToBody"
|
|
49
|
+
|
|
50
|
+
:key-value="keyValue"
|
|
51
|
+
:data-key="dataKey"
|
|
52
|
+
:virtual-list="virtualList"
|
|
53
|
+
:keeps="keeps"
|
|
54
|
+
:estimate-size="estimateSize"
|
|
55
|
+
|
|
56
|
+
v-bind="$attrs"
|
|
57
|
+
|
|
58
|
+
:offset="offset"
|
|
59
|
+
:start="start"
|
|
60
|
+
:page-mode="pageMode"
|
|
61
|
+
:direction="direction"
|
|
62
|
+
:top-threshold="topThreshold"
|
|
63
|
+
:bottom-threshold="bottomThreshold"
|
|
64
|
+
:root-tag="rootTag"
|
|
65
|
+
:wrap-tag="wrapTag"
|
|
66
|
+
:wrap-style="wrapStyle"
|
|
67
|
+
:item-tag="itemTag"
|
|
68
|
+
:item-class="itemClass"
|
|
69
|
+
:item-class-add="itemClassAdd"
|
|
70
|
+
:item-style="itemStyle"
|
|
71
|
+
:item-scoped-slots="itemScopedSlots"
|
|
72
|
+
:header-tag="headerTag"
|
|
73
|
+
:header-class="headeClass"
|
|
74
|
+
:header-style="headerStyle"
|
|
75
|
+
:footer-tag="footerTag"
|
|
76
|
+
:footer-class="footerClass"
|
|
77
|
+
:footer-style="footerStyle"
|
|
78
|
+
:extra-props="extraProps"
|
|
79
|
+
|
|
80
|
+
@scroll="e => $emit('scroll', e)"
|
|
81
|
+
@totop="e => $emit('totop', e)"
|
|
82
|
+
@tobottom="e => $emit('tobottom', e)"
|
|
83
|
+
@resized="e => $emit('resized', e)"
|
|
84
|
+
@fetch-data="(e) => $emit(e)"
|
|
85
|
+
@remove-tag="(e) => $emit('remove-tag', e)"
|
|
86
|
+
@blur="(e) => $emit('blur', e)"
|
|
87
|
+
@focus="(e) => $emit('tobottom', e)"
|
|
88
|
+
@clear="(e) => $emit('tobottom', e)"
|
|
89
|
+
@visible-change="(e) => $emit('tobottom', e)"
|
|
90
|
+
>
|
|
91
|
+
|
|
92
|
+
</nf-virtual-select>
|
|
93
|
+
</el-popover>
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
96
|
+
|
|
97
|
+
<script lang="ts">
|
|
98
|
+
import { defineComponent } from 'vue-demi'
|
|
99
|
+
|
|
100
|
+
export default defineComponent({
|
|
101
|
+
name: "nf-popup-lazy-select",
|
|
102
|
+
})
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<script lang="ts" setup>
|
|
106
|
+
import { ref } from 'vue-demi'
|
|
107
|
+
|
|
108
|
+
const props = withDefaults(defineProps<{
|
|
109
|
+
/**
|
|
110
|
+
* 输入时传递给后端key别名定制
|
|
111
|
+
*/
|
|
112
|
+
keywordAlias?: string,
|
|
113
|
+
pageNoAlias?: string,
|
|
114
|
+
pageSizeAlias?: string,
|
|
115
|
+
valueAlias?: string,
|
|
116
|
+
/**
|
|
117
|
+
* 调用页数的接口,要求返回{records: any[], total:number}的格式
|
|
118
|
+
*/
|
|
119
|
+
request?: Function,
|
|
120
|
+
/**
|
|
121
|
+
* 加载中文本提示
|
|
122
|
+
*/
|
|
123
|
+
loadingDesc?: string,
|
|
124
|
+
/**
|
|
125
|
+
* 分页大小
|
|
126
|
+
*/
|
|
127
|
+
pageSize?: number
|
|
128
|
+
/**
|
|
129
|
+
* 初始化是否加载数据,不加载则延迟到focus
|
|
130
|
+
*/
|
|
131
|
+
initList?: boolean
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* el-select参数
|
|
135
|
+
*/
|
|
136
|
+
multipleLimit?: number
|
|
137
|
+
collapseTags?: boolean
|
|
138
|
+
disabled?: boolean
|
|
139
|
+
multiple?: boolean
|
|
140
|
+
reserveKeyword?: boolean
|
|
141
|
+
popperClass?: string
|
|
142
|
+
defaultFirstOption?: boolean
|
|
143
|
+
popperAppendToBody?: boolean
|
|
144
|
+
/**
|
|
145
|
+
* 输入框文本提示
|
|
146
|
+
*/
|
|
147
|
+
placeholder?: string
|
|
148
|
+
/**
|
|
149
|
+
* 没数据文本提示
|
|
150
|
+
*/
|
|
151
|
+
noDataText?: string
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* 虚拟滚动其他参数
|
|
155
|
+
*/
|
|
156
|
+
offset?: number,
|
|
157
|
+
start?: number,
|
|
158
|
+
pageMode?: boolean,
|
|
159
|
+
direction?: string,
|
|
160
|
+
topThreshold?: number,
|
|
161
|
+
bottomThreshold?: number,
|
|
162
|
+
rootTag?: string,
|
|
163
|
+
wrapTag?: string,
|
|
164
|
+
wrapStyle?: Record<string, any>,
|
|
165
|
+
itemTag?: string,
|
|
166
|
+
itemClass?: string,
|
|
167
|
+
itemClassAdd?: Function,
|
|
168
|
+
itemStyle?: Record<string, any>,
|
|
169
|
+
itemScopedSlots?: Record<string, any>,
|
|
170
|
+
headerTag?: string,
|
|
171
|
+
headeClass?: string,
|
|
172
|
+
headerStyle?: Record<string, any>,
|
|
173
|
+
footerTag?: string,
|
|
174
|
+
footerClass?: string,
|
|
175
|
+
footerStyle?: Record<string, any>,
|
|
176
|
+
extraProps?: Record<string, any>
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* 开启虚拟滚动
|
|
180
|
+
*/
|
|
181
|
+
virtualList?: boolean,
|
|
182
|
+
dataKey?: string | (() => string),
|
|
183
|
+
keyValue?: [string, string],
|
|
184
|
+
dataComponent?: Record<string, any>,
|
|
185
|
+
keeps?: number,
|
|
186
|
+
estimateSize?: number,
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* 样式控制
|
|
190
|
+
*/
|
|
191
|
+
width?: string,
|
|
192
|
+
height?: string,
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* 开启select item tooltip
|
|
196
|
+
*/
|
|
197
|
+
showTip?: boolean,
|
|
198
|
+
|
|
199
|
+
lazySelectPopWidth?: string | number
|
|
200
|
+
lazySelectPopperClass?: string
|
|
201
|
+
lazySelectPopDisabled?: boolean
|
|
202
|
+
lazySelectPopOffset?: number
|
|
203
|
+
|
|
204
|
+
placement?: string
|
|
205
|
+
trigger?: 'click'|'focus'|'hover'|'manual'
|
|
206
|
+
transition?: string
|
|
207
|
+
visibleArrow?: boolean
|
|
208
|
+
popperOptions?: Record<string, any>
|
|
209
|
+
openDelay?: number
|
|
210
|
+
closeDelay?: number
|
|
211
|
+
tabindex?: number
|
|
212
|
+
size?: "mini" | "medium" | "small"
|
|
213
|
+
}>(), {
|
|
214
|
+
keywordAlias: 'keyword',
|
|
215
|
+
pageNoAlias: 'pageNo',
|
|
216
|
+
pageSizeAlias: 'pageSize',
|
|
217
|
+
valueAlias: 'value',
|
|
218
|
+
// 调用页数的接口
|
|
219
|
+
request: () => ({}),
|
|
220
|
+
loadingDesc: '加载中...',
|
|
221
|
+
pageSize: 10,
|
|
222
|
+
initList: true,
|
|
223
|
+
|
|
224
|
+
noDataText: '无数据',
|
|
225
|
+
multipleLimit: 0,
|
|
226
|
+
collapseTags: false,
|
|
227
|
+
disabled: false,
|
|
228
|
+
multiple: false,
|
|
229
|
+
reserveKeyword: false,
|
|
230
|
+
popperClass: '',
|
|
231
|
+
defaultFirstOption: false,
|
|
232
|
+
popperAppendToBody: true,
|
|
233
|
+
placeholder: '请输入',
|
|
234
|
+
|
|
235
|
+
offset: 0,
|
|
236
|
+
start: 0,
|
|
237
|
+
pageMode: false,
|
|
238
|
+
direction: 'vertical',
|
|
239
|
+
topThreshold: 0,
|
|
240
|
+
bottomThreshold: 0,
|
|
241
|
+
rootTag: 'div',
|
|
242
|
+
wrapTag: 'div',
|
|
243
|
+
wrapStyle: () => ({}),
|
|
244
|
+
itemTag: 'div',
|
|
245
|
+
itemClass: '',
|
|
246
|
+
itemClassAdd: undefined,
|
|
247
|
+
itemStyle: () => ({}),
|
|
248
|
+
itemScopedSlots: () => ({}),
|
|
249
|
+
headerTag: 'div',
|
|
250
|
+
headeClass: '',
|
|
251
|
+
headerStyle: () => ({}),
|
|
252
|
+
footerTag: 'div',
|
|
253
|
+
footerClass: '',
|
|
254
|
+
footerStyle: () => ({}),
|
|
255
|
+
extraProps: () => ({
|
|
256
|
+
label: 'label',
|
|
257
|
+
value: 'value'
|
|
258
|
+
}),
|
|
259
|
+
|
|
260
|
+
keeps: 30,
|
|
261
|
+
estimateSize: 50,
|
|
262
|
+
dataKey: 'templateId',
|
|
263
|
+
virtualList: false,
|
|
264
|
+
keyValue: () => ['label', 'value'],
|
|
265
|
+
|
|
266
|
+
width: '100%',
|
|
267
|
+
height: '245px',
|
|
268
|
+
|
|
269
|
+
showTip: false,
|
|
270
|
+
|
|
271
|
+
lazySelectPopWidth: '160',
|
|
272
|
+
lazySelectPopperClass: '',
|
|
273
|
+
lazySelectPopDisabled: false,
|
|
274
|
+
lazySelectPopOffset: 0,
|
|
275
|
+
|
|
276
|
+
placement: 'bottom',
|
|
277
|
+
trigger: 'click',
|
|
278
|
+
transition: 'fade-in-linear',
|
|
279
|
+
visibleArrow: true,
|
|
280
|
+
popperOptions: () => ({ boundariesElement: 'body', gpuAcceleration: false }),
|
|
281
|
+
data: () => [],
|
|
282
|
+
openDelay: undefined,
|
|
283
|
+
closeDelay: 200,
|
|
284
|
+
tabindex: 0,
|
|
285
|
+
size: 'mini'
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
const keyword = ref()
|
|
289
|
+
|
|
290
|
+
</script>
|
|
291
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@94ai/nf-theme-chalk/lib/css/nf-popup-lazy-select.css'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@94ai/nf-theme-chalk/lib/nf-popup-lazy-select.scss'
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@94ai/nf-popup-lazy-select",
|
|
3
|
+
"version": "3.2.72",
|
|
4
|
+
"description": "> TODO: description",
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"author": "zoujiahe <zoujiahe@94ai.com>",
|
|
7
|
+
"homepage": "https://oss.xccjh.top/common-ui/#/ai-index",
|
|
8
|
+
"license": "ISC",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "http://94ai.gitlab.com/ui/common-ui.git"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@94ai/nf-theme-chalk": "^3.2.72",
|
|
18
|
+
"@94ai/nf-variable-select": "^3.2.72",
|
|
19
|
+
"vue-demi": "^0.14.5"
|
|
20
|
+
},
|
|
21
|
+
"peerDependenciesMeta": {
|
|
22
|
+
"@vue/composition-api": {
|
|
23
|
+
"optional": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@vue/composition-api": "^1.0.0-rc.1",
|
|
28
|
+
"element-ui": ">=2.13.2",
|
|
29
|
+
"vue": "^2.0.0 || >=3.0.0"
|
|
30
|
+
},
|
|
31
|
+
"types": "lib/index.d.ts",
|
|
32
|
+
"main": "lib/nf-popup-lazy-select.cjs.js",
|
|
33
|
+
"module": "lib/nf-popup-lazy-select.esm-bundler.js",
|
|
34
|
+
"gitHead": "92c79145b64d591457896ae871b4b553ab096422"
|
|
35
|
+
}
|