@m4l/components 9.24.1-beta-feature-731-code-editor.1 → 9.25.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/@types/types.d.ts +0 -11
- package/components/MFIsolationApp/MFIsolationApp.d.ts.map +1 -1
- package/components/MFIsolationApp/MFIsolationApp.js +76 -80
- package/components/datagrids/Datagrid.styles.d.ts.map +1 -1
- package/components/datagrids/Datagrid.styles.js +25 -0
- package/components/datagrids/slots/DataGridEnum.d.ts +3 -1
- package/components/datagrids/slots/DataGridEnum.d.ts.map +1 -1
- package/components/datagrids/slots/DataGridEnum.js +1 -1
- package/components/datagrids/slots/DataGridSlot.d.ts +6 -0
- package/components/datagrids/slots/DataGridSlot.d.ts.map +1 -1
- package/components/datagrids/slots/DataGridSlot.js +73 -65
- package/components/datagrids/views/CardsView/CardsView.d.ts +2 -1
- package/components/datagrids/views/CardsView/CardsView.d.ts.map +1 -1
- package/components/datagrids/views/CardsView/CardsView.js +96 -76
- package/components/datagrids/views/CardsView/hooks/useCardsPerRow/index.d.ts +2 -0
- package/components/datagrids/views/CardsView/hooks/useCardsPerRow/index.d.ts.map +1 -0
- package/components/datagrids/views/CardsView/hooks/useCardsPerRow/useCardsPerRow.d.ts +9 -0
- package/components/datagrids/views/CardsView/hooks/useCardsPerRow/useCardsPerRow.d.ts.map +1 -0
- package/components/datagrids/views/CardsView/hooks/useCardsPerRow/useCardsPerRow.js +19 -0
- package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/index.d.ts +3 -0
- package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/index.d.ts.map +1 -0
- package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/types.d.ts +26 -0
- package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/types.d.ts.map +1 -0
- package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/useCardsVirtualizer.d.ts +17 -0
- package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/useCardsVirtualizer.d.ts.map +1 -0
- package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/useCardsVirtualizer.js +23 -0
- package/components/datagrids/views/CardsView/subcomponents/CardRow/CardRow.d.ts +1 -1
- package/components/datagrids/views/CardsView/subcomponents/CardRow/CardRow.d.ts.map +1 -1
- package/components/datagrids/views/CardsView/subcomponents/CardRow/CardRow.js +49 -50
- package/components/datagrids/views/CardsView/subcomponents/CardRow/types.d.ts +4 -2
- package/components/datagrids/views/CardsView/subcomponents/CardRow/types.d.ts.map +1 -1
- package/components/extended/index.d.ts +0 -1
- package/components/extended/index.d.ts.map +1 -1
- package/components/hook-form/index.d.ts +0 -1
- package/components/hook-form/index.d.ts.map +1 -1
- package/index.js +559 -572
- package/package.json +8 -11
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts +0 -5
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts.map +0 -1
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.js +0 -14
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts +0 -2
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts.map +0 -1
- package/components/datagrids/helpers/shared/scrollToRowElement/scrollToRowElement.js +0 -24
- package/components/datagrids/views/CardsView/subcomponents/CardRow/subcomponents/LazyLoadCard/LazyLoadCard.js +0 -33
- package/components/datagrids/views/CardsView/subcomponents/CardRow/subcomponents/LazyLoadCard/subcomponents/IntersectCard/IntersectCard.js +0 -36
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts +0 -6
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.js +0 -405
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts +0 -3
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.js +0 -371
- package/components/extended/ReactSimpleCodeEditor/constants.d.ts +0 -83
- package/components/extended/ReactSimpleCodeEditor/constants.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/constants.js +0 -149
- package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts +0 -11
- package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/dictionary.js +0 -7
- package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts +0 -58
- package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.js +0 -1063
- package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts +0 -6
- package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.js +0 -7
- package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.d.ts +0 -6
- package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.js +0 -9
- package/components/extended/ReactSimpleCodeEditor/index.d.ts +0 -4
- package/components/extended/ReactSimpleCodeEditor/index.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts +0 -19
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.js +0 -4
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts +0 -88
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.js +0 -70
- package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts +0 -3
- package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/types.d.ts +0 -459
- package/components/extended/ReactSimpleCodeEditor/types.d.ts.map +0 -1
- package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts +0 -7
- package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts.map +0 -1
- package/components/hook-form/RHFCodeEditor/RHFCodeEditor.js +0 -6
- package/components/hook-form/RHFCodeEditor/index.d.ts +0 -3
- package/components/hook-form/RHFCodeEditor/index.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardsView.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/views/CardsView/CardsView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"CardsView.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/views/CardsView/CardsView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAKzC;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EACvE,KAAK,EAAE,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,2DAiM/C"}
|
|
@@ -1,93 +1,113 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { CardsContainerStyled as
|
|
4
|
-
import { useProcessedColumns as
|
|
5
|
-
import { useModalDetail as
|
|
6
|
-
import { calculateCardHeight as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { CardRow as
|
|
10
|
-
function
|
|
1
|
+
import { jsx as u } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useRef as v, useMemo as T, useEffect as D } from "react";
|
|
3
|
+
import { CardsContainerStyled as O, CardsVirtualContainerStyled as B, CardsVirtualRowItemStyled as F } from "../../slots/DataGridSlot.js";
|
|
4
|
+
import { useProcessedColumns as k } from "./hooks/useProcessedColumns/useProcessedColumns.js";
|
|
5
|
+
import { useModalDetail as _ } from "./hooks/useModalDetail/useModalDetail.js";
|
|
6
|
+
import { calculateCardHeight as j } from "./helpers/calculateCardHeight/calculateCardHeight.js";
|
|
7
|
+
import { useCardsPerRow as G } from "./hooks/useCardsPerRow/useCardsPerRow.js";
|
|
8
|
+
import { useCardsVirtualizer as q } from "./hooks/useCardsVirtualizer/useCardsVirtualizer.js";
|
|
9
|
+
import { CardRow as A } from "./subcomponents/CardRow/CardRow.js";
|
|
10
|
+
function $(E) {
|
|
11
11
|
const {
|
|
12
|
-
rows:
|
|
13
|
-
columns:
|
|
14
|
-
rowKeyGetter:
|
|
15
|
-
selectedRows:
|
|
16
|
-
onSelectedRowsChange:
|
|
17
|
-
onRowsChange:
|
|
12
|
+
rows: r,
|
|
13
|
+
columns: w,
|
|
14
|
+
rowKeyGetter: l,
|
|
15
|
+
selectedRows: H,
|
|
16
|
+
onSelectedRowsChange: d,
|
|
17
|
+
onRowsChange: p,
|
|
18
18
|
cardsViewConfig: e,
|
|
19
|
-
focusOnRowKey:
|
|
20
|
-
smoothScroll:
|
|
21
|
-
checkedRows:
|
|
22
|
-
onCheckedRowsChange:
|
|
23
|
-
} =
|
|
19
|
+
focusOnRowKey: s,
|
|
20
|
+
smoothScroll: g = !0,
|
|
21
|
+
checkedRows: m,
|
|
22
|
+
onCheckedRowsChange: R
|
|
23
|
+
} = E, f = v(null), h = v(void 0), c = k(w), x = k(w, {
|
|
24
24
|
applyVisibilityFilter: !1
|
|
25
|
-
}),
|
|
26
|
-
columns:
|
|
27
|
-
onRowsChange:
|
|
28
|
-
rows:
|
|
29
|
-
}),
|
|
30
|
-
const
|
|
31
|
-
const a =
|
|
32
|
-
return a ?
|
|
25
|
+
}), V = _({
|
|
26
|
+
columns: x,
|
|
27
|
+
onRowsChange: p,
|
|
28
|
+
rows: r
|
|
29
|
+
}), S = T(() => {
|
|
30
|
+
const o = c.reduce((t, n) => {
|
|
31
|
+
const a = n.renderCell?.__imageFormatterHeight;
|
|
32
|
+
return a ? t + a : t;
|
|
33
33
|
}, 0);
|
|
34
|
-
return
|
|
34
|
+
return j({
|
|
35
35
|
visibleColumnsCount: c.length,
|
|
36
36
|
customMinHeight: e?.customRender?.minHeight
|
|
37
|
-
}) +
|
|
38
|
-
}, [c, e])
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
}) + o;
|
|
38
|
+
}, [c, e]), i = G(f), I = Math.ceil(r.length / i), { virtualizer: C, virtualItems: M, totalSize: b } = q({
|
|
39
|
+
count: I,
|
|
40
|
+
scrollElementRef: f,
|
|
41
|
+
estimateSize: S
|
|
42
|
+
});
|
|
43
|
+
return D(() => {
|
|
44
|
+
if (!s) {
|
|
45
|
+
h.current = void 0;
|
|
42
46
|
return;
|
|
43
47
|
}
|
|
44
|
-
if (
|
|
45
|
-
(o) => s(o) === n
|
|
46
|
-
) === -1)
|
|
48
|
+
if (h.current === s)
|
|
47
49
|
return;
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
C
|
|
60
|
-
), l && l(/* @__PURE__ */ new Set([n])), d.current = n;
|
|
50
|
+
const o = r.findIndex(
|
|
51
|
+
(n) => l(n) === s
|
|
52
|
+
);
|
|
53
|
+
if (o === -1)
|
|
54
|
+
return;
|
|
55
|
+
const t = setTimeout(() => {
|
|
56
|
+
const n = Math.floor(o / i);
|
|
57
|
+
C.scrollToIndex(n, {
|
|
58
|
+
align: "center",
|
|
59
|
+
behavior: g ? "smooth" : "auto"
|
|
60
|
+
}), d && d(/* @__PURE__ */ new Set([s])), h.current = s;
|
|
61
61
|
}, 300);
|
|
62
|
-
return () => clearTimeout(
|
|
63
|
-
}, [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
return () => clearTimeout(t);
|
|
63
|
+
}, [
|
|
64
|
+
s,
|
|
65
|
+
r,
|
|
66
|
+
l,
|
|
67
|
+
i,
|
|
68
|
+
C,
|
|
69
|
+
g,
|
|
70
|
+
d
|
|
71
|
+
]), c.length === 0 ? null : /* @__PURE__ */ u(O, { ownerState: {}, "data-testid": "cards-container", ref: f, children: /* @__PURE__ */ u(B, { ownerState: { totalSize: b }, children: M.map((o) => {
|
|
72
|
+
const t = o.index * i, n = r.slice(t, t + i);
|
|
73
|
+
return /* @__PURE__ */ u(
|
|
74
|
+
F,
|
|
67
75
|
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
ref: C.measureElement,
|
|
77
|
+
"data-index": o.index,
|
|
78
|
+
ownerState: { offsetTop: o.start, cardsPerRow: i },
|
|
79
|
+
children: n.map((a, z) => {
|
|
80
|
+
const y = l(a), K = m?.has(y) || !1, P = m !== void 0 && R !== void 0;
|
|
81
|
+
return /* @__PURE__ */ u(
|
|
82
|
+
A,
|
|
83
|
+
{
|
|
84
|
+
row: a,
|
|
85
|
+
rows: r,
|
|
86
|
+
rowIndex: t + z,
|
|
87
|
+
columns: c,
|
|
88
|
+
originalColumns: x,
|
|
89
|
+
rowKeyGetter: l,
|
|
90
|
+
selectedRows: H,
|
|
91
|
+
onSelectedRowsChange: d,
|
|
92
|
+
onRowsChange: p,
|
|
93
|
+
customRender: e?.customRender,
|
|
94
|
+
minHeight: S,
|
|
95
|
+
isChecked: K,
|
|
96
|
+
showCheckbox: P,
|
|
97
|
+
checkedRows: m,
|
|
98
|
+
onCheckedRowsChange: R,
|
|
99
|
+
onOpenDetail: V,
|
|
100
|
+
showExpandButton: e && "columnsConfig" in e ? e.showExpandButton : void 0,
|
|
101
|
+
onExpandClick: e && "columnsConfig" in e ? e.onExpandClick : void 0
|
|
102
|
+
},
|
|
103
|
+
y
|
|
104
|
+
);
|
|
105
|
+
})
|
|
86
106
|
},
|
|
87
|
-
|
|
107
|
+
o.key
|
|
88
108
|
);
|
|
89
109
|
}) }) });
|
|
90
110
|
}
|
|
91
111
|
export {
|
|
92
|
-
|
|
112
|
+
$ as CardsView
|
|
93
113
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/datagrids/views/CardsView/hooks/useCardsPerRow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Computes the number of cards per row from the container width, accounting for the gap
|
|
4
|
+
* between columns. Formula: floor((width + gap) / (minCardWidth + gap)).
|
|
5
|
+
* Uses useLayoutEffect + an immediate getBoundingClientRect measurement so cardsPerRow is
|
|
6
|
+
* correct before the first paint, preventing stale DOM references in Storybook interaction tests.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useCardsPerRow(containerRef: RefObject<HTMLDivElement | null>, minCardWidth?: number, gap?: number): number;
|
|
9
|
+
//# sourceMappingURL=useCardsPerRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCardsPerRow.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/datagrids/views/CardsView/hooks/useCardsPerRow/useCardsPerRow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA6B,MAAM,OAAO,CAAC;AAY7D;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,YAAY,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,EAC9C,YAAY,SAAyB,EACrC,GAAG,SAAc,GAChB,MAAM,CA8BR"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useState as d, useLayoutEffect as f } from "react";
|
|
2
|
+
const w = 280, R = 16;
|
|
3
|
+
function A(r, n = w, t = R) {
|
|
4
|
+
const [a, s] = d(1);
|
|
5
|
+
return f(() => {
|
|
6
|
+
const e = r.current;
|
|
7
|
+
if (!e)
|
|
8
|
+
return;
|
|
9
|
+
const c = (o) => Math.max(1, Math.floor((o + t) / (n + t))), i = e.getBoundingClientRect().width;
|
|
10
|
+
i > 0 && s(c(i));
|
|
11
|
+
const u = new ResizeObserver(([o]) => {
|
|
12
|
+
s(c(o.contentRect.width));
|
|
13
|
+
});
|
|
14
|
+
return u.observe(e), () => u.disconnect();
|
|
15
|
+
}, [r, n, t]), a;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
A as useCardsPerRow
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export interface UseCardsVirtualizerProps {
|
|
3
|
+
/**
|
|
4
|
+
* Total number of virtual rows to render (Math.ceil(rows.length / cardsPerRow)).
|
|
5
|
+
* Each row contains cardsPerRow cards.
|
|
6
|
+
*/
|
|
7
|
+
count: number;
|
|
8
|
+
/**
|
|
9
|
+
* Ref to the scroll container element (CardsContainerStyled with overflow: auto).
|
|
10
|
+
* The virtualizer listens to scroll events on this element.
|
|
11
|
+
*/
|
|
12
|
+
scrollElementRef: RefObject<HTMLDivElement | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Number of extra rows to render outside the visible viewport.
|
|
15
|
+
* Prevents blank flashes during fast scrolling.
|
|
16
|
+
* @default 3
|
|
17
|
+
*/
|
|
18
|
+
overscan?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Estimated row height in pixels. Use calculateCardHeight() result as initial value.
|
|
21
|
+
* Corrected automatically via measureElement + ResizeObserver after first render.
|
|
22
|
+
* @default 200
|
|
23
|
+
*/
|
|
24
|
+
estimateSize?: number;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,gBAAgB,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACnD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/useCardsVirtualizer.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UseCardsVirtualizerProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook that wraps TanStack Virtual's `useVirtualizer` for the CardsView.
|
|
4
|
+
* Each virtual item represents a horizontal row of N cards (cardsPerRow).
|
|
5
|
+
* Row heights are measured dynamically via measureElement + ResizeObserver.
|
|
6
|
+
* @returns
|
|
7
|
+
* - `virtualizer` — virtualizer instance (use `virtualizer.measureElement` as ref on each row,
|
|
8
|
+
* and `virtualizer.scrollToIndex` to programmatically scroll to a row group)
|
|
9
|
+
* - `virtualItems` — array of visible row groups to render
|
|
10
|
+
* - `totalSize` — total scrollable height in pixels (set on the virtual container)
|
|
11
|
+
*/
|
|
12
|
+
export declare function useCardsVirtualizer({ count, scrollElementRef, overscan, estimateSize, }: UseCardsVirtualizerProps): {
|
|
13
|
+
virtualizer: import('@tanstack/virtual-core').Virtualizer<HTMLDivElement, Element>;
|
|
14
|
+
virtualItems: import('@tanstack/virtual-core').VirtualItem[];
|
|
15
|
+
totalSize: number;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useCardsVirtualizer.d.ts.map
|
package/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/useCardsVirtualizer.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCardsVirtualizer.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/datagrids/views/CardsView/hooks/useCardsVirtualizer/useCardsVirtualizer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AASnD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,gBAAgB,EAChB,QAAY,EACZ,YAAoC,GACrC,EAAE,wBAAwB;;;;EAa1B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useVirtualizer as u } from "@tanstack/react-virtual";
|
|
2
|
+
const a = 200;
|
|
3
|
+
function s({
|
|
4
|
+
count: e,
|
|
5
|
+
scrollElementRef: r,
|
|
6
|
+
overscan: i = 3,
|
|
7
|
+
estimateSize: l = a
|
|
8
|
+
}) {
|
|
9
|
+
const t = u({
|
|
10
|
+
count: e,
|
|
11
|
+
getScrollElement: () => r.current,
|
|
12
|
+
estimateSize: () => l,
|
|
13
|
+
overscan: i
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
virtualizer: t,
|
|
17
|
+
virtualItems: t.getVirtualItems(),
|
|
18
|
+
totalSize: t.getTotalSize()
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
s as useCardsVirtualizer
|
|
23
|
+
};
|
|
@@ -3,7 +3,7 @@ import { CardRowProps } from './types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Componente que muestra una fila de tarjetas.
|
|
5
5
|
*/
|
|
6
|
-
declare function CardRowComponent<TRow, TKey extends RowKey = RowKey>({ row, rows, rowIndex, columns, originalColumns, rowKeyGetter, selectedRows, onSelectedRowsChange, onRowsChange, customRender, minHeight, isChecked, checkedRows, showCheckbox, onCheckedRowsChange, onOpenDetail, showExpandButton, onExpandClick, }: CardRowProps<TRow, TKey>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function CardRowComponent<TRow, TKey extends RowKey = RowKey>({ row, rows, rowIndex, columns, originalColumns, rowKeyGetter, selectedRows, onSelectedRowsChange, onRowsChange, customRender, minHeight: _minHeight, isChecked, checkedRows, showCheckbox, onCheckedRowsChange, onOpenDetail, showExpandButton, onExpandClick, }: CardRowProps<TRow, TKey>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
7
|
/**
|
|
8
8
|
* Componente que muestra CardRow
|
|
9
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardRow.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/datagrids/views/CardsView/subcomponents/CardRow/CardRow.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CardRow.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/datagrids/views/CardsView/subcomponents/CardRow/CardRow.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAOvC;;GAEG;AACH,iBAAS,gBAAgB,CAAC,IAAI,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EAAE,EAC5D,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,SAAS,EAAE,UAAU,EACrB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,gBAAuB,EACvB,aAAa,GACd,EAAE,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,oDA4H1B;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,EAEd,OAAO,gBAAgB,CAAC"}
|
|
@@ -1,99 +1,98 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { CardContentWrapperStyled as
|
|
4
|
-
import { deepEqual as
|
|
5
|
-
import { useCardContent as
|
|
6
|
-
import { CardHeader as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
function Q({
|
|
1
|
+
import { jsxs as j, jsx as u } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import x, { useMemo as q } from "react";
|
|
3
|
+
import { CardContentWrapperStyled as y, CardContentStyled as B, CardStyled as W } from "../../../../slots/DataGridSlot.js";
|
|
4
|
+
import { deepEqual as _ } from "fast-equals";
|
|
5
|
+
import { useCardContent as z } from "../../hooks/useCardContent/useCardContent.js";
|
|
6
|
+
import { CardHeader as F } from "./subcomponents/CardHeader/CardHeader.js";
|
|
7
|
+
import { getDefaultAction as J } from "../../../../helpers/shared/getDefaultAction/getDefaultAction.js";
|
|
8
|
+
import { useDataGrid as L } from "../../../../hooks/shared/useDataGrid/useDataGrid.js";
|
|
9
|
+
function N({
|
|
11
10
|
row: t,
|
|
12
|
-
rows:
|
|
11
|
+
rows: o,
|
|
13
12
|
rowIndex: v,
|
|
14
13
|
columns: I,
|
|
15
|
-
originalColumns:
|
|
14
|
+
originalColumns: O,
|
|
16
15
|
rowKeyGetter: n,
|
|
17
16
|
selectedRows: r,
|
|
18
|
-
onSelectedRowsChange:
|
|
17
|
+
onSelectedRowsChange: m,
|
|
19
18
|
onRowsChange: M,
|
|
20
|
-
customRender:
|
|
21
|
-
minHeight:
|
|
22
|
-
isChecked:
|
|
23
|
-
checkedRows:
|
|
24
|
-
showCheckbox:
|
|
25
|
-
onCheckedRowsChange:
|
|
19
|
+
customRender: e,
|
|
20
|
+
minHeight: P,
|
|
21
|
+
isChecked: i,
|
|
22
|
+
checkedRows: l,
|
|
23
|
+
showCheckbox: s,
|
|
24
|
+
onCheckedRowsChange: d,
|
|
26
25
|
onOpenDetail: k,
|
|
27
26
|
showExpandButton: f = !0,
|
|
28
27
|
onExpandClick: C
|
|
29
28
|
}) {
|
|
30
|
-
const { rowActionsGetter: p } =
|
|
29
|
+
const { rowActionsGetter: p } = L(), g = e !== void 0, { cardContent: b } = z({
|
|
31
30
|
row: t,
|
|
32
|
-
rows:
|
|
31
|
+
rows: o,
|
|
33
32
|
rowIndex: v,
|
|
34
33
|
columns: I,
|
|
35
34
|
onRowsChange: M
|
|
36
|
-
}), D = q(() =>
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
35
|
+
}), D = q(() => g ? e.renderContent(t) : /* @__PURE__ */ j(y, { ownerState: {}, children: [
|
|
36
|
+
/* @__PURE__ */ u(
|
|
37
|
+
F,
|
|
39
38
|
{
|
|
40
39
|
row: t,
|
|
41
40
|
onOpenDetail: k,
|
|
42
|
-
isChecked:
|
|
43
|
-
showCheckbox:
|
|
44
|
-
checkedRows:
|
|
45
|
-
onCheckedRowsChange:
|
|
41
|
+
isChecked: i,
|
|
42
|
+
showCheckbox: s,
|
|
43
|
+
checkedRows: l,
|
|
44
|
+
onCheckedRowsChange: d,
|
|
46
45
|
showExpandButton: f,
|
|
47
46
|
onExpandClick: C
|
|
48
47
|
}
|
|
49
48
|
),
|
|
50
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ u(B, { ownerState: {}, children: b })
|
|
51
50
|
] }), [
|
|
51
|
+
g,
|
|
52
|
+
e,
|
|
53
|
+
t,
|
|
52
54
|
b,
|
|
53
55
|
i,
|
|
54
|
-
t,
|
|
55
|
-
g,
|
|
56
|
-
a,
|
|
57
|
-
d,
|
|
58
|
-
m,
|
|
59
56
|
s,
|
|
57
|
+
l,
|
|
58
|
+
d,
|
|
60
59
|
f,
|
|
61
60
|
C
|
|
62
|
-
]),
|
|
63
|
-
if (!
|
|
61
|
+
]), h = (a) => {
|
|
62
|
+
if (!a.target.closest(
|
|
64
63
|
'input, button, a, [role="button"], .MuiCheckbox-root, .MuiIconButton-root'
|
|
65
|
-
) && r &&
|
|
64
|
+
) && r && m) {
|
|
66
65
|
if (r.has(n(t)))
|
|
67
66
|
return;
|
|
68
|
-
const
|
|
69
|
-
|
|
67
|
+
const c = /* @__PURE__ */ new Set([n(t)]);
|
|
68
|
+
m(c);
|
|
70
69
|
}
|
|
71
|
-
},
|
|
72
|
-
if (
|
|
70
|
+
}, A = (a) => {
|
|
71
|
+
if (a.target.closest(
|
|
73
72
|
'input, button, a, [role="button"], .MuiCheckbox-root, .MuiIconButton-root'
|
|
74
73
|
) || !p)
|
|
75
74
|
return;
|
|
76
|
-
const
|
|
75
|
+
const c = p(t), S = J(c);
|
|
77
76
|
S?.onClick && S.onClick(t);
|
|
78
77
|
};
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
|
|
78
|
+
return /* @__PURE__ */ u(
|
|
79
|
+
W,
|
|
81
80
|
{
|
|
82
81
|
variant: "outlined",
|
|
83
82
|
selected: r?.has(n(t)),
|
|
84
83
|
ownerState: {
|
|
85
|
-
checked:
|
|
84
|
+
checked: i,
|
|
86
85
|
selected: r?.has(n(t))
|
|
87
86
|
},
|
|
88
|
-
onClick:
|
|
89
|
-
onDoubleClick:
|
|
87
|
+
onClick: h,
|
|
88
|
+
onDoubleClick: A,
|
|
90
89
|
"data-testid": "data-grid-card",
|
|
91
90
|
"data-row-key": n(t),
|
|
92
91
|
children: D
|
|
93
92
|
}
|
|
94
|
-
)
|
|
93
|
+
);
|
|
95
94
|
}
|
|
96
|
-
const
|
|
95
|
+
const G = x.memo(N, (t, o) => _(t, o));
|
|
97
96
|
export {
|
|
98
|
-
|
|
97
|
+
G as CardRow
|
|
99
98
|
};
|
|
@@ -46,9 +46,11 @@ export interface CardRowProps<TRow, TKey extends RowKey = RowKey> {
|
|
|
46
46
|
*/
|
|
47
47
|
customRender?: CardsViewConfig<TRow>['customRender'];
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* @deprecated No longer used since TanStack Virtualizer replaced LazyLoadCard.
|
|
50
|
+
* Card height is now managed by useCardsVirtualizer's estimateSize.
|
|
51
|
+
* Kept for API compatibility — has no visual effect.
|
|
50
52
|
*/
|
|
51
|
-
minHeight
|
|
53
|
+
minHeight?: number;
|
|
52
54
|
/**
|
|
53
55
|
* Indica si la fila está chequeada
|
|
54
56
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/datagrids/views/CardsView/subcomponents/CardRow/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,IAAI,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM;IAC9D;;OAEG;IACH,GAAG,EAAE,IAAI,CAAC;IACV;;OAEG;IACH,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,SAAS,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;IACtC;;OAEG;IACH,eAAe,EAAE,SAAS,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;IAC9C;;OAEG;IACH,YAAY,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IAClC;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACjC;;OAEG;IACH,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,WAAW,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IACpE;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC;IAC9E;;OAEG;IACH,YAAY,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC;IACrD
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/datagrids/views/CardsView/subcomponents/CardRow/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,IAAI,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM;IAC9D;;OAEG;IACH,GAAG,EAAE,IAAI,CAAC;IACV;;OAEG;IACH,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,SAAS,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;IACtC;;OAEG;IACH,eAAe,EAAE,SAAS,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;IAC9C;;OAEG;IACH,YAAY,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IAClC;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACjC;;OAEG;IACH,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,WAAW,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IACpE;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC;IAC9E;;OAEG;IACH,YAAY,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC;IACrD;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAClE;;OAEG;IACH,YAAY,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IAClC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;CACrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/extended/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/extended/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,OAAO,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { RHFAutocomplete } from './RHFAutocomplete/RHFAutocomplete';
|
|
2
2
|
export * from './RHFColorPicker';
|
|
3
|
-
export * from './RHFCodeEditor';
|
|
4
3
|
export { getRHFAutocompleteComponentsDictionary } from './RHFAutocomplete/dictionary';
|
|
5
4
|
export { RHFAutocompleteAsync } from './RHFAutocompleteAsync/RHFAutocompleteAsync';
|
|
6
5
|
export * from './RHFImageSelector';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/hook-form/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,cAAc,kBAAkB,CAAC;AACjC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/hook-form/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,sCAAsC,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,2CAA2C,EAAE,MAAM,mCAAmC,CAAC;AAChG,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
|