@aplus-frontend/ui 6.29.1 → 6.29.3

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 (43) hide show
  1. package/es/src/ag-grid/components/header-cell/index.vue2.mjs +15 -16
  2. package/es/src/ag-grid/hooks/use-columns.d.ts +1 -0
  3. package/es/src/ag-grid/hooks/use-columns.mjs +17 -12
  4. package/es/src/ag-grid/hooks/use-search-form.mjs +14 -14
  5. package/es/src/ag-grid/index.vue.mjs +241 -233
  6. package/es/src/ag-grid/interface.d.ts +4 -0
  7. package/es/src/ag-grid/utils.d.ts +6 -0
  8. package/es/src/ag-grid/utils.mjs +16 -11
  9. package/es/src/ap-field/checkbox/index.vue.mjs +20 -20
  10. package/es/src/ap-field/radio/index.vue.mjs +24 -24
  11. package/es/src/ap-form/item-group/helper.mjs +36 -31
  12. package/es/src/ap-form/search-form/hooks/use-count-per-row.mjs +27 -26
  13. package/es/src/version.d.ts +1 -1
  14. package/es/src/version.mjs +1 -1
  15. package/lib/src/ag-grid/components/header-cell/index.vue2.js +1 -1
  16. package/lib/src/ag-grid/hooks/use-columns.d.ts +1 -0
  17. package/lib/src/ag-grid/hooks/use-columns.js +1 -1
  18. package/lib/src/ag-grid/hooks/use-search-form.js +1 -1
  19. package/lib/src/ag-grid/index.vue.js +1 -1
  20. package/lib/src/ag-grid/interface.d.ts +4 -0
  21. package/lib/src/ag-grid/utils.d.ts +6 -0
  22. package/lib/src/ag-grid/utils.js +1 -1
  23. package/lib/src/ap-field/checkbox/index.vue.js +1 -1
  24. package/lib/src/ap-field/radio/index.vue.js +1 -1
  25. package/lib/src/ap-form/item-group/helper.js +1 -1
  26. package/lib/src/ap-form/search-form/hooks/use-count-per-row.js +1 -1
  27. package/lib/src/version.d.ts +1 -1
  28. package/lib/src/version.js +1 -1
  29. package/package.json +3 -3
  30. package/theme/ag-grid/index.css +6 -0
  31. package/theme/antdv-override.css +6 -0
  32. package/theme/antdv-override.less +17 -0
  33. package/theme/ap-field/checkbox.css +3 -0
  34. package/theme/ap-field/checkbox.less +3 -0
  35. package/theme/ap-field/index.css +6 -0
  36. package/theme/ap-field/radio.css +3 -0
  37. package/theme/ap-field/radio.less +3 -0
  38. package/theme/ap-grid/index.css +6 -0
  39. package/theme/ap-table/ap-table.css +6 -0
  40. package/theme/ap-table-modal/index.css +6 -0
  41. package/theme/batch-input-group/index.css +6 -0
  42. package/theme/editable-table/index.css +6 -0
  43. package/theme/index.css +12 -0
@@ -1,5 +1,5 @@
1
- import { defineComponent as w, computed as d, createElementBlock as f, openBlock as s, normalizeClass as r, unref as e, createBlock as B, createCommentVNode as O, resolveDynamicComponent as _, createVNode as C } from "vue";
2
- import { useToken as D } from "@aplus-frontend/antdv/es/theme/internal";
1
+ import { defineComponent as w, computed as d, createElementBlock as f, openBlock as s, normalizeClass as r, unref as e, createBlock as B, createCommentVNode as _, resolveDynamicComponent as D, createVNode as C } from "vue";
2
+ import { useToken as O } from "@aplus-frontend/antdv/es/theme/internal";
3
3
  import { CaretUpOutlined as V, CaretDownOutlined as j } from "@ant-design/icons-vue";
4
4
  import { getTableTitle as z } from "../../../ap-table/utils.mjs";
5
5
  import "../../../config-provider/index.mjs";
