vlite3 0.2.6 → 0.2.8

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 (31) hide show
  1. package/components/Button.vue.js +42 -33
  2. package/components/Carousel/Carousel.vue.d.ts +14 -0
  3. package/components/ChoiceBox/ChoiceBox.vue.js +19 -19
  4. package/components/ColorPicker/ColorIro.vue.d.ts +18 -1
  5. package/components/ColorPicker/ColorIro.vue.js +59 -61
  6. package/components/ColorPicker/ColorPicker.vue.d.ts +2 -0
  7. package/components/ColorPicker/ColorPicker.vue.js +81 -26
  8. package/components/DataTable/DataTable.vue.js +2 -2
  9. package/components/DataTable/DataTable.vue2.js +18 -15
  10. package/components/DataTable/DataTableRow.vue.js +47 -44
  11. package/components/Kanban/Kanban.vue.d.ts +60 -0
  12. package/components/Kanban/Kanban.vue.js +7 -0
  13. package/components/Kanban/Kanban.vue2.js +62 -0
  14. package/components/Kanban/KanbanBoard.vue.d.ts +59 -0
  15. package/components/Kanban/KanbanBoard.vue.js +7 -0
  16. package/components/Kanban/KanbanBoard.vue2.js +132 -0
  17. package/components/Kanban/index.d.ts +4 -0
  18. package/components/Kanban/types.d.ts +32 -0
  19. package/components/Kanban/useKanbanBoard.d.ts +13 -0
  20. package/components/Kanban/useKanbanBoard.js +43 -0
  21. package/components/Tabes/Tabes.vue.js +10 -10
  22. package/components/Workbook/Sheet.vue.d.ts +6 -0
  23. package/components/Workbook/Sheet.vue.js +63 -55
  24. package/components/Workbook/Workbook.vue.d.ts +3 -2
  25. package/components/Workbook/Workbook.vue.js +152 -5
  26. package/components/Workbook/Workbook.vue2.js +2 -146
  27. package/components/Workbook/types.d.ts +3 -0
  28. package/index.d.ts +1 -1
  29. package/index.js +120 -114
  30. package/package.json +3 -3
  31. package/style.css +5 -1
@@ -1,7 +1,7 @@
1
1
  import o from "./DataTable.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-53f1fe21"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b5d3795b"]]);
5
5
  export {
6
- e as default
6
+ p as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as ee, ref as g, computed as b, watch as p, onMounted as te, openBlock as n, createElementBlock as i, createVNode as C, createSlots as V, withCtx as T, renderSlot as S, createBlock as D, createCommentVNode as I, createElementVNode as r, normalizeClass as B, Fragment as R, renderList as $, normalizeStyle as A, mergeProps as le, toDisplayString as M, createTextVNode as ae, unref as se } from "vue";
1
+ import { defineComponent as ee, ref as g, computed as b, watch as p, onMounted as te, openBlock as n, createElementBlock as i, createVNode as C, createSlots as j, withCtx as T, renderSlot as S, createBlock as D, createCommentVNode as I, createElementVNode as r, normalizeClass as B, Fragment as R, renderList as $, normalizeStyle as A, mergeProps as le, toDisplayString as M, createTextVNode as ae, unref as se } from "vue";
2
2
  import oe from "../Icon.vue.js";
3
3
  import ne from "../CheckBox.vue.js";
4
4
  import re from "../Button.vue.js";
