@moontra/moonui-pro 2.25.10 → 2.25.12
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.global.js +29 -29
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +67 -52
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3606,10 +3606,10 @@ var moonUICardVariantsPro = cva(
|
|
|
3606
3606
|
glow: "border border-border shadow-[0_0_30px_rgba(var(--primary),0.15)] dark:shadow-[0_0_40px_rgba(var(--primary),0.25)]"
|
|
3607
3607
|
},
|
|
3608
3608
|
size: {
|
|
3609
|
-
default: "
|
|
3610
|
-
sm: "
|
|
3611
|
-
lg: "
|
|
3612
|
-
xl: "
|
|
3609
|
+
default: "",
|
|
3610
|
+
sm: "",
|
|
3611
|
+
lg: "",
|
|
3612
|
+
xl: ""
|
|
3613
3613
|
},
|
|
3614
3614
|
radius: {
|
|
3615
3615
|
default: "rounded-lg",
|
|
@@ -3712,7 +3712,7 @@ var MoonUICardHeaderPro = t.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
3712
3712
|
"div",
|
|
3713
3713
|
{
|
|
3714
3714
|
ref,
|
|
3715
|
-
className: cn("flex flex-col space-y-1.5", className),
|
|
3715
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
3716
3716
|
...props
|
|
3717
3717
|
}
|
|
3718
3718
|
));
|
|
@@ -3735,13 +3735,13 @@ var MoonUICardDescriptionPro = t.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3735
3735
|
}
|
|
3736
3736
|
));
|
|
3737
3737
|
MoonUICardDescriptionPro.displayName = "MoonUICardDescriptionPro";
|
|
3738
|
-
var MoonUICardContentPro = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("pt-0", className), ...props }));
|
|
3738
|
+
var MoonUICardContentPro = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
3739
3739
|
MoonUICardContentPro.displayName = "MoonUICardContentPro";
|
|
3740
3740
|
var MoonUICardFooterPro = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3741
3741
|
"div",
|
|
3742
3742
|
{
|
|
3743
3743
|
ref,
|
|
3744
|
-
className: cn("flex items-center pt-
|
|
3744
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
3745
3745
|
...props
|
|
3746
3746
|
}
|
|
3747
3747
|
));
|
|
@@ -64323,10 +64323,10 @@ function DashboardGrid({
|
|
|
64323
64323
|
className,
|
|
64324
64324
|
glassmorphism = false,
|
|
64325
64325
|
breakpoints = { lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 },
|
|
64326
|
-
cols = { lg: 12, md:
|
|
64326
|
+
cols = { lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 },
|
|
64327
64327
|
rowHeight = 80,
|
|
64328
|
-
margin = [
|
|
64329
|
-
containerPadding = [
|
|
64328
|
+
margin = [20, 20],
|
|
64329
|
+
containerPadding = [20, 20]
|
|
64330
64330
|
}) {
|
|
64331
64331
|
const [layouts, setLayouts] = t__default.useState({});
|
|
64332
64332
|
const [currentBreakpoint, setCurrentBreakpoint] = t__default.useState("lg");
|
|
@@ -64361,61 +64361,76 @@ function DashboardGrid({
|
|
|
64361
64361
|
const baseLayout = widgets.map((widget, index2) => ({
|
|
64362
64362
|
i: widget.id,
|
|
64363
64363
|
x: widget.position?.x ?? index2 * 3 % 12,
|
|
64364
|
-
y: widget.position?.y ?? Math.floor(index2
|
|
64364
|
+
y: widget.position?.y ?? Math.floor(index2 / 4) * 3,
|
|
64365
64365
|
w: widget.size?.w ?? 3,
|
|
64366
64366
|
h: widget.size?.h ?? 3,
|
|
64367
|
-
minW: widget.size?.minW ||
|
|
64367
|
+
minW: widget.size?.minW || 1,
|
|
64368
64368
|
maxW: widget.size?.maxW || 12,
|
|
64369
64369
|
minH: widget.size?.minH || 2,
|
|
64370
64370
|
maxH: widget.size?.maxH || 8,
|
|
64371
64371
|
isDraggable: editMode && !lockedWidgets.has(widget.id) && widget.permissions?.canMove !== false,
|
|
64372
64372
|
isResizable: editMode && !lockedWidgets.has(widget.id) && widget.permissions?.canResize !== false
|
|
64373
64373
|
}));
|
|
64374
|
-
const
|
|
64375
|
-
|
|
64376
|
-
|
|
64377
|
-
|
|
64378
|
-
|
|
64374
|
+
const preventCollisions = (items, colCount) => {
|
|
64375
|
+
const sorted = [...items].sort((a, b) => {
|
|
64376
|
+
if (a.y === b.y)
|
|
64377
|
+
return a.x - b.x;
|
|
64378
|
+
return a.y - b.y;
|
|
64379
|
+
});
|
|
64380
|
+
let currentY = 0;
|
|
64381
|
+
const positioned = [];
|
|
64382
|
+
for (const item of sorted) {
|
|
64383
|
+
const adjustedW = Math.min(item.w, colCount);
|
|
64384
|
+
let finalY = currentY;
|
|
64385
|
+
for (const prev of positioned) {
|
|
64386
|
+
const prevBottom = prev.y + prev.h;
|
|
64387
|
+
if (prev.x < adjustedW && prev.x + prev.w > 0 && prevBottom > finalY) {
|
|
64388
|
+
finalY = prevBottom;
|
|
64389
|
+
}
|
|
64390
|
+
}
|
|
64391
|
+
positioned.push({
|
|
64392
|
+
...item,
|
|
64393
|
+
w: adjustedW,
|
|
64394
|
+
x: 0,
|
|
64395
|
+
y: finalY
|
|
64396
|
+
});
|
|
64397
|
+
currentY = finalY + item.h;
|
|
64398
|
+
}
|
|
64399
|
+
return positioned;
|
|
64400
|
+
};
|
|
64379
64401
|
return {
|
|
64380
64402
|
lg: baseLayout,
|
|
64381
|
-
md:
|
|
64382
|
-
const maxW = Math.min(item.w, 4);
|
|
64403
|
+
md: widgets.map((widget, index2) => {
|
|
64383
64404
|
const row = Math.floor(index2 / 2);
|
|
64384
|
-
const col = index2 % 2 *
|
|
64405
|
+
const col = index2 % 2 * 5;
|
|
64385
64406
|
return {
|
|
64386
|
-
|
|
64387
|
-
w:
|
|
64407
|
+
i: widget.id,
|
|
64408
|
+
w: Math.min(widget.size?.w ?? 5, 5),
|
|
64409
|
+
h: widget.size?.h ?? 3,
|
|
64388
64410
|
x: col,
|
|
64389
|
-
y: row *
|
|
64390
|
-
|
|
64411
|
+
y: row * 4,
|
|
64412
|
+
minW: 2,
|
|
64413
|
+
minH: 2,
|
|
64414
|
+
isDraggable: editMode && !lockedWidgets.has(widget.id),
|
|
64415
|
+
isResizable: editMode && !lockedWidgets.has(widget.id)
|
|
64391
64416
|
};
|
|
64392
64417
|
}),
|
|
64393
|
-
sm:
|
|
64394
|
-
const maxW = Math.min(item.w, 4);
|
|
64395
|
-
return {
|
|
64396
|
-
...item,
|
|
64397
|
-
w: maxW,
|
|
64398
|
-
x: 0,
|
|
64399
|
-
y: index2 * 3,
|
|
64400
|
-
h: Math.min(item.h, 3)
|
|
64401
|
-
};
|
|
64402
|
-
}),
|
|
64403
|
-
xs: sortedLayout.map((item, index2) => ({
|
|
64418
|
+
sm: preventCollisions(baseLayout.map((item) => ({
|
|
64404
64419
|
...item,
|
|
64405
|
-
w:
|
|
64406
|
-
|
|
64407
|
-
|
|
64408
|
-
|
|
64409
|
-
h: Math.min(item.h, 2)
|
|
64410
|
-
})),
|
|
64411
|
-
xxs: sortedLayout.map((item, index2) => ({
|
|
64420
|
+
w: Math.min(item.w, 6),
|
|
64421
|
+
h: Math.min(item.h, 4)
|
|
64422
|
+
})), 6),
|
|
64423
|
+
xs: preventCollisions(baseLayout.map((item) => ({
|
|
64412
64424
|
...item,
|
|
64413
|
-
w:
|
|
64425
|
+
w: Math.min(item.w, 4),
|
|
64426
|
+
h: Math.min(item.h, 3)
|
|
64427
|
+
})), 4),
|
|
64428
|
+
xxs: preventCollisions(baseLayout.map((item) => ({
|
|
64429
|
+
...item,
|
|
64430
|
+
w: 2,
|
|
64414
64431
|
// Full width on extra small
|
|
64415
|
-
|
|
64416
|
-
|
|
64417
|
-
h: Math.min(item.h, 2)
|
|
64418
|
-
}))
|
|
64432
|
+
h: Math.min(item.h, 3)
|
|
64433
|
+
})), 2)
|
|
64419
64434
|
};
|
|
64420
64435
|
};
|
|
64421
64436
|
const toggleWidgetLock = (widgetId) => {
|
|
@@ -64659,12 +64674,12 @@ function DashboardGrid({
|
|
|
64659
64674
|
draggableHandle: ".drag-handle",
|
|
64660
64675
|
isDraggable: editMode,
|
|
64661
64676
|
isResizable: editMode,
|
|
64662
|
-
compactType,
|
|
64663
|
-
preventCollision:
|
|
64677
|
+
compactType: "vertical",
|
|
64678
|
+
preventCollision: true,
|
|
64664
64679
|
useCSSTransforms: true,
|
|
64665
64680
|
transformScale: 1,
|
|
64666
64681
|
isDroppable: true,
|
|
64667
|
-
autoSize:
|
|
64682
|
+
autoSize: false,
|
|
64668
64683
|
verticalCompact: true,
|
|
64669
64684
|
children: widgets.map((widget) => /* @__PURE__ */ jsx("div", { children: renderWidget(widget) }, widget.id))
|
|
64670
64685
|
}
|
|
@@ -65667,7 +65682,7 @@ var DASHBOARD_TEMPLATES = [
|
|
|
65667
65682
|
type: "activity",
|
|
65668
65683
|
title: "Recent Activity",
|
|
65669
65684
|
size: { w: 3, h: 6 },
|
|
65670
|
-
position: { x:
|
|
65685
|
+
position: { x: 6, y: 0 },
|
|
65671
65686
|
data: {
|
|
65672
65687
|
realtime: true,
|
|
65673
65688
|
items: [
|
|
@@ -65944,7 +65959,7 @@ var DashboardInternal = t__default.memo(function DashboardInternal2({
|
|
|
65944
65959
|
const newWidgets = template.widgets.map((w, index2) => ({
|
|
65945
65960
|
...w,
|
|
65946
65961
|
id: `widget-${Date.now()}-${index2}`,
|
|
65947
|
-
position: w.position || { x: index2 * 3 % 12, y: Math.floor(index2
|
|
65962
|
+
position: w.position || { x: index2 * 3 % 12, y: Math.floor(index2 / 4) * 3 },
|
|
65948
65963
|
size: w.size || { w: 3, h: 3 }
|
|
65949
65964
|
}));
|
|
65950
65965
|
setWidgets(newWidgets);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.25.
|
|
3
|
+
"version": "2.25.12",
|
|
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",
|