@dazhicheng/ui 1.5.236 → 1.5.237

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.
@@ -9,7 +9,7 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/en
9
9
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
10
10
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
11
11
  import "lodash-es";
12
- import { TtButton as V } from "../../../tt-button/index.js";
12
+ import { TtButton as P } from "../../../tt-button/index.js";
13
13
  import "../../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
14
14
  import { useDesign as J } from "../../../../packages/hooks/src/useDesign.js";
15
15
  import K from "./ExpandableArrow.vue2.js";
@@ -23,7 +23,7 @@ const de = /* @__PURE__ */ O({
23
23
  },
24
24
  emits: ["update:modelValue"],
25
25
  setup(S, { expose: $ }) {
26
- const [n, j] = Q(), c = _(S, "modelValue"), { prefixCls: A } = J("form-submit-btn"), D = E(), h = d(() => ({
26
+ const [n, j] = Q(), c = _(S, "modelValue"), { prefixCls: V } = J("form-submit-btn"), D = E(), h = d(() => ({
27
27
  content: "重置",
28
28
  show: !0,
29
29
  ...o(n).resetButtonOptions
@@ -44,7 +44,7 @@ const de = /* @__PURE__ */ O({
44
44
  const s = F(await t.formApi.getValues()) ?? {};
45
45
  await ((a = t.handleSubmit) == null ? void 0 : a.call(t, s));
46
46
  }
47
- async function P(e) {
47
+ async function A(e) {
48
48
  var s, a;
49
49
  e == null || e.preventDefault(), e == null || e.stopPropagation();
50
50
  const t = o(n), r = F(await ((s = t.formApi) == null ? void 0 : s.getValues())) ?? {};
@@ -60,7 +60,7 @@ const de = /* @__PURE__ */ O({
60
60
  }
61
61
  await H();
62
62
  const e = D["wrapper-ref"];
63
- if (!e) {
63
+ if (!e || !e.offsetParent) {
64
64
  p();
65
65
  return;
66
66
  }
@@ -133,15 +133,15 @@ const de = /* @__PURE__ */ O({
133
133
  o(n).showCollapseButton && z();
134
134
  }, 200);
135
135
  }), $({
136
- handleReset: P,
136
+ handleReset: A,
137
137
  handleSubmit: w
138
138
  }), (e, t) => (l(), C("div", {
139
139
  class: I(o(G)(N.value))
140
140
  }, [
141
141
  o(n).actionButtonsReverse ? (l(), C(x, { key: 0 }, [
142
142
  m(e.$slots, "submit-before"),
143
- i.value.show ? (l(), v(b(o(V)), g({ key: 0 }, i.value, {
144
- class: o(A),
143
+ i.value.show ? (l(), v(b(o(P)), g({ key: 0 }, i.value, {
144
+ class: o(V),
145
145
  type: "primary",
146
146
  onClick: w
147
147
  }), {
@@ -152,7 +152,7 @@ const de = /* @__PURE__ */ O({
152
152
  }, 16, ["class"])) : u("", !0)
153
153
  ], 64)) : u("", !0),
154
154
  m(e.$slots, "reset-before"),
155
- h.value.show ? (l(), v(b(o(V)), g({ key: 1 }, h.value, { onClick: P }), {
155
+ h.value.show ? (l(), v(b(o(P)), g({ key: 1 }, h.value, { onClick: A }), {
156
156
  default: k(() => [
157
157
  B(R(h.value.content), 1)
158
158
  ]),
@@ -160,10 +160,10 @@ const de = /* @__PURE__ */ O({
160
160
  }, 16)) : u("", !0),
161
161
  o(n).actionButtonsReverse ? u("", !0) : (l(), C(x, { key: 2 }, [
162
162
  m(e.$slots, "submit-before"),
163
- i.value.show ? (l(), v(b(o(V)), g({
163
+ i.value.show ? (l(), v(b(o(P)), g({
164
164
  key: 0,
165
165
  type: "primary",
166
- class: o(A)
166
+ class: o(V)
167
167
  }, i.value, { onClick: w }), {
168
168
  default: k(() => [
169
169
  B(R(i.value.content), 1)
@@ -1,47 +1,45 @@
1
- import { useTemplateRef as y, ref as f, computed as b, watch as k, nextTick as x, onMounted as C } from "vue";
1
+ import { useTemplateRef as b, ref as f, computed as k, watch as x, nextTick as m, onMounted as C } from "vue";
2
2
  import { useElementVisibility as B, useBreakpoints as I, breakpointsTailwind as S } from "@vueuse/core";
3
3
  function M(o) {
4
- const n = y("wrapperRef"), r = B(n), i = f({}), s = f(!1), w = I(S), d = b(() => {
4
+ const n = b("wrapperRef"), w = B(n), i = f({}), r = f(!1), d = I(S), v = k(() => {
5
5
  const e = o.collapsedRows ?? 1, t = i.value;
6
- let c = 0;
6
+ let s = 0;
7
7
  for (let a = 1; a <= e; a++)
8
- c += (t == null ? void 0 : t[a]) ?? 0;
9
- return c - 1 || 1;
8
+ s += (t == null ? void 0 : t[a]) ?? 0;
9
+ return s - 1 || 1;
10
10
  });
11
- k(
11
+ x(
12
12
  [
13
13
  () => o.showCollapseButton,
14
- () => w.active().value,
14
+ () => d.active().value,
15
15
  () => {
16
16
  var e;
17
17
  return (e = o.schema) == null ? void 0 : e.length;
18
18
  },
19
- () => r.value
19
+ () => w.value
20
20
  ],
21
21
  async ([e]) => {
22
- e && await u();
22
+ e && (await m(), i.value = {}, r.value = !1, await c());
23
23
  }
24
24
  );
25
- async function u() {
26
- if (!o.showCollapseButton || !r.value || (await x(), !n.value || !r.value))
25
+ async function c() {
26
+ if (!o.showCollapseButton || (await m(), !n.value))
27
27
  return;
28
- const e = Array.from(n.value.children);
29
- i.value = {};
30
- const t = n.value, a = window.getComputedStyle(t).getPropertyValue("grid-template-rows").split(" "), v = t == null ? void 0 : t.getBoundingClientRect();
31
- e.forEach((g) => {
32
- const p = g.getBoundingClientRect().top - v.top;
33
- let l = 0, m = 0;
34
- for (const [R, h] of a.entries())
35
- if (m += Number.parseFloat(h), p < m) {
36
- l = R + 1;
28
+ const e = Array.from(n.value.children), t = n.value, a = window.getComputedStyle(t).getPropertyValue("grid-template-rows").split(" "), g = t == null ? void 0 : t.getBoundingClientRect();
29
+ e.forEach((p) => {
30
+ const R = p.getBoundingClientRect().top - g.top;
31
+ let l = 0, u = 0;
32
+ for (const [h, y] of a.entries())
33
+ if (u += Number.parseFloat(y), R < u) {
34
+ l = h + 1;
37
35
  break;
38
36
  }
39
- l > ((o == null ? void 0 : o.collapsedRows) ?? 1) || (i.value[l] = (i.value[l] ?? 0) + 1, s.value = !0);
37
+ l > ((o == null ? void 0 : o.collapsedRows) ?? 1) || (i.value[l] = (i.value[l] ?? 0) + 1, r.value = !0);
40
38
  });
41
39
  }
42
40
  return C(() => {
43
- u();
44
- }), { isCalculated: s, keepFormItemIndex: d, wrapperRef: n };
41
+ c();
42
+ }), { isCalculated: r, keepFormItemIndex: v, wrapperRef: n };
45
43
  }
46
44
  export {
47
45
  M as useExpandable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazhicheng/ui",
3
- "version": "1.5.236",
3
+ "version": "1.5.237",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -67,8 +67,8 @@
67
67
  "vue-router": "^5.0.2",
68
68
  "vxe-pc-ui": "^4.12.36",
69
69
  "vxe-table": "^4.17.48",
70
- "@dazhicheng/hooks": "1.4.44",
71
- "@dazhicheng/utils": "1.3.41"
70
+ "@dazhicheng/utils": "1.3.41",
71
+ "@dazhicheng/hooks": "1.4.44"
72
72
  },
73
73
  "files": [
74
74
  "dist"