@aplus-frontend/ui 0.1.9 → 0.1.10

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.
Files changed (47) hide show
  1. package/es/src/ap-field/interface.d.ts +4 -0
  2. package/es/src/ap-field/select/index.vue.d.ts +6 -0
  3. package/es/src/ap-field/select/index.vue.mjs +36 -31
  4. package/es/src/ap-layout/ap-info-layout/ap-info-layout.vue.d.ts +6 -2
  5. package/es/src/ap-layout/ap-info-layout/ap-info-layout.vue.mjs +33 -23
  6. package/es/src/ap-table/ap-table.vue.mjs +158 -147
  7. package/es/src/ap-table/constants.d.ts +26 -0
  8. package/es/src/ap-table/hooks/use-table-paging.d.ts +4 -3
  9. package/es/src/ap-table/hooks/use-table-paging.mjs +63 -63
  10. package/es/src/ap-table/interface.d.ts +13 -1
  11. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +53 -48
  12. package/es/src/business/ap-export-group/interface.d.ts +4 -0
  13. package/es/src/business/ap-label/ApLabel.vue2.mjs +18 -17
  14. package/es/src/business/ap-label/ApLabelGroup.d.ts +22 -4
  15. package/es/src/business/ap-label/ApLabelGroup.mjs +17 -23
  16. package/es/src/business/ap-label/constans.d.ts +10 -2
  17. package/es/src/business/ap-label/constans.mjs +8 -0
  18. package/es/src/business/ap-label/interface.d.ts +13 -8
  19. package/es/src/business/index.d.ts +35 -5
  20. package/es/src/theme/antd-global-overwrite/admin/button.css +3 -0
  21. package/es/src/theme/antd-global-overwrite/admin/index.css +3 -0
  22. package/es/src/theme/antd-global-overwrite/aplus/button.css +3 -0
  23. package/es/src/theme/antd-global-overwrite/aplus/index.css +3 -0
  24. package/lib/src/ap-field/interface.d.ts +4 -0
  25. package/lib/src/ap-field/select/index.vue.d.ts +6 -0
  26. package/lib/src/ap-field/select/index.vue.js +1 -1
  27. package/lib/src/ap-layout/ap-info-layout/ap-info-layout.vue.d.ts +6 -2
  28. package/lib/src/ap-layout/ap-info-layout/ap-info-layout.vue.js +1 -1
  29. package/lib/src/ap-table/ap-table.vue.js +1 -1
  30. package/lib/src/ap-table/constants.d.ts +26 -0
  31. package/lib/src/ap-table/hooks/use-table-paging.d.ts +4 -3
  32. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  33. package/lib/src/ap-table/interface.d.ts +13 -1
  34. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  35. package/lib/src/business/ap-export-group/interface.d.ts +4 -0
  36. package/lib/src/business/ap-label/ApLabel.vue2.js +1 -1
  37. package/lib/src/business/ap-label/ApLabelGroup.d.ts +22 -4
  38. package/lib/src/business/ap-label/ApLabelGroup.js +1 -1
  39. package/lib/src/business/ap-label/constans.d.ts +10 -2
  40. package/lib/src/business/ap-label/constans.js +1 -1
  41. package/lib/src/business/ap-label/interface.d.ts +13 -8
  42. package/lib/src/business/index.d.ts +35 -5
  43. package/lib/src/theme/antd-global-overwrite/admin/button.css +3 -0
  44. package/lib/src/theme/antd-global-overwrite/admin/index.css +3 -0
  45. package/lib/src/theme/antd-global-overwrite/aplus/button.css +3 -0
  46. package/lib/src/theme/antd-global-overwrite/aplus/index.css +3 -0
  47. package/package.json +3 -3
@@ -109,6 +109,10 @@ export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'v
109
109
  * 是否在Select框聚焦时再次触发选项请求
110
110
  */
111
111
  refetchOnFocus?: boolean;
112
+ /**
113
+ * 是否延迟请求选项列表
114
+ */
115
+ lazy?: boolean;
112
116
  };