@@ -11,28 +11,27 @@ const K = /* @__PURE__ */ w({
11
11
  params: {}
12
12
  },
13
13
  setup(S) {
14
- const o = S, { b: v, e: a } = g("ag-custom-header"), { be: b, bem: k } = g("ap-grid"), [, I] = D(), { sorter: c, setSorter: T } = A(), n = d(() => o.params.column.sorter);
14
+ const o = S, { b: v, e: n } = g("ag-custom-header"), { be: b, bem: k } = g("ap-grid"), [, I] = O(), { sorter: c, setSorter: T } = A(), a = d(() => o.params.column.sorter);
15
15
  function h(t) {
16
16
  return t ? t === "asc" ? "desc" : null : "asc";
17
17
  }
18
18
  const m = d(() => o.params?.column?.getColId?.());
19
- function y() {
20
- if (!n.value)
19
+ function x() {
20
+ if (!a.value)
21
21
  return;
22
- const l = o.params.column.getColId(), x = o.params.column.getSort(), u = h(x), p = o.params.api, N = p.getColumnState().map((i) => ({
22
+ const l = o.params.column.getColId(), y = o.params.column.getSort(), u = h(y), p = o.params.api, N = p.getColumnState().map((i) => ({
23
23
  ...i,
24
24
  sort: i.colId === l ? u : null
25
25
  }));
26
26
  p.applyColumnState({
27
- state: N,
28
- applyOrder: !0
27
+ state: N
29
28
  }), T({ [l]: u });
30
29
  }
31
30
  return (t, l) => (s(), f("div", {
32
- class: r([e(v)(), { sortable: n.value }, `align-${t.params.column.align || "left"}`]),
33
- onClick: y
31
+ class: r([e(v)(), { sortable: a.value }, `align-${t.params.column.align || "left"}`]),
32
+ onClick: x
34
33
  }, [
35
- (s(), B(_(
34
+ (s(), B(D(
36
35
  e(z)(
37
36
  t.params.column,
38
37
  [
@@ -43,17 +42,17 @@ const K = /* @__PURE__ */ w({
43
42
  e(I).colorTextTertiary
44
43
  )
45
44
  ))),
46
- n.value ? (s(), f("span", {
45
+ a.value ? (s(), f("span", {
47
46
  key: 0,
48
- class: r(e(a)("sort-wrapper"))
47
+ class: r(e(n)("sort-wrapper"))
49
48
  }, [
50
49
  C(e(V), {
51
- class: r({ [e(a)("sorter-up")]: !0, active: e(c)[m.value] === "asc" })
50
+ class: r({ [e(n)("sorter-up")]: !0, active: e(c)[m.value] === "asc" })
52
51
  }, null, 8, ["class"]),
53
52
  C(e(j), {
54
- class: r({ [e(a)("sorter-down")]: !0, active: e(c)[m.value] === "desc" })
53
+ class: r({ [e(n)("sorter-down")]: !0, active: e(c)[m.value] === "desc" })
55
54
  }, null, 8, ["class"])
56
- ], 2)) : O("", !0)
55
+ ], 2)) : _("", !0)
57
56
  ], 2));
58
57
  }
59
58
  });
@@ -7,4 +7,5 @@ export declare const useColumns: <RecordType>(props: AgGridProps<RecordType>) =>
7
7
  columns: Ref<AgGridColumnType<RecordType>[], AgGridColumnType<RecordType>[]>;
8
8
  shownColumns: Ref<AgGridColumnType<RecordType>[], AgGridColumnType<RecordType>[]>;
9
9
  columnKeys: ComputedRef<string[]>;
10
+ getTargetColumnByKey: (key?: string) => AgGridColumnType<RecordType> | undefined;
10
11
  };
@@ -1,28 +1,33 @@
1
- import { ref as u, computed as s, watch as r } from "vue";
2
- const a = (n) => {
3
- const o = u([]), t = u([]);
1
+ import { ref as u, computed as a, watch as i } from "vue";
2
+ import { getStringKey as l } from "../utils.mjs";
3
+ const g = (o) => {
4
+ const n = u([]), t = u([]);
4
5
  function m() {
5
- return n.columns?.filter((e) => !e.hideInTable) || [];
6
+ return o.columns?.filter((e) => !e.hideInTable) || [];
6
7
  }
7
- const l = s(
8
- () => o.value.map((e) => e.key ? String(e.key) : e.key).filter(Boolean)
8
+ function r(e) {
9
+ return n.value.find((c) => l(c.key) === e);
10
+ }
11
+ const s = a(
12
+ () => n.value.map((e) => l(e.key)).filter(Boolean)
9
13
  );
10
- return r(
11
- () => n.columns,
14
+ return i(
15
+ () => o.columns,
12
16
  () => {
13
17
  const e = m();
14
- o.value = e, t.value = e, n.onShownColumnsChange?.(e);
18
+ n.value = e, t.value = e, o.onShownColumnsChange?.(e);
15
19
  },
16
20
  {
17
21
  deep: !0,
18
22
  immediate: !0
19
23
  }
20
24
  ), {
21
- columns: o,
25
+ columns: n,
22
26
  shownColumns: t,
23
- columnKeys: l
27
+ columnKeys: s,
28
+ getTargetColumnByKey: r
24
29
  };
25
30
  };
26
31
  export {
27
- a as useColumns
32
+ g as useColumns
28
33
  };
@@ -1,35 +1,35 @@
1
1
  import { noRenderAsFormItemValueList as s } from "../../ap-table/constants.mjs";
2
2
  import { computed as p, unref as l } from "vue";
3
- import { getColumnOrder as d, updateFormProps as u, getFieldProps as m, getSearchFormItemRenderNode as i } from "../../ap-table/utils.mjs";
3
+ import { getColumnOrder as t, updateFormProps as u, getFieldProps as i, getSearchFormItemRenderNode as m } from "../../ap-table/utils.mjs";
4
4
  import "../../config-provider/index.mjs";
5
- import { useGlobalConfig as c } from "../../config-provider/hooks/use-global-config.mjs";
6
- const P = (n) => {
7
- let t = 0;
8
- const a = c("valueTypeMap");
9
- return p(() => (t++, n.columns?.filter(
10
- (e) => !e.hideInSearch && (e.dataIndex || e.key) && (e.valueType || e.customRenderFormItem) && !s.includes(e.valueType)
5
+ import { useGlobalConfig as f } from "../../config-provider/hooks/use-global-config.mjs";
6
+ const P = (a) => {
7
+ let d = 0;
8
+ const n = f("valueTypeMap");
9
+ return p(() => (d++, a.columns?.filter(
10
+ (e) => !e.hideInSearch && (e.field ?? e.dataIndex ?? e.key) && (e.valueType || e.customRenderFormItem) && !s.includes(e.valueType)
11
11
  )?.sort((e, o) => {
12
- const r = d(e.order);
13
- return d(o.order) - r;
12
+ const r = t(e.order);
13
+ return t(o.order) - r;
14
14
  })?.map((e) => {
15
15
  const o = u(
16
16
  e,
17
- m(e.fieldProps, {})
17
+ i(e.fieldProps, {})
18
18
  ), r = {
19
19
  ...e,
20
20
  fieldProps: {
21
21
  label: e.title,
22
- name: e.dataIndex || e.key,
22
+ name: e.field ?? e.dataIndex ?? e.key,
23
23
  // tips: 在表格中的查询表单项默认是带边框的
24
24
  bordered: !0,
25
25
  ...o || {},
26
- _signal: t
26
+ _signal: d
27
27
  },
28
28
  renderNode: void 0
29
29
  };
30
- return r.renderNode = i(
30
+ return r.renderNode = m(
31
31
  r,
32
- l(a)
32
+ l(n)
33
33
  ), r;
34
34
  }) || []));
35
35
  };