lew-ui 2.7.8 → 2.7.9

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/dist/index.js CHANGED
@@ -5992,12 +5992,14 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
5992
5992
  computeTableRowHeight();
5993
5993
  });
5994
5994
  }
5995
- useResizeObserver(tableRef, () => {
5996
- state.isInitialized = false;
5997
- handleTableResize();
5998
- });
5999
5995
  onMounted(() => {
6000
5996
  init();
5997
+ if (typeof window !== "undefined" && typeof ResizeObserver !== "undefined") {
5998
+ useResizeObserver(tableRef, () => {
5999
+ state.isInitialized = false;
6000
+ handleTableResize();
6001
+ });
6002
+ }
6001
6003
  if (props2.checkable && !props2.rowKey) {
6002
6004
  throw new Error("LewTable error: rowKey is required when checkable is enabled!");
6003
6005
  }
@@ -22484,15 +22486,18 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
22484
22486
  height: 0,
22485
22487
  width: 0
22486
22488
  });
22487
- useResizeObserver(lewTextareaViewRef, () => {
22488
- if (props2.resize !== "none") {
22489
- const { width, height } = lewTextareaViewRef.value.getBoundingClientRect();
22490
- resizeObj.value = {
22491
- width,
22492
- height
22493
- };
22494
- }
22495
- });
22489
+ if (typeof window !== "undefined" && typeof ResizeObserver !== "undefined") {
22490
+ useResizeObserver(lewTextareaViewRef, (entries) => {
22491
+ if (props2.resize !== "none") {
22492
+ const entry = entries[0];
22493
+ const { width, height } = entry.contentRect;
22494
+ resizeObj.value = {
22495
+ width,
22496
+ height
22497
+ };
22498
+ }
22499
+ });
22500
+ }
22496
22501
  const modelValue2 = useModel(__props2, "modelValue");
22497
22502
  const state = reactive({
22498
22503
  isFocus: false
@@ -22620,7 +22625,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
22620
22625
  };
22621
22626
  }
22622
22627
  });
22623
- const LewTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-0c440dd9"]]);
22628
+ const LewTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-49451908"]]);
22624
22629
  const treeSelectModel = {
22625
22630
  modelValue: {
22626
22631
  type: [String, Number],
@@ -25712,9 +25717,11 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
25712
25717
  const debouncedCalculate = useDebounceFn(calculateDisplayText, 150);
25713
25718
  onMounted(() => {
25714
25719
  initCalculateDisplayText();
25715
- });
25716
- useResizeObserver(lewTextTrimRef, () => {
25717
- debouncedCalculate();
25720
+ if (typeof window !== "undefined" && typeof ResizeObserver !== "undefined") {
25721
+ useResizeObserver(lewTextTrimRef, () => {
25722
+ debouncedCalculate();
25723
+ });
25724
+ }
25718
25725
  });
25719
25726
  onUnmounted(() => {
25720
25727
  destroyTippy();
@@ -25748,7 +25755,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
25748
25755
  };
25749
25756
  }
25750
25757
  });
25751
- const LewTextTrim = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-d5450bb7"]]);
25758
+ const LewTextTrim = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-e11780ce"]]);
25752
25759
  const titleProps = {
25753
25760
  text: {
25754
25761
  type: String,