@oneflowui/ui 0.5.7 → 0.5.9

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 (34) hide show
  1. package/README.md +11 -0
  2. package/dist/components/ContextMenu/index.vue.js +2 -2
  3. package/dist/components/Dashboard/index.vue.d.ts +1 -1
  4. package/dist/components/Dashboard/index.vue.js +3 -3
  5. package/dist/components/database/DatabaseView.vue.d.ts +6 -1
  6. package/dist/components/database/DatabaseView.vue.js +2 -2
  7. package/dist/components/database/DatabaseView.vue2.js +438 -293
  8. package/dist/components/overlay/Drawer.vue.d.ts +1 -1
  9. package/dist/components/overlay/Modal.vue.d.ts +1 -1
  10. package/dist/components/table/ColumnHeaderMenu.vue.d.ts +2 -2
  11. package/dist/components/table/DataTable.vue.d.ts +3 -1
  12. package/dist/components/table/DataTable.vue.js +2 -2
  13. package/dist/components/table/DataTable.vue2.js +598 -526
  14. package/dist/components/table/DetailSheet.vue.d.ts +2 -0
  15. package/dist/components/table/DetailSheet.vue.js +2 -2
  16. package/dist/components/table/DetailSheet.vue2.js +155 -76
  17. package/dist/components/table/TableDataRow.vue.d.ts +3 -1
  18. package/dist/components/table/TableDataRow.vue.js +3 -3
  19. package/dist/components/table/TableDataRow.vue2.js +95 -68
  20. package/dist/components/table/TableHeaderRow.vue.d.ts +3 -1
  21. package/dist/components/table/TableHeaderRow.vue.js +3 -3
  22. package/dist/components/table/TableHeaderRow.vue2.js +96 -60
  23. package/dist/composables/useColumnResize.d.ts +4 -1
  24. package/dist/composables/useColumnResize.js +114 -45
  25. package/dist/composables/useRowDrag.d.ts +1 -1
  26. package/dist/composables/useVirtualList.d.ts +1 -0
  27. package/dist/composables/useVirtualList.js +89 -77
  28. package/dist/plugin.js +240 -171
  29. package/dist/style.css +1 -1
  30. package/dist/types/index.d.ts +2 -1
  31. package/dist/utils/icon.js +25 -68
  32. package/dist/utils/iconRegistry.d.ts +7 -0
  33. package/dist/utils/iconRegistry.js +60 -0
  34. package/package.json +1 -1
@@ -8,6 +8,8 @@ type __VLS_Props = {
8
8
  columns: TableColumn[];
9
9
  fieldDefs?: CellFieldDef[];
10
10
  visible: boolean;
11
+ /** 作为右侧工作区内嵌时,不渲染 Teleport / 遮罩层 */
12
+ embedded?: boolean;
11
13
  /** 标记哪些字段是 content 字段(全宽 markdown 渲染) */
12
14
  contentFields?: string[];
13
15
  /** 是否显示为全屏模式(桌面端宽面板) */
@@ -1,7 +1,7 @@
1
1
  import t from "./DetailSheet.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-f18fde43"]]);
4
+ const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-bac586d2"]]);
5
5
  export {
6
- a as default
6
+ m as default
7
7
  };
