@94ai/nf-search-form 3.2.43 → 3.2.44

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 CHANGED
@@ -1386,7 +1386,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1386
1386
  configNfSearchItemVisibleDialog: import("vue-demi").Ref<boolean>;
1387
1387
  syncCookiesToSearchFormItemOptions: (readCached?: boolean) => void;
1388
1388
  onResize: (params?: Record<string, any>) => void;
1389
- visibleChange: (params?: Record<string, any>) => void;
1389
+ visibleChange: () => void;
1390
1390
  }> & import("vue/types/v3-component-options").ExtractComputedReturns<{}> & import("vue-demi").ComponentCustomProperties & Readonly<import("vue-demi").ExtractPropTypes<{
1391
1391
  storageKey: {
1392
1392
  type: import("vue-demi").PropType<string>;
@@ -2265,7 +2265,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
2265
2265
  configNfSearchItemVisibleDialog: import("vue-demi").Ref<boolean>;
2266
2266
  syncCookiesToSearchFormItemOptions: (readCached?: boolean) => void;
2267
2267
  onResize: (params?: Record<string, any>) => void;
2268
- visibleChange: (params?: Record<string, any>) => void;
2268
+ visibleChange: () => void;
2269
2269
  }, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
2270
2270
  onChange: (event: Record<string, any>) => void;
2271
2271
  itemsChange: (event: string[]) => void;
@@ -276,34 +276,6 @@ const TimeRange = __component__$4.exports;
276
276
  function createUniqueString(randomLength = 36) {
277
277
  return Number(Math.random().toString().substr(3, randomLength) + Date.now()).toString(36);
278
278
  }
279
- function debounce(func, wait, immediate) {
280
- let timeout, args, context, timestamp, result;
281
- const later = function() {
282
- const last = +/* @__PURE__ */ new Date() - timestamp;
283
- if (last < wait && last > 0) {
284
- timeout = setTimeout(later, wait - last);
285
- } else {
286
- timeout = null;
287
- if (!immediate) {
288
- result = func.apply(context, args);
289
- if (!timeout)
290
- context = args = null;
291
- }
292
- }
293
- };
294
- return function(...args2) {
295
- context = this;
296
- timestamp = +/* @__PURE__ */ new Date();
297
- const callNow = immediate && !timeout;
298
- if (!timeout)
299
- timeout = setTimeout(later, wait);
300
- if (callNow) {
301
- result = func.apply(context, args2);
302
- context = args2 = null;
303
- }
304
- return result;
305
- };
306
- }
307
279
  function deepClone(source) {
308
280
  if (!source && typeof source !== "object") {
309
281
  throw new Error("error arguments shallowClone");
@@ -7727,18 +7699,11 @@ __sfc_main.setup = (__props, __ctx) => {
7727
7699
  const isCollapseChange = async (val) => {
7728
7700
  emit("isCollapseChange", val);
7729
7701
  await vueDemi.nextTick();
7730
- onResize();
7702
+ refreshLabel();
7731
7703
  };
7732
7704
  const domWidth = vueDemi.ref();
7733
7705
  const topDom = vueDemi.ref();
7734
- const onResize = (params = {}) => {
7735
- console.log(params, "resize");
7736
- const {
7737
- width
7738
- } = params || {};
7739
- if (width && domWidth.value && width === domWidth.value) {
7740
- return;
7741
- }
7706
+ const refreshLabel = () => {
7742
7707
  if (props.btnModel === "inline" && !props.btnBoxLabel && props.labelPosition === "top") {
7743
7708
  if (nfSearchFormRef.value.$el.getBoundingClientRect().left === defaultButtonSlot.value.$el.getBoundingClientRect().left) {
7744
7709
  showBtnBoxLabel.value = "";
@@ -7747,13 +7712,16 @@ __sfc_main.setup = (__props, __ctx) => {
7747
7712
  }
7748
7713
  }
7749
7714
  };
7750
- const calcColumns = (params = {}) => {
7715
+ const onResize = (params = {}) => {
7751
7716
  const {
7752
7717
  width
7753
- } = params || {};
7718
+ } = (params == null ? void 0 : params[0].contentRect) || {};
7754
7719
  if (width && domWidth.value && width === domWidth.value) {
7755
7720
  return;
7756
7721
  }
7722
+ refreshLabel();
7723
+ };
7724
+ const calcColumns = () => {
7757
7725
  if (props.columns) {
7758
7726
  newColumns.value = props.columns;
7759
7727
  return;
@@ -7771,15 +7739,12 @@ __sfc_main.setup = (__props, __ctx) => {
7771
7739
  }, 0);
7772
7740
  newColumns.value = count;
7773
7741
  };
7774
- const resizeOpterate = (params) => {
7775
- onResize(params);
7776
- calcColumns(params);
7777
- };
7778
- const debounceResize = debounce(resizeOpterate, 100, false);
7779
7742
  const observer = vueDemi.ref();
7780
7743
  vueDemi.onMounted(async () => {
7781
7744
  await vueDemi.nextTick();
7782
- observer.value = new index(debounceResize);
7745
+ calcColumns();
7746
+ await vueDemi.nextTick();
7747
+ observer.value = new index(onResize);
7783
7748
  observer.value.observe(topDom.value, {
7784
7749
  box: "border-box"
7785
7750
  });
@@ -7820,7 +7785,7 @@ __sfc_main.setup = (__props, __ctx) => {
7820
7785
  syncCookiesToSearchFormItemOptions();
7821
7786
  refreshNfSearchFormModel();
7822
7787
  await vueDemi.nextTick();
7823
- onResize();
7788
+ refreshLabel();
7824
7789
  }
7825
7790
  };
7826
7791
  const refreshNfSearchFormModel = async () => {
@@ -7853,7 +7818,7 @@ __sfc_main.setup = (__props, __ctx) => {
7853
7818
  syncCookiesToSearchFormItemOptions();
7854
7819
  refreshNfSearchFormModel();
7855
7820
  await vueDemi.nextTick();
7856
- onResize();
7821
+ refreshLabel();
7857
7822
  cb();
7858
7823
  } catch (e) {
7859
7824
  error();
@@ -7866,7 +7831,7 @@ __sfc_main.setup = (__props, __ctx) => {
7866
7831
  syncCookiesToSearchFormItemOptions();
7867
7832
  refreshNfSearchFormModel();
7868
7833
  await vueDemi.nextTick();
7869
- onResize();
7834
+ refreshLabel();
7870
7835
  };
7871
7836
  return Object.assign({
7872
7837
  defaultButtonSlot,
@@ -7964,7 +7929,7 @@ __sfc_main.setup = (__props, __ctx) => {
7964
7929
  */
7965
7930
  syncCookiesToSearchFormItemOptions,
7966
7931
  onResize,
7967
- visibleChange: onResize
7932
+ visibleChange: refreshLabel
7968
7933
  });
7969
7934
  };
7970
7935
  __sfc_main.components = Object.assign({
@@ -274,34 +274,6 @@ const TimeRange = __component__$4.exports;
274
274
  function createUniqueString(randomLength = 36) {
275
275
  return Number(Math.random().toString().substr(3, randomLength) + Date.now()).toString(36);
276
276
  }
277
- function debounce(func, wait, immediate) {
278
- let timeout, args, context, timestamp, result;
279
- const later = function() {
280
- const last = +/* @__PURE__ */ new Date() - timestamp;
281
- if (last < wait && last > 0) {
282
- timeout = setTimeout(later, wait - last);
283
- } else {
284
- timeout = null;
285
- if (!immediate) {
286
- result = func.apply(context, args);
287
- if (!timeout)
288
- context = args = null;
289
- }
290
- }
291
- };
292
- return function(...args2) {
293
- context = this;
294
- timestamp = +/* @__PURE__ */ new Date();
295
- const callNow = immediate && !timeout;
296
- if (!timeout)
297
- timeout = setTimeout(later, wait);
298
- if (callNow) {
299
- result = func.apply(context, args2);
300
- context = args2 = null;
301
- }
302
- return result;
303
- };
304
- }
305
277
  function deepClone(source) {
306
278
  if (!source && typeof source !== "object") {
307
279
  throw new Error("error arguments shallowClone");
@@ -7725,18 +7697,11 @@ __sfc_main.setup = (__props, __ctx) => {
7725
7697
  const isCollapseChange = async (val) => {
7726
7698
  emit("isCollapseChange", val);
7727
7699
  await nextTick();
7728
- onResize();
7700
+ refreshLabel();
7729
7701
  };
7730
7702
  const domWidth = ref();
7731
7703
  const topDom = ref();
7732
- const onResize = (params = {}) => {
7733
- console.log(params, "resize");
7734
- const {
7735
- width
7736
- } = params || {};
7737
- if (width && domWidth.value && width === domWidth.value) {
7738
- return;
7739
- }
7704
+ const refreshLabel = () => {
7740
7705
  if (props.btnModel === "inline" && !props.btnBoxLabel && props.labelPosition === "top") {
7741
7706
  if (nfSearchFormRef.value.$el.getBoundingClientRect().left === defaultButtonSlot.value.$el.getBoundingClientRect().left) {
7742
7707
  showBtnBoxLabel.value = "";
@@ -7745,13 +7710,16 @@ __sfc_main.setup = (__props, __ctx) => {
7745
7710
  }
7746
7711
  }
7747
7712
  };
7748
- const calcColumns = (params = {}) => {
7713
+ const onResize = (params = {}) => {
7749
7714
  const {
7750
7715
  width
7751
- } = params || {};
7716
+ } = (params == null ? void 0 : params[0].contentRect) || {};
7752
7717
  if (width && domWidth.value && width === domWidth.value) {
7753
7718
  return;
7754
7719
  }
7720
+ refreshLabel();
7721
+ };
7722
+ const calcColumns = () => {
7755
7723
  if (props.columns) {
7756
7724
  newColumns.value = props.columns;
7757
7725
  return;
@@ -7769,15 +7737,12 @@ __sfc_main.setup = (__props, __ctx) => {
7769
7737
  }, 0);
7770
7738
  newColumns.value = count;
7771
7739
  };
7772
- const resizeOpterate = (params) => {
7773
- onResize(params);
7774
- calcColumns(params);
7775
- };
7776
- const debounceResize = debounce(resizeOpterate, 100, false);
7777
7740
  const observer = ref();
7778
7741
  onMounted(async () => {
7779
7742
  await nextTick();
7780
- observer.value = new index(debounceResize);
7743
+ calcColumns();
7744
+ await nextTick();
7745
+ observer.value = new index(onResize);
7781
7746
  observer.value.observe(topDom.value, {
7782
7747
  box: "border-box"
7783
7748
  });
@@ -7818,7 +7783,7 @@ __sfc_main.setup = (__props, __ctx) => {
7818
7783
  syncCookiesToSearchFormItemOptions();
7819
7784
  refreshNfSearchFormModel();
7820
7785
  await nextTick();
7821
- onResize();
7786
+ refreshLabel();
7822
7787
  }
7823
7788
  };
7824
7789
  const refreshNfSearchFormModel = async () => {
@@ -7851,7 +7816,7 @@ __sfc_main.setup = (__props, __ctx) => {
7851
7816
  syncCookiesToSearchFormItemOptions();
7852
7817
  refreshNfSearchFormModel();
7853
7818
  await nextTick();
7854
- onResize();
7819
+ refreshLabel();
7855
7820
  cb();
7856
7821
  } catch (e) {
7857
7822
  error();
@@ -7864,7 +7829,7 @@ __sfc_main.setup = (__props, __ctx) => {
7864
7829
  syncCookiesToSearchFormItemOptions();
7865
7830
  refreshNfSearchFormModel();
7866
7831
  await nextTick();
7867
- onResize();
7832
+ refreshLabel();
7868
7833
  };
7869
7834
  return Object.assign({
7870
7835
  defaultButtonSlot,
@@ -7962,7 +7927,7 @@ __sfc_main.setup = (__props, __ctx) => {
7962
7927
  */
7963
7928
  syncCookiesToSearchFormItemOptions,
7964
7929
  onResize,
7965
- visibleChange: onResize
7930
+ visibleChange: refreshLabel
7966
7931
  });
7967
7932
  };
7968
7933
  __sfc_main.components = Object.assign({
@@ -473,7 +473,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
473
473
  configNfSearchItemVisibleDialog: import("vue-demi").Ref<boolean>;
474
474
  syncCookiesToSearchFormItemOptions: (readCached?: boolean) => void;
475
475
  onResize: (params?: Record<string, any>) => void;
476
- visibleChange: (params?: Record<string, any>) => void;
476
+ visibleChange: () => 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;
@@ -816,18 +816,12 @@ onBeforeMount(() => {
816
816
  const isCollapseChange = async (val: boolean) => {
817
817
  emit('isCollapseChange', val)
818
818
  await nextTick()
819
- onResize()
819
+ refreshLabel()
820
820
  }
821
821
 
822
822
  const domWidth = ref()
823
823
  const topDom = ref()
824
-
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
- }
824
+ const refreshLabel = () => {
831
825
  if (props.btnModel === 'inline' && !props.btnBoxLabel && props.labelPosition === 'top') {
832
826
  if (nfSearchFormRef.value.$el.getBoundingClientRect().left === defaultButtonSlot.value.$el.getBoundingClientRect().left) {
833
827
  showBtnBoxLabel.value = ''
@@ -836,12 +830,15 @@ const onResize = (params: Record<string, any> = {}) => {
836
830
  }
837
831
  }
838
832
  }
839
-
840
- const calcColumns = (params: Record<string, any> = {}) => {
841
- const { width } = (params || {})
833
+ const onResize = (params: Record<string, any> = {}) => {
834
+ const { width } = (params?.[0].contentRect || {})
842
835
  if (width && domWidth.value && width === domWidth.value) {
843
836
  return
844
837
  }
838
+ refreshLabel()
839
+ }
840
+
841
+ const calcColumns = () => {
845
842
  if (props.columns) {
846
843
  newColumns.value = props.columns
847
844
  return
@@ -858,16 +855,13 @@ const calcColumns = (params: Record<string, any> = {}) => {
858
855
  }, 0)
859
856
  newColumns.value = count
860
857
  }
861
- const resizeOpterate = (params) => {
862
- onResize(params)
863
- calcColumns(params)
864
- }
865
858
 
866
- const debounceResize = debounce(resizeOpterate, 100, false)
867
859
  const observer = ref()
868
860
  onMounted(async () => {
869
861
  await nextTick()
870
- observer.value = new ResizeObserver(debounceResize)
862
+ calcColumns()
863
+ await nextTick()
864
+ observer.value = new ResizeObserver(onResize)
871
865
  observer.value.observe(topDom.value, { box: "border-box" });
872
866
  domWidth.value = topDom.value.offsetWidth;
873
867
  })
@@ -925,7 +919,7 @@ const hiddenNfSearchFormItemOptionField = async (prop) => {
925
919
  syncCookiesToSearchFormItemOptions()
926
920
  refreshNfSearchFormModel()
927
921
  await nextTick()
928
- onResize()
922
+ refreshLabel()
929
923
  }
930
924
  }
931
925
 
@@ -966,7 +960,7 @@ const columnCheckConfirm = async (cb, error) => {
966
960
  syncCookiesToSearchFormItemOptions()
967
961
  refreshNfSearchFormModel()
968
962
  await nextTick()
969
- onResize()
963
+ refreshLabel()
970
964
  cb()
971
965
  } catch (e) {
972
966
  error()
@@ -983,7 +977,7 @@ const nfSearchFormItemOptionFieldsSave = async (value) => {
983
977
  syncCookiesToSearchFormItemOptions()
984
978
  refreshNfSearchFormModel()
985
979
  await nextTick()
986
- onResize()
980
+ refreshLabel()
987
981
  }
988
982
 
989
983
  defineExpose({
@@ -1060,7 +1054,7 @@ defineExpose({
1060
1054
  */
1061
1055
  syncCookiesToSearchFormItemOptions,
1062
1056
  onResize,
1063
- visibleChange: onResize
1057
+ visibleChange: refreshLabel
1064
1058
  })
1065
1059
 
1066
1060
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-search-form",
3
- "version": "3.2.43",
3
+ "version": "3.2.44",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "zoujiahe <zoujiahe@94ai.com>",
@@ -14,20 +14,20 @@
14
14
  "url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
15
15
  },
16
16
  "dependencies": {
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",
17
+ "@94ai/nf-action": "^3.2.44",
18
+ "@94ai/nf-double-half-year": "^3.2.44",
19
+ "@94ai/nf-double-quarter": "^3.2.44",
20
+ "@94ai/nf-double-week": "^3.2.44",
21
+ "@94ai/nf-double-year": "^3.2.44",
22
+ "@94ai/nf-drawer": "^3.2.44",
23
+ "@94ai/nf-form": "^3.2.44",
24
+ "@94ai/nf-form-item": "^3.2.44",
25
+ "@94ai/nf-half-year-picker": "^3.2.44",
26
+ "@94ai/nf-message": "^3.2.44",
27
+ "@94ai/nf-quarter-picker": "^3.2.44",
28
+ "@94ai/nf-select-transfer": "^3.2.44",
29
+ "@94ai/nf-theme-chalk": "^3.2.44",
30
+ "@94ai/nf-virtual-select": "^3.2.44",
31
31
  "resize-observer-polyfill": "^1.5.1",
32
32
  "vue-cookies": "^1.8.3",
33
33
  "vue-demi": "^0.14.5",
@@ -46,5 +46,5 @@
46
46
  "types": "lib/index.d.ts",
47
47
  "main": "lib/nf-search-form.cjs.js",
48
48
  "module": "lib/nf-search-form.esm-bundler.js",
49
- "gitHead": "97e367dab0bceb94fc5f16c5154a8b5bf744a38b"
49
+ "gitHead": "baed79e5f2059e6d9f8151a0e62c63d92e3d0ef0"
50
50
  }