@aplus-frontend/ui 0.5.0 → 0.5.2

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.
@@ -1,16 +1,19 @@
1
- import { createVNode as E, Fragment as M } from "vue";
2
- import { isUndefined as S, isArray as B, isString as v, isBoolean as F, pick as w } from "lodash-unified";
3
- import { valueEnumToArray as W, getTableTitle as A, getTableRenderType as j, getTableRenderProps as k, getTableCellRenderNode as z } from "../../ap-table/utils.mjs";
1
+ import { createVNode as F, Fragment as M } from "vue";
2
+ import { isUndefined as S, isArray as c, isString as v, isBoolean as A, isNumber as B, pick as R } from "lodash-unified";
3
+ import { valueEnumToArray as N, getTableTitle as E, getTableRenderType as W, getTableRenderProps as _, getTableCellRenderNode as j } from "../../ap-table/utils.mjs";
4
+ import { noRenderAsFormItemValueList as k } from "../../ap-table/constants.mjs";
5
+ import "../../ap-table/components/paragraph-ellipsis/index.vue.mjs";
6
+ import z from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
4
7
  function O(e) {
5
8
  if (!S(e))
6
- return B(e) ? e.reduce((r, i) => v(i) ? `${r}.${i}` : `${r}[${i}]`, "") : String(e);
9
+ return c(e) ? e.reduce((r, t) => v(t) ? `${r}.${t}` : `${r}[${t}]`, "") : String(e);
7
10
  }
