@94ai/nf-search-form 3.3.0 → 3.3.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.
@@ -1,39 +1,42 @@
1
- declare const _default: import("vue-demi").DefineComponent<{
2
- value: {
3
- type: import("vue-demi").PropType<string[]>;
4
- default: () => never[];
5
- };
6
- endPlaceholder: {
7
- type: import("vue-demi").PropType<string>;
8
- required: true;
9
- default: string;
10
- };
11
- startPlaceholder: {
12
- type: import("vue-demi").PropType<string>;
13
- required: true;
14
- default: string;
15
- };
16
- }, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
1
+ declare const _default: import("vue-demi").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
+ value?: string[] | undefined;
3
+ endPlaceholder: string;
4
+ startPlaceholder: string;
5
+ }>, {
6
+ value: () => never[];
7
+ endPlaceholder: string;
8
+ startPlaceholder: string;
9
+ }>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
17
10
  input: (event: [string | undefined, string | undefined]) => void;
18
11
  change: (event: [string | undefined, string | undefined]) => void;
19
- }, string, Readonly<import("vue-demi").ExtractPropTypes<{
20
- value: {
21
- type: import("vue-demi").PropType<string[]>;
22
- default: () => never[];
23
- };
24
- endPlaceholder: {
25
- type: import("vue-demi").PropType<string>;
26
- required: true;
27
- default: string;
28
- };
29
- startPlaceholder: {
30
- type: import("vue-demi").PropType<string>;
31
- required: true;
32
- default: string;
33
- };
34
- }>>, {
12
+ }, string, Readonly<import("vue-demi").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
13
+ value?: string[] | undefined;
14
+ endPlaceholder: string;
15
+ startPlaceholder: string;
16
+ }>, {
17
+ value: () => never[];
18
+ endPlaceholder: string;
19
+ startPlaceholder: string;
20
+ }>>>, {
35
21
  value: string[];
36
22
  endPlaceholder: string;
37
23
  startPlaceholder: string;
38
24
  }>;
39
25
  export default _default;
26
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
27
+ type __VLS_TypePropsToRuntimeProps<T> = {
28
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
29
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
30
+ } : {
31
+ type: import('vue').PropType<T[K]>;
32
+ required: true;
33
+ };
34
+ };
35
+ type __VLS_WithDefaults<P, D> = {
36
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
37
+ default: D[K];
38
+ }> : P[K];
39
+ };
40
+ type __VLS_Prettify<T> = {
41
+ [K in keyof T]: T[K];
42
+ } & {};
@@ -651,7 +651,7 @@ const initLocalShow = (init = false) => {
651
651
  const localShowItems = ref<string[]>(initLocalShow(true))
652
652
  watch(() => localShowItems.value?.length, async () => {
653
653
  emit('update:showItems', localShowItems.value)
654
- if (Object.keys(nfSearchFormModel.value).length) {
654
+ if (Object.keys(nfSearchFormModel.value).length) { // 有可能用computed或异步引起数据更改实时同步model
655
655
  refreshNfSearchFormModel(false)
656
656
  }
657
657
  }, {
@@ -695,7 +695,7 @@ const setLocalShowItems = (list, syncToInitHidden = false) => {
695
695
  }
696
696
 
697
697
 
698
- const syncCookiesToLocalShowColumn = async () => {
698
+ const syncCookiesToLocalShowColumn = async (refreshModel = false) => {
699
699
  if (props.columnEdit) {
700
700
  try {
701
701
  let columnState: string | NfTableColumnAttributes | undefined = CachedManager.syncCachedGet(props.storageKey)
@@ -718,6 +718,9 @@ const syncCookiesToLocalShowColumn = async () => {
718
718
  console.log(e)
719
719
  }
720
720
  }
721
+ if (refreshModel) {
722
+ refreshNfSearchFormModel()
723
+ }
721
724
  }
722
725
 
723
726
 
@@ -876,20 +879,18 @@ const refreshNfSearchFormModel = (outEmit = true, init = false) => {
876
879
  if (v.initValue !== undefined) {
877
880
  obj[v.prop!] = v.initValue
878
881
  } else {
879
- obj[v.prop!] = undefined
882
+ obj[v.prop!] = null
880
883
  }
881
884
  } else {
882
- obj[v.prop!] = nfSearchFormModel.value[v.prop]
885
+ const value = nfSearchFormModel.value[v.prop]
886
+ obj[v.prop!] = typeof value === 'undefined' ? null : value
883
887
  }
884
888
  }
885
889
  })
886
890
  if (JSON.stringify(nfSearchFormModel.value) !== JSON.stringify(obj)) {
887
891
  nfSearchFormModel.value = obj
888
892
  if (outEmit) {
889
- emit('onChange', nfSearchFormModel.value)
890
- nextTick(() => {
891
- emit('itemsChange', localShowItems.value)
892
- })
893
+ emit('itemsChange', localShowItems.value)
893
894
  }
894
895
  }
895
896
  }
@@ -1010,9 +1011,9 @@ const hiddenNfSearchFormItemOptionField = async (prop) => {
1010
1011
  props.formOptions._skip = false
1011
1012
  })
1012
1013
  localShowItems.value = prop.formOptions.filter(item => !item.initHidden).map(item => item.prop)
1014
+ refreshNfSearchFormModel()
1013
1015
  await syncLocalShowColumnToCookies()
1014
1016
  await syncCookiesToSearchFormItemOptions()
1015
- refreshNfSearchFormModel()
1016
1017
  await nextTick()
1017
1018
  refreshLabel()
1018
1019
  }
