@aplus-frontend/ui 0.0.22 → 0.0.23

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.
@@ -28,7 +28,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
28
28
  size: "small" | "middle";
29
29
  value: CheckCardValueType | CheckCardValueType[];
30
30
  bordered: boolean;
31
- stopPropagation: boolean;
31
+ stopPropagation: boolean | ((event: MouseEvent) => boolean);
32
32
  }, {}>, {
33
33
  default?(_: {}): any;
34
34
  }>;
@@ -11,7 +11,7 @@ const z = /* @__PURE__ */ g({
11
11
  disabled: { type: Boolean, default: void 0 },
12
12
  loading: { type: Boolean, default: void 0 },
13
13
  size: { default: void 0 },
14
- stopPropagation: { type: Boolean, default: void 0 },
14
+ stopPropagation: { type: [Boolean, Function], default: void 0 },
15
15
  multiple: { type: Boolean, default: !1 },
16
16
  defaultValue: { type: [String, Number, Boolean, Array] },
17
17
  value: { type: [String, Number, Boolean, Array], default: void 0 },
@@ -27,7 +27,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
27
27
  size: "small" | "middle";
28
28
  bordered: boolean;
29
29
  checked: boolean;
30
- stopPropagation: boolean;
30
+ stopPropagation: boolean | ((event: MouseEvent) => boolean);
31
31
  }, {}>, Readonly<CheckCardSlots> & CheckCardSlots>;
32
32
  export default _default;
33
33
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,15 +1,15 @@
1
- import { defineComponent as F, computed as i, unref as l, createVNode as m, watch as I, watchEffect as U, openBlock as c, createElementBlock as N, normalizeStyle as W, normalizeClass as P, withModifiers as j, createBlock as f, renderSlot as G, resolveDynamicComponent as V, createCommentVNode as v, createElementVNode as O } from "vue";
2
- import { Skeleton as $ } from "ant-design-vue";
1
+ import { defineComponent as I, computed as i, unref as l, createVNode as m, watch as U, watchEffect as W, openBlock as c, createElementBlock as N, normalizeStyle as j, normalizeClass as P, withModifiers as G, createBlock as f, renderSlot as O, resolveDynamicComponent as V, createCommentVNode as v, createElementVNode as $ } from "vue";
2
+ import { Skeleton as q } from "ant-design-vue";
3
3
  import "../config-provider/index.mjs";
4
4
  import "../hooks/index.mjs";
5
5
  import { isFunction as z } from "lodash-unified";
6
- import { useInjectCheckCard as q } from "./context.mjs";
6
+ import { useInjectCheckCard as A } from "./context.mjs";
7
7
  import "./style/index.css";
8
- import A from "./checked.svg.mjs";
9
- import { useNamespace as H } from "../config-provider/hooks/use-namespace.mjs";
10
- import { useGlobalConfig as J } from "../config-provider/hooks/use-global-config.mjs";
11
- import { useControllableValue as K } from "../hooks/useControllableValue.mjs";
12
- const L = ["src"], ne = /* @__PURE__ */ F({
8
+ import H from "./checked.svg.mjs";
9
+ import { useNamespace as J } from "../config-provider/hooks/use-namespace.mjs";
10
+ import { useGlobalConfig as K } from "../config-provider/hooks/use-global-config.mjs";
11
+ import { useControllableValue as L } from "../hooks/useControllableValue.mjs";
12
+ const Q = ["src"], re = /* @__PURE__ */ I({
13
13
  name: "CheckCard",
14
14
  __name: "index",
15
15
  props: {
@@ -27,7 +27,7 @@ const L = ["src"], ne = /* @__PURE__ */ F({
27
27
  default: "middle"
28
28
  },
29
29
  stopPropagation: {
30
- type: Boolean,
30
+ type: [Boolean, Function],
31
31
  default: !1
32
32
  },
33
33
  checked: {
@@ -48,19 +48,19 @@ const L = ["src"], ne = /* @__PURE__ */ F({
48
48
  content: {}
49
49
  },
50
50
  emits: ["update:checked"],
51
- setup(_, {
52
- emit: w
51
+ setup(S, {
52
+ emit: _
53
53
  }) {
54
- const o = _, {
54
+ const o = S, {
55
55
  b: g,
56
- m: u,
56
+ m: s,
57
57
  e: p,
58
- bm: D,
58
+ bm: w,
59
59
  em: k
60
- } = H("check-card"), b = J("uiMode", "aplus"), E = w, n = q(), {
60
+ } = J("check-card"), h = K("uiMode", "aplus"), D = _, n = A(), {
61
61
  value: r,
62
- updateValue: h
63
- } = K(o, E, {
62
+ updateValue: b
63
+ } = L(o, D, {
64
64
  valuePropName: "checked",
65
65
  defaultValuePropName: "defaultChecked"
66
66
  }), a = i(() => {
@@ -68,12 +68,12 @@ const L = ["src"], ne = /* @__PURE__ */ F({
68
68
  ...o
69
69
  }, t = l(n);
70
70
  return t && (e.disabled = e.disabled || t.disabled, e.bordered = e.bordered || t.bordered, e.loading = e.loading || t.loading, e.size = e.size || t.size, e.stopPropagation = e.stopPropagation || t.stopPropagation), e;
71
- }), S = i(() => {
72
- const e = l(b), t = l(a);
73
- return [g(), ...t.disabled ? [] : [g(e), l(r) ? D(e, "checked") : null], u(t.size), t.bordered ? u("bordered") : null, t.disabled ? u("disabled") : null];
71
+ }), E = i(() => {
72
+ const e = l(h), t = l(a);
73
+ return [g(), ...t.disabled ? [] : [g(e), l(r) ? w(e, "checked") : null], s(t.size), t.bordered ? s("bordered") : null, t.disabled ? s("disabled") : null];
74
74
  }), M = i(() => ({
75
75
  ...o.style,
76
- "--check-card-border-color": b.value === "admin" ? "#D9D9D9" : "#E9EDF3"
76
+ "--check-card-border-color": h.value === "admin" ? "#D9D9D9" : "#E9EDF3"
77
77
  })), y = i(() => {
78
78
  if (!o.title)
79
79
  return;
@@ -90,30 +90,34 @@ const L = ["src"], ne = /* @__PURE__ */ F({
90
90
  }, [e]);
91
91
  });
92
92
  function T(e) {
93
+ const t = l(a).stopPropagation;
94
+ return t ? t === !0 ? e.target !== e.currentTarget : t(e) : !1;
95
+ }
96
+ function F(e) {
93
97
  var t, d;
94
- a.value.stopPropagation && e.target !== e.currentTarget || a.value.loading || a.value.disabled || (n.value ? (d = (t = n.value) == null ? void 0 : t.toggleOption) == null || d.call(t, o.value) : h(!l(r)));
98
+ T(e) || a.value.loading || a.value.disabled || (n.value ? (d = (t = n.value) == null ? void 0 : t.toggleOption) == null || d.call(t, o.value) : b(!l(r)));
95
99
  }
96
- return I(() => n.value, (e) => {
100
+ return U(() => n.value, (e) => {
97
101
  if (!e)
98
102
  return;
99
103
  const t = e.multiple ? (e.value || []).includes(o.value) : e.value === o.value;
100
- h(t);
104
+ b(t);
101
105
  }, {
102
106
  immediate: !0
103
- }), U((e) => {
107
+ }), W((e) => {
104
108
  var t, d;
105
109
  (d = (t = n.value) == null ? void 0 : t.registerValue) == null || d.call(t, o.value), e(() => {
106
- var s, B;
107
- return (B = (s = n.value) == null ? void 0 : s.cancelValue) == null ? void 0 : B.call(s, o.value);
110
+ var u, B;
111
+ return (B = (u = n.value) == null ? void 0 : u.cancelValue) == null ? void 0 : B.call(u, o.value);
108
112
  });
109
113
  }), (e, t) => (c(), N("div", {
110
- style: W(M.value),
111
- class: P(S.value),
112
- onClick: j(T, ["stop"])
113
- }, [a.value.loading ? (c(), f(l($), {
114
+ style: j(M.value),
115
+ class: P(E.value),
116
+ onClick: G(F, ["stop"])
117
+ }, [a.value.loading ? (c(), f(l(q), {
114
118
  key: 0,
115
119
  active: ""
116
- })) : G(e.$slots, "default", {
120
+ })) : O(e.$slots, "default", {
117
121
  key: 1,
118
122
  checked: l(r)
119
123
  }, () => [y.value ? (c(), f(V(y.value), {
@@ -123,11 +127,11 @@ const L = ["src"], ne = /* @__PURE__ */ F({
123
127
  })) : v("", !0)]), l(r) ? (c(), N("div", {
124
128
  key: 2,
125
129
  class: P(l(p)("checked-icon"))
126
- }, [O("img", {
127
- src: l(A)
128
- }, null, 8, L)], 2)) : v("", !0)], 6));
130
+ }, [$("img", {
131
+ src: l(H)
132
+ }, null, 8, Q)], 2)) : v("", !0)], 6));
129
133
  }
130
134
  });
131
135
  export {
132
- ne as default
136
+ re as default
133
137
  };
@@ -24,7 +24,7 @@ type CheckCardCommonType = {
24
24
  /**
25
25
  * 是否阻止点击事件冒泡(对于自定义内容包含输入控件时需要设置)
26
26
  */
27
- stopPropagation?: boolean;
27
+ stopPropagation?: boolean | ((event: MouseEvent) => boolean);
28
28
  };
29
29
  export type CheckCardProps = CheckCardCommonType & {
30
30
  /**