@oneflowui/ui 0.5.5 → 0.5.6
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.
- package/dist/components/table/DataTable.vue.d.ts +6 -0
- package/dist/components/table/DataTable.vue.js +4 -4
- package/dist/components/table/DataTable.vue2.js +193 -185
- package/dist/components/table/MobileListView.vue.d.ts +23 -1
- package/dist/components/table/MobileListView.vue.js +1 -1
- package/dist/components/table/MobileListView.vue2.js +48 -39
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,23 @@ type __VLS_Props = {
|
|
|
10
10
|
statusColorMap?: ColorMap;
|
|
11
11
|
readonly?: boolean;
|
|
12
12
|
};
|
|
13
|
-
declare
|
|
13
|
+
declare function __VLS_template(): {
|
|
14
|
+
attrs: Partial<{}>;
|
|
15
|
+
slots: {
|
|
16
|
+
cell?(_: {
|
|
17
|
+
row: TableRow;
|
|
18
|
+
col: TableColumn;
|
|
19
|
+
}): any;
|
|
20
|
+
cell?(_: {
|
|
21
|
+
row: TableRow;
|
|
22
|
+
col: TableColumn;
|
|
23
|
+
}): any;
|
|
24
|
+
};
|
|
25
|
+
refs: {};
|
|
26
|
+
rootEl: HTMLDivElement;
|
|
27
|
+
};
|
|
28
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
29
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
30
|
"row-click": (row: any) => any;
|
|
15
31
|
"add-row": () => any;
|
|
16
32
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
@@ -21,4 +37,10 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
21
37
|
addable: boolean;
|
|
22
38
|
readonly: boolean;
|
|
23
39
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
40
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
24
41
|
export default _default;
|
|
42
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
43
|
+
new (): {
|
|
44
|
+
$slots: S;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./MobileListView.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e312b60f"]]);
|
|
5
5
|
export {
|
|
6
6
|
f as default
|
|
7
7
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { mergeColorMap as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as E, computed as v, ref as k, openBlock as o, createElementBlock as a, Fragment as g, renderList as C, createElementVNode as X, normalizeStyle as M, renderSlot as S, createTextVNode as A, toDisplayString as d, createCommentVNode as i } from "vue";
|
|
2
|
+
import { mergeColorMap as L, DEFAULT_STATUS_MAP as N, resolveBadge as Y } from "../../composables/useBadge.js";
|
|
3
|
+
const D = { class: "of-mobile-list" }, F = ["onClick", "onTouchstart"], U = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "of-mobile-card__title"
|
|
6
|
-
},
|
|
6
|
+
}, z = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "of-mobile-card__meta"
|
|
9
|
-
},
|
|
9
|
+
}, I = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "of-mobile-card__tag"
|
|
12
|
-
},
|
|
12
|
+
}, O = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "of-mobile-card__action-delete"
|
|
15
|
-
},
|
|
15
|
+
}, j = /* @__PURE__ */ E({
|
|
16
16
|
__name: "MobileListView",
|
|
17
17
|
props: {
|
|
18
18
|
rows: {},
|
|
@@ -23,61 +23,70 @@ const $ = { class: "of-mobile-list" }, D = ["onClick", "onTouchstart"], F = {
|
|
|
23
23
|
readonly: { type: Boolean, default: !1 }
|
|
24
24
|
},
|
|
25
25
|
emits: ["row-click", "add-row"],
|
|
26
|
-
setup(r, { emit:
|
|
27
|
-
const m = r, y =
|
|
28
|
-
function u(
|
|
29
|
-
const e =
|
|
26
|
+
setup(r, { emit: T }) {
|
|
27
|
+
const m = r, y = T, B = v(() => L(N, m.statusColorMap)), f = v(() => m.columns[0]), h = v(() => m.columns.slice(1, 4));
|
|
28
|
+
function u(t, n) {
|
|
29
|
+
const e = t[n.key];
|
|
30
30
|
return e != null ? String(e) : "";
|
|
31
31
|
}
|
|
32
|
-
function p(
|
|
33
|
-
return Y(
|
|
32
|
+
function p(t) {
|
|
33
|
+
return Y(t, B.value);
|
|
34
34
|
}
|
|
35
|
-
let b = 0,
|
|
36
|
-
const c =
|
|
37
|
-
function
|
|
38
|
-
b =
|
|
35
|
+
let b = 0, _ = 0;
|
|
36
|
+
const c = k(null), s = k(0);
|
|
37
|
+
function V(t, n) {
|
|
38
|
+
b = t.touches[0].clientX, _ = t.touches[0].clientY, c.value = n, s.value = 0;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function $(t) {
|
|
41
41
|
if (!c.value) return;
|
|
42
|
-
const n =
|
|
42
|
+
const n = t.touches[0].clientX - b, e = t.touches[0].clientY - _;
|
|
43
43
|
if (Math.abs(e) > Math.abs(n)) {
|
|
44
44
|
c.value = null;
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
s.value = Math.max(-80, Math.min(0, n));
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function x() {
|
|
50
50
|
s.value < -40 ? s.value = -80 : (s.value = 0, c.value = null);
|
|
51
51
|
}
|
|
52
|
-
return (
|
|
53
|
-
(
|
|
52
|
+
return (t, n) => (o(), a("div", D, [
|
|
53
|
+
(o(!0), a(g, null, C(r.rows, (e) => (o(), a("div", {
|
|
54
54
|
key: e.id,
|
|
55
55
|
class: "of-mobile-card-wrapper"
|
|
56
56
|
}, [
|
|
57
57
|
X("div", {
|
|
58
58
|
class: "of-mobile-card",
|
|
59
59
|
style: M({ transform: c.value === e.id ? `translateX(${s.value}px)` : "" }),
|
|
60
|
-
onClick: (
|
|
61
|
-
onTouchstart: (
|
|
62
|
-
onTouchmove:
|
|
63
|
-
onTouchend:
|
|
60
|
+
onClick: (l) => y("row-click", e),
|
|
61
|
+
onTouchstart: (l) => V(l, e.id),
|
|
62
|
+
onTouchmove: $,
|
|
63
|
+
onTouchend: x
|
|
64
64
|
}, [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, [
|
|
70
|
-
|
|
65
|
+
f.value ? (o(), a("div", U, [
|
|
66
|
+
S(t.$slots, "cell", {
|
|
67
|
+
row: e,
|
|
68
|
+
col: f.value
|
|
69
|
+
}, () => [
|
|
70
|
+
A(d(u(e, f.value) || "—"), 1)
|
|
71
|
+
], !0)
|
|
72
|
+
])) : i("", !0),
|
|
73
|
+
h.value.length > 0 ? (o(), a("div", z, [
|
|
74
|
+
(o(!0), a(g, null, C(h.value, (l) => S(t.$slots, "cell", {
|
|
75
|
+
key: l.key,
|
|
76
|
+
row: e,
|
|
77
|
+
col: l
|
|
78
|
+
}, () => [
|
|
79
|
+
l.key === "status" && u(e, l) ? (o(), a("span", {
|
|
71
80
|
key: 0,
|
|
72
81
|
class: "of-mobile-card__badge",
|
|
73
|
-
style: M(p(u(e,
|
|
74
|
-
}, d(p(u(e,
|
|
75
|
-
],
|
|
82
|
+
style: M(p(u(e, l)).style)
|
|
83
|
+
}, d(p(u(e, l)).label), 5)) : u(e, l) ? (o(), a("span", I, d(l.label) + ": " + d(u(e, l)), 1)) : i("", !0)
|
|
84
|
+
], !0)), 128))
|
|
76
85
|
])) : i("", !0)
|
|
77
|
-
], 44,
|
|
78
|
-
c.value === e.id && s.value < -40 ? (
|
|
86
|
+
], 44, F),
|
|
87
|
+
c.value === e.id && s.value < -40 ? (o(), a("div", O, " 删除 ")) : i("", !0)
|
|
79
88
|
]))), 128)),
|
|
80
|
-
r.addable && !r.readonly ? (
|
|
89
|
+
r.addable && !r.readonly ? (o(), a("button", {
|
|
81
90
|
key: 0,
|
|
82
91
|
class: "of-mobile-add-btn",
|
|
83
92
|
onClick: n[0] || (n[0] = (e) => y("add-row"))
|
|
@@ -86,5 +95,5 @@ const $ = { class: "of-mobile-list" }, D = ["onClick", "onTouchstart"], F = {
|
|
|
86
95
|
}
|
|
87
96
|
});
|
|
88
97
|
export {
|
|
89
|
-
|
|
98
|
+
j as default
|
|
90
99
|
};
|