@expcat/tigercat-core 0.3.70 → 0.4.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.
- package/dist/index.cjs +413 -8
- package/dist/index.d.cts +494 -7
- package/dist/index.d.ts +494 -7
- package/dist/index.js +362 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -673,7 +673,8 @@ function mergeTigerLocale(base, override) {
|
|
|
673
673
|
drawer: { ...base?.drawer, ...override?.drawer },
|
|
674
674
|
upload: { ...base?.upload, ...override?.upload },
|
|
675
675
|
pagination: { ...base?.pagination, ...override?.pagination },
|
|
676
|
-
formWizard: { ...base?.formWizard, ...override?.formWizard }
|
|
676
|
+
formWizard: { ...base?.formWizard, ...override?.formWizard },
|
|
677
|
+
taskBoard: { ...base?.taskBoard, ...override?.taskBoard }
|
|
677
678
|
};
|
|
678
679
|
}
|
|
679
680
|
var DEFAULT_PAGINATION_LABELS = {
|
|
@@ -728,6 +729,29 @@ function formatPaginationTotal(template, total, range) {
|
|
|
728
729
|
function formatPageAriaLabel(template, page) {
|
|
729
730
|
return template.replace("{page}", String(page));
|
|
730
731
|
}
|
|
732
|
+
var DEFAULT_TASK_BOARD_LABELS = {
|
|
733
|
+
emptyColumnText: "No tasks",
|
|
734
|
+
addCardText: "Add task",
|
|
735
|
+
wipLimitText: "WIP limit: {limit}",
|
|
736
|
+
dragHintText: "Drag to move",
|
|
737
|
+
boardAriaLabel: "Task Board"
|
|
738
|
+
};
|
|
739
|
+
var ZH_CN_TASK_BOARD_LABELS = {
|
|
740
|
+
emptyColumnText: "\u6682\u65E0\u4EFB\u52A1",
|
|
741
|
+
addCardText: "\u6DFB\u52A0\u4EFB\u52A1",
|
|
742
|
+
wipLimitText: "WIP \u9650\u5236: {limit}",
|
|
743
|
+
dragHintText: "\u62D6\u62FD\u4EE5\u79FB\u52A8",
|
|
744
|
+
boardAriaLabel: "\u4EFB\u52A1\u770B\u677F"
|
|
745
|
+
};
|
|
746
|
+
function getTaskBoardLabels(locale) {
|
|
747
|
+
return {
|
|
748
|
+
emptyColumnText: locale?.taskBoard?.emptyColumnText ?? DEFAULT_TASK_BOARD_LABELS.emptyColumnText,
|
|
749
|
+
addCardText: locale?.taskBoard?.addCardText ?? DEFAULT_TASK_BOARD_LABELS.addCardText,
|
|
750
|
+
wipLimitText: locale?.taskBoard?.wipLimitText ?? DEFAULT_TASK_BOARD_LABELS.wipLimitText,
|
|
751
|
+
dragHintText: locale?.taskBoard?.dragHintText ?? DEFAULT_TASK_BOARD_LABELS.dragHintText,
|
|
752
|
+
boardAriaLabel: locale?.taskBoard?.boardAriaLabel ?? DEFAULT_TASK_BOARD_LABELS.boardAriaLabel
|
|
753
|
+
};
|
|
754
|
+
}
|
|
731
755
|
|
|
732
756
|
// src/utils/datepicker-i18n.ts
|
|
733
757
|
function getDatePickerLabels(locale, overrides) {
|
|
@@ -1086,6 +1110,106 @@ function parseInputValue(target, type) {
|
|
|
1086
1110
|
return target.value;
|
|
1087
1111
|
}
|
|
1088
1112
|
|
|
1113
|
+
// src/utils/input-number-utils.ts
|
|
1114
|
+
function getInputNumberWrapperClasses(disabled) {
|
|
1115
|
+
return classNames(
|
|
1116
|
+
"inline-flex items-center relative w-full",
|
|
1117
|
+
"border rounded-md shadow-sm",
|
|
1118
|
+
"bg-[var(--tiger-surface,#ffffff)]",
|
|
1119
|
+
"transition-colors",
|
|
1120
|
+
disabled ? "bg-[var(--tiger-surface-muted,#f3f4f6)] cursor-not-allowed opacity-60" : "hover:border-[var(--tiger-primary,#2563eb)]"
|
|
1121
|
+
);
|
|
1122
|
+
}
|
|
1123
|
+
var WRAPPER_STATUS_CLASSES = {
|
|
1124
|
+
default: "border-[var(--tiger-border,#e5e7eb)]",
|
|
1125
|
+
error: "border-red-500",
|
|
1126
|
+
success: "border-green-500",
|
|
1127
|
+
warning: "border-yellow-500"
|
|
1128
|
+
};
|
|
1129
|
+
var WRAPPER_FOCUS_STATUS_CLASSES = {
|
|
1130
|
+
default: "ring-[var(--tiger-primary,#2563eb)]",
|
|
1131
|
+
error: "ring-red-500",
|
|
1132
|
+
success: "ring-green-500",
|
|
1133
|
+
warning: "ring-yellow-500"
|
|
1134
|
+
};
|
|
1135
|
+
function getInputNumberStatusClasses(status = "default") {
|
|
1136
|
+
return WRAPPER_STATUS_CLASSES[status];
|
|
1137
|
+
}
|
|
1138
|
+
function getInputNumberFocusRingColor(status = "default") {
|
|
1139
|
+
return WRAPPER_FOCUS_STATUS_CLASSES[status];
|
|
1140
|
+
}
|
|
1141
|
+
var WRAPPER_SIZE_CLASSES = {
|
|
1142
|
+
sm: "h-8",
|
|
1143
|
+
md: "h-10",
|
|
1144
|
+
lg: "h-12"
|
|
1145
|
+
};
|
|
1146
|
+
function getInputNumberSizeClasses(size = "md") {
|
|
1147
|
+
return WRAPPER_SIZE_CLASSES[size];
|
|
1148
|
+
}
|
|
1149
|
+
var INPUT_SIZE_CLASSES2 = {
|
|
1150
|
+
sm: "text-sm px-2",
|
|
1151
|
+
md: "text-base px-3",
|
|
1152
|
+
lg: "text-lg px-4"
|
|
1153
|
+
};
|
|
1154
|
+
function getInputNumberInputClasses(size = "md", hasControlsRight, hasControlsBoth) {
|
|
1155
|
+
return classNames(
|
|
1156
|
+
"w-full h-full bg-transparent border-0 outline-none",
|
|
1157
|
+
"text-[var(--tiger-text,#111827)]",
|
|
1158
|
+
"placeholder:text-[var(--tiger-text-muted,#6b7280)]",
|
|
1159
|
+
"disabled:text-[var(--tiger-text-muted,#6b7280)] disabled:cursor-not-allowed",
|
|
1160
|
+
"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
|
|
1161
|
+
INPUT_SIZE_CLASSES2[size],
|
|
1162
|
+
hasControlsRight && "pr-8",
|
|
1163
|
+
hasControlsBoth && "px-8 text-center"
|
|
1164
|
+
);
|
|
1165
|
+
}
|
|
1166
|
+
function getInputNumberStepButtonClasses(position, disabled) {
|
|
1167
|
+
return classNames(
|
|
1168
|
+
"flex items-center justify-center",
|
|
1169
|
+
"w-7 h-1/2",
|
|
1170
|
+
"border-l border-[var(--tiger-border,#e5e7eb)]",
|
|
1171
|
+
"text-[var(--tiger-text-muted,#6b7280)]",
|
|
1172
|
+
"transition-colors cursor-pointer select-none",
|
|
1173
|
+
position === "up" ? "border-b border-b-[var(--tiger-border,#e5e7eb)]" : "",
|
|
1174
|
+
disabled ? "opacity-40 cursor-not-allowed" : "hover:text-[var(--tiger-primary,#2563eb)] hover:bg-[var(--tiger-surface-muted,#f9fafb)]"
|
|
1175
|
+
);
|
|
1176
|
+
}
|
|
1177
|
+
function getInputNumberSideButtonClasses(position, disabled) {
|
|
1178
|
+
return classNames(
|
|
1179
|
+
"flex items-center justify-center",
|
|
1180
|
+
"w-8 h-full",
|
|
1181
|
+
"text-[var(--tiger-text-muted,#6b7280)]",
|
|
1182
|
+
"transition-colors cursor-pointer select-none",
|
|
1183
|
+
position === "left" ? "border-r border-r-[var(--tiger-border,#e5e7eb)] rounded-l-md" : "border-l border-l-[var(--tiger-border,#e5e7eb)] rounded-r-md",
|
|
1184
|
+
disabled ? "opacity-40 cursor-not-allowed" : "hover:text-[var(--tiger-primary,#2563eb)] hover:bg-[var(--tiger-surface-muted,#f9fafb)]"
|
|
1185
|
+
);
|
|
1186
|
+
}
|
|
1187
|
+
var inputNumberControlsRightClasses = "absolute right-0 top-0 h-full flex flex-col";
|
|
1188
|
+
var inputNumberUpIconPathD = "M7 10l5-5 5 5H7z";
|
|
1189
|
+
var inputNumberDownIconPathD = "M7 7l5 5 5-5H7z";
|
|
1190
|
+
var inputNumberMinusIconPathD = "M5 12h14";
|
|
1191
|
+
var inputNumberPlusIconPathD = "M12 5v14M5 12h14";
|
|
1192
|
+
function clampValue(value, min = -Infinity, max = Infinity) {
|
|
1193
|
+
return Math.min(Math.max(value, min), max);
|
|
1194
|
+
}
|
|
1195
|
+
function stepValue(current, step, direction, min = -Infinity, max = Infinity, precision) {
|
|
1196
|
+
const base = current ?? 0;
|
|
1197
|
+
const raw = direction === "up" ? base + step : base - step;
|
|
1198
|
+
const clamped = clampValue(raw, min, max);
|
|
1199
|
+
return precision !== void 0 ? formatPrecision(clamped, precision) : clamped;
|
|
1200
|
+
}
|
|
1201
|
+
function formatPrecision(value, precision) {
|
|
1202
|
+
return Number(value.toFixed(precision));
|
|
1203
|
+
}
|
|
1204
|
+
function isAtMin(value, min = -Infinity) {
|
|
1205
|
+
if (value === null || value === void 0) return false;
|
|
1206
|
+
return value <= min;
|
|
1207
|
+
}
|
|
1208
|
+
function isAtMax(value, max = Infinity) {
|
|
1209
|
+
if (value === null || value === void 0) return false;
|
|
1210
|
+
return value >= max;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1089
1213
|
// src/utils/form-item-styles.ts
|
|
1090
1214
|
var FORM_ITEM_SPACING = {
|
|
1091
1215
|
sm: "mb-3 last:mb-0",
|
|
@@ -1861,7 +1985,7 @@ function isValidTimeValue(value, min, max) {
|
|
|
1861
1985
|
function validateStep(step) {
|
|
1862
1986
|
return Math.max(1, Math.floor(step));
|
|
1863
1987
|
}
|
|
1864
|
-
function
|
|
1988
|
+
function clampValue2(value, min, max) {
|
|
1865
1989
|
return Math.max(min, Math.min(max, value));
|
|
1866
1990
|
}
|
|
1867
1991
|
function parseTime(timeString) {
|
|
@@ -1877,9 +2001,9 @@ function parseTime(timeString) {
|
|
|
1877
2001
|
return { hours, minutes, seconds };
|
|
1878
2002
|
}
|
|
1879
2003
|
function formatTime(hours, minutes, seconds = 0, showSeconds = false) {
|
|
1880
|
-
const h =
|
|
1881
|
-
const m =
|
|
1882
|
-
const s =
|
|
2004
|
+
const h = clampValue2(hours, 0, 23).toString().padStart(2, "0");
|
|
2005
|
+
const m = clampValue2(minutes, 0, 59).toString().padStart(2, "0");
|
|
2006
|
+
const s = clampValue2(seconds, 0, 59).toString().padStart(2, "0");
|
|
1883
2007
|
return showSeconds ? `${h}:${m}:${s}` : `${h}:${m}`;
|
|
1884
2008
|
}
|
|
1885
2009
|
function to12HourFormat(hours) {
|
|
@@ -1924,8 +2048,8 @@ function formatTimeDisplayWithLocale(hours, minutes, seconds = 0, format = "24",
|
|
|
1924
2048
|
}
|
|
1925
2049
|
const { hours: hours12, period } = to12HourFormat(hours);
|
|
1926
2050
|
const h = hours12.toString().padStart(2, "0");
|
|
1927
|
-
const m =
|
|
1928
|
-
const s =
|
|
2051
|
+
const m = clampValue2(minutes, 0, 59).toString().padStart(2, "0");
|
|
2052
|
+
const s = clampValue2(seconds, 0, 59).toString().padStart(2, "0");
|
|
1929
2053
|
const timeStr = showSeconds ? `${h}:${m}:${s}` : `${h}:${m}`;
|
|
1930
2054
|
const labels = getTimePeriodLabels(locale);
|
|
1931
2055
|
const suffix = period === "AM" ? labels.am : labels.pm;
|
|
@@ -2419,6 +2543,11 @@ function getDividerStyle(orientation, color, thickness) {
|
|
|
2419
2543
|
var layoutRootClasses = "tiger-layout flex flex-col min-h-screen";
|
|
2420
2544
|
var layoutHeaderClasses = "tiger-header bg-[var(--tiger-surface,#ffffff)] border-b border-[var(--tiger-border,#e5e7eb)]";
|
|
2421
2545
|
var layoutSidebarClasses = "tiger-sidebar bg-[var(--tiger-surface,#ffffff)] border-r border-[var(--tiger-border,#e5e7eb)] overflow-hidden transition-all duration-300";
|
|
2546
|
+
var layoutSidebarCollapsedClasses = "tiger-sidebar-collapsed";
|
|
2547
|
+
function getSidebarStyle(collapsed, width = "256px", collapsedWidth = "64px") {
|
|
2548
|
+
const w = collapsed ? collapsedWidth : width;
|
|
2549
|
+
return { width: w, minWidth: w };
|
|
2550
|
+
}
|
|
2422
2551
|
var layoutContentClasses = "tiger-content flex-1 bg-[var(--tiger-layout-content-bg,#f9fafb)] p-6";
|
|
2423
2552
|
var layoutFooterClasses = "tiger-footer bg-[var(--tiger-surface,#ffffff)] border-t border-[var(--tiger-border,#e5e7eb)] p-4";
|
|
2424
2553
|
|
|
@@ -2592,6 +2721,14 @@ function getCheckboxCellClasses(size) {
|
|
|
2592
2721
|
};
|
|
2593
2722
|
return classNames("text-center", widthClasses[size]);
|
|
2594
2723
|
}
|
|
2724
|
+
function getExpandCellClasses(size) {
|
|
2725
|
+
return getCheckboxCellClasses(size);
|
|
2726
|
+
}
|
|
2727
|
+
var expandIconButtonClasses = "inline-flex items-center justify-center w-5 h-5 rounded cursor-pointer border-0 bg-transparent transition-transform duration-200 text-[var(--tiger-text-muted,#6b7280)] hover:text-[var(--tiger-text,#111827)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--tiger-focus-ring,var(--tiger-primary,#2563eb))]";
|
|
2728
|
+
function getExpandIconRotationClasses(expanded) {
|
|
2729
|
+
return expanded ? "rotate-90" : "rotate-0";
|
|
2730
|
+
}
|
|
2731
|
+
var expandedRowContentClasses = "bg-[var(--tiger-surface-muted,#f9fafb)] border-b border-[var(--tiger-border,#e5e7eb)]";
|
|
2595
2732
|
function defaultSortFn(a, b) {
|
|
2596
2733
|
if (a === null || a === void 0) return 1;
|
|
2597
2734
|
if (b === null || b === void 0) return -1;
|
|
@@ -3506,12 +3643,16 @@ var submenuTitleClasses = "flex w-full items-center justify-between px-4 py-2 te
|
|
|
3506
3643
|
var submenuExpandIconClasses = "ml-2 transition-transform duration-200";
|
|
3507
3644
|
var submenuExpandIconExpandedClasses = "transform rotate-180";
|
|
3508
3645
|
var submenuContentHorizontalClasses = "absolute left-0 top-full mt-0 min-w-[160px] bg-[var(--tiger-surface,#ffffff)] text-[var(--tiger-text,#111827)] border border-[var(--tiger-border,#e5e7eb)] rounded shadow-lg z-50";
|
|
3646
|
+
var submenuContentHorizontalNestedClasses = "absolute left-full top-0 ml-0 min-w-[160px] bg-[var(--tiger-surface,#ffffff)] text-[var(--tiger-text,#111827)] border border-[var(--tiger-border,#e5e7eb)] rounded shadow-lg z-50";
|
|
3509
3647
|
var submenuContentPopupClasses = "absolute left-full top-0 ml-1 min-w-[180px] bg-[var(--tiger-surface,#ffffff)] text-[var(--tiger-text,#111827)] border border-[var(--tiger-border,#e5e7eb)] rounded shadow-lg z-50";
|
|
3510
3648
|
var submenuContentVerticalClasses = "overflow-hidden pl-2";
|
|
3511
3649
|
var submenuContentInlineClasses = "overflow-hidden";
|
|
3512
3650
|
var menuItemGroupTitleClasses = "px-4 py-2 text-xs font-semibold text-[var(--tiger-text-muted,#6b7280)] uppercase tracking-wider";
|
|
3513
3651
|
var menuCollapsedClasses = "min-w-[64px]";
|
|
3514
3652
|
var menuCollapsedItemClasses = "justify-center px-2";
|
|
3653
|
+
function getSubmenuPopupZIndex(level) {
|
|
3654
|
+
return { zIndex: 50 + level * 10 };
|
|
3655
|
+
}
|
|
3515
3656
|
function getMenuClasses(mode, theme, collapsed) {
|
|
3516
3657
|
const classes = [menuBaseClasses, menuModeClasses[mode]];
|
|
3517
3658
|
if (theme === "dark") {
|
|
@@ -3583,7 +3724,11 @@ function replaceKeys(key, keys) {
|
|
|
3583
3724
|
function getMenuButtons(container) {
|
|
3584
3725
|
return Array.from(
|
|
3585
3726
|
container.querySelectorAll('button[data-tiger-menuitem="true"]')
|
|
3586
|
-
).filter((el) =>
|
|
3727
|
+
).filter((el) => {
|
|
3728
|
+
if (el.disabled || el.closest('[data-tiger-menu-hidden="true"]')) return false;
|
|
3729
|
+
const nearest = el.closest('ul[role="menu"]');
|
|
3730
|
+
return nearest === container;
|
|
3731
|
+
});
|
|
3587
3732
|
}
|
|
3588
3733
|
function moveFocusInMenu(current, delta) {
|
|
3589
3734
|
const menuEl = current.closest('ul[role="menu"]');
|
|
@@ -6466,6 +6611,164 @@ var formatCommentTime = (value) => {
|
|
|
6466
6611
|
return value;
|
|
6467
6612
|
};
|
|
6468
6613
|
|
|
6614
|
+
// src/utils/task-board-utils.ts
|
|
6615
|
+
var taskBoardBaseClasses = "tiger-task-board flex gap-4 overflow-x-auto p-4 min-h-[400px]";
|
|
6616
|
+
var taskBoardColumnClasses = "tiger-task-board-column flex flex-col shrink-0 w-72 rounded-lg border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] shadow-sm transition-shadow";
|
|
6617
|
+
var taskBoardColumnHeaderClasses = "flex items-center justify-between px-3 py-2 border-b border-[var(--tiger-border,#e5e7eb)] text-sm font-semibold text-[var(--tiger-text,#1f2937)] select-none";
|
|
6618
|
+
var taskBoardColumnBodyClasses = "flex-1 overflow-y-auto p-2 space-y-2 min-h-[80px]";
|
|
6619
|
+
var taskBoardCardClasses = "tiger-task-board-card rounded-md border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] p-3 shadow-sm cursor-grab select-none transition-opacity";
|
|
6620
|
+
var taskBoardCardDraggingClasses = "opacity-50 shadow-lg";
|
|
6621
|
+
var taskBoardDropIndicatorClasses = "h-1 rounded-full bg-[var(--tiger-primary,#2563eb)] my-1 transition-all";
|
|
6622
|
+
var taskBoardColumnDropTargetClasses = "ring-2 ring-[var(--tiger-primary,#2563eb)] ring-opacity-50";
|
|
6623
|
+
var taskBoardColumnDraggingClasses = "opacity-50";
|
|
6624
|
+
var taskBoardEmptyClasses = "flex items-center justify-center text-[var(--tiger-text-muted,#6b7280)] text-sm py-8";
|
|
6625
|
+
var taskBoardWipExceededClasses = "text-[var(--tiger-error,#ef4444)]";
|
|
6626
|
+
var taskBoardAddCardClasses = "flex items-center justify-center gap-1 w-full py-1.5 text-sm text-[var(--tiger-text-muted,#6b7280)] hover:text-[var(--tiger-primary,#2563eb)] hover:bg-[var(--tiger-surface-muted,#f9fafb)] rounded transition-colors cursor-pointer";
|
|
6627
|
+
var MIME = "text/plain";
|
|
6628
|
+
function createCardDragData(cardId, columnId, index) {
|
|
6629
|
+
const data = { type: "card", cardId, columnId, index };
|
|
6630
|
+
return JSON.stringify(data);
|
|
6631
|
+
}
|
|
6632
|
+
function createColumnDragData(columnId, index) {
|
|
6633
|
+
const data = { type: "column", columnId, index };
|
|
6634
|
+
return JSON.stringify(data);
|
|
6635
|
+
}
|
|
6636
|
+
function parseDragData(dataTransfer) {
|
|
6637
|
+
try {
|
|
6638
|
+
const raw = dataTransfer.getData(MIME);
|
|
6639
|
+
if (!raw) return null;
|
|
6640
|
+
const data = JSON.parse(raw);
|
|
6641
|
+
if (data.type === "card" || data.type === "column") return data;
|
|
6642
|
+
return null;
|
|
6643
|
+
} catch {
|
|
6644
|
+
return null;
|
|
6645
|
+
}
|
|
6646
|
+
}
|
|
6647
|
+
function setDragData(dataTransfer, json) {
|
|
6648
|
+
dataTransfer.setData(MIME, json);
|
|
6649
|
+
dataTransfer.effectAllowed = "move";
|
|
6650
|
+
}
|
|
6651
|
+
function moveCard(columns, cardId, fromColumnId, toColumnId, toIndex, options) {
|
|
6652
|
+
const srcColIdx = columns.findIndex((c) => c.id === fromColumnId);
|
|
6653
|
+
const dstColIdx = columns.findIndex((c) => c.id === toColumnId);
|
|
6654
|
+
if (srcColIdx === -1 || dstColIdx === -1) return null;
|
|
6655
|
+
const srcCol = columns[srcColIdx];
|
|
6656
|
+
const cardIdx = srcCol.cards.findIndex((c) => c.id === cardId);
|
|
6657
|
+
if (cardIdx === -1) return null;
|
|
6658
|
+
const card = srcCol.cards[cardIdx];
|
|
6659
|
+
const clampedTo = Math.max(
|
|
6660
|
+
0,
|
|
6661
|
+
Math.min(
|
|
6662
|
+
toIndex,
|
|
6663
|
+
srcColIdx === dstColIdx ? srcCol.cards.length - 1 : columns[dstColIdx].cards.length
|
|
6664
|
+
)
|
|
6665
|
+
);
|
|
6666
|
+
if (srcColIdx === dstColIdx) {
|
|
6667
|
+
if (cardIdx === clampedTo) return null;
|
|
6668
|
+
const newCards = [...srcCol.cards];
|
|
6669
|
+
newCards.splice(cardIdx, 1);
|
|
6670
|
+
newCards.splice(clampedTo, 0, card);
|
|
6671
|
+
const newCols2 = columns.map((c, i) => i === srcColIdx ? { ...c, cards: newCards } : c);
|
|
6672
|
+
return {
|
|
6673
|
+
columns: newCols2,
|
|
6674
|
+
event: { cardId, fromColumnId, toColumnId, fromIndex: cardIdx, toIndex: clampedTo }
|
|
6675
|
+
};
|
|
6676
|
+
}
|
|
6677
|
+
const dstCol = columns[dstColIdx];
|
|
6678
|
+
if (options?.enforceWipLimit && dstCol.wipLimit != null && dstCol.wipLimit > 0 && dstCol.cards.length >= dstCol.wipLimit) {
|
|
6679
|
+
return null;
|
|
6680
|
+
}
|
|
6681
|
+
const newSrcCards = srcCol.cards.filter((c) => c.id !== cardId);
|
|
6682
|
+
const newDstCards = [...dstCol.cards];
|
|
6683
|
+
newDstCards.splice(clampedTo, 0, card);
|
|
6684
|
+
const newCols = columns.map((c, i) => {
|
|
6685
|
+
if (i === srcColIdx) return { ...c, cards: newSrcCards };
|
|
6686
|
+
if (i === dstColIdx) return { ...c, cards: newDstCards };
|
|
6687
|
+
return c;
|
|
6688
|
+
});
|
|
6689
|
+
return {
|
|
6690
|
+
columns: newCols,
|
|
6691
|
+
event: { cardId, fromColumnId, toColumnId, fromIndex: cardIdx, toIndex: clampedTo }
|
|
6692
|
+
};
|
|
6693
|
+
}
|
|
6694
|
+
function reorderColumns(columns, fromIndex, toIndex) {
|
|
6695
|
+
if (fromIndex === toIndex || fromIndex < 0 || fromIndex >= columns.length || toIndex < 0 || toIndex >= columns.length) {
|
|
6696
|
+
return null;
|
|
6697
|
+
}
|
|
6698
|
+
const col = columns[fromIndex];
|
|
6699
|
+
const next = [...columns];
|
|
6700
|
+
next.splice(fromIndex, 1);
|
|
6701
|
+
next.splice(toIndex, 0, col);
|
|
6702
|
+
return {
|
|
6703
|
+
columns: next,
|
|
6704
|
+
event: { columnId: col.id, fromIndex, toIndex }
|
|
6705
|
+
};
|
|
6706
|
+
}
|
|
6707
|
+
function isWipExceeded(column) {
|
|
6708
|
+
if (column.wipLimit == null || column.wipLimit <= 0) return false;
|
|
6709
|
+
return column.cards.length > column.wipLimit;
|
|
6710
|
+
}
|
|
6711
|
+
function getDropIndex(pointerY, cardRects) {
|
|
6712
|
+
for (let i = 0; i < cardRects.length; i++) {
|
|
6713
|
+
const mid = cardRects[i].top + cardRects[i].height / 2;
|
|
6714
|
+
if (pointerY < mid) return i;
|
|
6715
|
+
}
|
|
6716
|
+
return cardRects.length;
|
|
6717
|
+
}
|
|
6718
|
+
function getColumnDropIndex(pointerX, columnRects) {
|
|
6719
|
+
for (let i = 0; i < columnRects.length; i++) {
|
|
6720
|
+
const mid = columnRects[i].left + columnRects[i].width / 2;
|
|
6721
|
+
if (pointerX < mid) return i;
|
|
6722
|
+
}
|
|
6723
|
+
return columnRects.length;
|
|
6724
|
+
}
|
|
6725
|
+
function createTouchDragTracker() {
|
|
6726
|
+
let state = {
|
|
6727
|
+
startX: 0,
|
|
6728
|
+
startY: 0,
|
|
6729
|
+
currentX: 0,
|
|
6730
|
+
currentY: 0,
|
|
6731
|
+
active: false,
|
|
6732
|
+
sourceElement: null
|
|
6733
|
+
};
|
|
6734
|
+
return {
|
|
6735
|
+
onTouchStart(e, source) {
|
|
6736
|
+
const touch = e.touches[0];
|
|
6737
|
+
state = {
|
|
6738
|
+
startX: touch.clientX,
|
|
6739
|
+
startY: touch.clientY,
|
|
6740
|
+
currentX: touch.clientX,
|
|
6741
|
+
currentY: touch.clientY,
|
|
6742
|
+
active: true,
|
|
6743
|
+
sourceElement: source
|
|
6744
|
+
};
|
|
6745
|
+
},
|
|
6746
|
+
onTouchMove(e) {
|
|
6747
|
+
if (!state.active) return;
|
|
6748
|
+
const touch = e.touches[0];
|
|
6749
|
+
state.currentX = touch.clientX;
|
|
6750
|
+
state.currentY = touch.clientY;
|
|
6751
|
+
e.preventDefault();
|
|
6752
|
+
},
|
|
6753
|
+
onTouchEnd() {
|
|
6754
|
+
state = { ...state, active: false, sourceElement: null };
|
|
6755
|
+
return { ...state };
|
|
6756
|
+
},
|
|
6757
|
+
getState() {
|
|
6758
|
+
return state;
|
|
6759
|
+
},
|
|
6760
|
+
cancel() {
|
|
6761
|
+
state = { ...state, active: false, sourceElement: null };
|
|
6762
|
+
}
|
|
6763
|
+
};
|
|
6764
|
+
}
|
|
6765
|
+
function findColumnFromPoint(x, y, boardEl) {
|
|
6766
|
+
if (!boardEl) return null;
|
|
6767
|
+
const el = document.elementFromPoint(x, y);
|
|
6768
|
+
if (!el) return null;
|
|
6769
|
+
return el.closest("[data-tiger-taskboard-column]");
|
|
6770
|
+
}
|
|
6771
|
+
|
|
6469
6772
|
// src/theme/checkbox.ts
|
|
6470
6773
|
var checkboxSizeClasses = {
|
|
6471
6774
|
sm: "w-4 h-4",
|
|
@@ -6659,6 +6962,7 @@ export {
|
|
|
6659
6962
|
DEFAULT_CHART_COLORS,
|
|
6660
6963
|
DEFAULT_FORM_WIZARD_LABELS,
|
|
6661
6964
|
DEFAULT_PAGINATION_LABELS,
|
|
6965
|
+
DEFAULT_TASK_BOARD_LABELS,
|
|
6662
6966
|
DONUT_BASE_SHADOW,
|
|
6663
6967
|
DONUT_EMPHASIS_SHADOW,
|
|
6664
6968
|
DROPDOWN_CHEVRON_PATH,
|
|
@@ -6692,6 +6996,7 @@ export {
|
|
|
6692
6996
|
TimePickerCloseIconPath,
|
|
6693
6997
|
ZH_CN_FORM_WIZARD_LABELS,
|
|
6694
6998
|
ZH_CN_PAGINATION_LABELS,
|
|
6999
|
+
ZH_CN_TASK_BOARD_LABELS,
|
|
6695
7000
|
activeOpacityClasses,
|
|
6696
7001
|
activePressClasses,
|
|
6697
7002
|
alertBaseClasses,
|
|
@@ -6799,6 +7104,7 @@ export {
|
|
|
6799
7104
|
clampPercentage,
|
|
6800
7105
|
clampScale,
|
|
6801
7106
|
clampSlideIndex,
|
|
7107
|
+
clampValue,
|
|
6802
7108
|
classNames,
|
|
6803
7109
|
clearFieldErrors,
|
|
6804
7110
|
clipCommentTreeDepth,
|
|
@@ -6840,13 +7146,16 @@ export {
|
|
|
6840
7146
|
createAreaPath,
|
|
6841
7147
|
createAriaId,
|
|
6842
7148
|
createBandScale,
|
|
7149
|
+
createCardDragData,
|
|
6843
7150
|
createChartInteractionHandlers,
|
|
7151
|
+
createColumnDragData,
|
|
6844
7152
|
createFloatingIdFactory,
|
|
6845
7153
|
createLinePath,
|
|
6846
7154
|
createLinearScale,
|
|
6847
7155
|
createPieArcPath,
|
|
6848
7156
|
createPointScale,
|
|
6849
7157
|
createPolygonPath,
|
|
7158
|
+
createTouchDragTracker,
|
|
6850
7159
|
cropCanvas,
|
|
6851
7160
|
cropUploadTriggerClasses,
|
|
6852
7161
|
cropUploadTriggerDisabledClasses,
|
|
@@ -6898,11 +7207,14 @@ export {
|
|
|
6898
7207
|
dotsVariantConfig,
|
|
6899
7208
|
ensureBarMinHeight,
|
|
6900
7209
|
errorCircleSolidIcon20PathD,
|
|
7210
|
+
expandIconButtonClasses,
|
|
7211
|
+
expandedRowContentClasses,
|
|
6901
7212
|
fileToUploadFile,
|
|
6902
7213
|
filterData,
|
|
6903
7214
|
filterOptions,
|
|
6904
7215
|
filterTreeNodes,
|
|
6905
7216
|
findActiveAnchor,
|
|
7217
|
+
findColumnFromPoint,
|
|
6906
7218
|
findNode,
|
|
6907
7219
|
flattenSelectOptions,
|
|
6908
7220
|
focusElement,
|
|
@@ -6920,6 +7232,7 @@ export {
|
|
|
6920
7232
|
formatMonthYear,
|
|
6921
7233
|
formatPageAriaLabel,
|
|
6922
7234
|
formatPaginationTotal,
|
|
7235
|
+
formatPrecision,
|
|
6923
7236
|
formatProgressText,
|
|
6924
7237
|
formatTime,
|
|
6925
7238
|
formatTimeDisplay,
|
|
@@ -6977,6 +7290,7 @@ export {
|
|
|
6977
7290
|
getCollapseIconClasses,
|
|
6978
7291
|
getCollapsePanelClasses,
|
|
6979
7292
|
getCollapsePanelHeaderClasses,
|
|
7293
|
+
getColumnDropIndex,
|
|
6980
7294
|
getContainerClasses,
|
|
6981
7295
|
getContainerHeight,
|
|
6982
7296
|
getContainerScrollTop,
|
|
@@ -7005,6 +7319,7 @@ export {
|
|
|
7005
7319
|
getDrawerMaskClasses,
|
|
7006
7320
|
getDrawerPanelClasses,
|
|
7007
7321
|
getDrawerTitleClasses,
|
|
7322
|
+
getDropIndex,
|
|
7008
7323
|
getDropdownChevronClasses,
|
|
7009
7324
|
getDropdownContainerClasses,
|
|
7010
7325
|
getDropdownItemClasses,
|
|
@@ -7012,6 +7327,8 @@ export {
|
|
|
7012
7327
|
getDropdownTriggerClasses,
|
|
7013
7328
|
getElementOffsetTop,
|
|
7014
7329
|
getErrorFields,
|
|
7330
|
+
getExpandCellClasses,
|
|
7331
|
+
getExpandIconRotationClasses,
|
|
7015
7332
|
getFieldError,
|
|
7016
7333
|
getFileListItemClasses,
|
|
7017
7334
|
getFirstDayOfMonth,
|
|
@@ -7034,6 +7351,13 @@ export {
|
|
|
7034
7351
|
getInputAffixClasses,
|
|
7035
7352
|
getInputClasses,
|
|
7036
7353
|
getInputErrorClasses,
|
|
7354
|
+
getInputNumberFocusRingColor,
|
|
7355
|
+
getInputNumberInputClasses,
|
|
7356
|
+
getInputNumberSideButtonClasses,
|
|
7357
|
+
getInputNumberSizeClasses,
|
|
7358
|
+
getInputNumberStatusClasses,
|
|
7359
|
+
getInputNumberStepButtonClasses,
|
|
7360
|
+
getInputNumberWrapperClasses,
|
|
7037
7361
|
getInputWrapperClasses,
|
|
7038
7362
|
getJustifyClasses,
|
|
7039
7363
|
getLeafKeys,
|
|
@@ -7127,6 +7451,7 @@ export {
|
|
|
7127
7451
|
getSeparatorContent,
|
|
7128
7452
|
getShortDayNames,
|
|
7129
7453
|
getShortMonthNames,
|
|
7454
|
+
getSidebarStyle,
|
|
7130
7455
|
getSimplePaginationButtonClasses,
|
|
7131
7456
|
getSimplePaginationButtonsWrapperClasses,
|
|
7132
7457
|
getSimplePaginationContainerClasses,
|
|
@@ -7155,6 +7480,7 @@ export {
|
|
|
7155
7480
|
getStepsContainerClasses,
|
|
7156
7481
|
getSubMenuExpandIconClasses,
|
|
7157
7482
|
getSubMenuTitleClasses,
|
|
7483
|
+
getSubmenuPopupZIndex,
|
|
7158
7484
|
getSvgDefaultAttrs,
|
|
7159
7485
|
getSwitchClasses,
|
|
7160
7486
|
getSwitchThumbClasses,
|
|
@@ -7169,6 +7495,7 @@ export {
|
|
|
7169
7495
|
getTableWrapperClasses,
|
|
7170
7496
|
getTabsContainerClasses,
|
|
7171
7497
|
getTagVariantClasses,
|
|
7498
|
+
getTaskBoardLabels,
|
|
7172
7499
|
getTextClasses,
|
|
7173
7500
|
getThemeColor,
|
|
7174
7501
|
getTimePeriodLabels,
|
|
@@ -7239,9 +7566,16 @@ export {
|
|
|
7239
7566
|
injectShakeStyle,
|
|
7240
7567
|
injectSvgAnimationStyles,
|
|
7241
7568
|
inputFocusClasses,
|
|
7569
|
+
inputNumberControlsRightClasses,
|
|
7570
|
+
inputNumberDownIconPathD,
|
|
7571
|
+
inputNumberMinusIconPathD,
|
|
7572
|
+
inputNumberPlusIconPathD,
|
|
7573
|
+
inputNumberUpIconPathD,
|
|
7242
7574
|
interactiveClasses,
|
|
7243
7575
|
interpolateUploadLabel,
|
|
7244
7576
|
isActivationKey,
|
|
7577
|
+
isAtMax,
|
|
7578
|
+
isAtMin,
|
|
7245
7579
|
isBrowser,
|
|
7246
7580
|
isDateInRange,
|
|
7247
7581
|
isEnterKey,
|
|
@@ -7260,11 +7594,13 @@ export {
|
|
|
7260
7594
|
isTabKey,
|
|
7261
7595
|
isTimeInRange,
|
|
7262
7596
|
isToday,
|
|
7597
|
+
isWipExceeded,
|
|
7263
7598
|
layoutContentClasses,
|
|
7264
7599
|
layoutFooterClasses,
|
|
7265
7600
|
layoutHeaderClasses,
|
|
7266
7601
|
layoutRootClasses,
|
|
7267
7602
|
layoutSidebarClasses,
|
|
7603
|
+
layoutSidebarCollapsedClasses,
|
|
7268
7604
|
linePointTransitionClasses,
|
|
7269
7605
|
linkBaseClasses,
|
|
7270
7606
|
linkDisabledClasses,
|
|
@@ -7337,6 +7673,7 @@ export {
|
|
|
7337
7673
|
modalSizeClasses,
|
|
7338
7674
|
modalTitleClasses,
|
|
7339
7675
|
modalWrapperClasses,
|
|
7676
|
+
moveCard,
|
|
7340
7677
|
moveCropRect,
|
|
7341
7678
|
moveFocusInMenu,
|
|
7342
7679
|
nextIconPath,
|
|
@@ -7358,6 +7695,7 @@ export {
|
|
|
7358
7695
|
notificationTitleClasses,
|
|
7359
7696
|
paginateData,
|
|
7360
7697
|
parseDate,
|
|
7698
|
+
parseDragData,
|
|
7361
7699
|
parseInputValue,
|
|
7362
7700
|
parseTime,
|
|
7363
7701
|
parseWidthToPx,
|
|
@@ -7395,6 +7733,7 @@ export {
|
|
|
7395
7733
|
radioRootBaseClasses,
|
|
7396
7734
|
radioSizeClasses,
|
|
7397
7735
|
radioVisualBaseClasses,
|
|
7736
|
+
reorderColumns,
|
|
7398
7737
|
replaceKeys,
|
|
7399
7738
|
resetAreaGradientCounter,
|
|
7400
7739
|
resetBarGradientCounter,
|
|
@@ -7419,6 +7758,7 @@ export {
|
|
|
7419
7758
|
selectOptionDisabledClasses,
|
|
7420
7759
|
selectOptionSelectedClasses,
|
|
7421
7760
|
selectSearchInputClasses,
|
|
7761
|
+
setDragData,
|
|
7422
7762
|
setThemeColors,
|
|
7423
7763
|
shouldHideBadge,
|
|
7424
7764
|
skeletonAnimationClasses,
|
|
@@ -7449,7 +7789,9 @@ export {
|
|
|
7449
7789
|
statusSuccessIconPath,
|
|
7450
7790
|
statusWarningIconPath,
|
|
7451
7791
|
stepFinishChar,
|
|
7792
|
+
stepValue,
|
|
7452
7793
|
submenuContentHorizontalClasses,
|
|
7794
|
+
submenuContentHorizontalNestedClasses,
|
|
7453
7795
|
submenuContentInlineClasses,
|
|
7454
7796
|
submenuContentPopupClasses,
|
|
7455
7797
|
submenuContentVerticalClasses,
|
|
@@ -7492,6 +7834,18 @@ export {
|
|
|
7492
7834
|
tagCloseButtonBaseClasses,
|
|
7493
7835
|
tagCloseIconPath,
|
|
7494
7836
|
tagSizeClasses,
|
|
7837
|
+
taskBoardAddCardClasses,
|
|
7838
|
+
taskBoardBaseClasses,
|
|
7839
|
+
taskBoardCardClasses,
|
|
7840
|
+
taskBoardCardDraggingClasses,
|
|
7841
|
+
taskBoardColumnBodyClasses,
|
|
7842
|
+
taskBoardColumnClasses,
|
|
7843
|
+
taskBoardColumnDraggingClasses,
|
|
7844
|
+
taskBoardColumnDropTargetClasses,
|
|
7845
|
+
taskBoardColumnHeaderClasses,
|
|
7846
|
+
taskBoardDropIndicatorClasses,
|
|
7847
|
+
taskBoardEmptyClasses,
|
|
7848
|
+
taskBoardWipExceededClasses,
|
|
7495
7849
|
textAlignClasses,
|
|
7496
7850
|
textColorClasses,
|
|
7497
7851
|
textDecorationClasses,
|