@94ai/nf-search-form 3.2.39 → 3.2.43
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 +38 -38
- package/lib/nf-search-form.cjs.js +554 -36
- package/lib/nf-search-form.esm-bundler.js +555 -37
- package/lib/nf-search-form.vue.d.ts +13 -13
- package/package/nf-search-form.vue +28 -14
- package/package.json +17 -16
|
@@ -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: {
|
|
@@ -472,8 +472,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
472
472
|
columnCheckDrawer: import("vue-demi").Ref<any>;
|
|
473
473
|
configNfSearchItemVisibleDialog: import("vue-demi").Ref<boolean>;
|
|
474
474
|
syncCookiesToSearchFormItemOptions: (readCached?: boolean) => void;
|
|
475
|
-
onResize: () => void;
|
|
476
|
-
visibleChange: () => void;
|
|
475
|
+
onResize: (params?: Record<string, any>) => void;
|
|
476
|
+
visibleChange: (params?: Record<string, any>) => void;
|
|
477
477
|
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
|
|
478
478
|
onChange: (event: Record<string, any>) => void;
|
|
479
479
|
itemsChange: (event: string[]) => void;
|
|
@@ -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: {
|
|
@@ -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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="nf-search-form">
|
|
2
|
+
<div class="nf-search-form" ref="topDom">
|
|
3
3
|
<nf-form ref="nfSearchFormRef"
|
|
4
4
|
:model="nfSearchFormModel"
|
|
5
5
|
:inline="inline"
|
|
@@ -273,6 +273,7 @@ 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';
|
|
276
277
|
|
|
277
278
|
import {
|
|
278
279
|
createUniqueString,
|
|
@@ -286,6 +287,7 @@ import {
|
|
|
286
287
|
watch,
|
|
287
288
|
onBeforeMount,
|
|
288
289
|
onMounted,
|
|
290
|
+
onBeforeUnmount,
|
|
289
291
|
onUnmounted,
|
|
290
292
|
nextTick
|
|
291
293
|
} from 'vue-demi'
|
|
@@ -817,18 +819,29 @@ const isCollapseChange = async (val: boolean) => {
|
|
|
817
819
|
onResize()
|
|
818
820
|
}
|
|
819
821
|
|
|
822
|
+
const domWidth = ref()
|
|
823
|
+
const topDom = ref()
|
|
820
824
|
|
|
821
|
-
const onResize = () => {
|
|
825
|
+
const onResize = (params: Record<string, any> = {}) => {
|
|
826
|
+
console.log(params, 'resize')
|
|
827
|
+
const { width } = (params || {})
|
|
828
|
+
if (width && domWidth.value && width === domWidth.value) {
|
|
829
|
+
return
|
|
830
|
+
}
|
|
822
831
|
if (props.btnModel === 'inline' && !props.btnBoxLabel && props.labelPosition === 'top') {
|
|
823
832
|
if (nfSearchFormRef.value.$el.getBoundingClientRect().left === defaultButtonSlot.value.$el.getBoundingClientRect().left) {
|
|
824
833
|
showBtnBoxLabel.value = ''
|
|
825
834
|
} else {
|
|
826
|
-
showBtnBoxLabel.value = '
|
|
835
|
+
showBtnBoxLabel.value = '.'
|
|
827
836
|
}
|
|
828
837
|
}
|
|
829
838
|
}
|
|
830
839
|
|
|
831
|
-
const calcColumns = () => {
|
|
840
|
+
const calcColumns = (params: Record<string, any> = {}) => {
|
|
841
|
+
const { width } = (params || {})
|
|
842
|
+
if (width && domWidth.value && width === domWidth.value) {
|
|
843
|
+
return
|
|
844
|
+
}
|
|
832
845
|
if (props.columns) {
|
|
833
846
|
newColumns.value = props.columns
|
|
834
847
|
return
|
|
@@ -845,21 +858,22 @@ const calcColumns = () => {
|
|
|
845
858
|
}, 0)
|
|
846
859
|
newColumns.value = count
|
|
847
860
|
}
|
|
861
|
+
const resizeOpterate = (params) => {
|
|
862
|
+
onResize(params)
|
|
863
|
+
calcColumns(params)
|
|
864
|
+
}
|
|
848
865
|
|
|
849
|
-
const debounceResize = debounce(
|
|
850
|
-
const
|
|
851
|
-
|
|
866
|
+
const debounceResize = debounce(resizeOpterate, 100, false)
|
|
867
|
+
const observer = ref()
|
|
852
868
|
onMounted(async () => {
|
|
853
|
-
window.addEventListener('resize', debounceResize)
|
|
854
|
-
window.addEventListener('resize', debounceCalcColumns)
|
|
855
869
|
await nextTick()
|
|
856
|
-
|
|
857
|
-
|
|
870
|
+
observer.value = new ResizeObserver(debounceResize)
|
|
871
|
+
observer.value.observe(topDom.value, { box: "border-box" });
|
|
872
|
+
domWidth.value = topDom.value.offsetWidth;
|
|
858
873
|
})
|
|
859
874
|
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
window.removeEventListener('resize', debounceCalcColumns)
|
|
875
|
+
onBeforeUnmount(() => {
|
|
876
|
+
observer.value?.unobserve(topDom.value)
|
|
863
877
|
})
|
|
864
878
|
|
|
865
879
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@94ai/nf-search-form",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.43",
|
|
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/nf-action": "^3.2.
|
|
18
|
-
"@94ai/nf-double-half-year": "^3.2.
|
|
19
|
-
"@94ai/nf-double-quarter": "^3.2.
|
|
20
|
-
"@94ai/nf-double-week": "^3.2.
|
|
21
|
-
"@94ai/nf-double-year": "^3.2.
|
|
22
|
-
"@94ai/nf-drawer": "^3.2.
|
|
23
|
-
"@94ai/nf-form": "^3.2.
|
|
24
|
-
"@94ai/nf-form-item": "^3.2.
|
|
25
|
-
"@94ai/nf-half-year-picker": "^3.2.
|
|
26
|
-
"@94ai/nf-message": "^3.2.
|
|
27
|
-
"@94ai/nf-quarter-picker": "^3.2.
|
|
28
|
-
"@94ai/nf-select-transfer": "^3.2.
|
|
29
|
-
"@94ai/nf-theme-chalk": "^3.2.
|
|
30
|
-
"@94ai/nf-virtual-select": "^3.2.
|
|
17
|
+
"@94ai/nf-action": "^3.2.43",
|
|
18
|
+
"@94ai/nf-double-half-year": "^3.2.43",
|
|
19
|
+
"@94ai/nf-double-quarter": "^3.2.43",
|
|
20
|
+
"@94ai/nf-double-week": "^3.2.43",
|
|
21
|
+
"@94ai/nf-double-year": "^3.2.43",
|
|
22
|
+
"@94ai/nf-drawer": "^3.2.43",
|
|
23
|
+
"@94ai/nf-form": "^3.2.43",
|
|
24
|
+
"@94ai/nf-form-item": "^3.2.43",
|
|
25
|
+
"@94ai/nf-half-year-picker": "^3.2.43",
|
|
26
|
+
"@94ai/nf-message": "^3.2.43",
|
|
27
|
+
"@94ai/nf-quarter-picker": "^3.2.43",
|
|
28
|
+
"@94ai/nf-select-transfer": "^3.2.43",
|
|
29
|
+
"@94ai/nf-theme-chalk": "^3.2.43",
|
|
30
|
+
"@94ai/nf-virtual-select": "^3.2.43",
|
|
31
|
+
"resize-observer-polyfill": "^1.5.1",
|
|
31
32
|
"vue-cookies": "^1.8.3",
|
|
32
33
|
"vue-demi": "^0.14.5",
|
|
33
34
|
"vuedraggable": "^2.24.3"
|
|
@@ -45,5 +46,5 @@
|
|
|
45
46
|
"types": "lib/index.d.ts",
|
|
46
47
|
"main": "lib/nf-search-form.cjs.js",
|
|
47
48
|
"module": "lib/nf-search-form.esm-bundler.js",
|
|
48
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "97e367dab0bceb94fc5f16c5154a8b5bf744a38b"
|
|
49
50
|
}
|