8
- function R(e) {
11
+ function b(e) {
9
12
  if (e)
10
13
  return e === !0 ? "left" : e;
11
14
  }
12
15
  function G(e) {
13
- return F(e) ? {
16
+ return A(e) ? {
14
17
  sortable: e
15
18
  } : e ? {
16
19
  sortable: !0,
@@ -20,87 +23,114 @@ function G(e) {
20
23
  sortable: !1
21
24
  };
22
25
  }
23
- function H(e) {
26
+ function I(e) {
24
27
  let r;
25
- return F(e.filters) && e.valueEnum ? r = W(e.valueEnum) : r = e.filters, r == null ? void 0 : r.map((i) => ({
26
- label: v(i.text) ? i.text : "",
27
- value: i.value
28
+ return A(e.filters) && e.valueEnum ? r = N(e.valueEnum) : r = e.filters, r == null ? void 0 : r.map((t) => ({
29
+ label: v(t.text) ? t.text : "",
30
+ value: t.value
28
31
  }));
29
32
  }
30
- function N(e) {
33
+ function L(e) {
31
34
  if (e)
32
35
  return (r) => e(r.value, r.row);
33
36
  }
34
- function u(e, r, i) {
35
- const d = w(e, ["width", "minWidth", "align"]);
36
- return d.field = O(e.dataIndex), d.fixed = R(e.fixed), d.title = e.title, d.slots = {
37
- header: () => A(e, i, void 0, r)
38
- }, d.headerAlign = e.align, d.showOverflow = e.ellipsis, d.showHeaderOverflow = e.ellipsis, d;
37
+ function U(e, r, t) {
38
+ return e ? B(e) ? {
39
+ tooltip: t,
40
+ rows: e
41
+ } : e === !0 || e === "tooltip" ? {
42
+ tooltip: t,
43
+ rows: 1
44
+ } : {
45
+ tooltip: null,
46
+ rows: 1,
47
+ htmlTitle: e === "title" ? r : ""
48
+ } : !1;
49
+ }
50
+ function V(e, r, t) {
51
+ if (k.includes(e.valueType))
52
+ return t;
53
+ if (e.copyable || e.ellipsis) {
54
+ const l = U(e.ellipsis, r, t);
55
+ return F(z, {
56
+ copyable: e.copyable,
57
+ ellipsis: l,
58
+ content: t
59
+ }, null);
60
+ }
61
+ return t;
39
62
  }
40
- function y(e, r, i, d) {
41
- const t = w(e, ["width", "minWidth", "align", "resizable"]);
42
- t.field = O(e.dataIndex), t.fixed = R(e.fixed), t.headerAlign = e.align, t.footerAlign = e.align, t.showOverflow = e.ellipsis, t.showFooterOverflow = e.ellipsis, Object.assign(t, G(e.sorter)), t.filters = H(e), t.filterMultiple = e.filterMultiple, t.filterMethod = N(e.onFilter), t.title = e.title;
43
- const h = ({
44
- value: s,
63
+ function x(e, r, t) {
64
+ const l = R(e, ["width", "minWidth", "align"]);
65
+ return l.field = O(e.dataIndex), l.fixed = b(e.fixed), l.title = e.title, l.slots = {
66
+ header: () => E(e, t, void 0, r)
67
+ }, l.headerAlign = e.align, l.showOverflow = !1, l.showFooterOverflow = !1, l;
68
+ }
69
+ function o(e, r, t, l) {
70
+ const i = R(e, ["width", "minWidth", "align", "resizable"]);
71
+ i.field = O(e.dataIndex), i.fixed = b(e.fixed), i.headerAlign = e.align, i.footerAlign = e.align, i.showOverflow = !1, i.showFooterOverflow = !1, Object.assign(i, G(e.sorter)), i.filters = I(e), i.filterMultiple = e.filterMultiple, i.filterMethod = L(e.onFilter), i.title = e.title;
72
+ const a = ({
73
+ value: d,
45
74
  ...n
46
75
  }) => {
47
- var p, x;
48
- const l = j(e), a = k({
76
+ var T, y;
77
+ const f = W(e), p = _({
49
78
  ...e,
50
- valueType: l
79
+ valueType: f
51
80
  }, {
52
- value: s,
81
+ value: d,
53
82
  ...n
54
- }), f = z(l, a, n.record, d), $ = ((p = e.renderText) == null ? void 0 : p.call(e, {
55
- value: s,
83
+ }), $ = j(f, p, n.record, l), h = ((T = e.renderText) == null ? void 0 : T.call(e, {
84
+ value: d,
56
85
  ...n
57
- })) || s;
58
- let T = e.renderText ? E(M, null, [(x = e.renderText) == null ? void 0 : x.call(e, {
59
- value: s,
86
+ })) || d, w = e.renderText ? F(M, null, [(y = e.renderText) == null ? void 0 : y.call(e, {
87
+ value: d,
60
88
  ...n
61
- })]) : f;
62
- return e.customRender && (T = e.customRender({
63
- value: s,
89
+ })]) : $;
90
+ let u = V(e, h, w);
91
+ return e.customRender && (u = e.customRender({
92
+ value: d,
64
93
  ...n,
65
94
  column: e,
66
- originalNode: T,
67
- originalText: $
68
- })), T;
69
- };
70
- return t.slots = {
71
- header: () => A(e, i, void 0, r),
72
- default: ({
73
- row: s,
74
- rowIndex: n
75
- }) => h({
76
- value: s[t.field],
77
- text: s[t.field],
78
- record: s,
79
- index: n,
80
- renderIndex: n,
81
- column: e
82
- })
83
- }, t;
95
+ originalNode: u,
96
+ originalText: h
97
+ })), u;
98
+ }, s = ({
99
+ row: d,
100
+ rowIndex: n
101
+ }) => a({
102
+ value: d[i.field],
103
+ text: d[i.field],
104
+ record: d,
105
+ index: n,
106
+ renderIndex: n,
107
+ column: e
108
+ });
109
+ return i.slots = {
110
+ header: () => E(e, t, void 0, r),
111
+ default: s,
112
+ footer: s
113
+ }, i;
84
114
  }
85
- function I(e, r, i, d) {
115
+ function X(e, r, t, l) {
86
116
  var s;
87
117
  if (!((s = e.children) != null && s.length))
88
- return y(e, r, i, d);
89
- function t(n) {
90
- return n.map((l) => {
91
- var a;
92
- if ((a = l.children) != null && a.length) {
93
- const f = u(l, r, i);
94
- return f.children = t(l.children), f;
118
+ return o(e, r, t, l);
119
+ function i(d) {
120
+ return d.map((n) => {
121
+ var f;
122
+ if ((f = n.children) != null && f.length) {
123
+ const p = x(n, r, t);
124
+ return p.children = i(n.children), p;
95
125
  }
96
- return y(l, r, i, d);
126
+ return o(n, r, t, l);
97
127
  });
98
128
  }
99
- const h = u(e, r, i);
100
- return h.children = t(e.children), h;
129
+ const a = x(e, r, t);
130
+ return a.children = i(e.children), a;
101
131
  }
102
132
  export {
103
- I as transformCol,
104
- u as transformToColGroup,
105
- y as transformToColumn
133
+ X as transformCol,
134
+ x as transformToColGroup,
135
+ o as transformToColumn
106
136
  };