@94ai/nf-search-form 3.2.48 → 100.1.2
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/lib/index.d.ts +42 -42
- package/lib/nf-search-form.cjs.js +1013 -6347
- package/lib/nf-search-form.esm-bundler.js +1011 -6345
- package/lib/nf-search-form.vue.d.ts +13 -13
- package/package/nf-column-check-drawer.vue +1 -1
- package/package/nf-search-form-item.vue +1 -1
- package/package/nf-search-form.vue +2 -8
- package/package.json +17 -16
- package/lib/tools.d.ts +0 -17
- package/package/tools.ts +0 -177
|
@@ -77,6 +77,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
77
77
|
type: import("vue-demi").PropType<Record<string, any>>;
|
|
78
78
|
default: undefined;
|
|
79
79
|
};
|
|
80
|
+
inline: {
|
|
81
|
+
type: import("vue-demi").PropType<boolean>;
|
|
82
|
+
default: boolean;
|
|
83
|
+
};
|
|
80
84
|
upIcon: {
|
|
81
85
|
type: import("vue-demi").PropType<string>;
|
|
82
86
|
default: string;
|
|
@@ -155,16 +159,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
155
159
|
type: import("vue-demi").PropType<"right" | "left" | "top">;
|
|
156
160
|
default: string;
|
|
157
161
|
};
|
|
158
|
-
inline: {
|
|
159
|
-
type: import("vue-demi").PropType<boolean>;
|
|
160
|
-
default: boolean;
|
|
161
|
-
};
|
|
162
162
|
btnBoxLabel: {
|
|
163
163
|
type: import("vue-demi").PropType<string>;
|
|
164
164
|
default: string;
|
|
165
165
|
};
|
|
166
166
|
btnModel: {
|
|
167
|
-
type: import("vue-demi").PropType<"
|
|
167
|
+
type: import("vue-demi").PropType<"inline" | "block">;
|
|
168
168
|
default: string;
|
|
169
169
|
};
|
|
170
170
|
labelWidth: {
|
|
@@ -281,7 +281,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
281
281
|
type: import("vue-demi").PropType<string>;
|
|
282
282
|
};
|
|
283
283
|
btnItems: {
|
|
284
|
-
type: import("vue-demi").PropType<"" | string[] | "search" | "
|
|
284
|
+
type: import("vue-demi").PropType<"" | string[] | "search" | "export" | "reset">;
|
|
285
285
|
default: () => "";
|
|
286
286
|
};
|
|
287
287
|
reverseBtnSlot: {
|
|
@@ -559,6 +559,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
559
559
|
type: import("vue-demi").PropType<Record<string, any>>;
|
|
560
560
|
default: undefined;
|
|
561
561
|
};
|
|
562
|
+
inline: {
|
|
563
|
+
type: import("vue-demi").PropType<boolean>;
|
|
564
|
+
default: boolean;
|
|
565
|
+
};
|
|
562
566
|
upIcon: {
|
|
563
567
|
type: import("vue-demi").PropType<string>;
|
|
564
568
|
default: string;
|
|
@@ -637,16 +641,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
637
641
|
type: import("vue-demi").PropType<"right" | "left" | "top">;
|
|
638
642
|
default: string;
|
|
639
643
|
};
|
|
640
|
-
inline: {
|
|
641
|
-
type: import("vue-demi").PropType<boolean>;
|
|
642
|
-
default: boolean;
|
|
643
|
-
};
|
|
644
644
|
btnBoxLabel: {
|
|
645
645
|
type: import("vue-demi").PropType<string>;
|
|
646
646
|
default: string;
|
|
647
647
|
};
|
|
648
648
|
btnModel: {
|
|
649
|
-
type: import("vue-demi").PropType<"
|
|
649
|
+
type: import("vue-demi").PropType<"inline" | "block">;
|
|
650
650
|
default: string;
|
|
651
651
|
};
|
|
652
652
|
labelWidth: {
|
|
@@ -763,7 +763,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
763
763
|
type: import("vue-demi").PropType<string>;
|
|
764
764
|
};
|
|
765
765
|
btnItems: {
|
|
766
|
-
type: import("vue-demi").PropType<"" | string[] | "search" | "
|
|
766
|
+
type: import("vue-demi").PropType<"" | string[] | "search" | "export" | "reset">;
|
|
767
767
|
default: () => "";
|
|
768
768
|
};
|
|
769
769
|
reverseBtnSlot: {
|
|
@@ -907,6 +907,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
907
907
|
disabled: boolean;
|
|
908
908
|
itemWidth: number;
|
|
909
909
|
rules: Record<string, any>;
|
|
910
|
+
inline: boolean;
|
|
910
911
|
upIcon: string;
|
|
911
912
|
downIcon: string;
|
|
912
913
|
columns: number;
|
|
@@ -925,7 +926,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
925
926
|
statusIcon: boolean;
|
|
926
927
|
validateOnRuleChange: boolean;
|
|
927
928
|
labelPosition: 'top' | 'right' | 'left';
|
|
928
|
-
inline: boolean;
|
|
929
929
|
btnBoxLabel: string;
|
|
930
930
|
btnModel: 'inline' | 'block';
|
|
931
931
|
labelWidth: number;
|
|
@@ -188,7 +188,7 @@ import {
|
|
|
188
188
|
getCurrentInstance
|
|
189
189
|
} from 'vue-demi'
|
|
190
190
|
import { NfSearchFormItemOption } from '@94ai/nf-search-form/lib/types'
|
|
191
|
-
import { createUniqueString } from '
|
|
191
|
+
import { createUniqueString } from '@94ai/common-utils'
|
|
192
192
|
|
|
193
193
|
const emit = defineEmits<{
|
|
194
194
|
(e: 'input', event: any): void
|
|
@@ -273,12 +273,8 @@ export default defineComponent({
|
|
|
273
273
|
import SearchFormItem from './nf-search-form-item.vue'
|
|
274
274
|
import ColumnCheckDialog from './nf-column-check-dialog.vue'
|
|
275
275
|
import ColumnCheckDrawer from './nf-column-check-drawer.vue'
|
|
276
|
-
import ResizeObserver from 'resize-observer-polyfill'
|
|
277
|
-
|
|
278
|
-
import {
|
|
279
|
-
createUniqueString,
|
|
280
|
-
debounce
|
|
281
|
-
} from './tools'
|
|
276
|
+
import ResizeObserver from 'resize-observer-polyfill'
|
|
277
|
+
import { createUniqueString } from '@94ai/common-utils'
|
|
282
278
|
import { NfSearchFormItemOption } from './types'
|
|
283
279
|
import {
|
|
284
280
|
ref,
|
|
@@ -288,12 +284,10 @@ import {
|
|
|
288
284
|
onBeforeMount,
|
|
289
285
|
onMounted,
|
|
290
286
|
onBeforeUnmount,
|
|
291
|
-
onUnmounted,
|
|
292
287
|
nextTick
|
|
293
288
|
} from 'vue-demi'
|
|
294
289
|
import { ITabItem } from '@94ai/nf-drawer/lib/types'
|
|
295
290
|
import {
|
|
296
|
-
ElTableColumnAttributes,
|
|
297
291
|
NfTableColumnAttributes
|
|
298
292
|
} from '@94ai/nf-table/lib/types'
|
|
299
293
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@94ai/nf-search-form",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "100.1.2",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "zoujiahe <zoujiahe@94ai.com>",
|
|
@@ -14,20 +14,21 @@
|
|
|
14
14
|
"url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@94ai/
|
|
18
|
-
"@94ai/nf-
|
|
19
|
-
"@94ai/nf-double-
|
|
20
|
-
"@94ai/nf-double-
|
|
21
|
-
"@94ai/nf-double-
|
|
22
|
-
"@94ai/nf-
|
|
23
|
-
"@94ai/nf-
|
|
24
|
-
"@94ai/nf-form
|
|
25
|
-
"@94ai/nf-
|
|
26
|
-
"@94ai/nf-
|
|
27
|
-
"@94ai/nf-
|
|
28
|
-
"@94ai/nf-
|
|
29
|
-
"@94ai/nf-
|
|
30
|
-
"@94ai/nf-
|
|
17
|
+
"@94ai/common-utils": "^100.1.2",
|
|
18
|
+
"@94ai/nf-action": "^100.1.2",
|
|
19
|
+
"@94ai/nf-double-half-year": "^100.1.2",
|
|
20
|
+
"@94ai/nf-double-quarter": "^100.1.2",
|
|
21
|
+
"@94ai/nf-double-week": "^100.1.2",
|
|
22
|
+
"@94ai/nf-double-year": "^100.1.2",
|
|
23
|
+
"@94ai/nf-drawer": "^100.1.2",
|
|
24
|
+
"@94ai/nf-form": "^100.1.2",
|
|
25
|
+
"@94ai/nf-form-item": "^100.1.2",
|
|
26
|
+
"@94ai/nf-half-year-picker": "^100.1.2",
|
|
27
|
+
"@94ai/nf-message": "^100.1.2",
|
|
28
|
+
"@94ai/nf-quarter-picker": "^100.1.2",
|
|
29
|
+
"@94ai/nf-select-transfer": "^100.1.2",
|
|
30
|
+
"@94ai/nf-theme-chalk": "^100.1.2",
|
|
31
|
+
"@94ai/nf-virtual-select": "^100.1.2",
|
|
31
32
|
"resize-observer-polyfill": "^1.5.1",
|
|
32
33
|
"vue-cookies": "^1.8.3",
|
|
33
34
|
"vue-demi": "^0.14.5",
|
|
@@ -46,5 +47,5 @@
|
|
|
46
47
|
"types": "lib/index.d.ts",
|
|
47
48
|
"main": "lib/nf-search-form.cjs.js",
|
|
48
49
|
"module": "lib/nf-search-form.esm-bundler.js",
|
|
49
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "5b811c0e9d5ed95519222e3a9b744331734feeaf"
|
|
50
51
|
}
|
package/lib/tools.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare function createUniqueString(randomLength?: number): string;
|
|
2
|
-
export declare function debounce(func: any, wait: any, immediate: any): (...args: any[]) => any;
|
|
3
|
-
export declare const on: (event: any, handler: any, element?: Window & typeof globalThis) => void;
|
|
4
|
-
export declare function deepClone(source: any): Record<string, any> | Record<string, any>[];
|
|
5
|
-
export declare const off: (event: any, handler: any, element?: Window & typeof globalThis) => void;
|
|
6
|
-
export declare const pickerOptionsRange: {
|
|
7
|
-
shortcuts: {
|
|
8
|
-
text: string;
|
|
9
|
-
onClick(picker: any): void;
|
|
10
|
-
}[];
|
|
11
|
-
};
|
|
12
|
-
export declare const pickerOptionsRangeMonth: {
|
|
13
|
-
shortcuts: {
|
|
14
|
-
text: string;
|
|
15
|
-
onClick(picker: any): void;
|
|
16
|
-
}[];
|
|
17
|
-
};
|
package/package/tools.ts
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 创建唯一的字符串
|
|
3
|
-
* @return {string} ojgdvbvaua40
|
|
4
|
-
*/
|
|
5
|
-
export function createUniqueString(randomLength = 36) {
|
|
6
|
-
return Number(Math.random().toString().substr(3, randomLength) + Date.now()).toString(36)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function debounce(func, wait, immediate) {
|
|
10
|
-
let timeout, args, context, timestamp, result
|
|
11
|
-
|
|
12
|
-
const later = function() {
|
|
13
|
-
// 据上一次触发时间间隔
|
|
14
|
-
const last = +new Date() - timestamp
|
|
15
|
-
|
|
16
|
-
// 上次被包装函数被调用时间间隔last小于设定时间间隔wait
|
|
17
|
-
if (last < wait && last > 0) {
|
|
18
|
-
timeout = setTimeout(later, wait - last)
|
|
19
|
-
} else {
|
|
20
|
-
timeout = null
|
|
21
|
-
// 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
|
|
22
|
-
if (!immediate) {
|
|
23
|
-
result = func.apply(context, args)
|
|
24
|
-
if (!timeout) context = args = null
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return function(...args) {
|
|
30
|
-
// @ts-ignore
|
|
31
|
-
context = this
|
|
32
|
-
timestamp = +new Date()
|
|
33
|
-
const callNow = immediate && !timeout
|
|
34
|
-
// 如果延时不存在,重新设定延时
|
|
35
|
-
if (!timeout) timeout = setTimeout(later, wait)
|
|
36
|
-
if (callNow) {
|
|
37
|
-
result = func.apply(context, args)
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
context = args = null
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return result
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
export const on = (function() {
|
|
46
|
-
// @ts-ignore
|
|
47
|
-
if (document.addEventListener) {
|
|
48
|
-
return function(event, handler, element = window) {
|
|
49
|
-
if (element && event && handler) {
|
|
50
|
-
element.addEventListener(event, handler, false)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
} else {
|
|
54
|
-
return function(event, handler, element = window) {
|
|
55
|
-
if (element && event && handler) {
|
|
56
|
-
// @ts-ignore
|
|
57
|
-
element.attachEvent('on' + event, handler)
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
})()
|
|
62
|
-
|
|
63
|
-
export function deepClone(source) {
|
|
64
|
-
if (!source && typeof source !== 'object') {
|
|
65
|
-
throw new Error('error arguments shallowClone')
|
|
66
|
-
}
|
|
67
|
-
const targetObj: Record<string, any> | Record<string, any>[] = source.constructor === Array ? [] : {}
|
|
68
|
-
Object.keys(source).forEach((keys) => {
|
|
69
|
-
if (source[keys] && typeof source[keys] === 'object') {
|
|
70
|
-
targetObj[keys] = source[keys].constructor === Array ? [] : {}
|
|
71
|
-
targetObj[keys] = deepClone(source[keys])
|
|
72
|
-
} else {
|
|
73
|
-
targetObj[keys] = source[keys]
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
return targetObj
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* 移除事件监听
|
|
81
|
-
*/
|
|
82
|
-
export const off = (function() {
|
|
83
|
-
// @ts-ignore
|
|
84
|
-
if (document.removeEventListener) {
|
|
85
|
-
return function(event, handler, element = window) {
|
|
86
|
-
if (element && event) {
|
|
87
|
-
element.removeEventListener(event, handler, false)
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
} else {
|
|
91
|
-
return function(event, handler, element = window) {
|
|
92
|
-
if (element && event) {
|
|
93
|
-
// @ts-ignore
|
|
94
|
-
element.detachEvent('on' + event, handler)
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
})()
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* elementui日期时间范围 快捷选项
|
|
103
|
-
*/
|
|
104
|
-
export const pickerOptionsRange = {
|
|
105
|
-
shortcuts: [
|
|
106
|
-
{
|
|
107
|
-
text: '今天',
|
|
108
|
-
onClick(picker) {
|
|
109
|
-
const end = new Date()
|
|
110
|
-
const start = new Date(new Date().toDateString())
|
|
111
|
-
start.setTime(start.getTime())
|
|
112
|
-
picker.$emit('pick', [start, end])
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
text: '最近一周',
|
|
117
|
-
onClick(picker) {
|
|
118
|
-
const end = new Date()
|
|
119
|
-
const start = new Date()
|
|
120
|
-
start.setTime(end.getTime() - 3600 * 1000 * 24 * 7)
|
|
121
|
-
picker.$emit('pick', [start, end])
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
text: '最近一个月',
|
|
126
|
-
onClick(picker) {
|
|
127
|
-
const end = new Date()
|
|
128
|
-
const start = new Date()
|
|
129
|
-
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
|
130
|
-
picker.$emit('pick', [start, end])
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
text: '最近三个月',
|
|
135
|
-
onClick(picker) {
|
|
136
|
-
const end = new Date()
|
|
137
|
-
const start = new Date()
|
|
138
|
-
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
|
139
|
-
picker.$emit('pick', [start, end])
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* elementui月份范围 快捷选项
|
|
147
|
-
*/
|
|
148
|
-
export const pickerOptionsRangeMonth = {
|
|
149
|
-
shortcuts: [
|
|
150
|
-
{
|
|
151
|
-
text: '今年至今',
|
|
152
|
-
onClick(picker) {
|
|
153
|
-
const end = new Date()
|
|
154
|
-
const start = new Date(new Date().getFullYear(), 0)
|
|
155
|
-
picker.$emit('pick', [start, end])
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
text: '最近半年',
|
|
160
|
-
onClick(picker) {
|
|
161
|
-
const end = new Date()
|
|
162
|
-
const start = new Date()
|
|
163
|
-
start.setMonth(start.getMonth() - 6)
|
|
164
|
-
picker.$emit('pick', [start, end])
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
text: '最近一年',
|
|
169
|
-
onClick(picker) {
|
|
170
|
-
const end = new Date()
|
|
171
|
-
const start = new Date()
|
|
172
|
-
start.setMonth(start.getMonth() - 12)
|
|
173
|
-
picker.$emit('pick', [start, end])
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
]
|
|
177
|
-
}
|