@moontra/moonui-pro 2.13.0 → 2.14.0
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.d.ts +51 -1
- package/dist/index.mjs +186 -52
- package/package.json +1 -1
- package/src/components/kanban/kanban.tsx +387 -205
- package/src/components/kanban/types.ts +57 -0
package/dist/index.d.ts
CHANGED
|
@@ -1120,9 +1120,59 @@ interface KanbanProps {
|
|
|
1120
1120
|
disabled?: boolean;
|
|
1121
1121
|
labels?: KanbanLabel[];
|
|
1122
1122
|
users?: KanbanAssignee[];
|
|
1123
|
+
renderCard?: (card: KanbanCard, column: KanbanColumn, provided: any) => React.ReactNode;
|
|
1124
|
+
renderCardPreview?: (card: KanbanCard) => React.ReactNode;
|
|
1125
|
+
renderCardBadge?: (card: KanbanCard) => React.ReactNode;
|
|
1126
|
+
renderCardActions?: (card: KanbanCard) => React.ReactNode;
|
|
1127
|
+
cardCompactMode?: boolean;
|
|
1128
|
+
cardShowCoverImage?: boolean;
|
|
1129
|
+
cardShowAssignees?: boolean;
|
|
1130
|
+
cardShowLabels?: boolean;
|
|
1131
|
+
cardShowProgress?: boolean;
|
|
1132
|
+
cardDateFormat?: string;
|
|
1133
|
+
cardMaxAssigneesToShow?: number;
|
|
1134
|
+
renderAddCardButton?: (columnId: string) => React.ReactNode;
|
|
1135
|
+
renderAddCardForm?: (columnId: string, onAdd: (card: Partial<KanbanCard>) => void, onCancel: () => void) => React.ReactNode;
|
|
1136
|
+
addCardButtonText?: string | ((columnId: string) => string);
|
|
1137
|
+
addCardPosition?: 'top' | 'bottom';
|
|
1138
|
+
allowQuickAdd?: boolean;
|
|
1139
|
+
quickAddFields?: ('title' | 'description' | 'assignee' | 'priority')[];
|
|
1140
|
+
validateCard?: (card: Partial<KanbanCard>) => {
|
|
1141
|
+
valid: boolean;
|
|
1142
|
+
errors?: string[];
|
|
1143
|
+
};
|
|
1144
|
+
onBeforeCardAdd?: (card: Partial<KanbanCard>) => Partial<KanbanCard> | false;
|
|
1145
|
+
renderColumnHeader?: (column: KanbanColumn) => React.ReactNode;
|
|
1146
|
+
renderColumnFooter?: (column: KanbanColumn) => React.ReactNode;
|
|
1147
|
+
renderEmptyColumn?: (column: KanbanColumn) => React.ReactNode;
|
|
1148
|
+
columnMenuActions?: Array<{
|
|
1149
|
+
label: string;
|
|
1150
|
+
icon?: React.ReactNode;
|
|
1151
|
+
action: (column: KanbanColumn) => void;
|
|
1152
|
+
visible?: (column: KanbanColumn) => boolean;
|
|
1153
|
+
}>;
|
|
1154
|
+
allowColumnReorder?: boolean;
|
|
1155
|
+
columnColorOptions?: string[];
|
|
1156
|
+
columnDefaultColor?: string;
|
|
1157
|
+
dragDisabled?: boolean | ((card: KanbanCard) => boolean);
|
|
1158
|
+
dropDisabled?: boolean | ((column: KanbanColumn) => boolean);
|
|
1159
|
+
dragPreview?: 'card' | 'compact' | 'custom';
|
|
1160
|
+
renderDragPreview?: (card: KanbanCard) => React.ReactNode;
|
|
1161
|
+
canDrop?: (card: KanbanCard, targetColumn: KanbanColumn, position: number) => boolean;
|
|
1162
|
+
onDragStart?: (card: KanbanCard, column: KanbanColumn) => void;
|
|
1163
|
+
onDragEnd?: (card: KanbanCard, column: KanbanColumn) => void;
|
|
1164
|
+
theme?: 'default' | 'compact' | 'modern' | 'minimal';
|
|
1165
|
+
cardVariant?: 'default' | 'bordered' | 'elevated' | 'flat';
|
|
1166
|
+
enableAnimations?: boolean;
|
|
1167
|
+
animationDuration?: number;
|
|
1168
|
+
columnWidth?: number | 'auto';
|
|
1169
|
+
columnGap?: number;
|
|
1170
|
+
cardGap?: number;
|
|
1171
|
+
showTooltips?: boolean;
|
|
1172
|
+
tooltipDelay?: number;
|
|
1123
1173
|
}
|
|
1124
1174
|
|
|
1125
|
-
declare function Kanban({ columns: initialColumns, onCardMove, onCardClick, onCardEdit, onCardDelete, onCardUpdate, onAddCard, onAddColumn, onColumnUpdate, onColumnDelete, onBulkAction, onExport, className, showAddColumn, showCardDetails, showFilters, showSearch, enableKeyboardShortcuts, cardTemplates, columnTemplates, filters, defaultFilter, loading, disabled, labels, users }: KanbanProps): react_jsx_runtime.JSX.Element;
|
|
1175
|
+
declare function Kanban({ columns: initialColumns, onCardMove, onCardClick, onCardEdit, onCardDelete, onCardUpdate, onAddCard, onAddColumn, onColumnUpdate, onColumnDelete, onBulkAction, onExport, className, showAddColumn, showCardDetails, showFilters, showSearch, enableKeyboardShortcuts, cardTemplates, columnTemplates, filters, defaultFilter, loading, disabled, labels, users, renderCard, renderCardPreview, renderCardBadge, renderCardActions, cardCompactMode, cardShowCoverImage, cardShowAssignees, cardShowLabels, cardShowProgress, cardDateFormat, cardMaxAssigneesToShow, renderAddCardButton, renderAddCardForm, addCardButtonText, addCardPosition, allowQuickAdd, quickAddFields, validateCard, onBeforeCardAdd, renderColumnHeader, renderColumnFooter, renderEmptyColumn, columnMenuActions, allowColumnReorder, columnColorOptions, columnDefaultColor, dragDisabled, dropDisabled, dragPreview, renderDragPreview, canDrop, onDragStart, onDragEnd, theme, cardVariant, enableAnimations, animationDuration, columnWidth, columnGap, cardGap, showTooltips, tooltipDelay }: KanbanProps): react_jsx_runtime.JSX.Element;
|
|
1126
1176
|
|
|
1127
1177
|
interface AIConfig {
|
|
1128
1178
|
provider?: 'openai' | 'claude' | 'gemini' | 'cohere';
|
package/dist/index.mjs
CHANGED
|
@@ -12183,29 +12183,51 @@ var useAutoScroll = () => {
|
|
|
12183
12183
|
};
|
|
12184
12184
|
var KanbanCardComponent = ({
|
|
12185
12185
|
card,
|
|
12186
|
+
column,
|
|
12186
12187
|
isDragging,
|
|
12187
12188
|
onEdit,
|
|
12188
12189
|
onDelete,
|
|
12189
12190
|
onClick,
|
|
12190
12191
|
showDetails,
|
|
12191
|
-
disabled
|
|
12192
|
+
disabled,
|
|
12193
|
+
renderCard,
|
|
12194
|
+
renderCardPreview,
|
|
12195
|
+
renderCardBadge,
|
|
12196
|
+
renderCardActions,
|
|
12197
|
+
cardCompactMode,
|
|
12198
|
+
cardShowCoverImage,
|
|
12199
|
+
cardShowAssignees,
|
|
12200
|
+
cardShowLabels,
|
|
12201
|
+
cardShowProgress,
|
|
12202
|
+
cardDateFormat,
|
|
12203
|
+
cardMaxAssigneesToShow,
|
|
12204
|
+
provided,
|
|
12205
|
+
enableAnimations,
|
|
12206
|
+
animationDuration,
|
|
12207
|
+
cardVariant
|
|
12192
12208
|
}) => {
|
|
12193
12209
|
const [isEditingTitle, setIsEditingTitle] = useState(false);
|
|
12194
12210
|
const [title, setTitle] = useState(card.title);
|
|
12195
12211
|
const dragControls = useDragControls();
|
|
12212
|
+
const animationsEnabled = enableAnimations ?? true;
|
|
12213
|
+
const animDuration = animationDuration ?? 0.2;
|
|
12214
|
+
const variant = cardVariant ?? "default";
|
|
12196
12215
|
const completedChecklistItems = card.checklist?.items.filter((item) => item.completed).length || 0;
|
|
12197
12216
|
const totalChecklistItems = card.checklist?.items.length || 0;
|
|
12198
12217
|
const checklistProgress = totalChecklistItems > 0 ? completedChecklistItems / totalChecklistItems * 100 : 0;
|
|
12218
|
+
if (renderCard) {
|
|
12219
|
+
return renderCard(card, column, provided || {});
|
|
12220
|
+
}
|
|
12199
12221
|
return /* @__PURE__ */ jsx(
|
|
12200
12222
|
motion.div,
|
|
12201
12223
|
{
|
|
12202
12224
|
layout: true,
|
|
12203
|
-
initial: { opacity: 0, y: 20 },
|
|
12225
|
+
initial: { opacity: animationsEnabled ? 0 : 1, y: animationsEnabled ? 20 : 0 },
|
|
12204
12226
|
animate: { opacity: 1, y: 0 },
|
|
12205
|
-
exit: { opacity: 0, y: -20 },
|
|
12206
|
-
whileHover: { scale: 1.02 },
|
|
12207
|
-
whileDrag: { scale: 1.05, rotate: 3 },
|
|
12208
|
-
transition: { duration: 0
|
|
12227
|
+
exit: { opacity: animationsEnabled ? 0 : 1, y: animationsEnabled ? -20 : 0 },
|
|
12228
|
+
whileHover: animationsEnabled ? { scale: 1.02 } : {},
|
|
12229
|
+
whileDrag: animationsEnabled ? { scale: 1.05, rotate: 3 } : {},
|
|
12230
|
+
transition: { duration: animationsEnabled ? animDuration : 0 },
|
|
12209
12231
|
className: cn(
|
|
12210
12232
|
"relative group cursor-pointer select-none",
|
|
12211
12233
|
isDragging && "z-50"
|
|
@@ -12214,7 +12236,11 @@ var KanbanCardComponent = ({
|
|
|
12214
12236
|
MoonUICardPro,
|
|
12215
12237
|
{
|
|
12216
12238
|
className: cn(
|
|
12217
|
-
"border
|
|
12239
|
+
"border transition-all duration-200",
|
|
12240
|
+
variant === "bordered" && "border-2",
|
|
12241
|
+
variant === "elevated" && "shadow-lg hover:shadow-xl",
|
|
12242
|
+
variant === "flat" && "border-0 bg-muted/30",
|
|
12243
|
+
variant === "default" && "hover:shadow-md",
|
|
12218
12244
|
isDragging && "shadow-2xl ring-2 ring-primary ring-offset-2",
|
|
12219
12245
|
disabled && "cursor-not-allowed opacity-50"
|
|
12220
12246
|
),
|
|
@@ -12227,7 +12253,7 @@ var KanbanCardComponent = ({
|
|
|
12227
12253
|
onPointerDown: (e) => dragControls.start(e)
|
|
12228
12254
|
}
|
|
12229
12255
|
),
|
|
12230
|
-
card.coverImage && /* @__PURE__ */ jsxs("div", { className: "relative h-32 -mx-px -mt-px rounded-t-lg overflow-hidden", children: [
|
|
12256
|
+
cardShowCoverImage && card.coverImage && /* @__PURE__ */ jsxs("div", { className: "relative h-32 -mx-px -mt-px rounded-t-lg overflow-hidden", children: [
|
|
12231
12257
|
/* @__PURE__ */ jsx(
|
|
12232
12258
|
"img",
|
|
12233
12259
|
{
|
|
@@ -12239,7 +12265,7 @@ var KanbanCardComponent = ({
|
|
|
12239
12265
|
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/50 to-transparent" })
|
|
12240
12266
|
] }),
|
|
12241
12267
|
/* @__PURE__ */ jsxs(MoonUICardContentPro, { className: "p-3", children: [
|
|
12242
|
-
card.labels && card.labels.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mb-2", children: card.labels.map((label) => /* @__PURE__ */ jsx(
|
|
12268
|
+
cardShowLabels && card.labels && card.labels.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mb-2", children: card.labels.map((label) => /* @__PURE__ */ jsx(
|
|
12243
12269
|
"div",
|
|
12244
12270
|
{
|
|
12245
12271
|
className: "h-2 w-12 rounded-full",
|
|
@@ -12269,7 +12295,7 @@ var KanbanCardComponent = ({
|
|
|
12269
12295
|
onClick: (e) => e.stopPropagation()
|
|
12270
12296
|
}
|
|
12271
12297
|
) : /* @__PURE__ */ jsx("h4", { className: "font-medium text-sm line-clamp-2", children: card.title }) }),
|
|
12272
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity", children: /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
12298
|
+
renderCardActions ? /* @__PURE__ */ jsx("div", { className: "opacity-0 group-hover:opacity-100 transition-opacity", children: renderCardActions(card) }) : /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity", children: /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
12273
12299
|
/* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
12274
12300
|
MoonUIButtonPro,
|
|
12275
12301
|
{
|
|
@@ -12312,8 +12338,8 @@ var KanbanCardComponent = ({
|
|
|
12312
12338
|
] })
|
|
12313
12339
|
] }) })
|
|
12314
12340
|
] }),
|
|
12315
|
-
card.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mb-3 line-clamp-2", children: card.description }),
|
|
12316
|
-
(card.progress !== void 0 || card.checklist) && /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
|
|
12341
|
+
!cardCompactMode && card.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mb-3 line-clamp-2", children: card.description }),
|
|
12342
|
+
cardShowProgress && (card.progress !== void 0 || card.checklist) && /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
|
|
12317
12343
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-xs text-muted-foreground mb-1", children: [
|
|
12318
12344
|
/* @__PURE__ */ jsx("span", { children: "Progress" }),
|
|
12319
12345
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
@@ -12323,7 +12349,7 @@ var KanbanCardComponent = ({
|
|
|
12323
12349
|
] }),
|
|
12324
12350
|
/* @__PURE__ */ jsx(MoonUIProgressPro, { value: card.progress || checklistProgress, className: "h-1" })
|
|
12325
12351
|
] }),
|
|
12326
|
-
card.tags && card.tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mb-3", children: card.tags.map((tag, index2) => /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "text-xs px-1.5 py-0", children: tag }, index2)) }),
|
|
12352
|
+
!cardCompactMode && card.tags && card.tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mb-3", children: card.tags.map((tag, index2) => /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "text-xs px-1.5 py-0", children: tag }, index2)) }),
|
|
12327
12353
|
showDetails && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs", children: [
|
|
12328
12354
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
12329
12355
|
card.priority && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
@@ -12335,7 +12361,7 @@ var KanbanCardComponent = ({
|
|
|
12335
12361
|
isOverdue(card.dueDate) && "text-destructive"
|
|
12336
12362
|
), children: [
|
|
12337
12363
|
/* @__PURE__ */ jsx(Calendar$1, { className: "h-3 w-3" }),
|
|
12338
|
-
/* @__PURE__ */ jsx("span", { children: formatDate(card.dueDate) })
|
|
12364
|
+
/* @__PURE__ */ jsx("span", { children: cardDateFormat ? format(card.dueDate, cardDateFormat) : formatDate(card.dueDate) })
|
|
12339
12365
|
] }),
|
|
12340
12366
|
card.checklist && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
12341
12367
|
/* @__PURE__ */ jsx(CheckSquare, { className: "h-3 w-3" }),
|
|
@@ -12355,7 +12381,7 @@ var KanbanCardComponent = ({
|
|
|
12355
12381
|
/* @__PURE__ */ jsx(Paperclip, { className: "h-3 w-3" }),
|
|
12356
12382
|
/* @__PURE__ */ jsx("span", { children: card.attachments.length })
|
|
12357
12383
|
] }),
|
|
12358
|
-
card.assignees && card.assignees.length > 0 && /* @__PURE__ */ jsx(MoonUIAvatarGroupPro, { max:
|
|
12384
|
+
cardShowAssignees && card.assignees && card.assignees.length > 0 && /* @__PURE__ */ jsx(MoonUIAvatarGroupPro, { max: cardMaxAssigneesToShow, size: "xs", children: card.assignees.map((assignee) => /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-5 w-5", children: [
|
|
12359
12385
|
/* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: assignee.avatar }),
|
|
12360
12386
|
/* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials3(assignee.name) })
|
|
12361
12387
|
] }, assignee.id)) })
|
|
@@ -12394,7 +12420,54 @@ function Kanban({
|
|
|
12394
12420
|
loading = false,
|
|
12395
12421
|
disabled = false,
|
|
12396
12422
|
labels = [],
|
|
12397
|
-
users = []
|
|
12423
|
+
users = [],
|
|
12424
|
+
// Card Render Customization
|
|
12425
|
+
renderCard,
|
|
12426
|
+
renderCardPreview,
|
|
12427
|
+
renderCardBadge,
|
|
12428
|
+
renderCardActions,
|
|
12429
|
+
cardCompactMode = false,
|
|
12430
|
+
cardShowCoverImage = true,
|
|
12431
|
+
cardShowAssignees = true,
|
|
12432
|
+
cardShowLabels = true,
|
|
12433
|
+
cardShowProgress = true,
|
|
12434
|
+
cardDateFormat,
|
|
12435
|
+
cardMaxAssigneesToShow = 3,
|
|
12436
|
+
// Add Card Customization
|
|
12437
|
+
renderAddCardButton,
|
|
12438
|
+
renderAddCardForm,
|
|
12439
|
+
addCardButtonText,
|
|
12440
|
+
addCardPosition = "bottom",
|
|
12441
|
+
allowQuickAdd = true,
|
|
12442
|
+
quickAddFields = ["title"],
|
|
12443
|
+
validateCard,
|
|
12444
|
+
onBeforeCardAdd,
|
|
12445
|
+
// Column Customization
|
|
12446
|
+
renderColumnHeader,
|
|
12447
|
+
renderColumnFooter,
|
|
12448
|
+
renderEmptyColumn,
|
|
12449
|
+
columnMenuActions,
|
|
12450
|
+
allowColumnReorder = true,
|
|
12451
|
+
columnColorOptions,
|
|
12452
|
+
columnDefaultColor = "#6B7280",
|
|
12453
|
+
// Drag & Drop Enhancement
|
|
12454
|
+
dragDisabled = false,
|
|
12455
|
+
dropDisabled = false,
|
|
12456
|
+
dragPreview = "card",
|
|
12457
|
+
renderDragPreview,
|
|
12458
|
+
canDrop,
|
|
12459
|
+
onDragStart,
|
|
12460
|
+
onDragEnd,
|
|
12461
|
+
// UI/UX Customization
|
|
12462
|
+
theme = "default",
|
|
12463
|
+
cardVariant = "default",
|
|
12464
|
+
enableAnimations = true,
|
|
12465
|
+
animationDuration = 0.2,
|
|
12466
|
+
columnWidth,
|
|
12467
|
+
columnGap = 24,
|
|
12468
|
+
cardGap = 12,
|
|
12469
|
+
showTooltips = true,
|
|
12470
|
+
tooltipDelay = 500
|
|
12398
12471
|
}) {
|
|
12399
12472
|
const { hasProAccess, isLoading } = useSubscription();
|
|
12400
12473
|
if (!isLoading && !hasProAccess) {
|
|
@@ -12485,11 +12558,24 @@ function Kanban({
|
|
|
12485
12558
|
const handleDragStart = (card, columnId) => {
|
|
12486
12559
|
if (disabled)
|
|
12487
12560
|
return;
|
|
12561
|
+
if (typeof dragDisabled === "function" && dragDisabled(card))
|
|
12562
|
+
return;
|
|
12563
|
+
if (dragDisabled === true)
|
|
12564
|
+
return;
|
|
12488
12565
|
setDraggedCard(card.id);
|
|
12566
|
+
const column = columns.find((col) => col.id === columnId);
|
|
12567
|
+
if (column && onDragStart) {
|
|
12568
|
+
onDragStart(card, column);
|
|
12569
|
+
}
|
|
12489
12570
|
};
|
|
12490
12571
|
const handleDragOver = (e, columnId) => {
|
|
12491
12572
|
if (disabled)
|
|
12492
12573
|
return;
|
|
12574
|
+
const column = columns.find((col) => col.id === columnId);
|
|
12575
|
+
if (column && typeof dropDisabled === "function" && dropDisabled(column))
|
|
12576
|
+
return;
|
|
12577
|
+
if (dropDisabled === true)
|
|
12578
|
+
return;
|
|
12493
12579
|
e.preventDefault();
|
|
12494
12580
|
setDraggedOverColumn(columnId);
|
|
12495
12581
|
const container = scrollRef.current;
|
|
@@ -12506,6 +12592,13 @@ function Kanban({
|
|
|
12506
12592
|
}
|
|
12507
12593
|
};
|
|
12508
12594
|
const handleDragEnd = () => {
|
|
12595
|
+
if (draggedCard) {
|
|
12596
|
+
const card = columns.flatMap((col) => col.cards).find((c2) => c2.id === draggedCard);
|
|
12597
|
+
const column = columns.find((col) => col.cards.some((c2) => c2.id === draggedCard));
|
|
12598
|
+
if (card && column && onDragEnd) {
|
|
12599
|
+
onDragEnd(card, column);
|
|
12600
|
+
}
|
|
12601
|
+
}
|
|
12509
12602
|
setDraggedCard(null);
|
|
12510
12603
|
setDraggedOverColumn(null);
|
|
12511
12604
|
stopAutoScroll();
|
|
@@ -12514,6 +12607,11 @@ function Kanban({
|
|
|
12514
12607
|
if (disabled || !draggedCard || !onCardMove)
|
|
12515
12608
|
return;
|
|
12516
12609
|
e.preventDefault();
|
|
12610
|
+
const targetColumn = columns.find((col) => col.id === targetColumnId);
|
|
12611
|
+
const draggedCardObj = columns.flatMap((col) => col.cards).find((card) => card.id === draggedCard);
|
|
12612
|
+
if (targetColumn && draggedCardObj && canDrop && !canDrop(draggedCardObj, targetColumn, targetIndex)) {
|
|
12613
|
+
return;
|
|
12614
|
+
}
|
|
12517
12615
|
let sourceColumnId = null;
|
|
12518
12616
|
let sourceCard = null;
|
|
12519
12617
|
for (const column of columns) {
|
|
@@ -12691,11 +12789,11 @@ function Kanban({
|
|
|
12691
12789
|
description: "Column color has been changed"
|
|
12692
12790
|
});
|
|
12693
12791
|
};
|
|
12694
|
-
const handleExport = (
|
|
12792
|
+
const handleExport = (format6) => {
|
|
12695
12793
|
if (onExport) {
|
|
12696
|
-
onExport(
|
|
12794
|
+
onExport(format6);
|
|
12697
12795
|
} else {
|
|
12698
|
-
if (
|
|
12796
|
+
if (format6 === "json") {
|
|
12699
12797
|
const data = JSON.stringify(columns, null, 2);
|
|
12700
12798
|
const blob = new Blob([data], { type: "application/json" });
|
|
12701
12799
|
const url = URL.createObjectURL(blob);
|
|
@@ -12710,7 +12808,7 @@ function Kanban({
|
|
|
12710
12808
|
title: "Board exported",
|
|
12711
12809
|
description: "Board exported as JSON file"
|
|
12712
12810
|
});
|
|
12713
|
-
} else if (
|
|
12811
|
+
} else if (format6 === "csv") {
|
|
12714
12812
|
let csv = "Column,Card Title,Description,Priority,Assignees,Due Date,Tags\n";
|
|
12715
12813
|
columns.forEach((column) => {
|
|
12716
12814
|
column.cards.forEach((card) => {
|
|
@@ -12853,7 +12951,8 @@ function Kanban({
|
|
|
12853
12951
|
"div",
|
|
12854
12952
|
{
|
|
12855
12953
|
ref: scrollRef,
|
|
12856
|
-
className: "flex
|
|
12954
|
+
className: "flex overflow-x-auto pb-4",
|
|
12955
|
+
style: { gap: `${columnGap}px` },
|
|
12857
12956
|
onDragOver: (e) => e.preventDefault(),
|
|
12858
12957
|
children: [
|
|
12859
12958
|
/* @__PURE__ */ jsx(AnimatePresence, { mode: "sync", children: filteredColumns.map((column) => {
|
|
@@ -12862,14 +12961,19 @@ function Kanban({
|
|
|
12862
12961
|
return /* @__PURE__ */ jsx(
|
|
12863
12962
|
motion.div,
|
|
12864
12963
|
{
|
|
12865
|
-
layout:
|
|
12866
|
-
initial: { opacity: 0, x: -20 },
|
|
12964
|
+
layout: enableAnimations,
|
|
12965
|
+
initial: { opacity: enableAnimations ? 0 : 1, x: enableAnimations ? -20 : 0 },
|
|
12867
12966
|
animate: { opacity: 1, x: 0 },
|
|
12868
|
-
exit: { opacity: 0, x: 20 },
|
|
12967
|
+
exit: { opacity: enableAnimations ? 0 : 1, x: enableAnimations ? 20 : 0 },
|
|
12869
12968
|
className: cn(
|
|
12870
|
-
"flex-shrink-0
|
|
12969
|
+
"flex-shrink-0 transition-all",
|
|
12871
12970
|
isDraggedOver && "scale-105"
|
|
12872
12971
|
),
|
|
12972
|
+
style: {
|
|
12973
|
+
width: columnWidth === "auto" ? "auto" : (columnWidth || 320) + "px",
|
|
12974
|
+
minWidth: columnWidth === "auto" ? "300px" : void 0,
|
|
12975
|
+
transitionDuration: enableAnimations ? `${animationDuration}s` : "0s"
|
|
12976
|
+
},
|
|
12873
12977
|
onDragOver: (e) => handleDragOver(e, column.id),
|
|
12874
12978
|
onDragLeave: () => setDraggedOverColumn(null),
|
|
12875
12979
|
onDrop: (e) => handleDrop(e, column.id, column.cards.length),
|
|
@@ -12878,7 +12982,7 @@ function Kanban({
|
|
|
12878
12982
|
isDraggedOver && "ring-2 ring-primary ring-offset-2 bg-primary/5",
|
|
12879
12983
|
column.collapsed && "opacity-60"
|
|
12880
12984
|
), children: [
|
|
12881
|
-
/* @__PURE__ */
|
|
12985
|
+
/* @__PURE__ */ jsx(MoonUICardHeaderPro, { className: "pb-3", children: renderColumnHeader ? renderColumnHeader(column) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12882
12986
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
12883
12987
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
12884
12988
|
column.color && /* @__PURE__ */ jsx(
|
|
@@ -12915,7 +13019,21 @@ function Kanban({
|
|
|
12915
13019
|
] }),
|
|
12916
13020
|
/* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
12917
13021
|
/* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "ghost", size: "sm", className: "h-6 w-6 p-0", children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }),
|
|
12918
|
-
/* @__PURE__ */
|
|
13022
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuContentPro, { align: "end", children: columnMenuActions ? columnMenuActions.map((action, index2) => {
|
|
13023
|
+
if (action.visible && !action.visible(column))
|
|
13024
|
+
return null;
|
|
13025
|
+
return /* @__PURE__ */ jsxs(
|
|
13026
|
+
MoonUIDropdownMenuItemPro,
|
|
13027
|
+
{
|
|
13028
|
+
onClick: () => action.action(column),
|
|
13029
|
+
children: [
|
|
13030
|
+
action.icon || null,
|
|
13031
|
+
action.label
|
|
13032
|
+
]
|
|
13033
|
+
},
|
|
13034
|
+
index2
|
|
13035
|
+
);
|
|
13036
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12919
13037
|
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "rename"), children: [
|
|
12920
13038
|
/* @__PURE__ */ jsx(Edit, { className: "mr-2 h-4 w-4" }),
|
|
12921
13039
|
"Rename"
|
|
@@ -12967,7 +13085,7 @@ function Kanban({
|
|
|
12967
13085
|
]
|
|
12968
13086
|
}
|
|
12969
13087
|
)
|
|
12970
|
-
] })
|
|
13088
|
+
] }) })
|
|
12971
13089
|
] })
|
|
12972
13090
|
] }),
|
|
12973
13091
|
column.limit && /* @__PURE__ */ jsx(MoonUICardDescriptionPro, { className: cn(
|
|
@@ -12981,12 +13099,12 @@ function Kanban({
|
|
|
12981
13099
|
column.limit,
|
|
12982
13100
|
")"
|
|
12983
13101
|
] }) : `WIP limit: ${column.cards.length}/${column.limit}` })
|
|
12984
|
-
] }),
|
|
12985
|
-
!column.collapsed && /* @__PURE__ */ jsxs(MoonUICardContentPro, { className: "space-y-3", children: [
|
|
12986
|
-
/* @__PURE__ */ jsx(ScrollArea, { className: "h-[calc(100vh-300px)]", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: column.cards.sort((a, b) => a.position - b.position).map((card, index2) => /* @__PURE__ */ jsx(
|
|
13102
|
+
] }) }),
|
|
13103
|
+
!column.collapsed && /* @__PURE__ */ jsxs(MoonUICardContentPro, { className: "space-y-3", style: { gap: `${cardGap}px` }, children: [
|
|
13104
|
+
/* @__PURE__ */ jsx(ScrollArea, { className: "h-[calc(100vh-300px)]", children: column.cards.length === 0 && renderEmptyColumn ? renderEmptyColumn(column) : /* @__PURE__ */ jsx(AnimatePresence, { mode: enableAnimations ? "popLayout" : void 0, children: column.cards.sort((a, b) => a.position - b.position).map((card, index2) => /* @__PURE__ */ jsx(
|
|
12987
13105
|
"div",
|
|
12988
13106
|
{
|
|
12989
|
-
draggable: !disabled,
|
|
13107
|
+
draggable: !disabled && (typeof dragDisabled === "function" ? !dragDisabled(card) : !dragDisabled),
|
|
12990
13108
|
onDragStart: () => handleDragStart(card, column.id),
|
|
12991
13109
|
onDragEnd: handleDragEnd,
|
|
12992
13110
|
onDrop: (e) => {
|
|
@@ -12999,6 +13117,7 @@ function Kanban({
|
|
|
12999
13117
|
KanbanCardComponent,
|
|
13000
13118
|
{
|
|
13001
13119
|
card,
|
|
13120
|
+
column,
|
|
13002
13121
|
isDragging: draggedCard === card.id,
|
|
13003
13122
|
onEdit: (e) => {
|
|
13004
13123
|
e.stopPropagation();
|
|
@@ -13010,13 +13129,27 @@ function Kanban({
|
|
|
13010
13129
|
},
|
|
13011
13130
|
onClick: () => handleCardClick(card),
|
|
13012
13131
|
showDetails: showCardDetails,
|
|
13013
|
-
disabled
|
|
13132
|
+
disabled,
|
|
13133
|
+
renderCard,
|
|
13134
|
+
renderCardPreview,
|
|
13135
|
+
renderCardBadge,
|
|
13136
|
+
renderCardActions,
|
|
13137
|
+
cardCompactMode,
|
|
13138
|
+
cardShowCoverImage,
|
|
13139
|
+
cardShowAssignees,
|
|
13140
|
+
cardShowLabels,
|
|
13141
|
+
cardShowProgress,
|
|
13142
|
+
cardDateFormat,
|
|
13143
|
+
cardMaxAssigneesToShow,
|
|
13144
|
+
enableAnimations,
|
|
13145
|
+
animationDuration,
|
|
13146
|
+
cardVariant
|
|
13014
13147
|
}
|
|
13015
13148
|
)
|
|
13016
13149
|
},
|
|
13017
13150
|
card.id
|
|
13018
13151
|
)) }) }),
|
|
13019
|
-
onAddCard && !column.locked && !isOverLimit && /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
13152
|
+
onAddCard && !column.locked && !isOverLimit && (renderAddCardButton ? renderAddCardButton(column.id) : /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
13020
13153
|
/* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
13021
13154
|
MoonUIButtonPro,
|
|
13022
13155
|
{
|
|
@@ -13026,7 +13159,7 @@ function Kanban({
|
|
|
13026
13159
|
disabled,
|
|
13027
13160
|
children: [
|
|
13028
13161
|
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-2" }),
|
|
13029
|
-
"Add card"
|
|
13162
|
+
typeof addCardButtonText === "function" ? addCardButtonText(column.id) : addCardButtonText || "Add card"
|
|
13030
13163
|
]
|
|
13031
13164
|
}
|
|
13032
13165
|
) }),
|
|
@@ -13049,7 +13182,8 @@ function Kanban({
|
|
|
13049
13182
|
index2
|
|
13050
13183
|
))
|
|
13051
13184
|
] })
|
|
13052
|
-
] })
|
|
13185
|
+
] })),
|
|
13186
|
+
renderColumnFooter && renderColumnFooter(column)
|
|
13053
13187
|
] })
|
|
13054
13188
|
] })
|
|
13055
13189
|
},
|
|
@@ -55056,9 +55190,9 @@ function AdvancedChart({
|
|
|
55056
55190
|
toggleSeriesVisibility(entry.dataKey);
|
|
55057
55191
|
}
|
|
55058
55192
|
};
|
|
55059
|
-
const handleExport = (
|
|
55193
|
+
const handleExport = (format6) => {
|
|
55060
55194
|
if (onExport) {
|
|
55061
|
-
onExport(
|
|
55195
|
+
onExport(format6);
|
|
55062
55196
|
}
|
|
55063
55197
|
};
|
|
55064
55198
|
const handleZoom = (direction) => {
|
|
@@ -59254,7 +59388,7 @@ var OptimizedImageInternal = ({
|
|
|
59254
59388
|
width,
|
|
59255
59389
|
height,
|
|
59256
59390
|
quality = 75,
|
|
59257
|
-
format:
|
|
59391
|
+
format: format6 = "auto",
|
|
59258
59392
|
lazy = true,
|
|
59259
59393
|
blur: blur2 = true,
|
|
59260
59394
|
priority = false,
|
|
@@ -59293,7 +59427,7 @@ var OptimizedImageInternal = ({
|
|
|
59293
59427
|
params.set("f", options.format);
|
|
59294
59428
|
return optimizedUrl;
|
|
59295
59429
|
};
|
|
59296
|
-
const optimizedSrc = getOptimizedSrc(src, { width, height, quality, format:
|
|
59430
|
+
const optimizedSrc = getOptimizedSrc(src, { width, height, quality, format: format6 });
|
|
59297
59431
|
const handleImageLoad = () => {
|
|
59298
59432
|
setIsLoaded(true);
|
|
59299
59433
|
setIsLoading(false);
|
|
@@ -59457,7 +59591,7 @@ var OptimizedImageInternal = ({
|
|
|
59457
59591
|
] }),
|
|
59458
59592
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
59459
59593
|
"Format: ",
|
|
59460
|
-
|
|
59594
|
+
format6
|
|
59461
59595
|
] })
|
|
59462
59596
|
]
|
|
59463
59597
|
}
|
|
@@ -62337,11 +62471,11 @@ function downloadFile(content, filename, mimeType) {
|
|
|
62337
62471
|
URL.revokeObjectURL(url);
|
|
62338
62472
|
}
|
|
62339
62473
|
async function exportData(data, options) {
|
|
62340
|
-
const { format:
|
|
62474
|
+
const { format: format6, filename = "data-export", columns, includeHeaders = true } = options;
|
|
62341
62475
|
let content;
|
|
62342
62476
|
let mimeType;
|
|
62343
62477
|
let extension;
|
|
62344
|
-
switch (
|
|
62478
|
+
switch (format6) {
|
|
62345
62479
|
case "csv":
|
|
62346
62480
|
content = dataToCSV(data, columns, includeHeaders);
|
|
62347
62481
|
mimeType = "text/csv;charset=utf-8;";
|
|
@@ -62355,7 +62489,7 @@ async function exportData(data, options) {
|
|
|
62355
62489
|
case "xlsx":
|
|
62356
62490
|
throw new Error("XLSX export requires additional dependencies. Use CSV format instead.");
|
|
62357
62491
|
default:
|
|
62358
|
-
throw new Error(`Unsupported export format: ${
|
|
62492
|
+
throw new Error(`Unsupported export format: ${format6}`);
|
|
62359
62493
|
}
|
|
62360
62494
|
const finalFilename = `${filename}-${( new Date()).toISOString().split("T")[0]}.${extension}`;
|
|
62361
62495
|
downloadFile(content, finalFilename, mimeType);
|
|
@@ -62838,11 +62972,11 @@ function DataTable({
|
|
|
62838
62972
|
rowSelection: features.rowSelection !== false || selectable,
|
|
62839
62973
|
export: features.export !== false || exportable
|
|
62840
62974
|
});
|
|
62841
|
-
const handleExport = async (
|
|
62975
|
+
const handleExport = async (format6) => {
|
|
62842
62976
|
const selectedRows = table.getFilteredSelectedRowModel().rows;
|
|
62843
62977
|
const dataToExport = selectedRows.length > 0 ? selectedRows.map((row) => row.original) : table.getFilteredRowModel().rows.map((row) => row.original);
|
|
62844
62978
|
if (typeof exportable === "object" && exportable.onExport) {
|
|
62845
|
-
exportable.onExport(dataToExport,
|
|
62979
|
+
exportable.onExport(dataToExport, format6);
|
|
62846
62980
|
return;
|
|
62847
62981
|
}
|
|
62848
62982
|
if (onExport) {
|
|
@@ -62852,7 +62986,7 @@ function DataTable({
|
|
|
62852
62986
|
const filename = typeof exportable === "object" && exportable.filename ? exportable.filename : "data-export";
|
|
62853
62987
|
const visibleColumns = getVisibleColumns(columns, columnVisibility);
|
|
62854
62988
|
await exportData(dataToExport, {
|
|
62855
|
-
format:
|
|
62989
|
+
format: format6,
|
|
62856
62990
|
filename,
|
|
62857
62991
|
columns: visibleColumns,
|
|
62858
62992
|
includeHeaders: true
|
|
@@ -64784,18 +64918,18 @@ var countries = [
|
|
|
64784
64918
|
{ code: "NO", name: "Norway", dialCode: "+47", flag: "\u{1F1F3}\u{1F1F4}", format: "xxx xx xxx" },
|
|
64785
64919
|
{ code: "FI", name: "Finland", dialCode: "+358", flag: "\u{1F1EB}\u{1F1EE}", format: "xx xxxxxxx" }
|
|
64786
64920
|
];
|
|
64787
|
-
function formatPhoneNumber(number,
|
|
64788
|
-
if (!number || !
|
|
64921
|
+
function formatPhoneNumber(number, format6) {
|
|
64922
|
+
if (!number || !format6)
|
|
64789
64923
|
return "";
|
|
64790
64924
|
const cleaned = number.replace(/\D/g, "");
|
|
64791
64925
|
let formatted = "";
|
|
64792
64926
|
let digitIndex = 0;
|
|
64793
|
-
for (let i = 0; i <
|
|
64794
|
-
if (
|
|
64927
|
+
for (let i = 0; i < format6.length && digitIndex < cleaned.length; i++) {
|
|
64928
|
+
if (format6[i] === "x") {
|
|
64795
64929
|
formatted += cleaned[digitIndex];
|
|
64796
64930
|
digitIndex++;
|
|
64797
64931
|
} else {
|
|
64798
|
-
formatted +=
|
|
64932
|
+
formatted += format6[i];
|
|
64799
64933
|
}
|
|
64800
64934
|
}
|
|
64801
64935
|
return formatted;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
4
4
|
"description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|