@@ -19,7 +19,7 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ve
19
19
  }, be = { key: 2 }, ke = ["colspan"], Pe = { class: "flex flex-col items-center justify-center gap-2 text-muted-foreground p-8" }, xe = { class: "flex h-12 w-12 items-center justify-center rounded-full bg-muted" }, Ce = { class: "mt-1 text-base font-semibold text-foreground" }, Se = { class: "text-sm max-w-sm mx-auto" }, Ie = {
20
20
  key: 0,
21
21
  class: "mt-4"
22
- }, $e = { key: 0 }, Ve = /* @__PURE__ */ ee({
22
+ }, $e = { key: 0 }, je = /* @__PURE__ */ ee({
23
23
  __name: "DataTable",
24
24
  props: {
25
25
  rows: { default: () => [] },
@@ -51,7 +51,10 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ve
51
51
  },
52
52
  emits: ["change", "select", "rowClick", "update:itemsPerPage", "update:selectedRows", "delete"],
53
53
  setup(a, { emit: U }) {
54
- const O = (e, t) => t.split(".").reduce((s, c) => s?.[c], e), u = (e, t) => O(e, t), l = a, w = U, d = g({ field: "", order: "" }), k = g(l.itemsPerPage), h = g(l.pageInfo?.currentPage || 1), y = g(l.search || ""), P = g(!1), v = g("initial"), L = b(() => l.loading && (v.value === "initial" || v.value === "page"));
54
+ const O = (e, t) => {
55
+ if (!(!e || !t))
56
+ return t.includes(".") ? t.split(".").reduce((s, c) => s?.[c], e) : e[t];
57
+ }, u = (e, t) => O(e, t), l = a, w = U, d = g({ field: "", order: "" }), k = g(l.itemsPerPage), h = g(l.pageInfo?.currentPage || 1), y = g(l.search || ""), P = g(!1), v = g("initial"), L = b(() => l.loading && (v.value === "initial" || v.value === "page"));
55
58
  p(
56
59
  () => l.loading,
57
60
  (e, t) => {
@@ -79,7 +82,7 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ve
79
82
  e && (h.value = e);
80
83
  }
81
84
  );
82
- const j = (e) => u(e, l.keyField), o = g(/* @__PURE__ */ new Set());
85
+ const E = (e) => u(e, l.keyField), o = g(/* @__PURE__ */ new Set());
83
86
  p(
84
87
  () => l.selectedRows,
85
88
  (e) => {
@@ -88,14 +91,14 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ve
88
91
  },
89
92
  { immediate: !0, deep: !0 }
90
93
  );
91
- const z = b(() => l.rows.length === 0 ? !1 : l.rows.every((e) => o.value.has(u(e, l.keyField)))), E = b(() => o.value.size > 0 && !z.value), W = b(() => {
94
+ const z = b(() => l.rows.length === 0 ? !1 : l.rows.every((e) => o.value.has(u(e, l.keyField)))), N = b(() => o.value.size > 0 && !z.value), W = b(() => {
92
95
  const e = [...l.selectedRows || [], ...l.rows], t = /* @__PURE__ */ new Map();
93
96
  return e.forEach((s) => t.set(u(s, l.keyField), s)), Array.from(o.value).map((s) => t.get(s)).filter(Boolean);
94
97
  }), q = (e) => {
95
- e ? l.rows.forEach((t) => o.value.add(u(t, l.keyField))) : o.value.size > 0 && l.rows.forEach((t) => o.value.delete(u(t, l.keyField))), N();
98
+ e ? l.rows.forEach((t) => o.value.add(u(t, l.keyField))) : o.value.size > 0 && l.rows.forEach((t) => o.value.delete(u(t, l.keyField))), V();
96
99
  }, G = (e) => {
97
- o.value.has(e) ? o.value.delete(e) : o.value.add(e), N();
98
- }, N = () => {
100
+ o.value.has(e) ? o.value.delete(e) : o.value.add(e), V();
101
+ }, V = () => {
99
102
  const e = l.selectedRows || [], t = /* @__PURE__ */ new Set(), s = [];
100
103
  l.rows.forEach((m) => {
101
104
  const f = u(m, l.keyField);
@@ -107,7 +110,7 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ve
107
110
  const c = {
108
111
  selected: s,
109
112
  all: z.value,
110
- indeterminate: E.value
113
+ indeterminate: N.value
111
114
  };
112
115
  w("select", c), w("update:selectedRows", s);
113
116
  }, H = (e) => {
@@ -151,7 +154,7 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ve
151
154
  "onUpdate:modelValue": t[1] || (t[1] = (s) => y.value = s),
152
155
  "show-search": a.showSearch,
153
156
  placeholder: a.searchPlaceholder
154
- }, V({ _: 2 }, [
157
+ }, j({ _: 2 }, [
155
158
  e.$slots?.["toolbar-left"] ? {
156
159
  name: "left",
157
160
  fn: T(() => [
@@ -193,7 +196,7 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ve
193
196
  r("div", pe, [
194
197
  C(ne, {
195
198
  "model-value": z.value,
196
- indeterminate: E.value,
199
+ indeterminate: N.value,
197
200
  size: "xs",
198
201
  "onUpdate:modelValue": q
199
202
  }, null, 8, ["model-value", "indeterminate"])
@@ -235,20 +238,20 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ve
235
238
  }, null, 4)
236
239
  ], 2))), 128))
237
240
  ]))), 128)) : a.rows.length > 0 ? (n(!0), i(R, { key: 1 }, $(a.rows, (s, c) => (n(), D(ce, {
238
- key: j(s),
241
+ key: E(s),
239
242
  row: s,
240
243
  headers: a.headers,
241
244
  index: c,
242
245
  "key-field": a.keyField,
243
246
  selectable: a.selectable,
244
- "is-selected": o.value.has(j(s)),
247
+ "is-selected": o.value.has(E(s)),
245
248
  hoverable: a.hoverable,
246
249
  striped: a.striped,
247
250
  compact: a.compact,
248
251
  onSelect: G,
249
252
  onRowClick: Q,
250
253
  class: "[&_td:last-child]:pr-3.5!"
251
- }, V({ _: 2 }, [
254
+ }, j({ _: 2 }, [
252
255
  $(a.headers, (m) => ({
253
256
  name: m.field,
254
257
  fn: T((f) => [
@@ -312,5 +315,5 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ve
312
315
  }
313
316
  });
314
317
  export {
315
- Ve as default
318
+ je as default
316
319
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as p, computed as k, openBlock as c, createElementBlock as a, normalizeClass as u, withModifiers as v, createElementVNode as m, createVNode as h, createCommentVNode as N, Fragment as B, renderList as M, renderSlot as V } from "vue";
2
- import z from "../CheckBox.vue.js";
3
- const F = ["data-state"], L = { class: "flex items-center justify-center" }, U = ["title", "innerHTML"], T = /* @__PURE__ */ p({
1
+ import { defineComponent as k, computed as p, openBlock as c, createElementBlock as d, normalizeClass as u, withModifiers as v, createElementVNode as m, createVNode as N, createCommentVNode as B, Fragment as M, renderList as V, renderSlot as z } from "vue";
2
+ import F from "../CheckBox.vue.js";
3
+ const L = ["data-state"], U = { class: "flex items-center justify-center" }, h = ["title", "innerHTML"], T = /* @__PURE__ */ k({
4
4
  __name: "DataTableRow",
5
5
  props: {
6
6
  row: {},
@@ -14,27 +14,30 @@ const F = ["data-state"], L = { class: "flex items-center justify-center" }, U =
14
14
  compact: { type: Boolean, default: !1 }
15
15
  },
16
16
  emits: ["select", "rowClick"],
17
- setup(t, { emit: f }) {
18
- const s = t, d = f, r = (e, n) => n.split(".").reduce((i, l) => i?.[l], e), g = (e, n, i) => e.format ? e.format(n, i) : n == null ? "-" : e.type === "price" ? new Intl.NumberFormat("en-US", {
17
+ setup(i, { emit: f }) {
18
+ const r = i, a = f, o = (e, t) => {
19
+ if (!(!e || !t))
20
+ return t.includes(".") ? t.split(".").reduce((n, l) => n?.[l], e) : e[t];
21
+ }, g = (e, t, n) => e.format ? e.format(t, n) : t == null ? "-" : e.type === "price" ? new Intl.NumberFormat("en-US", {
19
22
  style: "currency",
20
23
  currency: "USD"
21
- }).format(Number(n)) : e.type === "date" ? new Date(n).toLocaleDateString("en-US", {
24
+ }).format(Number(t)) : e.type === "date" ? new Date(t).toLocaleDateString("en-US", {
22
25
  year: "numeric",
23
26
  month: "short",
24
27
  day: "numeric"
25
- }) : e.type === "number" ? new Intl.NumberFormat("en-US").format(Number(n)) : String(n), x = (e, n, i) => {
28
+ }) : e.type === "number" ? new Intl.NumberFormat("en-US").format(Number(t)) : String(t), x = (e, t, n) => {
26
29
  const l = [];
27
30
  if (e.capitalize && l.push("capitalize"), e.addStatusColor) {
28
- const o = w(n);
29
- o && l.push(o);
31
+ const s = w(t);
32
+ s && l.push(s);
30
33
  }
31
34
  if (typeof e.class == "function") {
32
- const o = e.class(n, i);
33
- o && l.push(o);
35
+ const s = e.class(t, n);
36
+ s && l.push(s);
34
37
  } else e.class && l.push(e.class);
35
38
  return l.join(" ");
36
39
  }, w = (e) => {
37
- const n = {
40
+ const t = {
38
41
  active: "text-success font-medium",
39
42
  inactive: "text-muted-foreground",
40
43
  pending: "text-warning font-medium",
@@ -48,65 +51,65 @@ const F = ["data-state"], L = { class: "flex items-center justify-center" }, U =
48
51
  high: "text-destructive font-medium",
49
52
  medium: "text-warning font-medium",
50
53
  low: "text-muted-foreground"
51
- }, i = String(e).toLowerCase().replace(/[-_\s]/g, "");
52
- return n[i] || "";
53
- }, b = (e) => ({
54
+ }, n = String(e).toLowerCase().replace(/[-_\s]/g, "");
55
+ return t[n] || "";
56
+ }, y = (e) => ({
54
57
  left: "text-left",
55
58
  center: "text-center",
56
59
  right: "text-right"
57
- })[e.align || "left"], y = k(() => r(s.row, s.keyField)), C = () => {
58
- d("rowClick", { row: s.row, index: s.index });
60
+ })[e.align || "left"], b = p(() => o(r.row, r.keyField)), C = () => {
61
+ a("rowClick", { row: r.row, index: r.index });
59
62
  }, S = () => {
60
- d("select", y.value);
63
+ a("select", b.value);
61
64
  };
62
- return (e, n) => (c(), a("tr", {
65
+ return (e, t) => (c(), d("tr", {
63
66
  class: u(["border-b border-border/70 transition-colors data-[state=selected]:bg-muted h-full", [
64
- t.hoverable ? "hover:bg-muted/50" : "",
65
- t.striped && t.index % 2 === 1 ? "bg-muted/20" : "bg-background",
66
- t.isSelected ? "bg-muted! hover:bg-muted/30" : "",
67
+ i.hoverable ? "hover:bg-muted/50" : "",
68
+ i.striped && i.index % 2 === 1 ? "bg-muted/20" : "bg-background",
69
+ i.isSelected ? "bg-muted! hover:bg-muted/30" : "",
67
70
  "group"
68
71
  ]]),
69
- "data-state": t.isSelected ? "selected" : void 0,
72
+ "data-state": i.isSelected ? "selected" : void 0,
70
73
  onClick: C
71
74
  }, [
72
- t.selectable ? (c(), a("td", {
75
+ i.selectable ? (c(), d("td", {
73
76
  key: 0,
74
77
  class: "w-[48px] px-0 py-3 align-middle text-center",
75
78
  style: { width: "48px" },
76
- onClick: n[0] || (n[0] = v(() => {
79
+ onClick: t[0] || (t[0] = v(() => {
77
80
  }, ["stop"]))
78
81
  }, [
79
- m("div", L, [
80
- h(z, {
81
- "model-value": t.isSelected,
82
+ m("div", U, [
83
+ N(F, {
84
+ "model-value": i.isSelected,
82
85
  size: "xs",
83
86
  "onUpdate:modelValue": S
84
87
  }, null, 8, ["model-value"])
85
88
  ])
86
- ])) : N("", !0),
87
- (c(!0), a(B, null, M(t.headers, (i) => (c(), a("td", {
88
- key: i.field,
89
+ ])) : B("", !0),
90
+ (c(!0), d(M, null, V(i.headers, (n) => (c(), d("td", {
91
+ key: n.field,
89
92
  class: u(["align-middle overflow-hidden", [
90
- t.compact ? "p-2 text-xs" : "py-3! px-3 text-sm",
91
- b(i),
92
- i.hideOnMobile ? "hidden md:table-cell" : "",
93
- x(i, r(t.row, i.field), t.row)
93
+ i.compact ? "p-2 text-xs" : "py-3! px-3 text-sm",
94
+ y(n),
95
+ n.hideOnMobile ? "hidden md:table-cell" : "",
96
+ x(n, o(i.row, n.field), i.row)
94
97
  ]])
95
98
  }, [
96
- V(e.$slots, i.field, {
97
- value: t.row,
98
- row: t.row,
99
- index: t.index,
100
- field: i.field
99
+ z(e.$slots, n.field, {
100
+ value: o(i.row, n.field),
101
+ row: i.row,
102
+ index: i.index,
103
+ field: n.field
101
104
  }, () => [
102
105
  m("span", {
103
106
  class: "truncate block",
104
- title: String(r(t.row, i.field)),
105
- innerHTML: g(i, r(t.row, i.field), t.row)
106
- }, null, 8, U)
107
+ title: String(o(i.row, n.field)),
108
+ innerHTML: g(n, o(i.row, n.field), i.row)
109
+ }, null, 8, h)
107
110
  ])
108
111
  ], 2))), 128))
109
- ], 10, F));
112
+ ], 10, L));
110
113
  }
111
114
  });
112
115
  export {
@@ -0,0 +1,60 @@
1
+ import { KanbanColumn, KanbanLoadDataResult, KanbanChangeEvent } from './types';
2
+ type __VLS_Props = {
3
+ columns: KanbanColumn[];
4
+ group?: string;
5
+ itemKey?: string;
6
+ loadData?: (columnId: string | number, page: number) => Promise<KanbanLoadDataResult>;
7
+ data?: Record<string | number, any[]>;
8
+ boardClass?: string;
9
+ headerClass?: string;
10
+ bodyClass?: string;
11
+ draggableClass?: string;
12
+ ghostClass?: string;
13
+ class?: string;
14
+ };
15
+ declare function __VLS_template(): {
16
+ attrs: Partial<{}>;
17
+ slots: {
18
+ 'column-header'?(_: {
19
+ column: KanbanColumn;
20
+ pageInfo: {
21
+ currentPage: number;
22
+ totalPages: number;
23
+ totalItems: number;
24
+ };
25
+ }): any;
26
+ 'prepend-item'?(_: {
27
+ column: KanbanColumn;
28
+ items: any[];
29
+ }): any;
30
+ item?(_: {
31
+ item: any;
32
+ column: KanbanColumn;
33
+ }): any;
34
+ 'append-item'?(_: {
35
+ column: KanbanColumn;
36
+ items: any[];
37
+ }): any;
38
+ };
39
+ refs: {};
40
+ rootEl: HTMLDivElement;
41
+ };
42
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
43
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
44
+ change: (payload: KanbanChangeEvent) => any;
45
+ "update:data": (val: Record<string | number, any[]>) => any;
46
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
47
+ onChange?: (payload: KanbanChangeEvent) => any;
48
+ "onUpdate:data"?: (val: Record<string | number, any[]>) => any;
49
+ }>, {
50
+ class: string;
51
+ group: string;
52
+ itemKey: string;
53
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
54
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
55
+ export default _default;
56
+ type __VLS_WithTemplateSlots<T, S> = T & {
57
+ new (): {
58
+ $slots: S;
59
+ };
60
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./Kanban.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-11bc76c9"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -0,0 +1,62 @@
1
+ import { defineComponent as b, openBlock as n, createElementBlock as m, normalizeClass as C, Fragment as p, renderList as y, createBlock as k, withCtx as o, renderSlot as d, mergeProps as r } from "vue";
2
+ import v from "./KanbanBoard.vue.js";
3
+ const K = /* @__PURE__ */ b({
4
+ __name: "Kanban",
5
+ props: {
6
+ columns: {},
7
+ group: { default: "kanban-group" },
8
+ itemKey: { default: "id" },
9
+ loadData: {},
10
+ data: {},
11
+ boardClass: {},
12
+ headerClass: {},
13
+ bodyClass: {},
14
+ draggableClass: {},
15
+ ghostClass: {},
16
+ class: { default: "h-full w-full" }
17
+ },
18
+ emits: ["change", "update:data"],
19
+ setup(a, { emit: i }) {
20
+ const s = a, u = i, g = (e) => {
21
+ u("change", e);
22
+ }, f = (e, c) => {
23
+ s.data && u("update:data", { ...s.data, [e]: c });
24
+ }, h = (e) => s.data ? s.data[e] || [] : [];
25
+ return (e, c) => (n(), m("div", {
26
+ class: C(["flex gap-4 overflow-x-auto p-1 custom-scrollbar-x", s.class])
27
+ }, [
28
+ (n(!0), m(p, null, y(a.columns, (l) => (n(), k(v, {
29
+ key: l.id,
30
+ column: l,
31
+ group: a.group,
32
+ "item-key": a.itemKey,
33
+ "load-data": a.loadData,
34
+ "column-data": h(l.id),
35
+ "board-class": a.boardClass,
36
+ "header-class": a.headerClass,
37
+ "body-class": a.bodyClass,
38
+ "draggable-class": a.draggableClass,
39
+ "ghost-class": a.ghostClass,
40
+ onChange: g,
41
+ "onUpdate:columnData": (t) => f(l.id, t)
42
+ }, {
43
+ header: o((t) => [
44
+ d(e.$slots, "column-header", r({ ref_for: !0 }, t), void 0, !0)
45
+ ]),
46
+ "prepend-item": o((t) => [
47
+ d(e.$slots, "prepend-item", r({ ref_for: !0 }, t), void 0, !0)
48
+ ]),
49
+ item: o((t) => [
50
+ d(e.$slots, "item", r({ ref_for: !0 }, t), void 0, !0)
51
+ ]),
52
+ "append-item": o((t) => [
53
+ d(e.$slots, "append-item", r({ ref_for: !0 }, t), void 0, !0)
54
+ ]),
55
+ _: 3
56
+ }, 8, ["column", "group", "item-key", "load-data", "column-data", "board-class", "header-class", "body-class", "draggable-class", "ghost-class", "onUpdate:columnData"]))), 128))
57
+ ], 2));
58
+ }
59
+ });
60
+ export {
61
+ K as default
62
+ };
@@ -0,0 +1,59 @@
1
+ import { KanbanColumn, KanbanLoadDataResult, KanbanChangeEvent } from './types';
2
+ type __VLS_Props = {
3
+ column: KanbanColumn;
4
+ group?: string;
5
+ itemKey?: string;
6
+ loadData?: (columnId: string | number, page: number) => Promise<KanbanLoadDataResult>;
7
+ columnData?: any[];
8
+ boardClass?: string;
9
+ headerClass?: string;
10
+ bodyClass?: string;
11
+ draggableClass?: string;
12
+ ghostClass?: string;
13
+ };
14
+ declare function __VLS_template(): {
15
+ attrs: Partial<{}>;
16
+ slots: {
17
+ header?(_: {
18
+ column: KanbanColumn;
19
+ pageInfo: {
20
+ currentPage: number;
21
+ totalPages: number;
22
+ totalItems: number;
23
+ };
24
+ }): any;
25
+ 'prepend-item'?(_: {
26
+ column: KanbanColumn;
27
+ items: any[];
28
+ }): any;
29
+ item?(_: {
30
+ item: any;
31
+ column: KanbanColumn;
32
+ }): any;
33
+ 'append-item'?(_: {
34
+ column: KanbanColumn;
35
+ items: any[];
36
+ }): any;
37
+ };
38
+ refs: {
39
+ scrollContainer: HTMLDivElement;
40
+ };
41
+ rootEl: HTMLDivElement;
42
+ };
43
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
44
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
45
+ change: (payload: KanbanChangeEvent) => any;
46
+ "update:columnData": (items: any[]) => any;
47
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
48
+ onChange?: (payload: KanbanChangeEvent) => any;
49
+ "onUpdate:columnData"?: (items: any[]) => any;
50
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
51
+ scrollContainer: HTMLDivElement;
52
+ }, HTMLDivElement>;
53
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
54
+ export default _default;
55
+ type __VLS_WithTemplateSlots<T, S> = T & {
56
+ new (): {
57
+ $slots: S;
58
+ };
59
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./KanbanBoard.vue2.js";
2
+ /* empty css */
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-d8186e60"]]);
5
+ export {
6
+ p as default
7
+ };
@@ -0,0 +1,132 @@
1
+ import { defineComponent as B, ref as K, watch as U, onMounted as j, openBlock as n, createElementBlock as s, normalizeClass as u, createElementVNode as r, renderSlot as m, unref as a, toDisplayString as g, createVNode as f, Fragment as b, withCtx as z, renderList as E, createCommentVNode as L } from "vue";
2
+ import { VueDraggable as M } from "vue-draggable-plus";
3
+ import p from "../Spinner/Spinner.vue.js";
4
+ import { useKanbanBoard as V } from "./useKanbanBoard.js";
5
+ const F = { class: "flex items-center justify-between font-semibold text-foreground" }, H = { class: "text-xs bg-muted text-muted-foreground px-2 py-0.5 rounded-full font-medium" }, J = {
6
+ key: 0,
7
+ class: "flex-1 flex items-center justify-center min-h-[100px]"
8
+ }, O = { class: "bg-card p-3 rounded-md shadow-sm border border-border text-sm" }, A = {
9
+ key: 0,
10
+ class: "py-4 flex justify-center shrink-0"
11
+ }, P = /* @__PURE__ */ B({
12
+ __name: "KanbanBoard",
13
+ props: {
14
+ column: {},
15
+ group: {},
16
+ itemKey: {},
17
+ loadData: { type: Function },
18
+ columnData: {},
19
+ boardClass: {},
20
+ headerClass: {},
21
+ bodyClass: {},
22
+ draggableClass: {},
23
+ ghostClass: {}
24
+ },
25
+ emits: ["change", "update:columnData"],
26
+ setup(o, { emit: v }) {
27
+ const t = o, c = v, y = K(null), { items: l, isInitialLoading: x, isLoadingMore: C, pageInfo: h, loadInitial: D, loadMore: k } = V(
28
+ t.column.id,
29
+ t.loadData,
30
+ t.columnData
31
+ ), I = (e) => {
32
+ l.value = e, c("update:columnData", e);
33
+ };
34
+ U(
35
+ () => t.columnData,
36
+ (e) => {
37
+ e && JSON.stringify(e) !== JSON.stringify(l.value) && (l.value = [...e]);
38
+ },
39
+ { deep: !0 }
40
+ ), j(() => {
41
+ t.loadData && (!t.columnData || t.columnData.length === 0) && D();
42
+ });
43
+ const S = (e) => {
44
+ const i = e.target;
45
+ i.scrollTop + i.clientHeight >= i.scrollHeight - 50 && k();
46
+ }, N = (e) => {
47
+ c("change", { type: "add", event: e, columnId: t.column.id });
48
+ }, $ = (e) => {
49
+ c("change", { type: "remove", event: e, columnId: t.column.id });
50
+ }, w = (e) => {
51
+ c("change", { type: "update", event: e, columnId: t.column.id });
52
+ };
53
+ return (e, i) => (n(), s("div", {
54
+ class: u([
55
+ "flex flex-col bg-muted/40 rounded-lg overflow-hidden shrink-0 border border-border/50",
56
+ o.boardClass || "w-80"
57
+ ])
58
+ }, [
59
+ r("div", {
60
+ class: u(["p-3 border-b border-border/50 bg-background/50", o.headerClass])
61
+ }, [
62
+ m(e.$slots, "header", {
63
+ column: o.column,
64
+ pageInfo: a(h)
65
+ }, () => [
66
+ r("div", F, [
67
+ r("span", null, g(o.column.title), 1),
68
+ r("span", H, g(a(h).totalItems), 1)
69
+ ])
70
+ ], !0)
71
+ ], 2),
72
+ r("div", {
73
+ ref_key: "scrollContainer",
74
+ ref: y,
75
+ class: u(["flex-1 flex flex-col overflow-y-auto p-3 custom-scrollbar", o.bodyClass]),
76
+ onScroll: S
77
+ }, [
78
+ a(x) && a(l).length === 0 ? (n(), s("div", J, [
79
+ f(p, {
80
+ size: "md",
81
+ color: "primary"
82
+ })
83
+ ])) : (n(), s(b, { key: 1 }, [
84
+ m(e.$slots, "prepend-item", {
85
+ column: o.column,
86
+ items: a(l)
87
+ }, void 0, !0),
88
+ f(a(M), {
89
+ "model-value": a(l),
90
+ "onUpdate:modelValue": I,
91
+ group: o.group,
92
+ animation: 150,
93
+ ghostClass: o.ghostClass || "kanban-ghost",
94
+ class: u(["flex-1 flex flex-col gap-3 min-h-[50px] py-1", o.draggableClass]),
95
+ onAdd: N,
96
+ onRemove: $,
97
+ onUpdate: w
98
+ }, {
99
+ default: z(() => [
100
+ (n(!0), s(b, null, E(a(l), (d) => (n(), s("div", {
101
+ key: d[o.itemKey || "id"],
102
+ class: "cursor-grab active:cursor-grabbing"
103
+ }, [
104
+ m(e.$slots, "item", {
105
+ item: d,
106
+ column: o.column
107
+ }, () => [
108
+ r("div", O, g(d.title || d.name || d.id), 1)
109
+ ], !0)
110
+ ]))), 128))
111
+ ]),
112
+ _: 3
113
+ }, 8, ["model-value", "group", "ghostClass", "class"]),
114
+ m(e.$slots, "append-item", {
115
+ column: o.column,
116
+ items: a(l)
117
+ }, void 0, !0),
118
+ a(C) ? (n(), s("div", A, [
119
+ f(p, {
120
+ size: "sm",
121
+ variant: "dots",
122
+ color: "primary"
123
+ })
124
+ ])) : L("", !0)
125
+ ], 64))
126
+ ], 34)
127
+ ], 2));
128
+ }
129
+ });
130
+ export {
131
+ P as default
132
+ };
@@ -0,0 +1,4 @@
1
+ export { default as Kanban } from './Kanban.vue';
2
+ export { default as KanbanBoard } from './KanbanBoard.vue';
3
+ export * from './types';
4
+ export * from './useKanbanBoard';
@@ -0,0 +1,32 @@
1
+ export interface KanbanPageInfo {
2
+ currentPage: number;
3
+ totalPages: number;
4
+ totalItems: number;
5
+ }
6
+ export interface KanbanLoadDataResult<T = any> {
7
+ items: T[];
8
+ pageInfo: KanbanPageInfo;
9
+ }
10
+ export interface KanbanColumn {
11
+ id: string | number;
12
+ title: string;
13
+ [key: string]: any;
14
+ }
15
+ export interface KanbanChangeEvent {
16
+ type: 'add' | 'remove' | 'update';
17
+ event: any;
18
+ columnId: string | number;
19
+ }
20
+ export interface KanbanProps {
21
+ columns: KanbanColumn[];
22
+ group?: string;
23
+ itemKey?: string;
24
+ loadData?: (columnId: string | number, page: number) => Promise<KanbanLoadDataResult>;
25
+ data?: Record<string | number, any[]>;
26
+ boardClass?: string;
27
+ headerClass?: string;
28
+ bodyClass?: string;
29
+ draggableClass?: string;
30
+ ghostClass?: string;
31
+ class?: string;
32
+ }
@@ -0,0 +1,13 @@
1
+ import { KanbanLoadDataResult } from './types';
2
+ export declare function useKanbanBoard(columnId: string | number, loadDataFn?: (columnId: string | number, page: number) => Promise<KanbanLoadDataResult>, initialData?: any[]): {
3
+ items: import('vue').Ref<any[], any[]>;
4
+ isInitialLoading: import('vue').Ref<boolean, boolean>;
5
+ isLoadingMore: import('vue').Ref<boolean, boolean>;
6
+ pageInfo: {
7
+ currentPage: number;
8
+ totalPages: number;
9
+ totalItems: number;
10
+ };
11
+ loadInitial: () => Promise<void>;
12
+ loadMore: () => Promise<void>;
13
+ };