113
117
  export type ApFieldSelectExpose = {
114
118
  focus: () => void;
@@ -36,6 +36,8 @@ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypeProp
36
36
  labelInValue: undefined;
37
37
  multiple: undefined;
38
38
  searchMode: string;
39
+ refetchOnFocus: boolean;
40
+ lazy: boolean;
39
41
  }>, {
40
42
  focus: typeof focus;
41
43
  blur: typeof blur;
@@ -60,6 +62,8 @@ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypeProp
60
62
  labelInValue: undefined;
61
63
  multiple: undefined;
62
64
  searchMode: string;
65
+ refetchOnFocus: boolean;
66
+ lazy: boolean;
63
67
  }>>> & {
64
68
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
65
69
  }, {
@@ -78,8 +82,10 @@ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypeProp
78
82
  defaultActiveFirstOption: boolean;
79
83
  labelInValue: boolean;
80
84
  multiple: boolean;
85
+ lazy: boolean;
81
86
  emptyText: string;
82
87
  searchMode: "filter" | "request";
88
+ refetchOnFocus: boolean;
83
89
  }, {}>;
84
90
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
85
91
  export default _default;
@@ -1,4 +1,4 @@
1
- import { defineComponent as k, ref as f, onMounted as q, computed as m, unref as r, openBlock as v, createElementBlock as A, toDisplayString as M, createBlock as T, mergeProps as _, createSlots as R, renderList as D, withCtx as h, renderSlot as U, normalizeProps as L, guardReactiveProps as z, createVNode as K } from "vue";
1
+ import { defineComponent as k, ref as f, onMounted as q, computed as m, unref as u, openBlock as v, createElementBlock as A, toDisplayString as M, createBlock as T, mergeProps as _, createSlots as R, renderList as z, withCtx as h, renderSlot as D, normalizeProps as U, guardReactiveProps as L, createVNode as K } from "vue";
2
2
  import { debounce as H, isFunction as y, isArray as $, isNil as j, omit as E } from "lodash-unified";
3
3
  import { Select as W, Spin as G } from "ant-design-vue";
4
4
  import "../../hooks/index.mjs";