@@ -1034,9 +1035,8 @@ const columnCheckConfirm = async (cb, error) => {
1034
1035
  try {
1035
1036
  const value = columnCheckDrawer.value.syncTableColumnsToCookies()
1036
1037
  columnCheckConfirmFeedback(value)
1037
- await syncCookiesToLocalShowColumn()
1038
+ await syncCookiesToLocalShowColumn(true)
1038
1039
  await syncCookiesToSearchFormItemOptions()
1039
- refreshNfSearchFormModel()
1040
1040
  await nextTick()
1041
1041
  refreshLabel()
1042
1042
  nfSearchFormRef.value?.getFormItems()
@@ -1060,9 +1060,8 @@ async function clearColumnEditCached() {
1060
1060
  */
1061
1061
  const nfSearchFormItemOptionFieldsSave = async (value) => {
1062
1062
  columnCheckConfirmFeedback(value)
1063
- await syncCookiesToLocalShowColumn()
1063
+ await syncCookiesToLocalShowColumn(true)
1064
1064
  await syncCookiesToSearchFormItemOptions()
1065
- refreshNfSearchFormModel()
1066
1065
  await nextTick()
1067
1066
  refreshLabel()
1068
1067
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-search-form",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "zoujiahe <zoujiahe@94ai.com>",
@@ -14,22 +14,22 @@
14
14
  "url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/common-utils": "^3.3.0",
18
- "@94ai/nf-button": "^3.3.0",
19
- "@94ai/nf-double-half-year": "^3.3.0",
20
- "@94ai/nf-double-quarter": "^3.3.0",
21
- "@94ai/nf-double-week": "^3.3.0",
22
- "@94ai/nf-double-year": "^3.3.0",
23
- "@94ai/nf-drawer": "^3.3.0",
24
- "@94ai/nf-form": "^3.3.0",
25
- "@94ai/nf-form-item": "^3.3.0",
26
- "@94ai/nf-half-year-picker": "^3.3.0",
27
- "@94ai/nf-lazy-select": "^3.3.0",
28
- "@94ai/nf-message": "^3.3.0",
29
- "@94ai/nf-quarter-picker": "^3.3.0",
30
- "@94ai/nf-theme-chalk": "^3.3.0",
31
- "@94ai/nf-transfer-select": "^3.3.0",
32
- "@94ai/nf-virtual-select": "^3.3.0",
17
+ "@94ai/common-utils": "^3.3.2",
18
+ "@94ai/nf-button": "^3.3.2",
19
+ "@94ai/nf-double-half-year": "^3.3.2",
20
+ "@94ai/nf-double-quarter": "^3.3.2",
21
+ "@94ai/nf-double-week": "^3.3.2",
22
+ "@94ai/nf-double-year": "^3.3.2",
23
+ "@94ai/nf-drawer": "^3.3.2",
24
+ "@94ai/nf-form": "^3.3.2",
25
+ "@94ai/nf-form-item": "^3.3.2",
26
+ "@94ai/nf-half-year-picker": "^3.3.2",
27
+ "@94ai/nf-lazy-select": "^3.3.2",
28
+ "@94ai/nf-message": "^3.3.2",
29
+ "@94ai/nf-quarter-picker": "^3.3.2",
30
+ "@94ai/nf-theme-chalk": "^3.3.2",
31
+ "@94ai/nf-transfer-select": "^3.3.2",
32
+ "@94ai/nf-virtual-select": "^3.3.2",
33
33
  "idb-keyval": "^6.2.1",
34
34
  "resize-observer-polyfill": "^1.5.1",
35
35
  "vue-demi": "^0.14.5",
@@ -48,5 +48,5 @@
48
48
  "types": "lib/index.d.ts",
49
49
  "main": "lib/nf-search-form.cjs.js",
50
50
  "module": "lib/nf-search-form.esm-bundler.js",
51
- "gitHead": "3fb4167c1ba3abcf18bdce8af115483594286216"
51
+ "gitHead": "452ef85be9233a97e8514ea86cdf20c1fac1c9e5"
52
52
  }