vlite3 1.5.1 → 1.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.
Files changed (35) hide show
  1. package/components/CategoryManager/CategoryManager.vue2.js +3 -3
  2. package/components/Chart/GanttChart.vue.d.ts +92 -2
  3. package/components/Chart/GanttChart.vue.js +2 -2
  4. package/components/Chart/GanttChart.vue2.js +1028 -878
  5. package/components/Chart/GanttChartDateUtils.js +28 -24
  6. package/components/Chart/index.d.ts +1 -1
  7. package/components/Chart/types.d.ts +88 -1
  8. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  9. package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
  10. package/components/DataTable/DataTable.vue.js +1 -1
  11. package/components/Form/{AccordionView.vue.js → AccordionView.vue2.js} +1 -1
  12. package/components/Form/index.vue2.js +1 -1
  13. package/components/Kanban/Kanban.vue.d.ts +6 -5
  14. package/components/Kanban/Kanban.vue.js +1 -1
  15. package/components/Kanban/Kanban.vue2.js +139 -118
  16. package/components/Kanban/groupKanbanData.d.ts +36 -0
  17. package/components/Kanban/groupKanbanData.js +72 -0
  18. package/components/Kanban/index.d.ts +1 -0
  19. package/components/Kanban/types.d.ts +17 -0
  20. package/components/NavbarCommandPalette.vue.js +1 -1
  21. package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +1 -1
  22. package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
  23. package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
  24. package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
  25. package/components/Screen/Screen.vue.js +80 -82
  26. package/components/Screen/ScreenFilter.vue.js +3 -3
  27. package/components/Screen/components/ScreenAddAction.vue.js +31 -31
  28. package/components/Screen/components/ScreenHeaderTitle.vue.js +1 -1
  29. package/components/Screen/components/ScreenToolbar.vue.d.ts +9 -0
  30. package/components/Screen/components/ScreenToolbar.vue.js +85 -52
  31. package/index.js +426 -421
  32. package/package.json +1 -1
  33. package/style.css +1 -1
  34. /package/components/RichTextEditor/{RichTextLinkPopover.vue2.js → RichTextLinkPopover.vue.js} +0 -0
  35. /package/components/RichTextEditor/{RichTextToolbar.vue2.js → RichTextToolbar.vue.js} +0 -0
@@ -1,8 +1,8 @@
1
- const s = /^(\d{4})-(\d{2})-(\d{2})$/, f = /^(\d{4})-(\d{2})-(\d{2})/;
1
+ const s = /^(\d{4})-(\d{2})-(\d{2})$/, i = /^(\d{4})-(\d{2})-(\d{2})/;
2
2
  function u(t) {
3
3
  return new Date(t.getFullYear(), t.getMonth(), t.getDate(), 0, 0, 0, 0);
4
4
  }