@@ -89,60 +89,65 @@ const Y = { key: 0 }, re = /* @__PURE__ */ k({
89
89
  value: {},
90
90
  "onUpdate:value": {},
91
91
  searchMode: { default: "filter" },
92
- refetchOnFocus: { type: Boolean }
92
+ refetchOnFocus: { type: Boolean, default: !1 },
93
+ lazy: { type: Boolean, default: !1 }
93
94
  },
94
95
  emits: ["update:value"],
95
96
  setup(w, { expose: S, emit: g }) {
96
- let u = 0;
97
+ let n = 0;
97
98
  const B = H((o) => {
98
99
  if (!y(e.request))
99
100
  return;
100
- u += 1;
101
- const t = u;
102
- i.value = [], n.value = !0, e.request(o).then((l) => {
103
- u === t && (i.value = l);
101
+ n += 1;
102
+ const t = n;
103
+ i.value = [], a.value = !0, e.request(o).then((l) => {
104
+ n === t && (i.value = l);
104
105
  }).finally(() => {
105
- n.value = !1;
106
+ a.value = !1;
106
107
  });
107
108
  }, 300), e = w, F = (o, t) => {
108
- var a;
109
- const l = ((a = e.fieldNames) == null ? void 0 : a.label) || "label";
109
+ var r;
110
+ const l = ((r = e.fieldNames) == null ? void 0 : r.label) || "label";
110
111
  return typeof (t == null ? void 0 : t.label) == "string" && t[l].indexOf(o) > -1;
111
- }, i = f((e == null ? void 0 : e.options) || []), d = f(), n = f((e == null ? void 0 : e.loading) || !1), b = g;
112
+ }, i = f((e == null ? void 0 : e.options) || []), d = f(), a = f((e == null ? void 0 : e.loading) || !1), b = g;
112
113
  async function s(o = !0) {
113
114
  if (!y(e.request))
114
115
  return;
115
- n.value = !0, u += 1;
116
- const t = u;
116
+ a.value = !0, n += 1;
117
+ const t = n;
117
118
  try {
118
119
  o && (i.value = []);
119
120
  const l = await e.request();
120
- if (t !== u)
121
+ if (t !== n)
121
122
  return;
122
123
  i.value = l;
123
124
  } finally {
124
- n.value = !1;
125
+ a.value = !1;
125
126
  }
126
127
  }
127
128
  function C(o) {
128
129
  var t;
129
- (t = e.onFocus) == null || t.call(e, o), e.refetchOnFocus && u > 0 && !n.value && s(!0);
130
+ (t = e.onFocus) == null || t.call(e, o), e.refetchOnFocus && n > 0 && !a.value && s(!0);
130
131
  }
131
132
  q(() => {
133
+ if (e.lazy) {
134
+ n += 1;
135
+ return;
136
+ }
132
137
  s();
133
138
  });
134
139
  const { value: p, updateValue: x } = X(e, b), I = Q("Select", e), O = m(() => {
135
- const o = r(p);
140
+ const o = u(p);
136
141
  if (!o)
137
142
  return e.emptyText;
138
143
  if ($(o))
139
144
  return o.map(
140
145
  (l) => {
141
- var a;
142
- return (a = r(i).find((c) => c.value === l)) == null ? void 0 : a.label;
146
+ var r;
147
+ return (r = u(i).find((c) => c.value === l)) == null ? void 0 : r.label;
143
148
  }
144
149
  ).filter(Boolean).join("、") || e.emptyText;
145
- const t = r(i).find((l) => l.value === o);
150
+ const t = u(i).find((l) => l.value === o);
146
151
  return (t == null ? void 0 : t.label) || e.emptyText;
147
152
  }), P = m(() => {
148
153
  const o = !!(e != null && e.showSearch), t = e.searchMode;
@@ -151,7 +156,7 @@ const Y = { key: 0 }, re = /* @__PURE__ */ k({
151
156
  showArrow: !1,
152
157
  defaultActiveFirstOption: !1,
153
158
  onSearch: B,
154
- notFoundContent: n.value ? void 0 : null
159
+ notFoundContent: a.value ? void 0 : null
155
160
  } : {
156
161
  showArrow: !0,
157
162
  filterOption: j(e == null ? void 0 : e.filterOption) ? F : e == null ? void 0 : e.filterOption
@@ -167,7 +172,7 @@ const Y = { key: 0 }, re = /* @__PURE__ */ k({
167
172
  "onFocus"
168
173
  ])
169
174
  ),
170
- placeholder: r(I),
175
+ placeholder: u(I),
171
176
  ...l
172
177
  };
173
178
  });
@@ -183,29 +188,29 @@ const Y = { key: 0 }, re = /* @__PURE__ */ k({
183
188
  focus: V,
184
189
  blur: N,
185
190
  request: s
186
- }), (o, t) => o.mode === "read" ? (v(), A("span", Y, M(O.value), 1)) : (v(), T(r(W), _({
191
+ }), (o, t) => o.mode === "read" ? (v(), A("span", Y, M(O.value), 1)) : (v(), T(u(W), _({
187
192
  key: 1,
188
193
  "allow-clear": "",
189
194
  ref_key: "selectRef",
190
195
  ref: d
191
196
  }, P.value, {
192
197
  mode: o.multiple ? "multiple" : void 0,
193
- value: r(p),
194
- "onUpdate:value": r(x),
198
+ value: u(p),
199
+ "onUpdate:value": u(x),
195
200
  options: i.value,
196
- loading: n.value,
201
+ loading: a.value,
197
202
  onFocus: C
198
203
  }), R({ _: 2 }, [
199
- D(o.$slots, (l, a) => ({
200
- name: a,
204
+ z(o.$slots, (l, r) => ({
205
+ name: r,
201
206
  fn: h((c) => [
202
- U(o.$slots, a, L(z(c || {})))
207
+ D(o.$slots, r, U(L(c || {})))
203
208
  ])
204
209
  })),
205
- n.value ? {
210
+ a.value ? {
206
211
  name: "notFoundContent",
207
212
  fn: h(() => [
208
- K(r(G), { size: "small" })
213
+ K(u(G), { size: "small" })
209
214
  ]),
210
215
  key: "0"
211
216
  } : void 0
@@ -10,10 +10,14 @@ declare function __VLS_template(): {
10
10
  declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<APInfoLayoutProps>, {
11
11
  toEl: string;
12
12
  telDisabled: boolean;
13
- }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<APInfoLayoutProps>, {
13
+ }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
14
+ "update:telDisabled": (...args: any[]) => void;
15
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<APInfoLayoutProps>, {
14
16
  toEl: string;
15
17
  telDisabled: boolean;
16
- }>>>, {
18
+ }>>> & {
19
+ "onUpdate:telDisabled"?: ((...args: any[]) => any) | undefined;
20
+ }, {
17
21
  toEl: string | HTMLElement;
18
22
  telDisabled: boolean;
19
23
  }, {}>;
@@ -1,62 +1,72 @@
1
- import { defineComponent as C, computed as t, openBlock as l, createElementBlock as h, normalizeClass as a, createBlock as b, Teleport as g, renderSlot as n, createElementVNode as o, createVNode as $, unref as y } from "vue";
2
- import { Divider as B } from "ant-design-vue";
1
+ import { defineComponent as $, computed as t, onActivated as y, onDeactivated as B, openBlock as i, createElementBlock as E, normalizeClass as a, createBlock as H, Teleport as k, renderSlot as s, createElementVNode as o, createVNode as A, unref as N } from "vue";
2
+ import { Divider as T } from "ant-design-vue";
3
3
  import "../style/ap-info-layout.css";
4
4
  import "../../config-provider/index.mjs";
5
- import { useNamespace as D } from "../../config-provider/hooks/use-namespace.mjs";
6
- const z = /* @__PURE__ */ C({
5
+ import { useNamespace as V } from "../../config-provider/hooks/use-namespace.mjs";
6
+ const w = /* @__PURE__ */ $({
7
7
  name: "ApInfoLayout",
8
8
  __name: "ap-info-layout",
9
9
  props: {
10
10
  toEl: { default: "#microapp-fixed-header" },
11
11
  telDisabled: { type: Boolean, default: !1 }
12
12
  },
13
- setup(E) {
14
- const { b: s, be: d, bem: r } = D("info-layout"), i = t(() => [s("container")]), c = t(() => [s("header")]), u = t(() => [s("divider")]), p = t(() => [s("contant")]), m = t(() => [d("header", "contant")]), v = t(() => [r("header", "contant", "title")]), f = t(() => [r("header", "contant", "actions")]);
15
- return (e, H) => (l(), h("div", {
16
- class: a(i.value)
13
+ emits: ["update:telDisabled"],
14
+ setup(d, { emit: c }) {
15
+ const u = d, p = c, { b: l, be: v, bem: r } = V("info-layout"), m = t(() => [l("container")]), f = t(() => [l("header")]), C = t(() => [l("divider")]), b = t(() => [l("contant")]), g = t(() => [v("header", "contant")]), h = t(() => [r("header", "contant", "title")]), D = t(() => [r("header", "contant", "actions")]), n = t({
16
+ get: () => u.telDisabled,
17
+ set: (e) => {
18
+ p("update:telDisabled", e);
19
+ }
20
+ });
21
+ return y(() => {
22
+ n.value = !1;
23
+ }), B(() => {
24
+ n.value = !0;
25
+ }), (e, z) => (i(), E("div", {
26
+ class: a(m.value)
17
27
  }, [
18
- (l(), b(g, {
28
+ (i(), H(k, {
19
29
  to: e.toEl,
20
- disabled: e.telDisabled
30
+ disabled: n.value
21
31
  }, [
22
- n(e.$slots, "header"),
32
+ s(e.$slots, "header"),
23
33
  o("div", {
24
- class: a(`${c.value}`)
34
+ class: a(`${f.value}`)
25
35
  }, [
26
36
  o("div", {
27
- class: a(m.value)
37
+ class: a(g.value)
28
38
  }, [
29
39
  o("div", {
30
- class: a(v.value)
40
+ class: a(h.value)
31
41
  }, [
32
- n(e.$slots, "title")
42
+ s(e.$slots, "title")
33
43
  ], 2),
34
44
  o("div", {
35
- class: a(f.value)
45
+ class: a(D.value)
36
46
  }, [
37
- n(e.$slots, "actions")
47
+ s(e.$slots, "actions")
38
48
  ], 2)
39
49
  ], 2)
40
50
  ], 2)
41
51
  ], 8, ["to", "disabled"])),
42
52
  o("div", {
43
- class: a(u.value)
53
+ class: a(C.value)
44
54
  }, [
45
- n(e.$slots, "divider", {}, () => [
46
- $(y(B), {
55
+ s(e.$slots, "divider", {}, () => [
56
+ A(N(T), {
47
57
  class: "ap-info-layout-divider",
48
58
  dashed: ""
49
59
  })
50
60
  ])
51
61
  ], 2),
52
62
  o("div", {
53
- class: a(p.value)
63
+ class: a(b.value)
54
64
  }, [
55
- n(e.$slots, "content")
65
+ s(e.$slots, "content")
56
66
  ], 2)
57
67
  ], 2));
58
68
  }
59
69
  });
60
70
  export {
61
- z as default
71
+ w as default
62
72
  };