@almadar/ui 4.48.0 → 4.50.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/avl/index.cjs +1979 -1754
- package/dist/avl/index.js +753 -528
- package/dist/components/index.cjs +1740 -1515
- package/dist/components/index.js +734 -509
- package/dist/components/molecules/DataGrid.d.ts +3 -2
- package/dist/components/molecules/DataList.d.ts +3 -2
- package/dist/components/molecules/useDataDnd.d.ts +44 -0
- package/dist/providers/index.cjs +1605 -1380
- package/dist/providers/index.js +732 -507
- package/dist/runtime/index.cjs +1642 -1417
- package/dist/runtime/index.js +736 -511
- package/package.json +4 -1
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React81 from 'react';
|
|
2
|
+
import React81__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId } from 'react';
|
|
3
3
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
@@ -36,6 +36,9 @@ import langToml from 'react-syntax-highlighter/dist/esm/languages/prism/toml.js'
|
|
|
36
36
|
import langGo from 'react-syntax-highlighter/dist/esm/languages/prism/go.js';
|
|
37
37
|
import langGraphql from 'react-syntax-highlighter/dist/esm/languages/prism/graphql.js';
|
|
38
38
|
import { isInlineTrait } from '@almadar/core';
|
|
39
|
+
import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, closestCenter, useDroppable } from '@dnd-kit/core';
|
|
40
|
+
import { sortableKeyboardCoordinates, arrayMove, useSortable, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
41
|
+
import { CSS } from '@dnd-kit/utilities';
|
|
39
42
|
import { Handle, Position } from '@xyflow/react';
|
|
40
43
|
import { getPatternDefinition, getComponentForPattern as getComponentForPattern$1 } from '@almadar/patterns';
|
|
41
44
|
|
|
@@ -684,7 +687,7 @@ var init_Box = __esm({
|
|
|
684
687
|
fixed: "fixed",
|
|
685
688
|
sticky: "sticky"
|
|
686
689
|
};
|
|
687
|
-
Box =
|
|
690
|
+
Box = React81__default.forwardRef(
|
|
688
691
|
({
|
|
689
692
|
padding,
|
|
690
693
|
paddingX,
|
|
@@ -1383,7 +1386,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1383
1386
|
const IconComp = value;
|
|
1384
1387
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1385
1388
|
}
|
|
1386
|
-
if (
|
|
1389
|
+
if (React81__default.isValidElement(value)) {
|
|
1387
1390
|
return value;
|
|
1388
1391
|
}
|
|
1389
1392
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -1459,7 +1462,7 @@ var init_Button = __esm({
|
|
|
1459
1462
|
md: "h-4 w-4",
|
|
1460
1463
|
lg: "h-5 w-5"
|
|
1461
1464
|
};
|
|
1462
|
-
Button =
|
|
1465
|
+
Button = React81__default.forwardRef(
|
|
1463
1466
|
({
|
|
1464
1467
|
className,
|
|
1465
1468
|
variant = "primary",
|
|
@@ -1562,7 +1565,7 @@ var init_Badge = __esm({
|
|
|
1562
1565
|
md: "px-2.5 py-1 text-sm",
|
|
1563
1566
|
lg: "px-3 py-1.5 text-base"
|
|
1564
1567
|
};
|
|
1565
|
-
Badge =
|
|
1568
|
+
Badge = React81__default.forwardRef(
|
|
1566
1569
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
1567
1570
|
const iconSizes3 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
1568
1571
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -1856,7 +1859,7 @@ var init_SvgFlow = __esm({
|
|
|
1856
1859
|
opacity = 1,
|
|
1857
1860
|
className
|
|
1858
1861
|
}) => {
|
|
1859
|
-
const markerId =
|
|
1862
|
+
const markerId = React81__default.useMemo(() => {
|
|
1860
1863
|
flowIdCounter += 1;
|
|
1861
1864
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
1862
1865
|
}, []);
|
|
@@ -2399,7 +2402,7 @@ var init_SvgRing = __esm({
|
|
|
2399
2402
|
className,
|
|
2400
2403
|
label
|
|
2401
2404
|
}) => {
|
|
2402
|
-
const gradientId =
|
|
2405
|
+
const gradientId = React81__default.useMemo(() => {
|
|
2403
2406
|
ringIdCounter += 1;
|
|
2404
2407
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
2405
2408
|
}, []);
|
|
@@ -2560,7 +2563,7 @@ var Input;
|
|
|
2560
2563
|
var init_Input = __esm({
|
|
2561
2564
|
"components/atoms/Input.tsx"() {
|
|
2562
2565
|
init_cn();
|
|
2563
|
-
Input =
|
|
2566
|
+
Input = React81__default.forwardRef(
|
|
2564
2567
|
({
|
|
2565
2568
|
className,
|
|
2566
2569
|
inputType,
|
|
@@ -2678,7 +2681,7 @@ var Label;
|
|
|
2678
2681
|
var init_Label = __esm({
|
|
2679
2682
|
"components/atoms/Label.tsx"() {
|
|
2680
2683
|
init_cn();
|
|
2681
|
-
Label =
|
|
2684
|
+
Label = React81__default.forwardRef(
|
|
2682
2685
|
({ className, required, children, ...props }, ref) => {
|
|
2683
2686
|
return /* @__PURE__ */ jsxs(
|
|
2684
2687
|
"label",
|
|
@@ -2704,7 +2707,7 @@ var Textarea;
|
|
|
2704
2707
|
var init_Textarea = __esm({
|
|
2705
2708
|
"components/atoms/Textarea.tsx"() {
|
|
2706
2709
|
init_cn();
|
|
2707
|
-
Textarea =
|
|
2710
|
+
Textarea = React81__default.forwardRef(
|
|
2708
2711
|
({ className, error, ...props }, ref) => {
|
|
2709
2712
|
return /* @__PURE__ */ jsx(
|
|
2710
2713
|
"textarea",
|
|
@@ -2733,7 +2736,7 @@ var Select;
|
|
|
2733
2736
|
var init_Select = __esm({
|
|
2734
2737
|
"components/atoms/Select.tsx"() {
|
|
2735
2738
|
init_cn();
|
|
2736
|
-
Select =
|
|
2739
|
+
Select = React81__default.forwardRef(
|
|
2737
2740
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
2738
2741
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
2739
2742
|
/* @__PURE__ */ jsxs(
|
|
@@ -2775,7 +2778,7 @@ var Checkbox;
|
|
|
2775
2778
|
var init_Checkbox = __esm({
|
|
2776
2779
|
"components/atoms/Checkbox.tsx"() {
|
|
2777
2780
|
init_cn();
|
|
2778
|
-
Checkbox =
|
|
2781
|
+
Checkbox = React81__default.forwardRef(
|
|
2779
2782
|
({ className, label, id, ...props }, ref) => {
|
|
2780
2783
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
2781
2784
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -2857,7 +2860,7 @@ var init_Card = __esm({
|
|
|
2857
2860
|
md: "shadow",
|
|
2858
2861
|
lg: "shadow-lg"
|
|
2859
2862
|
};
|
|
2860
|
-
Card =
|
|
2863
|
+
Card = React81__default.forwardRef(
|
|
2861
2864
|
({
|
|
2862
2865
|
className,
|
|
2863
2866
|
variant = "bordered",
|
|
@@ -2893,9 +2896,9 @@ var init_Card = __esm({
|
|
|
2893
2896
|
}
|
|
2894
2897
|
);
|
|
2895
2898
|
Card.displayName = "Card";
|
|
2896
|
-
CardHeader =
|
|
2899
|
+
CardHeader = React81__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
2897
2900
|
CardHeader.displayName = "CardHeader";
|
|
2898
|
-
CardTitle =
|
|
2901
|
+
CardTitle = React81__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2899
2902
|
"h3",
|
|
2900
2903
|
{
|
|
2901
2904
|
ref,
|
|
@@ -2908,11 +2911,11 @@ var init_Card = __esm({
|
|
|
2908
2911
|
}
|
|
2909
2912
|
));
|
|
2910
2913
|
CardTitle.displayName = "CardTitle";
|
|
2911
|
-
CardContent =
|
|
2914
|
+
CardContent = React81__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
2912
2915
|
CardContent.displayName = "CardContent";
|
|
2913
2916
|
CardBody = CardContent;
|
|
2914
2917
|
CardBody.displayName = "CardBody";
|
|
2915
|
-
CardFooter =
|
|
2918
|
+
CardFooter = React81__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2916
2919
|
"div",
|
|
2917
2920
|
{
|
|
2918
2921
|
ref,
|
|
@@ -2967,7 +2970,7 @@ var init_FilterPill = __esm({
|
|
|
2967
2970
|
md: "w-3.5 h-3.5",
|
|
2968
2971
|
lg: "w-4 h-4"
|
|
2969
2972
|
};
|
|
2970
|
-
FilterPill =
|
|
2973
|
+
FilterPill = React81__default.forwardRef(
|
|
2971
2974
|
({
|
|
2972
2975
|
className,
|
|
2973
2976
|
variant = "default",
|
|
@@ -3046,7 +3049,7 @@ var init_Spinner = __esm({
|
|
|
3046
3049
|
md: "h-6 w-6",
|
|
3047
3050
|
lg: "h-8 w-8"
|
|
3048
3051
|
};
|
|
3049
|
-
Spinner =
|
|
3052
|
+
Spinner = React81__default.forwardRef(
|
|
3050
3053
|
({ className, size = "md", ...props }, ref) => {
|
|
3051
3054
|
return /* @__PURE__ */ jsx(
|
|
3052
3055
|
"div",
|
|
@@ -3494,7 +3497,7 @@ var Radio;
|
|
|
3494
3497
|
var init_Radio = __esm({
|
|
3495
3498
|
"components/atoms/Radio.tsx"() {
|
|
3496
3499
|
init_cn();
|
|
3497
|
-
Radio =
|
|
3500
|
+
Radio = React81__default.forwardRef(
|
|
3498
3501
|
({
|
|
3499
3502
|
label,
|
|
3500
3503
|
helperText,
|
|
@@ -3605,7 +3608,7 @@ var init_Switch = __esm({
|
|
|
3605
3608
|
"components/atoms/Switch.tsx"() {
|
|
3606
3609
|
"use client";
|
|
3607
3610
|
init_cn();
|
|
3608
|
-
Switch =
|
|
3611
|
+
Switch = React81.forwardRef(
|
|
3609
3612
|
({
|
|
3610
3613
|
checked,
|
|
3611
3614
|
defaultChecked = false,
|
|
@@ -3616,10 +3619,10 @@ var init_Switch = __esm({
|
|
|
3616
3619
|
name,
|
|
3617
3620
|
className
|
|
3618
3621
|
}, ref) => {
|
|
3619
|
-
const [isChecked, setIsChecked] =
|
|
3622
|
+
const [isChecked, setIsChecked] = React81.useState(
|
|
3620
3623
|
checked !== void 0 ? checked : defaultChecked
|
|
3621
3624
|
);
|
|
3622
|
-
|
|
3625
|
+
React81.useEffect(() => {
|
|
3623
3626
|
if (checked !== void 0) {
|
|
3624
3627
|
setIsChecked(checked);
|
|
3625
3628
|
}
|
|
@@ -4039,8 +4042,8 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4039
4042
|
position = "top",
|
|
4040
4043
|
className
|
|
4041
4044
|
}) => {
|
|
4042
|
-
const [isVisible, setIsVisible] =
|
|
4043
|
-
const timeoutRef =
|
|
4045
|
+
const [isVisible, setIsVisible] = React81__default.useState(false);
|
|
4046
|
+
const timeoutRef = React81__default.useRef(null);
|
|
4044
4047
|
const handleMouseEnter = () => {
|
|
4045
4048
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4046
4049
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -4049,7 +4052,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4049
4052
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4050
4053
|
setIsVisible(false);
|
|
4051
4054
|
};
|
|
4052
|
-
|
|
4055
|
+
React81__default.useEffect(() => {
|
|
4053
4056
|
return () => {
|
|
4054
4057
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4055
4058
|
};
|
|
@@ -4259,7 +4262,7 @@ var init_StatusDot = __esm({
|
|
|
4259
4262
|
md: "w-2.5 h-2.5",
|
|
4260
4263
|
lg: "w-3 h-3"
|
|
4261
4264
|
};
|
|
4262
|
-
StatusDot =
|
|
4265
|
+
StatusDot = React81__default.forwardRef(
|
|
4263
4266
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
4264
4267
|
return /* @__PURE__ */ jsx(
|
|
4265
4268
|
"span",
|
|
@@ -4312,7 +4315,7 @@ var init_TrendIndicator = __esm({
|
|
|
4312
4315
|
down: TrendingDown,
|
|
4313
4316
|
flat: ArrowRight
|
|
4314
4317
|
};
|
|
4315
|
-
TrendIndicator =
|
|
4318
|
+
TrendIndicator = React81__default.forwardRef(
|
|
4316
4319
|
({
|
|
4317
4320
|
className,
|
|
4318
4321
|
value,
|
|
@@ -4379,7 +4382,7 @@ var init_RangeSlider = __esm({
|
|
|
4379
4382
|
md: "w-4 h-4",
|
|
4380
4383
|
lg: "w-5 h-5"
|
|
4381
4384
|
};
|
|
4382
|
-
RangeSlider =
|
|
4385
|
+
RangeSlider = React81__default.forwardRef(
|
|
4383
4386
|
({
|
|
4384
4387
|
className,
|
|
4385
4388
|
min = 0,
|
|
@@ -4947,7 +4950,7 @@ var init_ContentSection = __esm({
|
|
|
4947
4950
|
md: "py-16",
|
|
4948
4951
|
lg: "py-24"
|
|
4949
4952
|
};
|
|
4950
|
-
ContentSection =
|
|
4953
|
+
ContentSection = React81__default.forwardRef(
|
|
4951
4954
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
4952
4955
|
return /* @__PURE__ */ jsx(
|
|
4953
4956
|
Box,
|
|
@@ -5481,7 +5484,7 @@ var init_AnimatedReveal = __esm({
|
|
|
5481
5484
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
5482
5485
|
"none": {}
|
|
5483
5486
|
};
|
|
5484
|
-
AnimatedReveal =
|
|
5487
|
+
AnimatedReveal = React81__default.forwardRef(
|
|
5485
5488
|
({
|
|
5486
5489
|
trigger = "scroll",
|
|
5487
5490
|
animation = "fade-up",
|
|
@@ -5641,7 +5644,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
5641
5644
|
"components/atoms/AnimatedGraphic.tsx"() {
|
|
5642
5645
|
"use client";
|
|
5643
5646
|
init_cn();
|
|
5644
|
-
AnimatedGraphic =
|
|
5647
|
+
AnimatedGraphic = React81__default.forwardRef(
|
|
5645
5648
|
({
|
|
5646
5649
|
src,
|
|
5647
5650
|
svgContent,
|
|
@@ -5664,7 +5667,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
5664
5667
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
5665
5668
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
5666
5669
|
const prevAnimateRef = useRef(animate);
|
|
5667
|
-
const setRef =
|
|
5670
|
+
const setRef = React81__default.useCallback(
|
|
5668
5671
|
(node) => {
|
|
5669
5672
|
containerRef.current = node;
|
|
5670
5673
|
if (typeof ref === "function") ref(node);
|
|
@@ -5889,9 +5892,9 @@ function ScoreDisplay({
|
|
|
5889
5892
|
...rest
|
|
5890
5893
|
}) {
|
|
5891
5894
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
5892
|
-
const [displayValue, setDisplayValue] =
|
|
5893
|
-
const [isAnimating, setIsAnimating] =
|
|
5894
|
-
|
|
5895
|
+
const [displayValue, setDisplayValue] = React81.useState(resolvedValue);
|
|
5896
|
+
const [isAnimating, setIsAnimating] = React81.useState(false);
|
|
5897
|
+
React81.useEffect(() => {
|
|
5895
5898
|
if (!animated || displayValue === resolvedValue) {
|
|
5896
5899
|
setDisplayValue(resolvedValue);
|
|
5897
5900
|
return;
|
|
@@ -5961,9 +5964,9 @@ function ControlButton({
|
|
|
5961
5964
|
className
|
|
5962
5965
|
}) {
|
|
5963
5966
|
const eventBus = useEventBus();
|
|
5964
|
-
const [isPressed, setIsPressed] =
|
|
5967
|
+
const [isPressed, setIsPressed] = React81.useState(false);
|
|
5965
5968
|
const actualPressed = pressed ?? isPressed;
|
|
5966
|
-
const handlePointerDown =
|
|
5969
|
+
const handlePointerDown = React81.useCallback(
|
|
5967
5970
|
(e) => {
|
|
5968
5971
|
e.preventDefault();
|
|
5969
5972
|
if (disabled) return;
|
|
@@ -5973,7 +5976,7 @@ function ControlButton({
|
|
|
5973
5976
|
},
|
|
5974
5977
|
[disabled, pressEvent, eventBus, onPress]
|
|
5975
5978
|
);
|
|
5976
|
-
const handlePointerUp =
|
|
5979
|
+
const handlePointerUp = React81.useCallback(
|
|
5977
5980
|
(e) => {
|
|
5978
5981
|
e.preventDefault();
|
|
5979
5982
|
if (disabled) return;
|
|
@@ -5983,7 +5986,7 @@ function ControlButton({
|
|
|
5983
5986
|
},
|
|
5984
5987
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
5985
5988
|
);
|
|
5986
|
-
const handlePointerLeave =
|
|
5989
|
+
const handlePointerLeave = React81.useCallback(
|
|
5987
5990
|
(e) => {
|
|
5988
5991
|
if (isPressed) {
|
|
5989
5992
|
setIsPressed(false);
|
|
@@ -6889,9 +6892,9 @@ function MiniMap({
|
|
|
6889
6892
|
viewportRect,
|
|
6890
6893
|
className
|
|
6891
6894
|
}) {
|
|
6892
|
-
const canvasRef =
|
|
6893
|
-
const frameRef =
|
|
6894
|
-
|
|
6895
|
+
const canvasRef = React81.useRef(null);
|
|
6896
|
+
const frameRef = React81.useRef(0);
|
|
6897
|
+
React81.useEffect(() => {
|
|
6895
6898
|
const canvas = canvasRef.current;
|
|
6896
6899
|
if (!canvas) return;
|
|
6897
6900
|
const ctx = canvas.getContext("2d");
|
|
@@ -7185,7 +7188,7 @@ var init_ErrorBoundary = __esm({
|
|
|
7185
7188
|
"use client";
|
|
7186
7189
|
init_cn();
|
|
7187
7190
|
init_ErrorState();
|
|
7188
|
-
ErrorBoundary = class extends
|
|
7191
|
+
ErrorBoundary = class extends React81__default.Component {
|
|
7189
7192
|
constructor(props) {
|
|
7190
7193
|
super(props);
|
|
7191
7194
|
__publicField(this, "reset", () => {
|
|
@@ -8616,8 +8619,8 @@ var init_Tooltip = __esm({
|
|
|
8616
8619
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
8617
8620
|
};
|
|
8618
8621
|
}, []);
|
|
8619
|
-
const triggerElement =
|
|
8620
|
-
const trigger =
|
|
8622
|
+
const triggerElement = React81__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
8623
|
+
const trigger = React81__default.cloneElement(triggerElement, {
|
|
8621
8624
|
ref: triggerRef,
|
|
8622
8625
|
onMouseEnter: handleMouseEnter,
|
|
8623
8626
|
onMouseLeave: handleMouseLeave,
|
|
@@ -8738,8 +8741,8 @@ var init_Popover = __esm({
|
|
|
8738
8741
|
onMouseEnter: handleOpen,
|
|
8739
8742
|
onMouseLeave: handleClose
|
|
8740
8743
|
};
|
|
8741
|
-
const childElement =
|
|
8742
|
-
const triggerElement =
|
|
8744
|
+
const childElement = React81__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
8745
|
+
const triggerElement = React81__default.cloneElement(
|
|
8743
8746
|
childElement,
|
|
8744
8747
|
{
|
|
8745
8748
|
ref: triggerRef,
|
|
@@ -8856,8 +8859,8 @@ var init_Menu = __esm({
|
|
|
8856
8859
|
"bottom-start": "top-full left-0 mt-2",
|
|
8857
8860
|
"bottom-end": "top-full right-0 mt-2"
|
|
8858
8861
|
};
|
|
8859
|
-
const triggerChild =
|
|
8860
|
-
const triggerElement =
|
|
8862
|
+
const triggerChild = React81__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
|
|
8863
|
+
const triggerElement = React81__default.cloneElement(
|
|
8861
8864
|
triggerChild,
|
|
8862
8865
|
{
|
|
8863
8866
|
ref: triggerRef,
|
|
@@ -9273,7 +9276,7 @@ var init_MapView = __esm({
|
|
|
9273
9276
|
shadowSize: [41, 41]
|
|
9274
9277
|
});
|
|
9275
9278
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
9276
|
-
const { useEffect: useEffect67, useRef: useRef65, useCallback: useCallback110, useState: useState95 } =
|
|
9279
|
+
const { useEffect: useEffect67, useRef: useRef65, useCallback: useCallback110, useState: useState95 } = React81__default;
|
|
9277
9280
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
9278
9281
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
9279
9282
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -9519,7 +9522,7 @@ function InputPattern({
|
|
|
9519
9522
|
fieldName
|
|
9520
9523
|
}) {
|
|
9521
9524
|
const { emit } = useEventBus();
|
|
9522
|
-
const [localValue, setLocalValue] =
|
|
9525
|
+
const [localValue, setLocalValue] = React81__default.useState(value);
|
|
9523
9526
|
const handleChange = (e) => {
|
|
9524
9527
|
setLocalValue(e.target.value);
|
|
9525
9528
|
if (onChange) {
|
|
@@ -9557,7 +9560,7 @@ function TextareaPattern({
|
|
|
9557
9560
|
fieldName
|
|
9558
9561
|
}) {
|
|
9559
9562
|
const { emit } = useEventBus();
|
|
9560
|
-
const [localValue, setLocalValue] =
|
|
9563
|
+
const [localValue, setLocalValue] = React81__default.useState(value);
|
|
9561
9564
|
const handleChange = (e) => {
|
|
9562
9565
|
setLocalValue(e.target.value);
|
|
9563
9566
|
if (onChange) {
|
|
@@ -9589,7 +9592,7 @@ function SelectPattern({
|
|
|
9589
9592
|
fieldName
|
|
9590
9593
|
}) {
|
|
9591
9594
|
const { emit } = useEventBus();
|
|
9592
|
-
const [localValue, setLocalValue] =
|
|
9595
|
+
const [localValue, setLocalValue] = React81__default.useState(value);
|
|
9593
9596
|
const handleChange = (e) => {
|
|
9594
9597
|
setLocalValue(e.target.value);
|
|
9595
9598
|
if (onChange) {
|
|
@@ -9618,7 +9621,7 @@ function CheckboxPattern({
|
|
|
9618
9621
|
className
|
|
9619
9622
|
}) {
|
|
9620
9623
|
const { emit } = useEventBus();
|
|
9621
|
-
const [localChecked, setLocalChecked] =
|
|
9624
|
+
const [localChecked, setLocalChecked] = React81__default.useState(checked);
|
|
9622
9625
|
const handleChange = (e) => {
|
|
9623
9626
|
setLocalChecked(e.target.checked);
|
|
9624
9627
|
if (onChange) {
|
|
@@ -9849,8 +9852,8 @@ function ActionButtons({
|
|
|
9849
9852
|
disabled
|
|
9850
9853
|
}) {
|
|
9851
9854
|
const eventBus = useEventBus();
|
|
9852
|
-
const [activeButtons, setActiveButtons] =
|
|
9853
|
-
const handlePress =
|
|
9855
|
+
const [activeButtons, setActiveButtons] = React81.useState(/* @__PURE__ */ new Set());
|
|
9856
|
+
const handlePress = React81.useCallback(
|
|
9854
9857
|
(id) => {
|
|
9855
9858
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
9856
9859
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9858,7 +9861,7 @@ function ActionButtons({
|
|
|
9858
9861
|
},
|
|
9859
9862
|
[actionEvent, eventBus, onAction]
|
|
9860
9863
|
);
|
|
9861
|
-
const handleRelease =
|
|
9864
|
+
const handleRelease = React81.useCallback(
|
|
9862
9865
|
(id) => {
|
|
9863
9866
|
setActiveButtons((prev) => {
|
|
9864
9867
|
const next = new Set(prev);
|
|
@@ -12709,7 +12712,7 @@ var init_MarkdownContent = __esm({
|
|
|
12709
12712
|
init_Box();
|
|
12710
12713
|
init_useTranslate();
|
|
12711
12714
|
init_cn();
|
|
12712
|
-
MarkdownContent =
|
|
12715
|
+
MarkdownContent = React81__default.memo(
|
|
12713
12716
|
({ content, direction, className }) => {
|
|
12714
12717
|
const { t: _t } = useTranslate();
|
|
12715
12718
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -12927,7 +12930,7 @@ var init_CodeBlock = __esm({
|
|
|
12927
12930
|
log8 = createLogger("almadar:ui:markdown-code");
|
|
12928
12931
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
12929
12932
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
12930
|
-
CodeBlock =
|
|
12933
|
+
CodeBlock = React81__default.memo(
|
|
12931
12934
|
({
|
|
12932
12935
|
code: rawCode,
|
|
12933
12936
|
language = "text",
|
|
@@ -14236,7 +14239,7 @@ var init_StateMachineView = __esm({
|
|
|
14236
14239
|
style: { top: title ? 30 : 0 },
|
|
14237
14240
|
children: [
|
|
14238
14241
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
14239
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
14242
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React81__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
14240
14243
|
StateNode,
|
|
14241
14244
|
{
|
|
14242
14245
|
state,
|
|
@@ -20680,7 +20683,7 @@ function CraftingRecipe({
|
|
|
20680
20683
|
className
|
|
20681
20684
|
}) {
|
|
20682
20685
|
const eventBus = useEventBus();
|
|
20683
|
-
const handleCraft =
|
|
20686
|
+
const handleCraft = React81.useCallback(() => {
|
|
20684
20687
|
onCraft?.();
|
|
20685
20688
|
if (craftEvent) {
|
|
20686
20689
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -20697,7 +20700,7 @@ function CraftingRecipe({
|
|
|
20697
20700
|
children: [
|
|
20698
20701
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
20699
20702
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
20700
|
-
return /* @__PURE__ */ jsxs(
|
|
20703
|
+
return /* @__PURE__ */ jsxs(React81.Fragment, { children: [
|
|
20701
20704
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
20702
20705
|
ItemSlot,
|
|
20703
20706
|
{
|
|
@@ -20760,8 +20763,8 @@ function DPad({
|
|
|
20760
20763
|
}) {
|
|
20761
20764
|
const eventBus = useEventBus();
|
|
20762
20765
|
const sizes = sizeMap15[size];
|
|
20763
|
-
const [activeDirections, setActiveDirections] =
|
|
20764
|
-
const handlePress =
|
|
20766
|
+
const [activeDirections, setActiveDirections] = React81.useState(/* @__PURE__ */ new Set());
|
|
20767
|
+
const handlePress = React81.useCallback(
|
|
20765
20768
|
(direction) => {
|
|
20766
20769
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
20767
20770
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -20769,7 +20772,7 @@ function DPad({
|
|
|
20769
20772
|
},
|
|
20770
20773
|
[directionEvent, eventBus, onDirection]
|
|
20771
20774
|
);
|
|
20772
|
-
const handleRelease =
|
|
20775
|
+
const handleRelease = React81.useCallback(
|
|
20773
20776
|
(direction) => {
|
|
20774
20777
|
setActiveDirections((prev) => {
|
|
20775
20778
|
const next = new Set(prev);
|
|
@@ -21269,6 +21272,192 @@ var init_DashboardLayout = __esm({
|
|
|
21269
21272
|
NavLink.displayName = "NavLink";
|
|
21270
21273
|
}
|
|
21271
21274
|
});
|
|
21275
|
+
function useDataDnd(args) {
|
|
21276
|
+
const {
|
|
21277
|
+
dragGroup,
|
|
21278
|
+
accepts,
|
|
21279
|
+
sortable,
|
|
21280
|
+
dropEvent,
|
|
21281
|
+
reorderEvent,
|
|
21282
|
+
dndItemIdField = "id",
|
|
21283
|
+
items,
|
|
21284
|
+
layout
|
|
21285
|
+
} = args;
|
|
21286
|
+
const enabled = Boolean(dragGroup || accepts || sortable);
|
|
21287
|
+
const eventBus = useEventBus();
|
|
21288
|
+
const parentRoot = React81__default.useContext(RootCtx);
|
|
21289
|
+
const isRoot = enabled && parentRoot === null;
|
|
21290
|
+
const [localOrder, setLocalOrder] = React81__default.useState(null);
|
|
21291
|
+
const orderedItems = localOrder ?? items;
|
|
21292
|
+
React81__default.useEffect(() => {
|
|
21293
|
+
setLocalOrder(null);
|
|
21294
|
+
}, [items]);
|
|
21295
|
+
const itemIds = React81__default.useMemo(
|
|
21296
|
+
() => orderedItems.map((it, idx) => {
|
|
21297
|
+
const raw = it[dndItemIdField];
|
|
21298
|
+
return raw ?? `__idx_${idx}`;
|
|
21299
|
+
}),
|
|
21300
|
+
[orderedItems, dndItemIdField]
|
|
21301
|
+
);
|
|
21302
|
+
const zonesRef = React81__default.useRef(/* @__PURE__ */ new Map());
|
|
21303
|
+
const registerZone = React81__default.useCallback((zoneId2, meta2) => {
|
|
21304
|
+
zonesRef.current.set(zoneId2, meta2);
|
|
21305
|
+
}, []);
|
|
21306
|
+
const unregisterZone = React81__default.useCallback((zoneId2) => {
|
|
21307
|
+
zonesRef.current.delete(zoneId2);
|
|
21308
|
+
}, []);
|
|
21309
|
+
const zoneId = React81__default.useId();
|
|
21310
|
+
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
21311
|
+
const meta = React81__default.useMemo(
|
|
21312
|
+
() => ({ group: ownGroup, dropEvent, reorderEvent, itemIds }),
|
|
21313
|
+
[ownGroup, dropEvent, reorderEvent, itemIds]
|
|
21314
|
+
);
|
|
21315
|
+
React81__default.useEffect(() => {
|
|
21316
|
+
const target = isRoot ? null : parentRoot;
|
|
21317
|
+
if (!target) {
|
|
21318
|
+
zonesRef.current.set(zoneId, meta);
|
|
21319
|
+
return () => zonesRef.current.delete(zoneId);
|
|
21320
|
+
}
|
|
21321
|
+
target.registerZone(zoneId, meta);
|
|
21322
|
+
return () => target.unregisterZone(zoneId);
|
|
21323
|
+
}, [parentRoot, isRoot, zoneId, meta]);
|
|
21324
|
+
const sensors = useSensors(
|
|
21325
|
+
useSensor(PointerSensor, { activationConstraint: { distance: 5 } }),
|
|
21326
|
+
useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates })
|
|
21327
|
+
);
|
|
21328
|
+
const findZoneByItem = React81__default.useCallback(
|
|
21329
|
+
(id) => {
|
|
21330
|
+
for (const z of zonesRef.current.values()) {
|
|
21331
|
+
if (z.itemIds.includes(id)) return z;
|
|
21332
|
+
}
|
|
21333
|
+
return void 0;
|
|
21334
|
+
},
|
|
21335
|
+
[]
|
|
21336
|
+
);
|
|
21337
|
+
const findZoneByGroup = React81__default.useCallback(
|
|
21338
|
+
(group) => {
|
|
21339
|
+
for (const z of zonesRef.current.values()) {
|
|
21340
|
+
if (z.group === group) return z;
|
|
21341
|
+
}
|
|
21342
|
+
return void 0;
|
|
21343
|
+
},
|
|
21344
|
+
[]
|
|
21345
|
+
);
|
|
21346
|
+
const handleDragEnd = React81__default.useCallback(
|
|
21347
|
+
(event) => {
|
|
21348
|
+
const { active, over } = event;
|
|
21349
|
+
if (!over) return;
|
|
21350
|
+
const sourceZone = findZoneByItem(active.id);
|
|
21351
|
+
const overData = over.data?.current;
|
|
21352
|
+
const targetGroup = overData?.dndGroup;
|
|
21353
|
+
if (!sourceZone || !targetGroup) return;
|
|
21354
|
+
const targetZone = findZoneByGroup(targetGroup);
|
|
21355
|
+
if (!targetZone) return;
|
|
21356
|
+
if (sourceZone.group !== targetZone.group) {
|
|
21357
|
+
if (targetZone.dropEvent) {
|
|
21358
|
+
const newIndex2 = targetZone.itemIds.indexOf(over.id);
|
|
21359
|
+
eventBus.emit(targetZone.dropEvent, {
|
|
21360
|
+
id: String(active.id),
|
|
21361
|
+
sourceGroup: sourceZone.group,
|
|
21362
|
+
targetGroup: targetZone.group,
|
|
21363
|
+
newIndex: newIndex2 === -1 ? targetZone.itemIds.length : newIndex2
|
|
21364
|
+
});
|
|
21365
|
+
}
|
|
21366
|
+
return;
|
|
21367
|
+
}
|
|
21368
|
+
const oldIndex = sourceZone.itemIds.indexOf(active.id);
|
|
21369
|
+
const newIndex = sourceZone.itemIds.indexOf(over.id);
|
|
21370
|
+
if (oldIndex === -1 || newIndex === -1 || oldIndex === newIndex) return;
|
|
21371
|
+
if (sourceZone.group === ownGroup) {
|
|
21372
|
+
const reordered = arrayMove(orderedItems, oldIndex, newIndex);
|
|
21373
|
+
setLocalOrder(reordered);
|
|
21374
|
+
}
|
|
21375
|
+
if (sourceZone.reorderEvent) {
|
|
21376
|
+
eventBus.emit(sourceZone.reorderEvent, {
|
|
21377
|
+
id: String(active.id),
|
|
21378
|
+
oldIndex,
|
|
21379
|
+
newIndex
|
|
21380
|
+
});
|
|
21381
|
+
}
|
|
21382
|
+
},
|
|
21383
|
+
[orderedItems, ownGroup, findZoneByItem, findZoneByGroup, eventBus]
|
|
21384
|
+
);
|
|
21385
|
+
const SortableItem = React81__default.useCallback(
|
|
21386
|
+
({ id, children }) => {
|
|
21387
|
+
const {
|
|
21388
|
+
attributes,
|
|
21389
|
+
listeners: listeners6,
|
|
21390
|
+
setNodeRef,
|
|
21391
|
+
transform,
|
|
21392
|
+
transition,
|
|
21393
|
+
isDragging
|
|
21394
|
+
} = useSortable({ id, data: { dndGroup: ownGroup } });
|
|
21395
|
+
const style = {
|
|
21396
|
+
transform: CSS.Transform.toString(transform),
|
|
21397
|
+
transition,
|
|
21398
|
+
opacity: isDragging ? 0.4 : 1,
|
|
21399
|
+
cursor: enabled ? "grab" : void 0
|
|
21400
|
+
};
|
|
21401
|
+
return /* @__PURE__ */ jsx(
|
|
21402
|
+
Box,
|
|
21403
|
+
{
|
|
21404
|
+
className: "touch-none",
|
|
21405
|
+
ref: setNodeRef,
|
|
21406
|
+
style,
|
|
21407
|
+
...attributes,
|
|
21408
|
+
...listeners6,
|
|
21409
|
+
children
|
|
21410
|
+
}
|
|
21411
|
+
);
|
|
21412
|
+
},
|
|
21413
|
+
[ownGroup, enabled]
|
|
21414
|
+
);
|
|
21415
|
+
const DropZoneShell = ({ children }) => {
|
|
21416
|
+
const { setNodeRef, isOver } = useDroppable({
|
|
21417
|
+
id: `dnd-zone-${zoneId}`,
|
|
21418
|
+
data: { dndGroup: ownGroup }
|
|
21419
|
+
});
|
|
21420
|
+
return /* @__PURE__ */ jsx(
|
|
21421
|
+
Box,
|
|
21422
|
+
{
|
|
21423
|
+
ref: setNodeRef,
|
|
21424
|
+
className: isOver ? "ring-2 ring-primary ring-offset-2 rounded-lg" : void 0,
|
|
21425
|
+
children
|
|
21426
|
+
}
|
|
21427
|
+
);
|
|
21428
|
+
};
|
|
21429
|
+
const rootContextValue = React81__default.useMemo(
|
|
21430
|
+
() => ({ registerZone, unregisterZone }),
|
|
21431
|
+
[registerZone, unregisterZone]
|
|
21432
|
+
);
|
|
21433
|
+
const wrapContainer = React81__default.useCallback(
|
|
21434
|
+
(children) => {
|
|
21435
|
+
if (!enabled) return children;
|
|
21436
|
+
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
21437
|
+
const inner = /* @__PURE__ */ jsx(DropZoneShell, { children: /* @__PURE__ */ jsx(SortableContext, { items: itemIds, strategy, children }) });
|
|
21438
|
+
if (isRoot) {
|
|
21439
|
+
return /* @__PURE__ */ jsx(RootCtx.Provider, { value: rootContextValue, children: /* @__PURE__ */ jsx(DndContext, { sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd, children: inner }) });
|
|
21440
|
+
}
|
|
21441
|
+
return inner;
|
|
21442
|
+
},
|
|
21443
|
+
[enabled, layout, sensors, handleDragEnd, itemIds, isRoot, rootContextValue]
|
|
21444
|
+
);
|
|
21445
|
+
return {
|
|
21446
|
+
enabled,
|
|
21447
|
+
wrapContainer,
|
|
21448
|
+
SortableItem,
|
|
21449
|
+
orderedItems
|
|
21450
|
+
};
|
|
21451
|
+
}
|
|
21452
|
+
var RootCtx;
|
|
21453
|
+
var init_useDataDnd = __esm({
|
|
21454
|
+
"components/molecules/useDataDnd.tsx"() {
|
|
21455
|
+
"use client";
|
|
21456
|
+
init_useEventBus();
|
|
21457
|
+
init_Box();
|
|
21458
|
+
RootCtx = React81__default.createContext(null);
|
|
21459
|
+
}
|
|
21460
|
+
});
|
|
21272
21461
|
function fieldLabel2(key) {
|
|
21273
21462
|
return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
21274
21463
|
}
|
|
@@ -21332,14 +21521,31 @@ function DataGrid({
|
|
|
21332
21521
|
hasMore,
|
|
21333
21522
|
children,
|
|
21334
21523
|
pageSize = 0,
|
|
21335
|
-
renderItem: schemaRenderItem
|
|
21524
|
+
renderItem: schemaRenderItem,
|
|
21525
|
+
dragGroup,
|
|
21526
|
+
accepts,
|
|
21527
|
+
sortable,
|
|
21528
|
+
dropEvent,
|
|
21529
|
+
reorderEvent,
|
|
21530
|
+
dndItemIdField
|
|
21336
21531
|
}) {
|
|
21337
21532
|
const eventBus = useEventBus();
|
|
21338
21533
|
const { t } = useTranslate();
|
|
21339
21534
|
const [selectedIds, setSelectedIds] = useState(/* @__PURE__ */ new Set());
|
|
21340
21535
|
const [visibleCount, setVisibleCount] = useState(pageSize || Infinity);
|
|
21341
21536
|
const fieldDefs = fields ?? columns ?? [];
|
|
21342
|
-
const
|
|
21537
|
+
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
21538
|
+
const dnd = useDataDnd({
|
|
21539
|
+
items: allDataRaw,
|
|
21540
|
+
layout: "grid",
|
|
21541
|
+
dragGroup,
|
|
21542
|
+
accepts,
|
|
21543
|
+
sortable,
|
|
21544
|
+
dropEvent,
|
|
21545
|
+
reorderEvent,
|
|
21546
|
+
dndItemIdField
|
|
21547
|
+
});
|
|
21548
|
+
const allData = dnd.orderedItems;
|
|
21343
21549
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
21344
21550
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
21345
21551
|
const toggleSelection = useCallback((id) => {
|
|
@@ -21411,203 +21617,205 @@ function DataGrid({
|
|
|
21411
21617
|
const allIds = data.map((item, i) => item.id || String(i));
|
|
21412
21618
|
const allSelected = allIds.length > 0 && allIds.every((id) => selectedIds.has(id));
|
|
21413
21619
|
const someSelected = selectedIds.size > 0;
|
|
21414
|
-
|
|
21415
|
-
|
|
21620
|
+
const idFieldName = dndItemIdField ?? "id";
|
|
21621
|
+
return dnd.wrapContainer(
|
|
21622
|
+
/* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
21623
|
+
selectable && someSelected && /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center px-2 py-2 bg-muted rounded-sm", children: [
|
|
21624
|
+
/* @__PURE__ */ jsx(
|
|
21625
|
+
"input",
|
|
21626
|
+
{
|
|
21627
|
+
type: "checkbox",
|
|
21628
|
+
checked: allSelected,
|
|
21629
|
+
onChange: toggleAll,
|
|
21630
|
+
className: "w-4 h-4 accent-primary",
|
|
21631
|
+
"aria-label": "Select all"
|
|
21632
|
+
}
|
|
21633
|
+
),
|
|
21634
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "font-semibold", children: [
|
|
21635
|
+
selectedIds.size,
|
|
21636
|
+
" ",
|
|
21637
|
+
t("common.selected") || "selected"
|
|
21638
|
+
] })
|
|
21639
|
+
] }),
|
|
21416
21640
|
/* @__PURE__ */ jsx(
|
|
21417
|
-
|
|
21641
|
+
Box,
|
|
21418
21642
|
{
|
|
21419
|
-
|
|
21420
|
-
|
|
21421
|
-
|
|
21422
|
-
|
|
21423
|
-
|
|
21424
|
-
|
|
21425
|
-
|
|
21426
|
-
|
|
21427
|
-
|
|
21428
|
-
|
|
21429
|
-
|
|
21430
|
-
|
|
21431
|
-
|
|
21432
|
-
|
|
21433
|
-
|
|
21434
|
-
|
|
21435
|
-
|
|
21436
|
-
|
|
21437
|
-
|
|
21438
|
-
|
|
21439
|
-
|
|
21440
|
-
|
|
21441
|
-
|
|
21442
|
-
return
|
|
21443
|
-
|
|
21444
|
-
|
|
21445
|
-
|
|
21446
|
-
|
|
21447
|
-
|
|
21448
|
-
|
|
21449
|
-
|
|
21450
|
-
|
|
21451
|
-
|
|
21452
|
-
|
|
21453
|
-
|
|
21454
|
-
|
|
21455
|
-
children: children(itemData, index)
|
|
21456
|
-
},
|
|
21457
|
-
id
|
|
21458
|
-
);
|
|
21459
|
-
}
|
|
21460
|
-
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
21461
|
-
return /* @__PURE__ */ jsxs(
|
|
21462
|
-
Box,
|
|
21463
|
-
{
|
|
21464
|
-
"data-entity-row": true,
|
|
21465
|
-
"data-entity-id": id,
|
|
21466
|
-
className: cn(
|
|
21467
|
-
"bg-card rounded-lg",
|
|
21468
|
-
"border border-border",
|
|
21469
|
-
"shadow-sm hover:shadow-lg",
|
|
21470
|
-
"hover:border-primary transition-all",
|
|
21471
|
-
"flex flex-col",
|
|
21472
|
-
isSelected && "ring-2 ring-primary border-primary"
|
|
21473
|
-
),
|
|
21474
|
-
children: [
|
|
21475
|
-
imageField && (() => {
|
|
21476
|
-
const imgUrl = getNestedValue(itemData, imageField);
|
|
21477
|
-
if (!imgUrl || typeof imgUrl !== "string") return null;
|
|
21478
|
-
return /* @__PURE__ */ jsx(Box, { className: "w-full aspect-video overflow-hidden rounded-t-lg", children: /* @__PURE__ */ jsx(
|
|
21479
|
-
"img",
|
|
21480
|
-
{
|
|
21481
|
-
src: imgUrl,
|
|
21482
|
-
alt: titleValue !== void 0 ? String(titleValue) : "",
|
|
21483
|
-
className: "w-full h-full object-cover",
|
|
21484
|
-
loading: "lazy"
|
|
21485
|
-
}
|
|
21486
|
-
) });
|
|
21487
|
-
})(),
|
|
21488
|
-
/* @__PURE__ */ jsx(Box, { className: "p-4 pb-0", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-start", children: [
|
|
21489
|
-
selectable && /* @__PURE__ */ jsx(
|
|
21490
|
-
"input",
|
|
21491
|
-
{
|
|
21492
|
-
type: "checkbox",
|
|
21493
|
-
checked: isSelected,
|
|
21494
|
-
onChange: () => toggleSelection(id),
|
|
21495
|
-
onClick: (e) => e.stopPropagation(),
|
|
21496
|
-
className: "w-4 h-4 mt-1 flex-shrink-0 accent-primary",
|
|
21497
|
-
"aria-label": `Select ${titleValue !== void 0 ? String(titleValue) : "item"}`
|
|
21498
|
-
}
|
|
21643
|
+
className: cn("grid", gapStyles6[gap], colsClass, className),
|
|
21644
|
+
style: gridTemplateColumns ? { gridTemplateColumns } : void 0,
|
|
21645
|
+
children: data.map((item, index) => {
|
|
21646
|
+
const itemData = item;
|
|
21647
|
+
const id = itemData.id || String(index);
|
|
21648
|
+
const isSelected = selectedIds.has(id);
|
|
21649
|
+
const dndId = itemData[idFieldName] ?? `__idx_${index}`;
|
|
21650
|
+
const wrapDnd = (node) => dnd.enabled ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: dndId, children: node }) : node;
|
|
21651
|
+
if (hasRenderProp) {
|
|
21652
|
+
return wrapDnd(
|
|
21653
|
+
/* @__PURE__ */ jsx(
|
|
21654
|
+
Box,
|
|
21655
|
+
{
|
|
21656
|
+
"data-entity-row": true,
|
|
21657
|
+
"data-entity-id": id,
|
|
21658
|
+
className: cn(isSelected && "ring-2 ring-primary rounded-lg"),
|
|
21659
|
+
children: children(itemData, index)
|
|
21660
|
+
},
|
|
21661
|
+
id
|
|
21662
|
+
)
|
|
21663
|
+
);
|
|
21664
|
+
}
|
|
21665
|
+
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
21666
|
+
return wrapDnd(
|
|
21667
|
+
/* @__PURE__ */ jsxs(
|
|
21668
|
+
Box,
|
|
21669
|
+
{
|
|
21670
|
+
"data-entity-row": true,
|
|
21671
|
+
"data-entity-id": id,
|
|
21672
|
+
className: cn(
|
|
21673
|
+
"bg-card rounded-lg",
|
|
21674
|
+
"border border-border",
|
|
21675
|
+
"shadow-sm hover:shadow-lg",
|
|
21676
|
+
"hover:border-primary transition-all",
|
|
21677
|
+
"flex flex-col",
|
|
21678
|
+
isSelected && "ring-2 ring-primary border-primary"
|
|
21499
21679
|
),
|
|
21500
|
-
|
|
21501
|
-
|
|
21502
|
-
|
|
21503
|
-
|
|
21504
|
-
|
|
21680
|
+
children: [
|
|
21681
|
+
imageField && (() => {
|
|
21682
|
+
const imgUrl = getNestedValue(itemData, imageField);
|
|
21683
|
+
if (!imgUrl || typeof imgUrl !== "string") return null;
|
|
21684
|
+
return /* @__PURE__ */ jsx(Box, { className: "w-full aspect-video overflow-hidden rounded-t-lg", children: /* @__PURE__ */ jsx(
|
|
21685
|
+
"img",
|
|
21505
21686
|
{
|
|
21506
|
-
|
|
21507
|
-
|
|
21508
|
-
|
|
21687
|
+
src: imgUrl,
|
|
21688
|
+
alt: titleValue !== void 0 ? String(titleValue) : "",
|
|
21689
|
+
className: "w-full h-full object-cover",
|
|
21690
|
+
loading: "lazy"
|
|
21509
21691
|
}
|
|
21510
|
-
)
|
|
21511
|
-
|
|
21512
|
-
|
|
21513
|
-
|
|
21514
|
-
|
|
21515
|
-
|
|
21516
|
-
|
|
21517
|
-
|
|
21518
|
-
|
|
21519
|
-
|
|
21520
|
-
|
|
21521
|
-
|
|
21522
|
-
|
|
21523
|
-
|
|
21524
|
-
|
|
21525
|
-
|
|
21526
|
-
|
|
21527
|
-
|
|
21528
|
-
|
|
21529
|
-
|
|
21530
|
-
|
|
21531
|
-
|
|
21532
|
-
|
|
21533
|
-
|
|
21534
|
-
|
|
21535
|
-
|
|
21536
|
-
|
|
21537
|
-
|
|
21538
|
-
|
|
21539
|
-
|
|
21540
|
-
|
|
21541
|
-
|
|
21542
|
-
|
|
21543
|
-
|
|
21544
|
-
field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
|
|
21545
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel2(field.name) })
|
|
21692
|
+
) });
|
|
21693
|
+
})(),
|
|
21694
|
+
/* @__PURE__ */ jsx(Box, { className: "p-4 pb-0", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-start", children: [
|
|
21695
|
+
selectable && /* @__PURE__ */ jsx(
|
|
21696
|
+
"input",
|
|
21697
|
+
{
|
|
21698
|
+
type: "checkbox",
|
|
21699
|
+
checked: isSelected,
|
|
21700
|
+
onChange: () => toggleSelection(id),
|
|
21701
|
+
onClick: (e) => e.stopPropagation(),
|
|
21702
|
+
className: "w-4 h-4 mt-1 flex-shrink-0 accent-primary",
|
|
21703
|
+
"aria-label": `Select ${titleValue !== void 0 ? String(titleValue) : "item"}`
|
|
21704
|
+
}
|
|
21705
|
+
),
|
|
21706
|
+
/* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1 min-w-0", children: [
|
|
21707
|
+
titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
21708
|
+
titleField?.icon && /* @__PURE__ */ jsx(Icon, { name: titleField.icon, size: "sm", className: "text-primary flex-shrink-0" }),
|
|
21709
|
+
/* @__PURE__ */ jsx(
|
|
21710
|
+
Typography,
|
|
21711
|
+
{
|
|
21712
|
+
variant: titleField?.variant === "h3" ? "h3" : "h4",
|
|
21713
|
+
className: "font-semibold truncate",
|
|
21714
|
+
children: String(titleValue)
|
|
21715
|
+
}
|
|
21716
|
+
)
|
|
21717
|
+
] }),
|
|
21718
|
+
badgeFields.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap", children: badgeFields.map((field) => {
|
|
21719
|
+
const val = getNestedValue(itemData, field.name);
|
|
21720
|
+
if (val === void 0 || val === null) return null;
|
|
21721
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
21722
|
+
field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
|
|
21723
|
+
/* @__PURE__ */ jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: String(val) })
|
|
21724
|
+
] }, field.name);
|
|
21725
|
+
}) })
|
|
21546
21726
|
] }),
|
|
21547
|
-
/* @__PURE__ */ jsx(
|
|
21548
|
-
|
|
21549
|
-
|
|
21550
|
-
|
|
21551
|
-
|
|
21552
|
-
|
|
21553
|
-
|
|
21554
|
-
|
|
21555
|
-
|
|
21556
|
-
|
|
21557
|
-
|
|
21558
|
-
|
|
21559
|
-
|
|
21560
|
-
|
|
21727
|
+
dangerActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0", children: dangerActions.map((action, idx) => /* @__PURE__ */ jsxs(
|
|
21728
|
+
Button,
|
|
21729
|
+
{
|
|
21730
|
+
variant: "ghost",
|
|
21731
|
+
size: "sm",
|
|
21732
|
+
onClick: handleActionClick(action, itemData),
|
|
21733
|
+
"data-testid": `action-${action.event}`,
|
|
21734
|
+
"data-row-id": String(itemData.id),
|
|
21735
|
+
className: "text-error hover:text-error hover:bg-error/10 px-2",
|
|
21736
|
+
children: [
|
|
21737
|
+
action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs" }),
|
|
21738
|
+
action.label
|
|
21739
|
+
]
|
|
21740
|
+
},
|
|
21741
|
+
idx
|
|
21742
|
+
)) })
|
|
21743
|
+
] }) }),
|
|
21744
|
+
bodyFields.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 flex-1", children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: bodyFields.map((field) => {
|
|
21745
|
+
const value = getNestedValue(itemData, field.name);
|
|
21746
|
+
if (value === void 0 || value === null || value === "") return null;
|
|
21747
|
+
if (field.format === "boolean") {
|
|
21748
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-center", children: [
|
|
21749
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
21750
|
+
field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
|
|
21751
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel2(field.name) })
|
|
21752
|
+
] }),
|
|
21753
|
+
/* @__PURE__ */ jsx(Badge, { variant: value ? "success" : "neutral", children: value ? t("common.yes") || "Yes" : t("common.no") || "No" })
|
|
21754
|
+
] }, field.name);
|
|
21561
21755
|
}
|
|
21562
|
-
|
|
21563
|
-
|
|
21564
|
-
|
|
21565
|
-
|
|
21566
|
-
|
|
21567
|
-
|
|
21568
|
-
|
|
21569
|
-
|
|
21570
|
-
|
|
21571
|
-
|
|
21572
|
-
|
|
21573
|
-
|
|
21574
|
-
|
|
21575
|
-
|
|
21576
|
-
|
|
21577
|
-
|
|
21578
|
-
|
|
21579
|
-
|
|
21580
|
-
|
|
21581
|
-
|
|
21582
|
-
|
|
21583
|
-
|
|
21584
|
-
|
|
21585
|
-
|
|
21586
|
-
|
|
21587
|
-
|
|
21588
|
-
|
|
21589
|
-
|
|
21590
|
-
|
|
21591
|
-
|
|
21592
|
-
|
|
21593
|
-
|
|
21594
|
-
|
|
21595
|
-
|
|
21596
|
-
|
|
21597
|
-
|
|
21598
|
-
|
|
21599
|
-
|
|
21600
|
-
|
|
21601
|
-
|
|
21602
|
-
|
|
21603
|
-
|
|
21604
|
-
|
|
21605
|
-
|
|
21606
|
-
|
|
21607
|
-
|
|
21608
|
-
|
|
21609
|
-
|
|
21610
|
-
|
|
21756
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-center", children: [
|
|
21757
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
21758
|
+
field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
|
|
21759
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel2(field.name) })
|
|
21760
|
+
] }),
|
|
21761
|
+
/* @__PURE__ */ jsx(
|
|
21762
|
+
Typography,
|
|
21763
|
+
{
|
|
21764
|
+
variant: field.variant === "caption" ? "caption" : "small",
|
|
21765
|
+
className: "text-right truncate max-w-[60%]",
|
|
21766
|
+
children: formatValue(value, field.format)
|
|
21767
|
+
}
|
|
21768
|
+
)
|
|
21769
|
+
] }, field.name);
|
|
21770
|
+
}) }) }),
|
|
21771
|
+
primaryActions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 mt-auto border-t border-border", children: /* @__PURE__ */ jsx(HStack, { gap: "sm", className: "justify-end", children: primaryActions.map((action, idx) => /* @__PURE__ */ jsxs(
|
|
21772
|
+
Button,
|
|
21773
|
+
{
|
|
21774
|
+
variant: action.variant === "primary" ? "primary" : "ghost",
|
|
21775
|
+
size: "sm",
|
|
21776
|
+
onClick: handleActionClick(action, itemData),
|
|
21777
|
+
"data-testid": `action-${action.event}`,
|
|
21778
|
+
"data-row-id": String(itemData.id),
|
|
21779
|
+
children: [
|
|
21780
|
+
action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
|
|
21781
|
+
action.label
|
|
21782
|
+
]
|
|
21783
|
+
},
|
|
21784
|
+
idx
|
|
21785
|
+
)) }) })
|
|
21786
|
+
]
|
|
21787
|
+
},
|
|
21788
|
+
id
|
|
21789
|
+
)
|
|
21790
|
+
);
|
|
21791
|
+
})
|
|
21792
|
+
}
|
|
21793
|
+
),
|
|
21794
|
+
hasMoreLocal && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(
|
|
21795
|
+
Button,
|
|
21796
|
+
{
|
|
21797
|
+
variant: "ghost",
|
|
21798
|
+
size: "sm",
|
|
21799
|
+
onClick: () => setVisibleCount((prev) => prev + (pageSize || 5)),
|
|
21800
|
+
children: [
|
|
21801
|
+
/* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
|
|
21802
|
+
t("common.showMore"),
|
|
21803
|
+
" (",
|
|
21804
|
+
allData.length - visibleCount,
|
|
21805
|
+
" remaining)"
|
|
21806
|
+
]
|
|
21807
|
+
}
|
|
21808
|
+
) }),
|
|
21809
|
+
infiniteScroll && loadMoreEvent && /* @__PURE__ */ jsx(
|
|
21810
|
+
InfiniteScrollSentinel,
|
|
21811
|
+
{
|
|
21812
|
+
loadMoreEvent,
|
|
21813
|
+
isLoading,
|
|
21814
|
+
hasMore
|
|
21815
|
+
}
|
|
21816
|
+
)
|
|
21817
|
+
] })
|
|
21818
|
+
);
|
|
21611
21819
|
}
|
|
21612
21820
|
var dataGridLog, BADGE_VARIANTS, gapStyles6;
|
|
21613
21821
|
var init_DataGrid = __esm({
|
|
@@ -21624,6 +21832,7 @@ var init_DataGrid = __esm({
|
|
|
21624
21832
|
init_Button();
|
|
21625
21833
|
init_Icon();
|
|
21626
21834
|
init_InfiniteScrollSentinel();
|
|
21835
|
+
init_useDataDnd();
|
|
21627
21836
|
dataGridLog = createLogger("almadar:ui:data-grid");
|
|
21628
21837
|
BADGE_VARIANTS = /* @__PURE__ */ new Set([
|
|
21629
21838
|
"default",
|
|
@@ -21718,17 +21927,34 @@ function DataList({
|
|
|
21718
21927
|
hasMore,
|
|
21719
21928
|
children,
|
|
21720
21929
|
pageSize = 5,
|
|
21721
|
-
renderItem: schemaRenderItem
|
|
21930
|
+
renderItem: schemaRenderItem,
|
|
21931
|
+
dragGroup,
|
|
21932
|
+
accepts,
|
|
21933
|
+
sortable: sortableProp,
|
|
21934
|
+
dropEvent,
|
|
21935
|
+
reorderEvent: dndReorderEvent,
|
|
21936
|
+
dndItemIdField
|
|
21722
21937
|
}) {
|
|
21723
21938
|
const eventBus = useEventBus();
|
|
21724
21939
|
const { t } = useTranslate();
|
|
21725
|
-
const [visibleCount, setVisibleCount] =
|
|
21940
|
+
const [visibleCount, setVisibleCount] = React81__default.useState(pageSize || Infinity);
|
|
21726
21941
|
const fieldDefs = fields ?? columns ?? [];
|
|
21727
|
-
const
|
|
21942
|
+
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
21943
|
+
const dnd = useDataDnd({
|
|
21944
|
+
items: allDataRaw,
|
|
21945
|
+
layout: "list",
|
|
21946
|
+
dragGroup,
|
|
21947
|
+
accepts,
|
|
21948
|
+
sortable: sortableProp,
|
|
21949
|
+
dropEvent,
|
|
21950
|
+
reorderEvent: dndReorderEvent,
|
|
21951
|
+
dndItemIdField
|
|
21952
|
+
});
|
|
21953
|
+
const allData = dnd.orderedItems;
|
|
21728
21954
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
21729
21955
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
21730
21956
|
const hasRenderProp = typeof children === "function";
|
|
21731
|
-
|
|
21957
|
+
React81__default.useEffect(() => {
|
|
21732
21958
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
21733
21959
|
const childrenTypeOf = typeof children;
|
|
21734
21960
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -21784,7 +22010,7 @@ function DataList({
|
|
|
21784
22010
|
const items2 = data.map((item) => item);
|
|
21785
22011
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
21786
22012
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
21787
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
22013
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
21788
22014
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
21789
22015
|
group.items.map((itemData, index) => {
|
|
21790
22016
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -21832,10 +22058,50 @@ function DataList({
|
|
|
21832
22058
|
}
|
|
21833
22059
|
const items = data.map((item) => item);
|
|
21834
22060
|
const groups = groupBy ? groupData(items, groupBy) : [{ label: "", items }];
|
|
22061
|
+
const idFieldName = dndItemIdField ?? "id";
|
|
21835
22062
|
const renderItem = (itemData, index, isLast) => {
|
|
22063
|
+
const dndId = itemData[idFieldName] ?? `__idx_${index}`;
|
|
22064
|
+
const wrapDnd = (node) => dnd.enabled ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: dndId, children: node }) : node;
|
|
21836
22065
|
if (hasRenderProp) {
|
|
21837
22066
|
const id2 = itemData.id || String(index);
|
|
21838
|
-
return
|
|
22067
|
+
return wrapDnd(
|
|
22068
|
+
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, children: [
|
|
22069
|
+
/* @__PURE__ */ jsxs(Box, { className: "group flex items-stretch gap-2", children: [
|
|
22070
|
+
/* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: children(itemData, index) }),
|
|
22071
|
+
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(
|
|
22072
|
+
HStack,
|
|
22073
|
+
{
|
|
22074
|
+
gap: "xs",
|
|
22075
|
+
className: "flex-shrink-0",
|
|
22076
|
+
children: itemActions.map((action, idx) => /* @__PURE__ */ jsxs(
|
|
22077
|
+
Button,
|
|
22078
|
+
{
|
|
22079
|
+
variant: action.variant ?? "ghost",
|
|
22080
|
+
size: "sm",
|
|
22081
|
+
onClick: handleActionClick(action, itemData),
|
|
22082
|
+
"data-testid": `action-${action.event}`,
|
|
22083
|
+
"data-row-id": String(itemData.id),
|
|
22084
|
+
className: cn(
|
|
22085
|
+
action.variant === "danger" && "text-error hover:bg-error/10"
|
|
22086
|
+
),
|
|
22087
|
+
children: [
|
|
22088
|
+
action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
|
|
22089
|
+
action.label
|
|
22090
|
+
]
|
|
22091
|
+
},
|
|
22092
|
+
idx
|
|
22093
|
+
))
|
|
22094
|
+
}
|
|
22095
|
+
)
|
|
22096
|
+
] }),
|
|
22097
|
+
isCard && !isLast && /* @__PURE__ */ jsx(Box, { className: "mx-6 border-b border-border/40" })
|
|
22098
|
+
] }, id2)
|
|
22099
|
+
);
|
|
22100
|
+
}
|
|
22101
|
+
const id = itemData.id || String(index);
|
|
22102
|
+
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
22103
|
+
return wrapDnd(
|
|
22104
|
+
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, children: [
|
|
21839
22105
|
/* @__PURE__ */ jsxs(
|
|
21840
22106
|
Box,
|
|
21841
22107
|
{
|
|
@@ -21846,166 +22112,124 @@ function DataList({
|
|
|
21846
22112
|
!isCard && !isCompact && "rounded-lg border border-transparent hover:border-border"
|
|
21847
22113
|
),
|
|
21848
22114
|
children: [
|
|
21849
|
-
/* @__PURE__ */
|
|
21850
|
-
|
|
21851
|
-
|
|
21852
|
-
|
|
21853
|
-
gap: "xs",
|
|
21854
|
-
className: "flex-shrink-0",
|
|
21855
|
-
children: itemActions.map((action, idx) => /* @__PURE__ */ jsxs(
|
|
21856
|
-
Button,
|
|
22115
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
|
|
22116
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center", children: [
|
|
22117
|
+
titleField?.icon && /* @__PURE__ */ jsx(
|
|
22118
|
+
Icon,
|
|
21857
22119
|
{
|
|
21858
|
-
|
|
21859
|
-
size: "sm",
|
|
21860
|
-
|
|
21861
|
-
|
|
21862
|
-
|
|
21863
|
-
|
|
21864
|
-
|
|
21865
|
-
|
|
21866
|
-
|
|
21867
|
-
|
|
21868
|
-
|
|
21869
|
-
|
|
21870
|
-
|
|
21871
|
-
|
|
21872
|
-
|
|
21873
|
-
|
|
21874
|
-
|
|
22120
|
+
name: titleField.icon,
|
|
22121
|
+
size: isCompact ? "xs" : "sm",
|
|
22122
|
+
className: "text-primary flex-shrink-0"
|
|
22123
|
+
}
|
|
22124
|
+
),
|
|
22125
|
+
titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsx(
|
|
22126
|
+
Typography,
|
|
22127
|
+
{
|
|
22128
|
+
variant: titleField?.variant === "h3" ? "h3" : "h4",
|
|
22129
|
+
className: cn("font-semibold truncate flex-1", isCompact && "text-sm"),
|
|
22130
|
+
children: String(titleValue)
|
|
22131
|
+
}
|
|
22132
|
+
),
|
|
22133
|
+
badgeFields.map((field) => {
|
|
22134
|
+
const val = getNestedValue(itemData, field.name);
|
|
22135
|
+
if (val === void 0 || val === null) return null;
|
|
22136
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center flex-shrink-0", children: [
|
|
22137
|
+
field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
|
|
22138
|
+
/* @__PURE__ */ jsx(Badge, { variant: statusVariant3(String(val)), children: String(val) })
|
|
22139
|
+
] }, field.name);
|
|
22140
|
+
})
|
|
22141
|
+
] }),
|
|
22142
|
+
bodyFields.length > 0 && !isCompact && /* @__PURE__ */ jsx(HStack, { gap: "md", className: "mt-1.5 flex-wrap", children: bodyFields.map((field) => {
|
|
22143
|
+
const value = getNestedValue(itemData, field.name);
|
|
22144
|
+
if (value === void 0 || value === null || value === "") return null;
|
|
22145
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
22146
|
+
field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
|
|
22147
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "secondary", children: [
|
|
22148
|
+
field.label ?? fieldLabel3(field.name),
|
|
22149
|
+
":"
|
|
22150
|
+
] }),
|
|
22151
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", children: formatValue2(value, field.format) })
|
|
22152
|
+
] }, field.name);
|
|
22153
|
+
}) }),
|
|
22154
|
+
progressFields.map((field) => {
|
|
22155
|
+
const value = getNestedValue(itemData, field.name);
|
|
22156
|
+
if (typeof value !== "number") return null;
|
|
22157
|
+
return /* @__PURE__ */ jsxs(Box, { className: "mt-2 max-w-xs", children: [
|
|
22158
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center mb-1", children: [
|
|
22159
|
+
field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
|
|
22160
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel3(field.name) })
|
|
22161
|
+
] }),
|
|
22162
|
+
/* @__PURE__ */ jsx(ProgressBar, { value, max: 100 })
|
|
22163
|
+
] }, field.name);
|
|
22164
|
+
})
|
|
22165
|
+
] }),
|
|
22166
|
+
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0", children: itemActions.map((action, idx) => /* @__PURE__ */ jsxs(
|
|
22167
|
+
Button,
|
|
22168
|
+
{
|
|
22169
|
+
variant: action.variant ?? "ghost",
|
|
22170
|
+
size: "sm",
|
|
22171
|
+
onClick: handleActionClick(action, itemData),
|
|
22172
|
+
"data-testid": `action-${action.event}`,
|
|
22173
|
+
"data-row-id": String(itemData.id),
|
|
22174
|
+
className: cn(
|
|
22175
|
+
action.variant === "danger" && "text-error hover:bg-error/10"
|
|
22176
|
+
),
|
|
22177
|
+
children: [
|
|
22178
|
+
action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
|
|
22179
|
+
action.label
|
|
22180
|
+
]
|
|
22181
|
+
},
|
|
22182
|
+
idx
|
|
22183
|
+
)) })
|
|
21875
22184
|
]
|
|
21876
22185
|
}
|
|
21877
22186
|
),
|
|
21878
22187
|
isCard && !isLast && /* @__PURE__ */ jsx(Box, { className: "mx-6 border-b border-border/40" })
|
|
21879
|
-
] },
|
|
21880
|
-
|
|
21881
|
-
const id = itemData.id || String(index);
|
|
21882
|
-
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
21883
|
-
return /* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, children: [
|
|
21884
|
-
/* @__PURE__ */ jsxs(
|
|
21885
|
-
Box,
|
|
21886
|
-
{
|
|
21887
|
-
className: cn(
|
|
21888
|
-
"group flex items-center gap-4 transition-all duration-200",
|
|
21889
|
-
isCompact ? "px-4 py-2" : "px-6 py-4",
|
|
21890
|
-
"hover:bg-muted/80",
|
|
21891
|
-
!isCard && !isCompact && "rounded-lg border border-transparent hover:border-border"
|
|
21892
|
-
),
|
|
21893
|
-
children: [
|
|
21894
|
-
/* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
|
|
21895
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center", children: [
|
|
21896
|
-
titleField?.icon && /* @__PURE__ */ jsx(
|
|
21897
|
-
Icon,
|
|
21898
|
-
{
|
|
21899
|
-
name: titleField.icon,
|
|
21900
|
-
size: isCompact ? "xs" : "sm",
|
|
21901
|
-
className: "text-primary flex-shrink-0"
|
|
21902
|
-
}
|
|
21903
|
-
),
|
|
21904
|
-
titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsx(
|
|
21905
|
-
Typography,
|
|
21906
|
-
{
|
|
21907
|
-
variant: titleField?.variant === "h3" ? "h3" : "h4",
|
|
21908
|
-
className: cn("font-semibold truncate flex-1", isCompact && "text-sm"),
|
|
21909
|
-
children: String(titleValue)
|
|
21910
|
-
}
|
|
21911
|
-
),
|
|
21912
|
-
badgeFields.map((field) => {
|
|
21913
|
-
const val = getNestedValue(itemData, field.name);
|
|
21914
|
-
if (val === void 0 || val === null) return null;
|
|
21915
|
-
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center flex-shrink-0", children: [
|
|
21916
|
-
field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
|
|
21917
|
-
/* @__PURE__ */ jsx(Badge, { variant: statusVariant3(String(val)), children: String(val) })
|
|
21918
|
-
] }, field.name);
|
|
21919
|
-
})
|
|
21920
|
-
] }),
|
|
21921
|
-
bodyFields.length > 0 && !isCompact && /* @__PURE__ */ jsx(HStack, { gap: "md", className: "mt-1.5 flex-wrap", children: bodyFields.map((field) => {
|
|
21922
|
-
const value = getNestedValue(itemData, field.name);
|
|
21923
|
-
if (value === void 0 || value === null || value === "") return null;
|
|
21924
|
-
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
21925
|
-
field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
|
|
21926
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "secondary", children: [
|
|
21927
|
-
field.label ?? fieldLabel3(field.name),
|
|
21928
|
-
":"
|
|
21929
|
-
] }),
|
|
21930
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", children: formatValue2(value, field.format) })
|
|
21931
|
-
] }, field.name);
|
|
21932
|
-
}) }),
|
|
21933
|
-
progressFields.map((field) => {
|
|
21934
|
-
const value = getNestedValue(itemData, field.name);
|
|
21935
|
-
if (typeof value !== "number") return null;
|
|
21936
|
-
return /* @__PURE__ */ jsxs(Box, { className: "mt-2 max-w-xs", children: [
|
|
21937
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center mb-1", children: [
|
|
21938
|
-
field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
|
|
21939
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel3(field.name) })
|
|
21940
|
-
] }),
|
|
21941
|
-
/* @__PURE__ */ jsx(ProgressBar, { value, max: 100 })
|
|
21942
|
-
] }, field.name);
|
|
21943
|
-
})
|
|
21944
|
-
] }),
|
|
21945
|
-
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0", children: itemActions.map((action, idx) => /* @__PURE__ */ jsxs(
|
|
21946
|
-
Button,
|
|
21947
|
-
{
|
|
21948
|
-
variant: action.variant ?? "ghost",
|
|
21949
|
-
size: "sm",
|
|
21950
|
-
onClick: handleActionClick(action, itemData),
|
|
21951
|
-
"data-testid": `action-${action.event}`,
|
|
21952
|
-
"data-row-id": String(itemData.id),
|
|
21953
|
-
className: cn(
|
|
21954
|
-
action.variant === "danger" && "text-error hover:bg-error/10"
|
|
21955
|
-
),
|
|
21956
|
-
children: [
|
|
21957
|
-
action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
|
|
21958
|
-
action.label
|
|
21959
|
-
]
|
|
21960
|
-
},
|
|
21961
|
-
idx
|
|
21962
|
-
)) })
|
|
21963
|
-
]
|
|
21964
|
-
}
|
|
21965
|
-
),
|
|
21966
|
-
isCard && !isLast && /* @__PURE__ */ jsx(Box, { className: "mx-6 border-b border-border/40" })
|
|
21967
|
-
] }, id);
|
|
22188
|
+
] }, id)
|
|
22189
|
+
);
|
|
21968
22190
|
};
|
|
21969
|
-
return
|
|
21970
|
-
|
|
21971
|
-
|
|
21972
|
-
|
|
21973
|
-
|
|
21974
|
-
|
|
21975
|
-
|
|
21976
|
-
|
|
21977
|
-
|
|
21978
|
-
|
|
21979
|
-
group
|
|
21980
|
-
|
|
21981
|
-
|
|
22191
|
+
return dnd.wrapContainer(
|
|
22192
|
+
/* @__PURE__ */ jsxs(
|
|
22193
|
+
Box,
|
|
22194
|
+
{
|
|
22195
|
+
className: cn(
|
|
22196
|
+
isCard && "bg-card rounded-xl border border-border shadow-lg overflow-hidden",
|
|
22197
|
+
!isCard && gapClass,
|
|
22198
|
+
className
|
|
22199
|
+
),
|
|
22200
|
+
children: [
|
|
22201
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
22202
|
+
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
22203
|
+
group.items.map(
|
|
22204
|
+
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
22205
|
+
)
|
|
22206
|
+
] }, gi)),
|
|
22207
|
+
hasMoreLocal && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(
|
|
22208
|
+
Button,
|
|
22209
|
+
{
|
|
22210
|
+
variant: "ghost",
|
|
22211
|
+
size: "sm",
|
|
22212
|
+
onClick: () => setVisibleCount((prev) => prev + (pageSize || 5)),
|
|
22213
|
+
children: [
|
|
22214
|
+
/* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
|
|
22215
|
+
t("common.showMore"),
|
|
22216
|
+
" (",
|
|
22217
|
+
allData.length - visibleCount,
|
|
22218
|
+
" remaining)"
|
|
22219
|
+
]
|
|
22220
|
+
}
|
|
22221
|
+
) }),
|
|
22222
|
+
infiniteScroll && loadMoreEvent && /* @__PURE__ */ jsx(
|
|
22223
|
+
InfiniteScrollSentinel,
|
|
22224
|
+
{
|
|
22225
|
+
loadMoreEvent,
|
|
22226
|
+
isLoading,
|
|
22227
|
+
hasMore
|
|
22228
|
+
}
|
|
21982
22229
|
)
|
|
21983
|
-
]
|
|
21984
|
-
|
|
21985
|
-
|
|
21986
|
-
{
|
|
21987
|
-
variant: "ghost",
|
|
21988
|
-
size: "sm",
|
|
21989
|
-
onClick: () => setVisibleCount((prev) => prev + (pageSize || 5)),
|
|
21990
|
-
children: [
|
|
21991
|
-
/* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
|
|
21992
|
-
t("common.showMore"),
|
|
21993
|
-
" (",
|
|
21994
|
-
allData.length - visibleCount,
|
|
21995
|
-
" remaining)"
|
|
21996
|
-
]
|
|
21997
|
-
}
|
|
21998
|
-
) }),
|
|
21999
|
-
infiniteScroll && loadMoreEvent && /* @__PURE__ */ jsx(
|
|
22000
|
-
InfiniteScrollSentinel,
|
|
22001
|
-
{
|
|
22002
|
-
loadMoreEvent,
|
|
22003
|
-
isLoading,
|
|
22004
|
-
hasMore
|
|
22005
|
-
}
|
|
22006
|
-
)
|
|
22007
|
-
]
|
|
22008
|
-
}
|
|
22230
|
+
]
|
|
22231
|
+
}
|
|
22232
|
+
)
|
|
22009
22233
|
);
|
|
22010
22234
|
}
|
|
22011
22235
|
var dataListLog;
|
|
@@ -22025,6 +22249,7 @@ var init_DataList = __esm({
|
|
|
22025
22249
|
init_ProgressBar();
|
|
22026
22250
|
init_Divider();
|
|
22027
22251
|
init_InfiniteScrollSentinel();
|
|
22252
|
+
init_useDataDnd();
|
|
22028
22253
|
dataListLog = createLogger("almadar:ui:data-list");
|
|
22029
22254
|
DataList.displayName = "DataList";
|
|
22030
22255
|
}
|
|
@@ -23275,7 +23500,7 @@ var init_WizardProgress = __esm({
|
|
|
23275
23500
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
23276
23501
|
const isActive = index === currentStep;
|
|
23277
23502
|
const isCompleted = index < currentStep;
|
|
23278
|
-
return /* @__PURE__ */ jsxs(
|
|
23503
|
+
return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
23279
23504
|
/* @__PURE__ */ jsx(
|
|
23280
23505
|
"button",
|
|
23281
23506
|
{
|
|
@@ -24186,7 +24411,7 @@ function InventoryGrid({
|
|
|
24186
24411
|
const eventBus = useEventBus();
|
|
24187
24412
|
const slotCount = totalSlots ?? items.length;
|
|
24188
24413
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
24189
|
-
const handleSelect =
|
|
24414
|
+
const handleSelect = React81.useCallback(
|
|
24190
24415
|
(id) => {
|
|
24191
24416
|
onSelect?.(id);
|
|
24192
24417
|
if (selectEvent) {
|
|
@@ -24399,15 +24624,15 @@ function GameCanvas2D({
|
|
|
24399
24624
|
fps = 60,
|
|
24400
24625
|
className
|
|
24401
24626
|
}) {
|
|
24402
|
-
const canvasRef =
|
|
24403
|
-
const rafRef =
|
|
24404
|
-
const frameRef =
|
|
24405
|
-
const lastTimeRef =
|
|
24406
|
-
const onDrawRef =
|
|
24627
|
+
const canvasRef = React81.useRef(null);
|
|
24628
|
+
const rafRef = React81.useRef(0);
|
|
24629
|
+
const frameRef = React81.useRef(0);
|
|
24630
|
+
const lastTimeRef = React81.useRef(0);
|
|
24631
|
+
const onDrawRef = React81.useRef(onDraw);
|
|
24407
24632
|
onDrawRef.current = onDraw;
|
|
24408
|
-
const onTickRef =
|
|
24633
|
+
const onTickRef = React81.useRef(onTick);
|
|
24409
24634
|
onTickRef.current = onTick;
|
|
24410
|
-
|
|
24635
|
+
React81.useEffect(() => {
|
|
24411
24636
|
const canvas = canvasRef.current;
|
|
24412
24637
|
if (!canvas) return;
|
|
24413
24638
|
const ctx = canvas.getContext("2d");
|
|
@@ -24696,7 +24921,7 @@ function TurnPanel({
|
|
|
24696
24921
|
className
|
|
24697
24922
|
}) {
|
|
24698
24923
|
const eventBus = useEventBus();
|
|
24699
|
-
const handleAction =
|
|
24924
|
+
const handleAction = React81.useCallback(
|
|
24700
24925
|
(event) => {
|
|
24701
24926
|
if (event) {
|
|
24702
24927
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -24842,7 +25067,7 @@ function UnitCommandBar({
|
|
|
24842
25067
|
className
|
|
24843
25068
|
}) {
|
|
24844
25069
|
const eventBus = useEventBus();
|
|
24845
|
-
const handleCommand =
|
|
25070
|
+
const handleCommand = React81.useCallback(
|
|
24846
25071
|
(event) => {
|
|
24847
25072
|
if (event) {
|
|
24848
25073
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -25327,7 +25552,7 @@ function GameMenu({
|
|
|
25327
25552
|
} catch {
|
|
25328
25553
|
}
|
|
25329
25554
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
25330
|
-
const handleOptionClick =
|
|
25555
|
+
const handleOptionClick = React81.useCallback(
|
|
25331
25556
|
(option) => {
|
|
25332
25557
|
if (option.event && eventBus) {
|
|
25333
25558
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -25441,7 +25666,7 @@ function GameOverScreen({
|
|
|
25441
25666
|
} catch {
|
|
25442
25667
|
}
|
|
25443
25668
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
25444
|
-
const handleActionClick =
|
|
25669
|
+
const handleActionClick = React81.useCallback(
|
|
25445
25670
|
(action) => {
|
|
25446
25671
|
if (action.event && eventBus) {
|
|
25447
25672
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -28068,7 +28293,7 @@ var init_StepFlow = __esm({
|
|
|
28068
28293
|
className
|
|
28069
28294
|
}) => {
|
|
28070
28295
|
if (orientation === "vertical") {
|
|
28071
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
28296
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React81__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
28072
28297
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
28073
28298
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
28074
28299
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -28079,7 +28304,7 @@ var init_StepFlow = __esm({
|
|
|
28079
28304
|
] })
|
|
28080
28305
|
] }) }, index)) });
|
|
28081
28306
|
}
|
|
28082
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(
|
|
28307
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
28083
28308
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
28084
28309
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
28085
28310
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -28961,7 +29186,7 @@ var init_LikertScale = __esm({
|
|
|
28961
29186
|
md: "text-base",
|
|
28962
29187
|
lg: "text-lg"
|
|
28963
29188
|
};
|
|
28964
|
-
LikertScale =
|
|
29189
|
+
LikertScale = React81__default.forwardRef(
|
|
28965
29190
|
({
|
|
28966
29191
|
question,
|
|
28967
29192
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -28973,7 +29198,7 @@ var init_LikertScale = __esm({
|
|
|
28973
29198
|
variant = "radios",
|
|
28974
29199
|
className
|
|
28975
29200
|
}, ref) => {
|
|
28976
|
-
const groupId =
|
|
29201
|
+
const groupId = React81__default.useId();
|
|
28977
29202
|
const eventBus = useEventBus();
|
|
28978
29203
|
const handleSelect = useCallback(
|
|
28979
29204
|
(next) => {
|
|
@@ -31199,7 +31424,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
31199
31424
|
"aria-label": "Breadcrumb",
|
|
31200
31425
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
31201
31426
|
const isLast = idx === items.length - 1;
|
|
31202
|
-
return /* @__PURE__ */ jsxs(
|
|
31427
|
+
return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
31203
31428
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
31204
31429
|
Icon,
|
|
31205
31430
|
{
|
|
@@ -32089,7 +32314,7 @@ var init_MiniStateMachine = __esm({
|
|
|
32089
32314
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
32090
32315
|
const tc = transitionCounts[s.name] ?? 0;
|
|
32091
32316
|
const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
|
|
32092
|
-
return /* @__PURE__ */ jsxs(
|
|
32317
|
+
return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
32093
32318
|
/* @__PURE__ */ jsx(
|
|
32094
32319
|
AvlState,
|
|
32095
32320
|
{
|
|
@@ -33466,7 +33691,7 @@ var init_DocumentViewer = __esm({
|
|
|
33466
33691
|
}
|
|
33467
33692
|
});
|
|
33468
33693
|
function extractTitle(children) {
|
|
33469
|
-
if (!
|
|
33694
|
+
if (!React81__default.isValidElement(children)) return void 0;
|
|
33470
33695
|
const props = children.props;
|
|
33471
33696
|
if (typeof props.title === "string") {
|
|
33472
33697
|
return props.title;
|
|
@@ -33521,7 +33746,7 @@ function LinearView({
|
|
|
33521
33746
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
33522
33747
|
const isDone = i < currentIdx;
|
|
33523
33748
|
const isCurrent = i === currentIdx;
|
|
33524
|
-
return /* @__PURE__ */ jsxs(
|
|
33749
|
+
return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
33525
33750
|
i > 0 && /* @__PURE__ */ jsx(
|
|
33526
33751
|
Typography,
|
|
33527
33752
|
{
|
|
@@ -34421,12 +34646,12 @@ var init_Form = __esm({
|
|
|
34421
34646
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
34422
34647
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
34423
34648
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
34424
|
-
const normalizedInitialData =
|
|
34649
|
+
const normalizedInitialData = React81__default.useMemo(() => {
|
|
34425
34650
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
34426
34651
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
34427
34652
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
34428
34653
|
}, [entity, initialData]);
|
|
34429
|
-
const entityDerivedFields =
|
|
34654
|
+
const entityDerivedFields = React81__default.useMemo(() => {
|
|
34430
34655
|
if (fields && fields.length > 0) return void 0;
|
|
34431
34656
|
if (!resolvedEntity) return void 0;
|
|
34432
34657
|
return resolvedEntity.fields.map(
|
|
@@ -34445,16 +34670,16 @@ var init_Form = __esm({
|
|
|
34445
34670
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
34446
34671
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
34447
34672
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
34448
|
-
const [formData, setFormData] =
|
|
34673
|
+
const [formData, setFormData] = React81__default.useState(
|
|
34449
34674
|
normalizedInitialData
|
|
34450
34675
|
);
|
|
34451
|
-
const [collapsedSections, setCollapsedSections] =
|
|
34676
|
+
const [collapsedSections, setCollapsedSections] = React81__default.useState(
|
|
34452
34677
|
/* @__PURE__ */ new Set()
|
|
34453
34678
|
);
|
|
34454
|
-
const [submitError, setSubmitError] =
|
|
34455
|
-
const formRef =
|
|
34679
|
+
const [submitError, setSubmitError] = React81__default.useState(null);
|
|
34680
|
+
const formRef = React81__default.useRef(null);
|
|
34456
34681
|
const formMode = props.mode;
|
|
34457
|
-
const mountedRef =
|
|
34682
|
+
const mountedRef = React81__default.useRef(false);
|
|
34458
34683
|
if (!mountedRef.current) {
|
|
34459
34684
|
mountedRef.current = true;
|
|
34460
34685
|
debug("forms", "mount", {
|
|
@@ -34467,7 +34692,7 @@ var init_Form = __esm({
|
|
|
34467
34692
|
});
|
|
34468
34693
|
}
|
|
34469
34694
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
34470
|
-
const evalContext =
|
|
34695
|
+
const evalContext = React81__default.useMemo(
|
|
34471
34696
|
() => ({
|
|
34472
34697
|
formValues: formData,
|
|
34473
34698
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -34476,7 +34701,7 @@ var init_Form = __esm({
|
|
|
34476
34701
|
}),
|
|
34477
34702
|
[formData, externalContext]
|
|
34478
34703
|
);
|
|
34479
|
-
|
|
34704
|
+
React81__default.useEffect(() => {
|
|
34480
34705
|
debug("forms", "initialData-sync", {
|
|
34481
34706
|
mode: formMode,
|
|
34482
34707
|
normalizedInitialData,
|
|
@@ -34487,7 +34712,7 @@ var init_Form = __esm({
|
|
|
34487
34712
|
setFormData(normalizedInitialData);
|
|
34488
34713
|
}
|
|
34489
34714
|
}, [normalizedInitialData]);
|
|
34490
|
-
const processCalculations =
|
|
34715
|
+
const processCalculations = React81__default.useCallback(
|
|
34491
34716
|
(changedFieldId, newFormData) => {
|
|
34492
34717
|
if (!hiddenCalculations.length) return;
|
|
34493
34718
|
const context = {
|
|
@@ -34512,7 +34737,7 @@ var init_Form = __esm({
|
|
|
34512
34737
|
},
|
|
34513
34738
|
[hiddenCalculations, externalContext, eventBus]
|
|
34514
34739
|
);
|
|
34515
|
-
const checkViolations =
|
|
34740
|
+
const checkViolations = React81__default.useCallback(
|
|
34516
34741
|
(changedFieldId, newFormData) => {
|
|
34517
34742
|
if (!violationTriggers.length) return;
|
|
34518
34743
|
const context = {
|
|
@@ -34550,7 +34775,7 @@ var init_Form = __esm({
|
|
|
34550
34775
|
processCalculations(name, newFormData);
|
|
34551
34776
|
checkViolations(name, newFormData);
|
|
34552
34777
|
};
|
|
34553
|
-
const isFieldVisible =
|
|
34778
|
+
const isFieldVisible = React81__default.useCallback(
|
|
34554
34779
|
(fieldName) => {
|
|
34555
34780
|
const condition = conditionalFields[fieldName];
|
|
34556
34781
|
if (!condition) return true;
|
|
@@ -34558,7 +34783,7 @@ var init_Form = __esm({
|
|
|
34558
34783
|
},
|
|
34559
34784
|
[conditionalFields, evalContext]
|
|
34560
34785
|
);
|
|
34561
|
-
const isSectionVisible =
|
|
34786
|
+
const isSectionVisible = React81__default.useCallback(
|
|
34562
34787
|
(section) => {
|
|
34563
34788
|
if (!section.condition) return true;
|
|
34564
34789
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -34634,7 +34859,7 @@ var init_Form = __esm({
|
|
|
34634
34859
|
eventBus.emit(`UI:${onCancel}`);
|
|
34635
34860
|
}
|
|
34636
34861
|
};
|
|
34637
|
-
const renderField =
|
|
34862
|
+
const renderField = React81__default.useCallback(
|
|
34638
34863
|
(field) => {
|
|
34639
34864
|
const fieldName = field.name || field.field;
|
|
34640
34865
|
if (!fieldName) return null;
|
|
@@ -34655,7 +34880,7 @@ var init_Form = __esm({
|
|
|
34655
34880
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
34656
34881
|
);
|
|
34657
34882
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
34658
|
-
const normalizedFields =
|
|
34883
|
+
const normalizedFields = React81__default.useMemo(() => {
|
|
34659
34884
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
34660
34885
|
return effectiveFields.map((field) => {
|
|
34661
34886
|
if (typeof field === "string") {
|
|
@@ -34677,7 +34902,7 @@ var init_Form = __esm({
|
|
|
34677
34902
|
return field;
|
|
34678
34903
|
});
|
|
34679
34904
|
}, [effectiveFields, resolvedEntity]);
|
|
34680
|
-
const schemaFields =
|
|
34905
|
+
const schemaFields = React81__default.useMemo(() => {
|
|
34681
34906
|
if (normalizedFields.length === 0) return null;
|
|
34682
34907
|
if (isDebugEnabled()) {
|
|
34683
34908
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -34687,7 +34912,7 @@ var init_Form = __esm({
|
|
|
34687
34912
|
}
|
|
34688
34913
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
34689
34914
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
34690
|
-
const sectionElements =
|
|
34915
|
+
const sectionElements = React81__default.useMemo(() => {
|
|
34691
34916
|
if (!sections || sections.length === 0) return null;
|
|
34692
34917
|
return sections.map((section) => {
|
|
34693
34918
|
if (!isSectionVisible(section)) {
|
|
@@ -36413,7 +36638,7 @@ var init_List = __esm({
|
|
|
36413
36638
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
36414
36639
|
return [];
|
|
36415
36640
|
}, [entity]);
|
|
36416
|
-
const getItemActions =
|
|
36641
|
+
const getItemActions = React81__default.useCallback(
|
|
36417
36642
|
(item) => {
|
|
36418
36643
|
if (!itemActions) return [];
|
|
36419
36644
|
if (typeof itemActions === "function") {
|
|
@@ -36886,7 +37111,7 @@ var init_MediaGallery = __esm({
|
|
|
36886
37111
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
36887
37112
|
);
|
|
36888
37113
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
36889
|
-
const items =
|
|
37114
|
+
const items = React81__default.useMemo(() => {
|
|
36890
37115
|
if (propItems) return propItems;
|
|
36891
37116
|
if (entityData.length === 0) return [];
|
|
36892
37117
|
return entityData.map((record, idx) => ({
|
|
@@ -37050,7 +37275,7 @@ var init_MediaGallery = __esm({
|
|
|
37050
37275
|
}
|
|
37051
37276
|
});
|
|
37052
37277
|
function extractTitle2(children) {
|
|
37053
|
-
if (!
|
|
37278
|
+
if (!React81__default.isValidElement(children)) return void 0;
|
|
37054
37279
|
const props = children.props;
|
|
37055
37280
|
if (typeof props.title === "string") {
|
|
37056
37281
|
return props.title;
|
|
@@ -37763,7 +37988,7 @@ var init_PageHeader = __esm({
|
|
|
37763
37988
|
info: "bg-info/10 text-info"
|
|
37764
37989
|
};
|
|
37765
37990
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
37766
|
-
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(
|
|
37991
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
37767
37992
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
37768
37993
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
37769
37994
|
"a",
|
|
@@ -38059,7 +38284,7 @@ var init_debugRegistry = __esm({
|
|
|
38059
38284
|
}
|
|
38060
38285
|
});
|
|
38061
38286
|
function useDebugData() {
|
|
38062
|
-
const [data, setData] =
|
|
38287
|
+
const [data, setData] = React81.useState(() => ({
|
|
38063
38288
|
traits: [],
|
|
38064
38289
|
ticks: [],
|
|
38065
38290
|
guards: [],
|
|
@@ -38073,7 +38298,7 @@ function useDebugData() {
|
|
|
38073
38298
|
},
|
|
38074
38299
|
lastUpdate: Date.now()
|
|
38075
38300
|
}));
|
|
38076
|
-
|
|
38301
|
+
React81.useEffect(() => {
|
|
38077
38302
|
const updateData = () => {
|
|
38078
38303
|
setData({
|
|
38079
38304
|
traits: getAllTraits(),
|
|
@@ -38182,12 +38407,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
38182
38407
|
return positions;
|
|
38183
38408
|
}
|
|
38184
38409
|
function WalkMinimap() {
|
|
38185
|
-
const [walkStep, setWalkStep] =
|
|
38186
|
-
const [traits2, setTraits] =
|
|
38187
|
-
const [coveredEdges, setCoveredEdges] =
|
|
38188
|
-
const [completedTraits, setCompletedTraits] =
|
|
38189
|
-
const prevTraitRef =
|
|
38190
|
-
|
|
38410
|
+
const [walkStep, setWalkStep] = React81.useState(null);
|
|
38411
|
+
const [traits2, setTraits] = React81.useState([]);
|
|
38412
|
+
const [coveredEdges, setCoveredEdges] = React81.useState([]);
|
|
38413
|
+
const [completedTraits, setCompletedTraits] = React81.useState(/* @__PURE__ */ new Set());
|
|
38414
|
+
const prevTraitRef = React81.useRef(null);
|
|
38415
|
+
React81.useEffect(() => {
|
|
38191
38416
|
const interval = setInterval(() => {
|
|
38192
38417
|
const w = window;
|
|
38193
38418
|
const step = w.__orbitalWalkStep;
|
|
@@ -38634,15 +38859,15 @@ var init_EntitiesTab = __esm({
|
|
|
38634
38859
|
}
|
|
38635
38860
|
});
|
|
38636
38861
|
function EventFlowTab({ events: events2 }) {
|
|
38637
|
-
const [filter, setFilter] =
|
|
38638
|
-
const containerRef =
|
|
38639
|
-
const [autoScroll, setAutoScroll] =
|
|
38640
|
-
|
|
38862
|
+
const [filter, setFilter] = React81.useState("all");
|
|
38863
|
+
const containerRef = React81.useRef(null);
|
|
38864
|
+
const [autoScroll, setAutoScroll] = React81.useState(true);
|
|
38865
|
+
React81.useEffect(() => {
|
|
38641
38866
|
if (autoScroll && containerRef.current) {
|
|
38642
38867
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
38643
38868
|
}
|
|
38644
38869
|
}, [events2.length, autoScroll]);
|
|
38645
|
-
const filteredEvents =
|
|
38870
|
+
const filteredEvents = React81.useMemo(() => {
|
|
38646
38871
|
if (filter === "all") return events2;
|
|
38647
38872
|
return events2.filter((e) => e.type === filter);
|
|
38648
38873
|
}, [events2, filter]);
|
|
@@ -38761,7 +38986,7 @@ var init_EventFlowTab = __esm({
|
|
|
38761
38986
|
}
|
|
38762
38987
|
});
|
|
38763
38988
|
function GuardsPanel({ guards }) {
|
|
38764
|
-
const [filter, setFilter] =
|
|
38989
|
+
const [filter, setFilter] = React81.useState("all");
|
|
38765
38990
|
if (guards.length === 0) {
|
|
38766
38991
|
return /* @__PURE__ */ jsx(
|
|
38767
38992
|
EmptyState,
|
|
@@ -38774,7 +38999,7 @@ function GuardsPanel({ guards }) {
|
|
|
38774
38999
|
}
|
|
38775
39000
|
const passedCount = guards.filter((g) => g.result).length;
|
|
38776
39001
|
const failedCount = guards.length - passedCount;
|
|
38777
|
-
const filteredGuards =
|
|
39002
|
+
const filteredGuards = React81.useMemo(() => {
|
|
38778
39003
|
if (filter === "all") return guards;
|
|
38779
39004
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
38780
39005
|
return guards.filter((g) => !g.result);
|
|
@@ -38935,10 +39160,10 @@ function EffectBadge({ effect }) {
|
|
|
38935
39160
|
] });
|
|
38936
39161
|
}
|
|
38937
39162
|
function TransitionTimeline({ transitions }) {
|
|
38938
|
-
const containerRef =
|
|
38939
|
-
const [autoScroll, setAutoScroll] =
|
|
38940
|
-
const [expandedId, setExpandedId] =
|
|
38941
|
-
|
|
39163
|
+
const containerRef = React81.useRef(null);
|
|
39164
|
+
const [autoScroll, setAutoScroll] = React81.useState(true);
|
|
39165
|
+
const [expandedId, setExpandedId] = React81.useState(null);
|
|
39166
|
+
React81.useEffect(() => {
|
|
38942
39167
|
if (autoScroll && containerRef.current) {
|
|
38943
39168
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
38944
39169
|
}
|
|
@@ -39224,9 +39449,9 @@ function getAllEvents(traits2) {
|
|
|
39224
39449
|
}
|
|
39225
39450
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
39226
39451
|
const eventBus = useEventBus();
|
|
39227
|
-
const [log12, setLog] =
|
|
39228
|
-
const prevStatesRef =
|
|
39229
|
-
|
|
39452
|
+
const [log12, setLog] = React81.useState([]);
|
|
39453
|
+
const prevStatesRef = React81.useRef(/* @__PURE__ */ new Map());
|
|
39454
|
+
React81.useEffect(() => {
|
|
39230
39455
|
for (const trait of traits2) {
|
|
39231
39456
|
const prev = prevStatesRef.current.get(trait.id);
|
|
39232
39457
|
if (prev && prev !== trait.currentState) {
|
|
@@ -39396,10 +39621,10 @@ function VerifyModePanel({
|
|
|
39396
39621
|
serverCount,
|
|
39397
39622
|
localCount
|
|
39398
39623
|
}) {
|
|
39399
|
-
const [expanded, setExpanded] =
|
|
39400
|
-
const scrollRef =
|
|
39401
|
-
const prevCountRef =
|
|
39402
|
-
|
|
39624
|
+
const [expanded, setExpanded] = React81.useState(true);
|
|
39625
|
+
const scrollRef = React81.useRef(null);
|
|
39626
|
+
const prevCountRef = React81.useRef(0);
|
|
39627
|
+
React81.useEffect(() => {
|
|
39403
39628
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
39404
39629
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
39405
39630
|
}
|
|
@@ -39465,10 +39690,10 @@ function RuntimeDebugger({
|
|
|
39465
39690
|
defaultTab,
|
|
39466
39691
|
schema
|
|
39467
39692
|
}) {
|
|
39468
|
-
const [isCollapsed, setIsCollapsed] =
|
|
39469
|
-
const [isVisible, setIsVisible] =
|
|
39693
|
+
const [isCollapsed, setIsCollapsed] = React81.useState(mode === "verify" ? true : defaultCollapsed);
|
|
39694
|
+
const [isVisible, setIsVisible] = React81.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
39470
39695
|
const debugData = useDebugData();
|
|
39471
|
-
|
|
39696
|
+
React81.useEffect(() => {
|
|
39472
39697
|
if (mode === "inline") return;
|
|
39473
39698
|
return onDebugToggle((enabled) => {
|
|
39474
39699
|
setIsVisible(enabled);
|
|
@@ -39477,7 +39702,7 @@ function RuntimeDebugger({
|
|
|
39477
39702
|
}
|
|
39478
39703
|
});
|
|
39479
39704
|
}, [mode]);
|
|
39480
|
-
|
|
39705
|
+
React81.useEffect(() => {
|
|
39481
39706
|
if (mode === "inline") return;
|
|
39482
39707
|
const handleKeyDown = (e) => {
|
|
39483
39708
|
if (e.key === "`" && isVisible) {
|
|
@@ -40026,7 +40251,7 @@ function SequenceBar({
|
|
|
40026
40251
|
onSlotRemove(index);
|
|
40027
40252
|
}, [onSlotRemove, playing]);
|
|
40028
40253
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
40029
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
40254
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
40030
40255
|
i > 0 && /* @__PURE__ */ jsx(
|
|
40031
40256
|
Typography,
|
|
40032
40257
|
{
|
|
@@ -41427,7 +41652,7 @@ var init_StatCard = __esm({
|
|
|
41427
41652
|
const labelToUse = propLabel ?? propTitle;
|
|
41428
41653
|
const eventBus = useEventBus();
|
|
41429
41654
|
const { t } = useTranslate();
|
|
41430
|
-
const handleActionClick =
|
|
41655
|
+
const handleActionClick = React81__default.useCallback(() => {
|
|
41431
41656
|
if (action?.event) {
|
|
41432
41657
|
eventBus.emit(`UI:${action.event}`, {});
|
|
41433
41658
|
}
|
|
@@ -41438,7 +41663,7 @@ var init_StatCard = __esm({
|
|
|
41438
41663
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
41439
41664
|
const isLoading = externalLoading ?? false;
|
|
41440
41665
|
const error = externalError;
|
|
41441
|
-
const computeMetricValue =
|
|
41666
|
+
const computeMetricValue = React81__default.useCallback(
|
|
41442
41667
|
(metric, items) => {
|
|
41443
41668
|
if (metric.value !== void 0) {
|
|
41444
41669
|
return metric.value;
|
|
@@ -41477,7 +41702,7 @@ var init_StatCard = __esm({
|
|
|
41477
41702
|
},
|
|
41478
41703
|
[]
|
|
41479
41704
|
);
|
|
41480
|
-
const schemaStats =
|
|
41705
|
+
const schemaStats = React81__default.useMemo(() => {
|
|
41481
41706
|
if (!metrics || metrics.length === 0) return null;
|
|
41482
41707
|
return metrics.map((metric) => ({
|
|
41483
41708
|
label: metric.label,
|
|
@@ -41485,7 +41710,7 @@ var init_StatCard = __esm({
|
|
|
41485
41710
|
format: metric.format
|
|
41486
41711
|
}));
|
|
41487
41712
|
}, [metrics, data, computeMetricValue]);
|
|
41488
|
-
const calculatedTrend =
|
|
41713
|
+
const calculatedTrend = React81__default.useMemo(() => {
|
|
41489
41714
|
if (manualTrend !== void 0) return manualTrend;
|
|
41490
41715
|
if (previousValue === void 0 || currentValue === void 0)
|
|
41491
41716
|
return void 0;
|
|
@@ -42621,7 +42846,7 @@ var init_Timeline = __esm({
|
|
|
42621
42846
|
}) => {
|
|
42622
42847
|
const { t } = useTranslate();
|
|
42623
42848
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
42624
|
-
const items =
|
|
42849
|
+
const items = React81__default.useMemo(() => {
|
|
42625
42850
|
if (propItems) return propItems;
|
|
42626
42851
|
if (entityData.length === 0) return [];
|
|
42627
42852
|
return entityData.map((record, idx) => {
|
|
@@ -42728,7 +42953,7 @@ var init_Timeline = __esm({
|
|
|
42728
42953
|
}
|
|
42729
42954
|
});
|
|
42730
42955
|
function extractToastProps(children) {
|
|
42731
|
-
if (!
|
|
42956
|
+
if (!React81__default.isValidElement(children)) {
|
|
42732
42957
|
if (typeof children === "string") {
|
|
42733
42958
|
return { message: children };
|
|
42734
42959
|
}
|
|
@@ -42766,7 +42991,7 @@ var init_ToastSlot = __esm({
|
|
|
42766
42991
|
eventBus.emit("UI:CLOSE");
|
|
42767
42992
|
};
|
|
42768
42993
|
if (!isVisible) return null;
|
|
42769
|
-
const isCustomContent =
|
|
42994
|
+
const isCustomContent = React81__default.isValidElement(children) && !message;
|
|
42770
42995
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
42771
42996
|
Toast,
|
|
42772
42997
|
{
|
|
@@ -43035,7 +43260,7 @@ var init_WizardContainer = __esm({
|
|
|
43035
43260
|
const isCompleted = index < currentStep;
|
|
43036
43261
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
43037
43262
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
43038
|
-
return /* @__PURE__ */ jsxs(
|
|
43263
|
+
return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
43039
43264
|
/* @__PURE__ */ jsx(
|
|
43040
43265
|
Button,
|
|
43041
43266
|
{
|
|
@@ -43417,12 +43642,12 @@ var init_WorldMapTemplate = __esm({
|
|
|
43417
43642
|
}
|
|
43418
43643
|
});
|
|
43419
43644
|
function lazyThree(name, loader) {
|
|
43420
|
-
const Lazy =
|
|
43645
|
+
const Lazy = React81__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
43421
43646
|
function ThreeWrapper(props) {
|
|
43422
|
-
return
|
|
43423
|
-
|
|
43647
|
+
return React81__default.createElement(
|
|
43648
|
+
React81__default.Suspense,
|
|
43424
43649
|
{ fallback: null },
|
|
43425
|
-
|
|
43650
|
+
React81__default.createElement(Lazy, props)
|
|
43426
43651
|
);
|
|
43427
43652
|
}
|
|
43428
43653
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -44026,7 +44251,7 @@ function SuspenseConfigProvider({
|
|
|
44026
44251
|
config,
|
|
44027
44252
|
children
|
|
44028
44253
|
}) {
|
|
44029
|
-
return
|
|
44254
|
+
return React81__default.createElement(
|
|
44030
44255
|
SuspenseConfigContext.Provider,
|
|
44031
44256
|
{ value: config },
|
|
44032
44257
|
children
|
|
@@ -44509,7 +44734,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
44509
44734
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
44510
44735
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
44511
44736
|
}
|
|
44512
|
-
return /* @__PURE__ */ jsx(
|
|
44737
|
+
return /* @__PURE__ */ jsx(React81__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
44513
44738
|
}
|
|
44514
44739
|
if (!child || typeof child !== "object") return null;
|
|
44515
44740
|
const childId = `${parentId}-${index}`;
|
|
@@ -44546,14 +44771,14 @@ function isPatternConfig(value) {
|
|
|
44546
44771
|
if (value === null || value === void 0) return false;
|
|
44547
44772
|
if (typeof value !== "object") return false;
|
|
44548
44773
|
if (Array.isArray(value)) return false;
|
|
44549
|
-
if (
|
|
44774
|
+
if (React81__default.isValidElement(value)) return false;
|
|
44550
44775
|
if (value instanceof Date) return false;
|
|
44551
44776
|
if (typeof value === "function") return false;
|
|
44552
44777
|
const record = value;
|
|
44553
44778
|
return "type" in record && typeof record.type === "string";
|
|
44554
44779
|
}
|
|
44555
44780
|
function isPlainConfigObject(value) {
|
|
44556
|
-
if (
|
|
44781
|
+
if (React81__default.isValidElement(value)) return false;
|
|
44557
44782
|
if (value instanceof Date) return false;
|
|
44558
44783
|
const proto = Object.getPrototypeOf(value);
|
|
44559
44784
|
return proto === Object.prototype || proto === null;
|