5
- function i(t) {
5
+ function y(t) {
6
6
  if (t instanceof Date)
7
7
  return Number.isNaN(t.getTime()) ? /* @__PURE__ */ new Date(NaN) : u(t);
8
8
  const e = String(t).trim();
@@ -18,7 +18,7 @@ function i(t) {
18
18
  0,
19
19
  0
20
20
  );
21
- const r = f.exec(e);
21
+ const r = i.exec(e);
22
22
  if (r && (e.includes("T") || e.includes(" ")))
23
23
  return new Date(
24
24
  Number(r[1]),
@@ -32,48 +32,52 @@ function i(t) {
32
32
  const a = new Date(e);
33
33
  return Number.isNaN(a.getTime()) ? a : u(a);
34
34
  }
35
- function o(t, e) {
35
+ function g(t, e) {
36
36
  const n = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
37
37
  return (Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()) - n) / 864e5;
38
38
  }
39
- function N(t, e) {
39
+ function T(t, e) {
40
40
  const n = u(t);
41
41
  return n.setDate(n.getDate() + e), n;
42
42
  }
43
- function l(t) {
43
+ function N(t) {
44
44
  const e = u(t), n = e.getDay();
45
45
  return e.setDate(e.getDate() - (n === 0 ? 6 : n - 1)), e;
46
46
  }
47
- function y(t) {
47
+ function l(t) {
48
48
  return new Date(t.getFullYear(), t.getMonth(), 1, 0, 0, 0, 0);
49
49
  }
50
- function w(t) {
50
+ function F(t) {
51
51
  const e = t.getFullYear(), n = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0");
52
52
  return `${e}-${n}-${r}`;
53
53
  }
54
- function T(t, e, n, r) {
54
+ function o(t, e, n, r) {
55
55
  if (n === "day")
56
- return o(e, t) * r;
56
+ return g(e, t) * r;
57
57
  if (n === "week")
58
- return o(e, t) / 7 * r;
59
- const a = e, g = (t.getFullYear() - a.getFullYear()) * 12 + (t.getMonth() - a.getMonth()), c = new Date(t.getFullYear(), t.getMonth() + 1, 0).getDate(), D = (t.getDate() - 1) / c;
60
- return (g + D) * r;
58
+ return g(e, t) / 7 * r;
59
+ const a = e, f = (t.getFullYear() - a.getFullYear()) * 12 + (t.getMonth() - a.getMonth()), D = new Date(t.getFullYear(), t.getMonth() + 1, 0).getDate(), c = (t.getDate() - 1) / D;
60
+ return (f + c) * r;
61
61
  }
62
- function F(t, e, n) {
62
+ function Y(t, e, n) {
63
63
  return e === "day" ? t / n : e === "week" ? t / n * 7 : t / n * 30.44;
64
64
  }
65
- function Y(t, e, n) {
65
+ function m(t, e, n) {
66
66
  return e === "day" ? t * n : e === "week" ? t / 7 * n : t / 30.44 * n;
67
67
  }
68
+ function w(t, e, n, r) {
69
+ return o(n === "day" ? u(t) : n === "week" ? N(t) : l(t), e, n, r);
70
+ }
68
71
  export {
69
- w as formatGanttLocalDate,
70
- N as ganttAddDays,
71
- o as ganttCalendarDaysBetween,
72
- T as ganttDateToX,
73
- Y as ganttDaysToPx,
74
- F as ganttPxToDays,
72
+ F as formatGanttLocalDate,
73
+ T as ganttAddDays,
74
+ g as ganttCalendarDaysBetween,
75
+ w as ganttColumnBoundaryX,
76
+ o as ganttDateToX,
77
+ m as ganttDaysToPx,
78
+ Y as ganttPxToDays,
75
79
  u as ganttStartOfLocalDay,
76
- y as ganttStartOfMonth,
77
- l as ganttStartOfWeek,
78
- i as parseGanttDate
80
+ l as ganttStartOfMonth,
81
+ N as ganttStartOfWeek,
82
+ y as parseGanttDate
79
83
  };
@@ -9,7 +9,7 @@ export { default as SegmentBarChart } from './SegmentBarChart.vue';
9
9
  export { default as StatCardChart } from './StatCardChart.vue';
10
10
  export { default as WaffleChart } from './WaffleChart.vue';
11
11
  export { default as GanttChart } from './GanttChart.vue';
12
- export type { ChartDataPoint, ChartDataset, ChartLegendsVariant, LegendPosition, LineChartProps, BarChartProps, PieChartProps, CircleChartProps, GaugeChartProps, GaugeVariant, GaugeZone, SpeedometerChartProps, SpeedometerVariant, TimelineChartProps, TimelineTask, SegmentBarChartProps, StatCardChartProps, StatCardItem, WaffleChartProps, GanttChartProps, GanttTask, GanttViewMode, GanttDependencyType, GanttTaskDependencyLink, GanttDependencyCreatePayload, GanttDependencyDeletePayload, } from './types';
12
+ export type { ChartDataPoint, ChartDataset, ChartLegendsVariant, LegendPosition, LineChartProps, BarChartProps, PieChartProps, CircleChartProps, GaugeChartProps, GaugeVariant, GaugeZone, SpeedometerChartProps, SpeedometerVariant, TimelineChartProps, TimelineTask, SegmentBarChartProps, StatCardChartProps, StatCardItem, WaffleChartProps, GanttChartProps, GanttTask, GanttPerson, GanttViewMode, GanttDependencyType, GanttTaskDependencyLink, GanttDependencyCreatePayload, GanttDependencyDeletePayload, GanttZoomState, } from './types';
13
13
  export { GANTT_DEPENDENCY_TYPE_LABELS } from './types';
14
14
  export { formatGanttLocalDate, parseGanttDate, ganttDateToX, ganttCalendarDaysBetween, } from './GanttChartDateUtils';
15
15
  export { default as ChartLegend } from './ChartLegend.vue';
@@ -386,6 +386,26 @@ export interface GanttTaskDependencyLink {
386
386
  /** Relationship from THIS task's perspective */
387
387
  type: GanttDependencyType;
388
388
  }
389
+ /**
390
+ * A person assigned to a Gantt task, shown in the tooltip. The shape maps onto
391
+ * both `AvatarGroup` (multiple assignees) and `Persona` (a single assignee):
392
+ * `name` → Persona `label` / AvatarGroup `heading`, `role` → Persona
393
+ * `secondaryLabel` / AvatarGroup `text`.
394
+ */
395
+ export interface GanttPerson {
396
+ /** Display name */
397
+ name?: string;
398
+ /** Avatar image URL */
399
+ src?: string;
400
+ /** Alt text for the avatar image */
401
+ alt?: string;
402
+ /** Initials/fallback shown when no image is available */
403
+ fallback?: string;
404
+ /** Secondary line (e.g. job title or role on the task) */
405
+ role?: string;
406
+ /** Presence indicator — only used when a single assignee renders as a Persona */
407
+ presence?: 'online' | 'offline' | 'busy' | 'dnd' | 'away';
408
+ }
389
409
  /** A single task (or milestone) on the Gantt chart */
390
410
  export interface GanttTask {
391
411
  /** Unique identifier for this task */
@@ -424,6 +444,11 @@ export interface GanttTask {
424
444
  blocked?: boolean;
425
445
  /** Short human-readable reason shown in the tooltip when `blocked` */
426
446
  blockedReason?: string;
447
+ /**
448
+ * People assigned to this task. Shown in the tooltip: a single assignee
449
+ * renders as a `Persona`, multiple render as an overlapping `AvatarGroup`.
450
+ */
451
+ assignees?: GanttPerson[];
427
452
  }
428
453
  export interface GanttChartProps {
429
454
  /** Array of task objects */
@@ -442,6 +467,8 @@ export interface GanttChartProps {
442
467
  sidebarWidth?: number;
443
468
  /** Show dashed vertical grid lines */
444
469
  showGrid?: boolean;
470
+ /** Gridline opacity 0–1 */
471
+ gridOpacity?: number;
445
472
  /** Enable hover tooltip */
446
473
  showTooltip?: boolean;
447
474
  /** Show task name labels inside bars when wide enough */
@@ -479,8 +506,68 @@ export interface GanttChartProps {
479
506
  * transactional guarantee.)
480
507
  */
481
508
  cascadeDependencies?: boolean;
482
- /** Show zoom controls and enable Ctrl/Meta + wheel zoom */
509
+ /**
510
+ * Enable Ctrl/Meta + wheel (and trackpad pinch) zoom. The chart renders no
511
+ * zoom buttons — drive zoom from the parent via the exposed methods
512
+ * (`zoomIn`, `zoomOut`, `setZoom`, `resetZoom`) and the `zoom-change` event.
513
+ */
483
514
  zoom?: boolean;
515
+ /** Lower bound for the zoom level (default 0.2) */
516
+ minZoom?: number;
517
+ /** Upper bound for the zoom level (default 5) */
518
+ maxZoom?: number;
519
+ /** Increment applied by `zoomIn` / `zoomOut` (default 0.2) */
520
+ zoomStep?: number;
521
+ /**
522
+ * Target number of period columns visible at once (days/weeks/months by
523
+ * view mode). Omit for a responsive count derived from the container width.
524
+ * Columns never shrink below `minColumnWidth`; the rest scrolls.
525
+ */
526
+ visiblePeriodCount?: number;
527
+ /**
528
+ * Minimum width in px per period column, preventing the full project range
529
+ * from being squeezed into the viewport. Per-view defaults: Day 44, Week 96,
530
+ * Month 130.
531
+ */
532
+ minColumnWidth?: number;
533
+ /** Force the timeline start date (aligned to the view's period boundary). */
534
+ timelineStart?: Date | string;
535
+ /** Force the timeline end date instead of deriving it from the last task. */
536
+ timelineEnd?: Date | string;
537
+ /**
538
+ * Extra empty periods after the last task's (completed) boundary period, as
539
+ * navigation padding (weeks in Day/Week view, months in Month view).
540
+ * Default 0.
541
+ */
542
+ rangePadding?: number;
543
+ /**
544
+ * Preserve the viewport's centre date when switching Day / Week / Month
545
+ * instead of jumping back to the project start. Default true.
546
+ */
547
+ preserveCenterDate?: boolean;
548
+ /**
549
+ * Show a collapse/expand control on the task sidebar so the timeline can be
550
+ * given more room. Default true.
551
+ */
552
+ collapsibleSidebar?: boolean;
553
+ /** Start with the sidebar collapsed. Default false. */
554
+ defaultSidebarCollapsed?: boolean;
555
+ }
556
+ /**
557
+ * Payload emitted by GanttChart `@zoom-change` on every zoom change (wheel or
558
+ * imperative). Use it to render accurate parent-owned zoom controls.
559
+ */
560
+ export interface GanttZoomState {
561
+ /** Current zoom level */
562
+ zoom: number;
563
+ /** `zoom < maxZoom` */
564
+ canZoomIn: boolean;
565
+ /** `zoom > minZoom` */
566
+ canZoomOut: boolean;
567
+ /** Configured `minZoom` */
568
+ min: number;
569
+ /** Configured `maxZoom` */
570
+ max: number;
484
571
  }
485
572
  /**
486
573
  * Payload emitted by GanttChart `@dependency-create`.
@@ -4,7 +4,7 @@ import k from "../Icon.vue.js";
4
4
  import { $t as E } from "../../utils/i18n.js";
5
5
  import { useCommandPaletteItems as Y } from "./useCommandPaletteItems.js";
6
6
  import { useCommandPaletteNav as Z } from "./useCommandPaletteNav.js";
7
- import ee from "./CommandPaletteItem.vue.js";
7
+ import ee from "./CommandPaletteItem.vue2.js";
8
8
  const te = { class: "command-palette-content flex flex-col w-full h-full max-h-[70vh]" }, oe = { class: "flex items-center gap-3 px-4 py-3 border-b border-border/80 shrink-0" }, se = ["placeholder"], ne = ["aria-label"], re = {
9
9
  key: 0,
10
10
  class: "flex flex-col items-center justify-center py-14 px-6 text-center select-none",
@@ -1,5 +1,5 @@
1
1
  import t from "./CommandPaletteItem.vue3.js";
2
- /* empty css */
2
+ /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const r = /* @__PURE__ */ o(t, [["__scopeId", "data-v-66b1ae06"]]);
5
5
  export {
@@ -240,7 +240,7 @@ const Qe = { class: "space-y-6.5" }, Ze = {
240
240
  a.class
241
241
  ].join(" ");
242
242
  }), Re = u(() => {
243
- const e = a.cellBordered ? "[&>thead>tr>th:not(:last-child)]:border-r [&>thead>tr>th]:border-border [&>tbody>tr>td:not(:last-child)]:border-r [&>tbody>tr>td]:border-border [&>tbody>tr>th:not(:last-child)]:border-r [&>tbody>tr>th]:border-border" : "";
243
+ const e = a.cellBordered ? "[&_thead_th]:border-border [&_tbody_td]:border-border [&_tbody_th]:border-border [&_thead_th:not(:last-child)]:border-r [&_tbody_td:not(:last-child)]:border-r [&_tbody_th:not(:last-child)]:border-r [&_tbody_tr:not(:last-child)>td]:border-b [&_tbody_tr:not(:last-child)>th]:border-b" : "";
244
244
  return [
245
245
  "w-full caption-bottom -text-fs-1",
246
246
  g.value ? "table-fixed" : "",
@@ -1,5 +1,5 @@
1
1
  import o from "./AccordionView.vue3.js";
2
- /* empty css */
2
+ /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const i = /* @__PURE__ */ r(o, [["__scopeId", "data-v-52660f5b"]]);
5
5
  export {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as g, computed as d, openBlock as n, createElementBlock as R, createElementVNode as x, createBlock as s, withCtx as k, createTextVNode as B, toDisplayString as I, createCommentVNode as y, unref as l } from "vue";
2
2
  import T from "./TableView.vue.js";
3
- import C from "./AccordionView.vue.js";
3
+ import C from "./AccordionView.vue2.js";
4
4
  import U from "../Label.vue.js";
5
5
  import z from "../Button.vue.js";
6
6
  import { useCustomFieldRows as N } from "./composables/useCustomFieldRows.js";
@@ -1,9 +1,9 @@
1
- import { KanbanChangeEvent, KanbanMoveEvent, KanbanProps } from './types';
1
+ import { KanbanChangeEvent, KanbanColumn, KanbanMoveEvent, KanbanProps } from './types';
2
2
  declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
5
  'column-header'?(_: {
6
- column: import('./types').KanbanColumn;
6
+ column: KanbanColumn;
7
7
  pageInfo: {
8
8
  currentPage: number;
9
9
  totalPages: number;
@@ -11,16 +11,16 @@ declare function __VLS_template(): {
11
11
  };
12
12
  }): any;
13
13
  'prepend-item'?(_: {
14
- column: import('./types').KanbanColumn;
14
+ column: KanbanColumn;
15
15
  items: any[];
16
16
  }): any;
17
17
  item?(_: {
18
18
  item: any;
19
- column: import('./types').KanbanColumn;
19
+ column: KanbanColumn;
20
20
  isDisabled: boolean;
21
21
  }): any;
22
22
  'append-item'?(_: {
23
- column: import('./types').KanbanColumn;
23
+ column: KanbanColumn;
24
24
  items: any[];
25
25
  }): any;
26
26
  };
@@ -58,6 +58,7 @@ declare const __VLS_component: import('vue').DefineComponent<KanbanProps, {}, {}
58
58
  itemKey: string;
59
59
  groupKey: string;
60
60
  positionKey: string;
61
+ includeOrphanColumns: boolean;
61
62
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
62
63
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
63
64
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import o from "./Kanban.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2dd0633e"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b1467651"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1,6 +1,7 @@
1
- import { defineComponent as G, ref as K, watch as U, openBlock as C, createElementBlock as P, normalizeClass as j, Fragment as q, renderList as w, createBlock as z, withCtx as v, renderSlot as g, mergeProps as h } from "vue";
2
- import F from "./KanbanBoard.vue.js";
3
- const T = /* @__PURE__ */ G({
1
+ import { defineComponent as G, ref as p, watch as S, openBlock as D, createElementBlock as B, normalizeClass as U, Fragment as V, renderList as q, createBlock as z, withCtx as g, renderSlot as C, mergeProps as h } from "vue";
2
+ import E from "./KanbanBoard.vue.js";
3
+ import { groupKanbanRawData as R } from "./groupKanbanData.js";
4
+ const Q = /* @__PURE__ */ G({
4
5
  __name: "Kanban",
5
6
  props: {
6
7
  columns: {},
@@ -11,6 +12,11 @@ const T = /* @__PURE__ */ G({
11
12
  rawData: {},
12
13
  groupKey: { default: "status" },
13
14
  positionKey: { default: "position" },
15
+ emptyColumnId: {},
16
+ unmappedColumnId: {},
17
+ includeOrphanColumns: { type: Boolean, default: !0 },
18
+ emptyColumnTitle: {},
19
+ unmappedColumnTitle: {},
14
20
  boardClass: {},
15
21
  headerClass: {},
16
22
  bodyClass: {},
@@ -21,108 +27,123 @@ const T = /* @__PURE__ */ G({
21
27
  onItemMoved: {}
22
28
  },
23
29
  emits: ["change", "move", "update:data", "item-move-failed"],
24
- setup(l, { emit: B }) {
25
- const s = l, c = B, u = K({}), d = K({}), p = K(!1);
26
- U(
27
- [() => s.data, () => s.rawData],
28
- ([e, a]) => {
29
- if (!p.value)
30
- if (a && Array.isArray(a)) {
31
- const o = {};
32
- s.columns.forEach((t) => o[t.id] = []), a.forEach((t) => {
33
- const i = t[s.groupKey];
34
- o[i] ? o[i].push({ ...t }) : o[i] = [{ ...t }];
35
- }), Object.keys(o).forEach((t) => {
36
- o[t].sort((i, r) => (i[s.positionKey] || 0) - (r[s.positionKey] || 0));
37
- }), d.value = o;
38
- } else e && (d.value = { ...e });
30
+ setup(i, { emit: T }) {
31
+ const t = i, c = T, r = p({}), d = p({}), f = p([]), y = p(!1), A = (e) => {
32
+ const o = R(
33
+ e,
34
+ t.columns,
35
+ t.groupKey,
36
+ t.positionKey,
37
+ {
38
+ emptyColumnId: t.emptyColumnId,
39
+ unmappedColumnId: t.unmappedColumnId,
40
+ includeOrphanColumns: t.includeOrphanColumns,
41
+ emptyColumnTitle: t.emptyColumnTitle,
42
+ unmappedColumnTitle: t.unmappedColumnTitle
43
+ }
44
+ );
45
+ d.value = o.grouped, f.value = o.columns;
46
+ };
47
+ S(
48
+ [
49
+ () => t.data,
50
+ () => t.rawData,
51
+ () => t.columns,
52
+ () => t.groupKey,
53
+ () => t.positionKey,
54
+ () => t.emptyColumnId,
55
+ () => t.unmappedColumnId,
56
+ () => t.includeOrphanColumns
57
+ ],
58
+ ([e, o]) => {
59
+ y.value || (o && Array.isArray(o) ? A(o) : e ? (d.value = { ...e }, f.value = [...t.columns || []]) : (d.value = {}, f.value = [...t.columns || []]));
39
60
  },
40
61
  { immediate: !0, deep: !0 }
41
62
  );
42
- const A = (e, a) => {
43
- let o = 0, t = 0;
44
- return a > 0 && (o = Number(e[a - 1]?.[s.positionKey]) || 0), a < e.length - 1 && (t = Number(e[a + 1]?.[s.positionKey]) || 0), o === 0 && t === 0 ? 1024 : o === 0 ? t / 2 : t === 0 ? o + 1024 : (o + t) / 2;
45
- }, E = (e) => {
46
- p.value = !0;
63
+ const O = (e, o) => {
64
+ let n = 0, a = 0;
65
+ return o > 0 && (n = Number(e[o - 1]?.[t.positionKey]) || 0), o < e.length - 1 && (a = Number(e[o + 1]?.[t.positionKey]) || 0), n === 0 && a === 0 ? 1024 : n === 0 ? a / 2 : a === 0 ? n + 1024 : (n + a) / 2;
66
+ }, $ = (e) => {
67
+ y.value = !0;
47
68
  try {
48
- const a = s.itemKey, o = { ...d.value }, t = [...o[e.toColumnId] || []];
49
- let i = t.find((n) => n?.[a] === e.itemId) || e.item;
50
- const r = t.findIndex((n) => n?.[a] === e.itemId);
51
- if (r >= 0)
52
- i = t.splice(r, 1)[0];
69
+ const o = t.itemKey, n = { ...d.value }, a = [...n[e.toColumnId] || []];
70
+ let u = a.find((l) => l?.[o] === e.itemId) || e.item;
71
+ const s = a.findIndex((l) => l?.[o] === e.itemId);
72
+ if (s >= 0)
73
+ u = a.splice(s, 1)[0];
53
74
  else if (e.fromColumnId === e.toColumnId) {
54
- const n = t.findIndex((m) => m?.[a] === e.itemId);
55
- n >= 0 && (i = t.splice(n, 1)[0]);
75
+ const l = a.findIndex((m) => m?.[o] === e.itemId);
76
+ l >= 0 && (u = a.splice(l, 1)[0]);
56
77
  }
57
- if (!i) return;
58
- if (i[s.positionKey] = e.previousPosition, i[s.groupKey] = e.previousGroupValue, e.fromColumnId === e.toColumnId) {
59
- const n = Math.min(Math.max(e.oldIndex, 0), t.length);
60
- t.splice(n, 0, i), o[e.toColumnId] = t;
78
+ if (!u) return;
79
+ if (u[t.positionKey] = e.previousPosition, u[t.groupKey] = e.previousGroupValue, e.fromColumnId === e.toColumnId) {
80
+ const l = Math.min(Math.max(e.oldIndex, 0), a.length);
81
+ a.splice(l, 0, u), n[e.toColumnId] = a;
61
82
  } else {
62
- o[e.toColumnId] = t;
63
- const n = [...o[e.fromColumnId] || []], m = n.findIndex((f) => f?.[a] === e.itemId);
64
- m >= 0 && n.splice(m, 1);
65
- const I = Math.min(Math.max(e.oldIndex, 0), n.length);
66
- n.splice(I, 0, i), o[e.fromColumnId] = n;
83
+ n[e.toColumnId] = a;
84
+ const l = [...n[e.fromColumnId] || []], m = l.findIndex((v) => v?.[o] === e.itemId);
85
+ m >= 0 && l.splice(m, 1);
86
+ const b = Math.min(Math.max(e.oldIndex, 0), l.length);
87
+ l.splice(b, 0, u), n[e.fromColumnId] = l;
67
88
  }
68
- d.value = o, s.data && c("update:data", { ...o });
89
+ d.value = n, t.data && c("update:data", { ...n });
69
90
  } finally {
70
91
  queueMicrotask(() => {
71
- p.value = !1;
92
+ y.value = !1;
72
93
  });
73
94
  }
74
- }, k = async (e, a, o, t) => {
75
- const i = d.value[e];
76
- if (!i) return;
77
- const r = i[a];
78
- if (!r) return;
79
- const n = r[s.itemKey], m = r[s.positionKey], I = r[s.groupKey], f = A(i, a);
80
- r[s.positionKey] = f, r[s.groupKey] = e;
81
- const y = () => E({
82
- itemId: n,
83
- item: r,
84
- fromColumnId: o,
95
+ }, k = async (e, o, n, a) => {
96
+ const u = d.value[e];
97
+ if (!u) return;
98
+ const s = u[o];
99
+ if (!s) return;
100
+ const l = s[t.itemKey], m = s[t.positionKey], b = s[t.groupKey], v = O(u, o);
101
+ s[t.positionKey] = v, s[t.groupKey] = e;
102
+ const K = () => $({
103
+ itemId: l,
104
+ item: s,
105
+ fromColumnId: n,
85
106
  toColumnId: e,
86
- oldIndex: t,
107
+ oldIndex: a,
87
108
  previousPosition: m,
88
- previousGroupValue: I
89
- }), V = {
90
- fromColumnId: o,
91
- oldIndex: t,
92
- newIndex: a,
109
+ previousGroupValue: b
110
+ }), F = {
111
+ fromColumnId: n,
112
+ oldIndex: a,
113
+ newIndex: o,
93
114
  previousPosition: m,
94
- revert: y
115
+ revert: K
95
116
  };
96
117
  c("move", {
97
- itemId: n,
98
- item: r,
99
- fromColumnId: o,
118
+ itemId: l,
119
+ item: s,
120
+ fromColumnId: n,
100
121
  toColumnId: e,
101
- oldIndex: t,
102
- newIndex: a
122
+ oldIndex: a,
123
+ newIndex: o
103
124
  });
104
- const D = s.onItemMoved;
105
- if (D)
125
+ const M = t.onItemMoved;
126
+ if (M)
106
127
  try {
107
- await D(n, e, f, r, V) === !1 && y();
108
- } catch (M) {
109
- y(), c("item-move-failed", {
110
- itemId: n,
128
+ await M(l, e, v, s, F) === !1 && K();
129
+ } catch (P) {
130
+ K(), c("item-move-failed", {
131
+ itemId: l,
111
132
  toColumnId: e,
112
- fromColumnId: o,
113
- newPosition: f,
114
- item: r,
115
- error: M
133
+ fromColumnId: n,
134
+ newPosition: v,
135
+ item: s,
136
+ error: P
116
137
  });
117
138
  }
118
- }, b = (e) => s.columns.find((a) => a.id === e)?.disabled === !0, $ = (e) => {
139
+ }, I = (e) => f.value.find((o) => o.id === e)?.disabled === !0, w = (e) => {
119
140
  if (c("change", e), e.type === "remove")
120
- u.value.remove = { columnId: e.columnId, event: e.event };
141
+ r.value.remove = { columnId: e.columnId, event: e.event };
121
142
  else if (e.type === "add")
122
- u.value.add = { columnId: e.columnId, event: e.event };
143
+ r.value.add = { columnId: e.columnId, event: e.event };
123
144
  else if (e.type === "update") {
124
- if (b(e.columnId)) {
125
- u.value = {};
145
+ if (I(e.columnId)) {
146
+ r.value = {};
126
147
  return;
127
148
  }
128
149
  k(
@@ -132,58 +153,58 @@ const T = /* @__PURE__ */ G({
132
153
  e.event.oldIndex
133
154
  );
134
155
  }
135
- if (u.value.remove && u.value.add) {
136
- const { remove: a, add: o } = u.value;
137
- if (b(a.columnId) || b(o.columnId)) {
138
- u.value = {};
156
+ if (r.value.remove && r.value.add) {
157
+ const { remove: o, add: n } = r.value;
158
+ if (I(o.columnId) || I(n.columnId)) {
159
+ r.value = {};
139
160
  return;
140
161
  }
141
162
  k(
163
+ n.columnId,
164
+ n.event.newIndex,
142
165
  o.columnId,
143
- o.event.newIndex,
144
- a.columnId,
145
- a.event.oldIndex
146
- ), u.value = {};
166
+ o.event.oldIndex
167
+ ), r.value = {};
147
168
  }
148
169
  setTimeout(() => {
149
- u.value = {};
170
+ r.value = {};
150
171
  }, 100);
151
- }, L = (e, a) => {
152
- d.value[e] = a, s.data && c("update:data", { ...s.data, [e]: a });
153
- }, N = (e) => d.value[e] || [];
154
- return (e, a) => (C(), P("div", {
155
- class: j([
172
+ }, L = (e, o) => {
173
+ d.value[e] = o, t.data && c("update:data", { ...t.data, [e]: o });
174
+ }, N = (e) => d.value[e] || d.value[String(e)] || [];
175
+ return (e, o) => (D(), B("div", {
176
+ class: U([
156
177
  "flex gap-4 scrollbar-thin overflow-x-auto p-1 scrollbar-thin-x scrollable-container",
157
- s.class
178
+ t.class
158
179
  ])
159
180
  }, [
160
- (C(!0), P(q, null, w(l.columns, (o) => (C(), z(F, {
161
- key: o.id,
162
- column: o,
163
- group: l.group,
164
- "item-key": l.itemKey,
165
- "load-data": l.loadData,
166
- "column-data": N(o.id),
167
- "board-class": l.boardClass,
168
- "header-class": l.headerClass,
169
- "body-class": l.bodyClass,
170
- "draggable-class": l.draggableClass,
171
- "ghost-class": l.ghostClass,
172
- "is-item-disabled": l.isItemDisabled,
173
- onChange: $,
174
- "onUpdate:columnData": (t) => L(o.id, t)
181
+ (D(!0), B(V, null, q(f.value, (n) => (D(), z(E, {
182
+ key: n.id,
183
+ column: n,
184
+ group: i.group,
185
+ "item-key": i.itemKey,
186
+ "load-data": i.loadData,
187
+ "column-data": N(n.id),
188
+ "board-class": i.boardClass,
189
+ "header-class": i.headerClass,
190
+ "body-class": i.bodyClass,
191
+ "draggable-class": i.draggableClass,
192
+ "ghost-class": i.ghostClass,
193
+ "is-item-disabled": i.isItemDisabled,
194
+ onChange: w,
195
+ "onUpdate:columnData": (a) => L(n.id, a)
175
196
  }, {
176
- header: v((t) => [
177
- g(e.$slots, "column-header", h({ ref_for: !0 }, t), void 0, !0)
197
+ header: g((a) => [
198
+ C(e.$slots, "column-header", h({ ref_for: !0 }, a), void 0, !0)
178
199
  ]),
179
- "prepend-item": v((t) => [
180
- g(e.$slots, "prepend-item", h({ ref_for: !0 }, t), void 0, !0)
200
+ "prepend-item": g((a) => [
201
+ C(e.$slots, "prepend-item", h({ ref_for: !0 }, a), void 0, !0)
181
202
  ]),
182
- item: v((t) => [
183
- g(e.$slots, "item", h({ ref_for: !0 }, t), void 0, !0)
203
+ item: g((a) => [
204
+ C(e.$slots, "item", h({ ref_for: !0 }, a), void 0, !0)
184
205
  ]),
185
- "append-item": v((t) => [
186
- g(e.$slots, "append-item", h({ ref_for: !0 }, t), void 0, !0)
206
+ "append-item": g((a) => [
207
+ C(e.$slots, "append-item", h({ ref_for: !0 }, a), void 0, !0)
187
208
  ]),
188
209
  _: 3
189
210
  }, 8, ["column", "group", "item-key", "load-data", "column-data", "board-class", "header-class", "body-class", "draggable-class", "ghost-class", "is-item-disabled", "onUpdate:columnData"]))), 128))
@@ -191,5 +212,5 @@ const T = /* @__PURE__ */ G({
191
212
  }
192
213
  });
193
214
  export {
194
- T as default
215
+ Q as default
195
216
  };