@@ -1,139 +1,218 @@
1
- import { defineComponent as V, ref as L, computed as u, openBlock as o, createBlock as k, Teleport as N, createVNode as E, Transition as H, withCtx as j, createElementBlock as d, normalizeClass as h, createElementVNode as n, Fragment as b, renderList as C, toDisplayString as v, createCommentVNode as p } from "vue";
2
- import z from "./FieldCell.vue.js";
3
- import { useMarkdown as O } from "../../composables/useMarkdown.js";
4
- const R = { class: "of-detail-sheet__properties" }, q = { class: "of-detail-sheet__label" }, A = { class: "of-detail-sheet__cell" }, G = {
1
+ import { defineComponent as H, ref as N, computed as h, openBlock as o, createBlock as C, Teleport as E, createVNode as j, Transition as z, withCtx as O, createElementBlock as a, normalizeClass as v, createElementVNode as e, Fragment as y, renderList as k, toDisplayString as _, createCommentVNode as m } from "vue";
2
+ import x from "./FieldCell.vue.js";
3
+ import { useMarkdown as R } from "../../composables/useMarkdown.js";
4
+ const q = { class: "of-detail-sheet__properties" }, A = { class: "of-detail-sheet__label" }, G = { class: "of-detail-sheet__cell" }, I = {
5
5
  key: 1,
6
6
  class: "of-detail-sheet__value"
7
- }, I = {
7
+ }, J = {
8
8
  key: 0,
9
9
  class: "of-detail-sheet__content"
10
- }, J = { class: "of-detail-sheet__content-label" }, Q = ["innerHTML"], U = { class: "of-detail-sheet__footer" }, W = ["disabled"], $ = /* @__PURE__ */ V({
10
+ }, Q = { class: "of-detail-sheet__content-label" }, U = ["innerHTML"], W = { class: "of-detail-sheet__footer" }, X = ["disabled"], Y = {
11
+ key: 1,
12
+ class: "of-detail-sheet-shell of-detail-sheet-shell--embedded"
13
+ }, Z = { class: "of-detail-sheet__properties" }, $ = { class: "of-detail-sheet__label" }, K = { class: "of-detail-sheet__cell" }, ee = {
14
+ key: 1,
15
+ class: "of-detail-sheet__value"
16
+ }, te = {
17
+ key: 0,
18
+ class: "of-detail-sheet__content"
19
+ }, le = { class: "of-detail-sheet__content-label" }, se = ["innerHTML"], oe = { class: "of-detail-sheet__footer" }, ae = ["disabled"], fe = /* @__PURE__ */ H({
11
20
  __name: "DetailSheet",
12
21
  props: {
13
22
  row: {},
14
23
  columns: {},
15
24
  fieldDefs: {},
16
25
  visible: { type: Boolean },
26
+ embedded: { type: Boolean },
17
27
  contentFields: {},
18
28
  fullPage: { type: Boolean },
19
29
  readonly: { type: Boolean }
20
30
  },
21
31
  emits: ["close", "save", "delete", "cell-edit"],
22
- setup(s, { emit: g }) {
23
- const a = s, r = g, { renderMarkdown: w } = O({ showCopyButton: !0 }), i = L({}), D = u(() => Object.keys(i.value).length > 0), B = u(() => new Set(a.contentFields ?? []));
24
- function y(t) {
25
- var l;
26
- if (B.value.has(t.key)) return !0;
27
- const e = (l = a.fieldDefs) == null ? void 0 : l.find((f) => f.id === t.key);
28
- return (e == null ? void 0 : e.type) === "richtext";
32
+ setup(n, { emit: L }) {
33
+ const i = n, r = L, { renderMarkdown: S } = R({ showCopyButton: !0 }), d = N({}), g = h(() => Object.keys(d.value).length > 0), p = h(() => i.embedded || i.visible), V = h(() => new Set(i.contentFields ?? []));
34
+ function w(s) {
35
+ var t;
36
+ if (V.value.has(s.key)) return !0;
37
+ const l = (t = i.fieldDefs) == null ? void 0 : t.find((f) => f.id === s.key);
38
+ return (l == null ? void 0 : l.type) === "richtext";
29
39
  }
30
- const F = u(() => a.columns.filter((t) => !y(t))), m = u(() => a.columns.filter((t) => y(t)));
31
- function x(t) {
32
- var e;
33
- return ((e = a.fieldDefs) == null ? void 0 : e.find((l) => l.id === t)) ?? {
34
- id: t,
40
+ const D = h(() => i.columns.filter((s) => !w(s))), b = h(() => i.columns.filter((s) => w(s)));
41
+ function B(s) {
42
+ var l;
43
+ return ((l = i.fieldDefs) == null ? void 0 : l.find((t) => t.id === s)) ?? {
44
+ id: s,
35
45
  type: "text",
36
- label: t
46
+ label: s
37
47
  };
38
48
  }
39
- function c(t) {
40
- return t.key in i.value ? i.value[t.key] : a.row[t.key];
49
+ function u(s) {
50
+ return s.key in d.value ? d.value[s.key] : i.row[s.key];
41
51
  }
42
- function S(t) {
43
- const e = c(t);
44
- return typeof e != "string" || !e ? "" : w(e);
52
+ function F(s) {
53
+ const l = u(s);
54
+ return typeof l != "string" || !l ? "" : S(l);
45
55
  }
46
- function M(t, e, l) {
47
- i.value = { ...i.value, [e]: l }, r("cell-edit", { rowId: t, fieldId: e, value: l });
56
+ function M(s, l, t) {
57
+ d.value = { ...d.value, [l]: t }, r("cell-edit", { rowId: s, fieldId: l, value: t });
48
58
  }
49
59
  function P() {
50
- r("save", { rowId: a.row.id, fields: { ...i.value } }), i.value = {}, r("close");
60
+ r("save", { rowId: i.row.id, fields: { ...d.value } }), d.value = {}, r("close");
51
61
  }
52
- function _() {
53
- i.value = {}, r("close");
62
+ function c() {
63
+ d.value = {}, r("close");
54
64
  }
55
65
  function T() {
56
- r("delete", a.row.id), r("close");
66
+ r("delete", i.row.id), r("close");
57
67
  }
58
- return (t, e) => (o(), k(N, { to: "body" }, [
59
- E(H, { name: "of-sheet" }, {
60
- default: j(() => [
61
- s.visible ? (o(), d("div", {
68
+ return (s, l) => n.embedded ? p.value ? (o(), a("div", Y, [
69
+ e("div", {
70
+ class: v(["of-detail-sheet", { "of-detail-sheet--full-page": n.fullPage }])
71
+ }, [
72
+ e("div", { class: "of-detail-sheet__header" }, [
73
+ e("button", {
74
+ class: "of-detail-sheet__close",
75
+ onClick: c
76
+ }, "✕"),
77
+ l[3] || (l[3] = e("h3", { class: "of-detail-sheet__title" }, "记录详情", -1)),
78
+ l[4] || (l[4] = e("div", { class: "of-detail-sheet__header-spacer" }, null, -1))
79
+ ]),
80
+ e("div", {
81
+ class: v(["of-detail-sheet__body", { "of-detail-sheet__body--full-page": n.fullPage }])
82
+ }, [
83
+ e("div", Z, [
84
+ (o(!0), a(y, null, k(D.value, (t) => {
85
+ var f;
86
+ return o(), a("div", {
87
+ key: t.key,
88
+ class: "of-detail-sheet__field"
89
+ }, [
90
+ e("span", $, _(t.label), 1),
91
+ e("div", K, [
92
+ (f = n.fieldDefs) != null && f.length ? (o(), C(x, {
93
+ key: 0,
94
+ "row-id": n.row.id,
95
+ field: B(t.key),
96
+ value: u(t),
97
+ readonly: n.readonly,
98
+ onCommit: M
99
+ }, null, 8, ["row-id", "field", "value", "readonly"])) : (o(), a("span", ee, _(u(t) ?? "—"), 1))
100
+ ])
101
+ ]);
102
+ }), 128))
103
+ ]),
104
+ b.value.length > 0 ? (o(), a("div", te, [
105
+ (o(!0), a(y, null, k(b.value, (t) => (o(), a("div", {
106
+ key: t.key,
107
+ class: "of-detail-sheet__content-block"
108
+ }, [
109
+ e("span", le, _(t.label), 1),
110
+ e("div", {
111
+ class: "of-detail-sheet__markdown of-markdown",
112
+ innerHTML: F(t)
113
+ }, null, 8, se)
114
+ ]))), 128))
115
+ ])) : m("", !0)
116
+ ], 2),
117
+ e("div", oe, [
118
+ e("button", {
119
+ class: "of-detail-sheet__btn of-detail-sheet__btn--delete",
120
+ onClick: T
121
+ }, " 删除 "),
122
+ l[5] || (l[5] = e("div", { class: "of-detail-sheet__footer-spacer" }, null, -1)),
123
+ e("button", {
124
+ class: "of-detail-sheet__btn of-detail-sheet__btn--cancel",
125
+ onClick: c
126
+ }, " 取消 "),
127
+ e("button", {
128
+ class: "of-detail-sheet__btn of-detail-sheet__btn--save",
129
+ disabled: !g.value,
130
+ onClick: P
131
+ }, " 保存 ", 8, ae)
132
+ ])
133
+ ], 2)
134
+ ])) : m("", !0) : (o(), C(E, {
135
+ key: 0,
136
+ to: "body"
137
+ }, [
138
+ j(z, { name: "of-sheet" }, {
139
+ default: O(() => [
140
+ p.value ? (o(), a("div", {
62
141
  key: 0,
63
- class: h(["of-detail-sheet-overlay", { "of-detail-sheet-overlay--full-page": s.fullPage }])
142
+ class: v(["of-detail-sheet-overlay", { "of-detail-sheet-overlay--full-page": n.fullPage }])
64
143
  }, [
65
- n("button", {
144
+ e("button", {
66
145
  type: "button",
67
146
  class: "of-detail-sheet-overlay__hitarea",
68
147
  "aria-label": "关闭详情",
69
- onClick: _
148
+ onClick: c
70
149
  }),
71
- n("div", {
72
- class: h(["of-detail-sheet", { "of-detail-sheet--full-page": s.fullPage }])
150
+ e("div", {
151
+ class: v(["of-detail-sheet", { "of-detail-sheet--full-page": n.fullPage }])
73
152
  }, [
74
- n("div", { class: "of-detail-sheet__header" }, [
75
- n("button", {
153
+ e("div", { class: "of-detail-sheet__header" }, [
154
+ e("button", {
76
155
  class: "of-detail-sheet__close",
77
- onClick: _
156
+ onClick: c
78
157
  }, "✕"),
79
- e[0] || (e[0] = n("h3", { class: "of-detail-sheet__title" }, "记录详情", -1)),
80
- e[1] || (e[1] = n("div", { class: "of-detail-sheet__header-spacer" }, null, -1))
158
+ l[0] || (l[0] = e("h3", { class: "of-detail-sheet__title" }, "记录详情", -1)),
159
+ l[1] || (l[1] = e("div", { class: "of-detail-sheet__header-spacer" }, null, -1))
81
160
  ]),
82
- n("div", {
83
- class: h(["of-detail-sheet__body", { "of-detail-sheet__body--full-page": s.fullPage }])
161
+ e("div", {
162
+ class: v(["of-detail-sheet__body", { "of-detail-sheet__body--full-page": n.fullPage }])
84
163
  }, [
85
- n("div", R, [
86
- (o(!0), d(b, null, C(F.value, (l) => {
164
+ e("div", q, [
165
+ (o(!0), a(y, null, k(D.value, (t) => {
87
166
  var f;
88
- return o(), d("div", {
89
- key: l.key,
167
+ return o(), a("div", {
168
+ key: t.key,
90
169
  class: "of-detail-sheet__field"
91
170
  }, [
92
- n("span", q, v(l.label), 1),
93
- n("div", A, [
94
- (f = s.fieldDefs) != null && f.length ? (o(), k(z, {
171
+ e("span", A, _(t.label), 1),
172
+ e("div", G, [
173
+ (f = n.fieldDefs) != null && f.length ? (o(), C(x, {
95
174
  key: 0,
96
- "row-id": s.row.id,
97
- field: x(l.key),
98
- value: c(l),
99
- readonly: s.readonly,
175
+ "row-id": n.row.id,
176
+ field: B(t.key),
177
+ value: u(t),
178
+ readonly: n.readonly,
100
179
  onCommit: M
101
- }, null, 8, ["row-id", "field", "value", "readonly"])) : (o(), d("span", G, v(c(l) ?? "—"), 1))
180
+ }, null, 8, ["row-id", "field", "value", "readonly"])) : (o(), a("span", I, _(u(t) ?? "—"), 1))
102
181
  ])
103
182
  ]);
104
183
  }), 128))
105
184
  ]),
106
- m.value.length > 0 ? (o(), d("div", I, [
107
- (o(!0), d(b, null, C(m.value, (l) => (o(), d("div", {
108
- key: l.key,
185
+ b.value.length > 0 ? (o(), a("div", J, [
186
+ (o(!0), a(y, null, k(b.value, (t) => (o(), a("div", {
187
+ key: t.key,
109
188
  class: "of-detail-sheet__content-block"
110
189
  }, [
111
- n("span", J, v(l.label), 1),
112
- n("div", {
190
+ e("span", Q, _(t.label), 1),
191
+ e("div", {
113
192
  class: "of-detail-sheet__markdown of-markdown",
114
- innerHTML: S(l)
115
- }, null, 8, Q)
193
+ innerHTML: F(t)
194
+ }, null, 8, U)
116
195
  ]))), 128))
117
- ])) : p("", !0)
196
+ ])) : m("", !0)
118
197
  ], 2),
119
- n("div", U, [
120
- n("button", {
198
+ e("div", W, [
199
+ e("button", {
121
200
  class: "of-detail-sheet__btn of-detail-sheet__btn--delete",
122
201
  onClick: T
123
202
  }, " 删除 "),
124
- e[2] || (e[2] = n("div", { class: "of-detail-sheet__footer-spacer" }, null, -1)),
125
- n("button", {
203
+ l[2] || (l[2] = e("div", { class: "of-detail-sheet__footer-spacer" }, null, -1)),
204
+ e("button", {
126
205
  class: "of-detail-sheet__btn of-detail-sheet__btn--cancel",
127
- onClick: _
206
+ onClick: c
128
207
  }, " 取消 "),
129
- n("button", {
208
+ e("button", {
130
209
  class: "of-detail-sheet__btn of-detail-sheet__btn--save",
131
- disabled: !D.value,
210
+ disabled: !g.value,
132
211
  onClick: P
133
- }, " 保存 ", 8, W)
212
+ }, " 保存 ", 8, X)
134
213
  ])
135
214
  ], 2)
136
- ], 2)) : p("", !0)
215
+ ], 2)) : m("", !0)
137
216
  ]),
138
217
  _: 1
139
218
  })
@@ -141,5 +220,5 @@ const R = { class: "of-detail-sheet__properties" }, q = { class: "of-detail-shee
141
220
  }
142
221
  });
143
222
  export {
144
- $ as default
223
+ fe as default
145
224
  };
@@ -1,4 +1,4 @@
1
- import { TableColumn, ColorMap } from '../../types';
1
+ import { TableColumn, ColorMap, Density } from '../../types';
2
2
  type TableRow = Record<string, unknown> & {
3
3
  id: string;
4
4
  };
@@ -8,6 +8,7 @@ type __VLS_Props = {
8
8
  selected?: boolean;
9
9
  selectable?: boolean;
10
10
  columns: TableColumn[];
11
+ density?: Density;
11
12
  /**
12
13
  * 优先级颜色映射,与内置默认映射合并(传入优先)
13
14
  */
@@ -36,6 +37,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
36
37
  onSelect?: ((id: string) => any) | undefined;
37
38
  onClick?: ((row: TableRow) => any) | undefined;
38
39
  }>, {
40
+ density: Density;
39
41
  selectable: boolean;
40
42
  rowKey: string;
41
43
  selected: boolean;
@@ -1,7 +1,7 @@
1
- import a from "./TableDataRow.vue2.js";
1
+ import o from "./TableDataRow.vue2.js";
2
2
  /* empty css */
3
- import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ o(a, [["__scopeId", "data-v-1b2affaf"]]);
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-4ecab060"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,24 +1,24 @@
1
- import { defineComponent as D, computed as p, openBlock as n, createElementBlock as r, normalizeClass as T, withModifiers as B, createElementVNode as u, createCommentVNode as A, Fragment as w, renderList as R, normalizeStyle as f, renderSlot as E, toDisplayString as a } from "vue";
2
- import { mergeColorMap as b, DEFAULT_PRIORITY_MAP as P, DEFAULT_STATUS_MAP as _, resolveBadge as h } from "../../composables/useBadge.js";
3
- const K = ["aria-selected"], N = ["for"], V = ["id", "checked"], F = {
1
+ import { defineComponent as B, computed as d, openBlock as o, createElementBlock as n, normalizeStyle as c, normalizeClass as Y, withModifiers as E, createElementVNode as g, createCommentVNode as R, Fragment as b, renderList as W, renderSlot as _, toDisplayString as r } from "vue";
2
+ import { mergeColorMap as v, DEFAULT_PRIORITY_MAP as H, DEFAULT_STATUS_MAP as N, resolveBadge as x } from "../../composables/useBadge.js";
3
+ const I = ["aria-selected"], K = ["for"], L = ["id", "checked"], U = {
4
4
  key: 0,
5
5
  class: "of-badge of-badge--role"
6
- }, I = {
6
+ }, V = {
7
7
  key: 1,
8
8
  class: "of-td-empty"
9
- }, L = {
9
+ }, X = {
10
10
  key: 3,
11
11
  class: "of-td-text"
12
- }, U = {
12
+ }, F = {
13
13
  key: 4,
14
14
  class: "of-td-id"
15
15
  }, z = {
16
16
  key: 5,
17
17
  class: "of-td-title"
18
- }, W = {
18
+ }, O = {
19
19
  key: 6,
20
20
  class: "of-td-text"
21
- }, Y = /* @__PURE__ */ D({
21
+ }, q = /* @__PURE__ */ B({
22
22
  __name: "TableDataRow",
23
23
  props: {
24
24
  row: {},
@@ -26,106 +26,133 @@ const K = ["aria-selected"], N = ["for"], V = ["id", "checked"], F = {
26
26
  selected: { type: Boolean, default: !1 },
27
27
  selectable: { type: Boolean, default: !0 },
28
28
  columns: {},
29
+ density: { default: "standard" },
29
30
  priorityColorMap: { default: void 0 },
30
31
  statusColorMap: { default: void 0 }
31
32
  },
32
33
  emits: ["select", "click"],
33
- setup(l, { emit: x }) {
34
- const i = l, c = x;
35
- function C(e) {
34
+ setup(i, { emit: M }) {
35
+ const s = i, y = M, C = {
36
+ compact: {
37
+ rowHeight: 36,
38
+ cellPaddingX: 10,
39
+ cellPaddingY: 6,
40
+ fillMinWidth: 180
41
+ },
42
+ standard: {
43
+ rowHeight: 44,
44
+ cellPaddingX: 12,
45
+ cellPaddingY: 8,
46
+ fillMinWidth: 220
47
+ },
48
+ comfortable: {
49
+ rowHeight: 52,
50
+ cellPaddingX: 14,
51
+ cellPaddingY: 10,
52
+ fillMinWidth: 240
53
+ }
54
+ }, u = d(() => C[s.density]), P = d(() => ({
55
+ minHeight: `${u.value.rowHeight}px`
56
+ })), k = d(() => ({
57
+ padding: `${u.value.cellPaddingY}px ${u.value.cellPaddingX}px`
58
+ }));
59
+ function S(e) {
60
+ const l = k.value;
36
61
  if (e.width === "fill") {
37
- const t = `${e.minWidth ?? 220}px`;
38
- return { flex: `1 1 ${t}`, minWidth: t };
62
+ const t = `${e.minWidth ?? u.value.fillMinWidth}px`;
63
+ return { ...l, flex: `1 1 ${t}`, minWidth: t };
39
64
  }
40
- return { width: `${e.width}px`, flexShrink: "0", flexGrow: "0" };
65
+ return { ...l, width: `${e.width}px`, flexShrink: "0", flexGrow: "0" };
41
66
  }
42
- const v = p(
43
- () => b(P, i.priorityColorMap)
44
- ), M = p(() => b(_, i.statusColorMap));
45
- function y(e) {
46
- return h(e, v.value);
67
+ const $ = d(
68
+ () => v(H, s.priorityColorMap)
69
+ ), D = d(() => v(N, s.statusColorMap));
70
+ function p(e) {
71
+ return x(e, $.value);
47
72
  }
48
- function k(e) {
49
- return h(e, M.value);
73
+ function m(e) {
74
+ return x(e, D.value);
50
75
  }
51
- function S(e) {
76
+ function T(e) {
52
77
  if (!e) return "-";
53
- const t = new Date(e);
54
- return isNaN(t.getTime()) ? e : `${t.getMonth() + 1}/${t.getDate()}`;
78
+ const l = new Date(e);
79
+ return isNaN(l.getTime()) ? e : `${l.getMonth() + 1}/${l.getDate()}`;
55
80
  }
56
- function g(e) {
57
- return i.row[e.key];
81
+ function w(e) {
82
+ return s.row[e.key];
58
83
  }
59
- function m(e) {
60
- const t = g(e);
61
- return t != null ? String(t) : "-";
84
+ function h(e) {
85
+ const l = w(e);
86
+ return l != null ? String(l) : "-";
62
87
  }
63
- function s(e) {
64
- const t = g(e);
65
- return typeof t == "string" ? t : "";
88
+ function a(e) {
89
+ const l = w(e);
90
+ return typeof l == "string" ? l : "";
66
91
  }
67
- function d() {
68
- const e = i.row[i.rowKey];
92
+ function f() {
93
+ const e = s.row[s.rowKey];
69
94
  return e != null ? String(e) : "";
70
95
  }
71
- function $(e) {
72
- e.target === e.currentTarget && (e.key !== "Enter" && e.key !== " " || (e.preventDefault(), c("click", i.row)));
96
+ function A(e) {
97
+ e.target === e.currentTarget && (e.key !== "Enter" && e.key !== " " || (e.preventDefault(), y("click", s.row)));
73
98
  }
74
- return (e, t) => (n(), r("div", {
75
- class: T(["of-table-row", { "of-table-row--selected": l.selected }]),
99
+ return (e, l) => (o(), n("div", {
100
+ class: Y(["of-table-row", { "of-table-row--selected": i.selected }]),
76
101
  role: "row",
77
102
  tabindex: "0",
78
- "aria-selected": l.selected || void 0,
79
- onClick: t[2] || (t[2] = (o) => c("click", l.row)),
80
- onKeydown: $
103
+ "aria-selected": i.selected || void 0,
104
+ style: c(P.value),
105
+ onClick: l[2] || (l[2] = (t) => y("click", i.row)),
106
+ onKeydown: A
81
107
  }, [
82
- l.selectable ? (n(), r("div", {
108
+ i.selectable ? (o(), n("div", {
83
109
  key: 0,
84
110
  class: "of-td of-td-checkbox",
85
111
  role: "gridcell",
86
- onClick: t[1] || (t[1] = B(() => {
112
+ style: c(k.value),
113
+ onClick: l[1] || (l[1] = E(() => {
87
114
  }, ["stop"]))
88
115
  }, [
89
- u("label", {
116
+ g("label", {
90
117
  class: "of-checkbox-label",
91
- for: `of-table-row-checkbox-${d()}`
118
+ for: `of-table-row-checkbox-${f()}`
92
119
  }, [
93
- u("input", {
94
- id: `of-table-row-checkbox-${d()}`,
120
+ g("input", {
121
+ id: `of-table-row-checkbox-${f()}`,
95
122
  type: "checkbox",
96
123
  class: "of-checkbox",
97
- checked: l.selected,
98
- onChange: t[0] || (t[0] = (o) => c("select", d()))
99
- }, null, 40, V),
100
- t[3] || (t[3] = u("span", { class: "of-sr-only" }, "选择当前行", -1))
101
- ], 8, N)
102
- ])) : A("", !0),
103
- (n(!0), r(w, null, R(l.columns, (o) => (n(), r("div", {
104
- key: o.key,
124
+ checked: i.selected,
125
+ onChange: l[0] || (l[0] = (t) => y("select", f()))
126
+ }, null, 40, L),
127
+ l[3] || (l[3] = g("span", { class: "of-sr-only" }, "选择当前行", -1))
128
+ ], 8, K)
129
+ ], 4)) : R("", !0),
130
+ (o(!0), n(b, null, W(i.columns, (t) => (o(), n("div", {
131
+ key: t.key,
105
132
  class: "of-td",
106
133
  role: "gridcell",
107
- style: f(C(o))
134
+ style: c(S(t))
108
135
  }, [
109
- E(e.$slots, "cell", {
110
- row: l.row,
111
- col: o
136
+ _(e.$slots, "cell", {
137
+ row: i.row,
138
+ col: t
112
139
  }, () => [
113
- o.key === "status" ? (n(), r("span", {
140
+ t.key === "status" ? (o(), n("span", {
114
141
  key: 0,
115
142
  class: "of-badge",
116
- style: f(k(s(o)).style)
117
- }, a(k(s(o)).label), 5)) : o.key === "priority" ? (n(), r("span", {
143
+ style: c(m(a(t)).style)
144
+ }, r(m(a(t)).label), 5)) : t.key === "priority" ? (o(), n("span", {
118
145
  key: 1,
119
146
  class: "of-badge",
120
- style: f(y(s(o)).style)
121
- }, a(y(s(o)).label), 5)) : o.key === "role" ? (n(), r(w, { key: 2 }, [
122
- s(o) ? (n(), r("span", F, a(s(o)), 1)) : (n(), r("span", I, "-"))
123
- ], 64)) : o.key === "updatedAt" ? (n(), r("span", L, a(S(s(o))), 1)) : o.key === "id" ? (n(), r("span", U, a(d()), 1)) : o.key === "title" ? (n(), r("span", z, a(m(o)), 1)) : (n(), r("span", W, a(m(o)), 1))
147
+ style: c(p(a(t)).style)
148
+ }, r(p(a(t)).label), 5)) : t.key === "role" ? (o(), n(b, { key: 2 }, [
149
+ a(t) ? (o(), n("span", U, r(a(t)), 1)) : (o(), n("span", V, "-"))
150
+ ], 64)) : t.key === "updatedAt" ? (o(), n("span", X, r(T(a(t))), 1)) : t.key === "id" ? (o(), n("span", F, r(f()), 1)) : t.key === "title" ? (o(), n("span", z, r(h(t)), 1)) : (o(), n("span", O, r(h(t)), 1))
124
151
  ], !0)
125
152
  ], 4))), 128))
126
- ], 42, K));
153
+ ], 46, I));
127
154
  }
128
155
  });
129
156
  export {
130
- Y as default
157
+ q as default
131
158
  };
@@ -1,4 +1,4 @@
1
- import { TableColumn } from '../../types';
1
+ import { Density, TableColumn } from '../../types';
2
2
  type __VLS_Props = {
3
3
  columns: TableColumn[];
4
4
  selectable?: boolean;
@@ -9,6 +9,7 @@ type __VLS_Props = {
9
9
  enableResize?: boolean;
10
10
  enableFieldMenu?: boolean;
11
11
  enableAddField?: boolean;
12
+ density?: Density;
12
13
  };
13
14
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
15
  sort: (key: string) => any;
@@ -27,6 +28,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
27
28
  "onHeader-dblclick"?: ((colKey: string) => any) | undefined;
28
29
  "onAdd-field"?: (() => any) | undefined;
29
30
  }>, {
31
+ density: Density;
30
32
  selectable: boolean;
31
33
  sortKey: string;
32
34
  sortOrder: "asc" | "desc";
@@ -1,7 +1,7 @@
1
1
  import o from "./TableHeaderRow.vue2.js";
2
2
  /* empty css */
3
- import e from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ e(o, [["__scopeId", "data-v-55ef62f3"]]);
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-9b7b027a"]]);
5
5
  export {
6
- f as default
6
+ m as default
7
7
  };