@worknice/whiteboard 0.66.1 → 0.67.1
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/controls/FilterModal.d.ts +2 -2
- package/dist/icons/components/Bolt.js +1 -1
- package/dist/icons/components/Clock.d.ts +5 -0
- package/dist/icons/components/Clock.js +14 -0
- package/dist/icons/components/Shield.d.ts +5 -0
- package/dist/icons/components/Shield.js +14 -0
- package/dist/icons/components/UserPlus.js +1 -1
- package/dist/icons/components/index.d.ts +2 -0
- package/dist/icons/components/index.js +5 -1
- package/dist/icons/svgs/Clock.js +2 -0
- package/dist/icons/svgs/Shield.js +2 -0
- package/dist/presentation/CardGrid.d.ts +2 -1
- package/dist/presentation/CardGrid.js +3 -2
- package/dist/presentation/CardGrid_module.css +1 -1
- package/dist/presentation/RichList/RichList.d.ts +23 -3
- package/dist/presentation/RichList/RichList.js +141 -26
- package/dist/presentation/RichList/RichList.module.js +2 -0
- package/dist/presentation/RichList/RichList.stories.d.ts +14 -0
- package/dist/presentation/RichList/RichList.stories.js +18 -1
- package/dist/presentation/RichList/RichListDisplayModal.js +2 -15
- package/dist/presentation/RichList/RichListRow.d.ts +16 -1
- package/dist/presentation/RichList/RichListRow.js +10 -3
- package/dist/presentation/RichList/RichListRow_module.css +5 -1
- package/dist/presentation/RichList/RichListSkeleton.d.ts +9 -0
- package/dist/presentation/RichList/RichListSkeleton.js +114 -0
- package/dist/presentation/RichList/RichListSkeleton.module.js +14 -0
- package/dist/presentation/RichList/RichListSkeleton_module.css +84 -0
- package/dist/presentation/RichList/RichListVirtualBody.d.ts +43 -0
- package/dist/presentation/RichList/RichListVirtualBody.js +68 -0
- package/dist/presentation/RichList/RichList_module.css +16 -4
- package/dist/presentation/RichList/stories/LargeList.d.ts +10 -0
- package/dist/presentation/RichList/stories/LargeList.js +137 -0
- package/dist/presentation/RichList/stories/Skeleton.d.ts +3 -0
- package/dist/presentation/RichList/stories/Skeleton.js +84 -0
- package/dist/presentation/RichList/types.d.ts +13 -2
- package/dist/static/svg/Clock.svg +1 -0
- package/dist/static/svg/Shield.svg +1 -0
- package/package.json +2 -2
|
@@ -20,7 +20,7 @@ function contentSlotAlignClass(align) {
|
|
|
20
20
|
return __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].contentSlotStart;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
const RichListRow = ({ row, table, groupEntry, enableRowSelection, href, onClick, normalizedLeadingSlots, normalizedPrimary, normalizedSecondary, mainSlotMaxWidthPx, shouldFillMainSlot, normalizedContentSlots, normalizedTrailingSlots, isCompactContentSlots, rowMainHidesContentSlotColumns, contentSlotsJustifyContent, actionsForRow, lastSelectedRowRef })=>{
|
|
23
|
+
const RichListRow = ({ row, table, groupEntry, enableRowSelection, anyRowCanBeSelected, href, onClick, normalizedLeadingSlots, normalizedPrimary, normalizedSecondary, mainSlotMaxWidthPx, shouldFillMainSlot, normalizedContentSlots, normalizedTrailingSlots, isCompactContentSlots, rowMainHidesContentSlotColumns, contentSlotsJustifyContent, actionsForRow, lastSelectedRowRef, virtualStyle, dataIndex, measureRef })=>{
|
|
24
24
|
const { Link } = (0, __WEBPACK_EXTERNAL_MODULE__utils_useNextContext_js_c6ca8eb1__["default"])();
|
|
25
25
|
const rowOriginal = row.original;
|
|
26
26
|
const hrefValue = href ? href(rowOriginal) : void 0;
|
|
@@ -117,7 +117,8 @@ const RichListRow = ({ row, table, groupEntry, enableRowSelection, href, onClick
|
|
|
117
117
|
const rowOverlay = hrefValue ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Link, {
|
|
118
118
|
className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].rowLink,
|
|
119
119
|
href: hrefValue,
|
|
120
|
-
"aria-label": void 0
|
|
120
|
+
"aria-label": void 0,
|
|
121
|
+
prefetch: false
|
|
121
122
|
}) : null;
|
|
122
123
|
const bulkCheckboxId = `richlist-bulk-${row.id}`;
|
|
123
124
|
const handleCheckboxPaddingClick = (event)=>{
|
|
@@ -141,7 +142,10 @@ const RichListRow = ({ row, table, groupEntry, enableRowSelection, href, onClick
|
|
|
141
142
|
onChange: (value)=>row.toggleSelected(value)
|
|
142
143
|
});
|
|
143
144
|
if (row.getIsGrouped() && groupEntry) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("li", {
|
|
145
|
+
ref: measureRef,
|
|
144
146
|
className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].listItem,
|
|
147
|
+
"data-index": dataIndex,
|
|
148
|
+
style: virtualStyle,
|
|
145
149
|
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
146
150
|
className: (0, __WEBPACK_EXTERNAL_MODULE_clsx__["default"])(__WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].row, __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].rowGrouped),
|
|
147
151
|
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
@@ -151,12 +155,15 @@ const RichListRow = ({ row, table, groupEntry, enableRowSelection, href, onClick
|
|
|
151
155
|
})
|
|
152
156
|
});
|
|
153
157
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("li", {
|
|
158
|
+
ref: measureRef,
|
|
154
159
|
className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].listItem,
|
|
160
|
+
"data-index": dataIndex,
|
|
155
161
|
"data-selected": row.getIsSelected() ? "" : void 0,
|
|
162
|
+
style: virtualStyle,
|
|
156
163
|
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
|
|
157
164
|
className: (0, __WEBPACK_EXTERNAL_MODULE_clsx__["default"])(__WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].row, isCompactContentSlots && __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].rowListAtCompactBreakpoint),
|
|
158
165
|
children: [
|
|
159
|
-
enableRowSelection &&
|
|
166
|
+
enableRowSelection && anyRowCanBeSelected ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
160
167
|
className: (0, __WEBPACK_EXTERNAL_MODULE_clsx__["default"])(__WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].checkboxLane, __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].checkboxLaneFullTarget, row.getIsSelected() && __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].checkboxLaneActive),
|
|
161
168
|
onClick: (event)=>{
|
|
162
169
|
event.stopPropagation();
|
|
@@ -3,10 +3,14 @@
|
|
|
3
3
|
display: block;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.listItem-HfVE7t
|
|
6
|
+
.listItem-HfVE7t .row-qNQike {
|
|
7
7
|
border-top: solid var(--size-n5) var(--color-grey-t09);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
.listItem-HfVE7t[data-index="0"] .row-qNQike {
|
|
11
|
+
border-top: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
.groupHeader-XItOuo {
|
|
11
15
|
flex: auto;
|
|
12
16
|
align-items: center;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RichListProps } from "./RichList";
|
|
2
|
+
/**
|
|
3
|
+
* Cheap, prop-derived stand-in for `RichListInner` rendered by the `RichList`
|
|
4
|
+
* wrapper while a large list defers its first paint. It never builds a TanStack
|
|
5
|
+
* row model, so it mounts instantly; the shape is inferred from the same slot
|
|
6
|
+
* config (wide breakpoint) to keep the eventual swap visually seamless.
|
|
7
|
+
*/
|
|
8
|
+
declare const RichListSkeleton: <Type>({ leadingSlot, mainSlot, contentSlots, trailingSlot, rowHeight, bulkActions, secondaryBulkActions, csvFilename, header, }: RichListProps<Type>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default RichListSkeleton;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__utils_customProperties_js_3d9c174d__ from "../../utils/customProperties.js";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__ from "./helpers.js";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__ from "./RichListSkeleton.module.js";
|
|
6
|
+
const SKELETON_ROW_COUNT = 12;
|
|
7
|
+
const toSlotArray = (slot)=>null == slot ? [] : Array.isArray(slot) ? slot : [
|
|
8
|
+
slot
|
|
9
|
+
];
|
|
10
|
+
const isWideVisible = (slot)=>(0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.isVisibleAtBreakpoint)(slot.layoutVisibility, false);
|
|
11
|
+
const RichListSkeleton = ({ leadingSlot, mainSlot, contentSlots, trailingSlot, rowHeight, bulkActions, secondaryBulkActions, csvFilename, header })=>{
|
|
12
|
+
const rowHeightValue = (0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.resolveRichListRowHeightValue)(rowHeight, false, "medium");
|
|
13
|
+
const rowHeightPx = (0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.richListRowHeightToPx)(rowHeightValue);
|
|
14
|
+
const rootStyle = (0, __WEBPACK_EXTERNAL_MODULE__utils_customProperties_js_3d9c174d__["default"])({
|
|
15
|
+
"--row-height": `${rowHeightPx}px`,
|
|
16
|
+
"--richlist-padding-inline": `${(0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.richListInlinePaddingPx)(rowHeightValue)}px`
|
|
17
|
+
});
|
|
18
|
+
const leadingSlots = toSlotArray(leadingSlot).map((slot, index)=>(0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.normalizeSlot)(slot, "leading", index)).filter(isWideVisible);
|
|
19
|
+
const trailingSlots = toSlotArray(trailingSlot).map((slot, index)=>(0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.normalizeSlot)(slot, "trailing", index)).filter(isWideVisible);
|
|
20
|
+
const visibleContentSlots = (contentSlots ?? []).map((slot, index)=>(0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.normalizeSlot)(slot, "content", index)).filter((slot)=>!slot.hiddenByDefault && isWideVisible(slot));
|
|
21
|
+
const enableRowSelection = (bulkActions?.length ?? 0) > 0 || (secondaryBulkActions?.length ?? 0) > 0;
|
|
22
|
+
const capabilityEntries = [
|
|
23
|
+
(0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.normalizeTextField)(mainSlot.primary, "primary"),
|
|
24
|
+
...mainSlot.secondary ? [
|
|
25
|
+
(0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.normalizeTextField)(mainSlot.secondary, "secondary")
|
|
26
|
+
] : [],
|
|
27
|
+
...toSlotArray(leadingSlot).map((slot, index)=>(0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.normalizeSlot)(slot, "leading", index)),
|
|
28
|
+
...(contentSlots ?? []).map((slot, index)=>(0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.normalizeSlot)(slot, "content", index)),
|
|
29
|
+
...toSlotArray(trailingSlot).map((slot, index)=>(0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.normalizeSlot)(slot, "trailing", index))
|
|
30
|
+
];
|
|
31
|
+
const hasToolbar = enableRowSelection || capabilityEntries.some((entry)=>Boolean(entry.filter) || entry.globalFiltering || entry.enableSorting || Boolean(entry.grouping)) || Boolean(csvFilename) && capabilityEntries.some((entry)=>entry.csvExport);
|
|
32
|
+
const laneWidth = (slot, fallbackPx)=>void 0 !== slot.size ? (0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.formatSlotSize)(slot.size) : `${fallbackPx}px`;
|
|
33
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
|
|
34
|
+
"aria-hidden": true,
|
|
35
|
+
className: __WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].root,
|
|
36
|
+
style: rootStyle,
|
|
37
|
+
children: [
|
|
38
|
+
header ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
39
|
+
className: __WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].header,
|
|
40
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
41
|
+
className: `${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].block} ${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].line}`,
|
|
42
|
+
style: {
|
|
43
|
+
width: 160
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
}) : null,
|
|
47
|
+
hasToolbar ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
|
|
48
|
+
className: __WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].toolbar,
|
|
49
|
+
children: [
|
|
50
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
51
|
+
className: `${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].block} ${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].line}`,
|
|
52
|
+
style: {
|
|
53
|
+
height: 32,
|
|
54
|
+
width: 240
|
|
55
|
+
}
|
|
56
|
+
}),
|
|
57
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
58
|
+
className: __WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].grow
|
|
59
|
+
}),
|
|
60
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
61
|
+
className: `${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].block} ${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].line}`,
|
|
62
|
+
style: {
|
|
63
|
+
height: 32,
|
|
64
|
+
width: 84
|
|
65
|
+
}
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
68
|
+
className: `${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].block} ${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].line}`,
|
|
69
|
+
style: {
|
|
70
|
+
height: 32,
|
|
71
|
+
width: 84
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
}) : null,
|
|
76
|
+
Array.from({
|
|
77
|
+
length: SKELETON_ROW_COUNT
|
|
78
|
+
}, (_, rowIndex)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
|
|
79
|
+
className: __WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].row,
|
|
80
|
+
children: [
|
|
81
|
+
enableRowSelection ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
82
|
+
className: `${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].block} ${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].checkbox}`
|
|
83
|
+
}) : null,
|
|
84
|
+
leadingSlots.map((slot)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
85
|
+
className: `${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].block} ${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].circle}`
|
|
86
|
+
}, slot.id)),
|
|
87
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
88
|
+
className: `${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].block} ${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].line}`,
|
|
89
|
+
style: {
|
|
90
|
+
width: 200
|
|
91
|
+
}
|
|
92
|
+
}),
|
|
93
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
94
|
+
className: __WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].grow
|
|
95
|
+
}),
|
|
96
|
+
visibleContentSlots.map((slot)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
97
|
+
className: `${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].block} ${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].line}`,
|
|
98
|
+
style: {
|
|
99
|
+
width: laneWidth(slot, 120)
|
|
100
|
+
}
|
|
101
|
+
}, slot.id)),
|
|
102
|
+
trailingSlots.map((slot)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
103
|
+
className: `${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].block} ${__WEBPACK_EXTERNAL_MODULE__RichListSkeleton_module_js_905f84d0__["default"].line}`,
|
|
104
|
+
style: {
|
|
105
|
+
width: laneWidth(slot, 140)
|
|
106
|
+
}
|
|
107
|
+
}, slot.id))
|
|
108
|
+
]
|
|
109
|
+
}, rowIndex))
|
|
110
|
+
]
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
const RichListSkeleton_rslib_entry_ = RichListSkeleton;
|
|
114
|
+
export { RichListSkeleton_rslib_entry_ as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./RichListSkeleton_module.css";
|
|
2
|
+
const RichListSkeleton_module_rslib_entry_ = {
|
|
3
|
+
root: "root-v9g0gr",
|
|
4
|
+
header: "header-Es16HO",
|
|
5
|
+
toolbar: "toolbar-C01ajM",
|
|
6
|
+
row: "row-p9lXk2",
|
|
7
|
+
grow: "grow-djYGNT",
|
|
8
|
+
block: "block-M158Qw",
|
|
9
|
+
richListSkeletonPulse: "richListSkeletonPulse-N50lJ4",
|
|
10
|
+
checkbox: "checkbox-TgI6UA",
|
|
11
|
+
circle: "circle-Wh22l0",
|
|
12
|
+
line: "line-SMRPlk"
|
|
13
|
+
};
|
|
14
|
+
export { RichListSkeleton_module_rslib_entry_ as default };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
.root-v9g0gr {
|
|
2
|
+
background: var(--color-white);
|
|
3
|
+
border: solid var(--size-n5) var(--color-grey-t09);
|
|
4
|
+
border-radius: var(--size-n2);
|
|
5
|
+
width: 100%;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.header-Es16HO {
|
|
10
|
+
border-bottom: solid var(--size-n5) var(--color-grey-t08);
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
min-height: var(--row-height);
|
|
13
|
+
padding: 0 var(--richlist-padding-inline, var(--size-n1));
|
|
14
|
+
align-items: center;
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.toolbar-C01ajM {
|
|
19
|
+
border-bottom: solid var(--size-n5) var(--color-grey-t09);
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: var(--size-n2);
|
|
23
|
+
min-height: var(--row-height);
|
|
24
|
+
padding: var(--size-n2) var(--richlist-padding-inline, var(--size-n1));
|
|
25
|
+
display: flex;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.row-p9lXk2 {
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: var(--size-00);
|
|
32
|
+
min-height: var(--row-height);
|
|
33
|
+
padding: 0 var(--richlist-padding-inline, var(--size-n1));
|
|
34
|
+
display: flex;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.row-p9lXk2 + .row-p9lXk2 {
|
|
38
|
+
border-top: solid var(--size-n5) var(--color-grey-t08);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.grow-djYGNT {
|
|
42
|
+
flex: auto;
|
|
43
|
+
min-width: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.block-M158Qw {
|
|
47
|
+
background: var(--color-grey-t09);
|
|
48
|
+
border-radius: var(--size-n3);
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
animation: 1.2s ease-in-out infinite richListSkeletonPulse-N50lJ4;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.checkbox-TgI6UA {
|
|
54
|
+
border-radius: var(--size-n4);
|
|
55
|
+
width: 18px;
|
|
56
|
+
height: 18px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.circle-Wh22l0 {
|
|
60
|
+
border-radius: 50%;
|
|
61
|
+
width: 32px;
|
|
62
|
+
height: 32px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.line-SMRPlk {
|
|
66
|
+
height: 16px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@keyframes richListSkeletonPulse-N50lJ4 {
|
|
70
|
+
0%, 100% {
|
|
71
|
+
opacity: 1;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
50% {
|
|
75
|
+
opacity: .4;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@media (prefers-reduced-motion: reduce) {
|
|
80
|
+
.block-M158Qw {
|
|
81
|
+
animation: none;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Row } from "@tanstack/react-table";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Positioning metadata handed to `renderRow` for a single virtual row. The caller
|
|
5
|
+
* spreads these onto the `<li>` it renders (via `RichListRow`): `offset` drives the
|
|
6
|
+
* `translateY`, `index` is exposed as `data-index` (used by the divider CSS and by
|
|
7
|
+
* the virtualizer to map an element back to its row), and `measureRef` lets the
|
|
8
|
+
* virtualizer remeasure variable-height rows (group headers).
|
|
9
|
+
*/
|
|
10
|
+
export type RichListVirtualRowMeta = {
|
|
11
|
+
index: number;
|
|
12
|
+
offset: number;
|
|
13
|
+
measureRef: (element: HTMLLIElement | null) => void;
|
|
14
|
+
};
|
|
15
|
+
type SharedProps<Type> = {
|
|
16
|
+
rows: Array<Row<Type>>;
|
|
17
|
+
/** Per-index size estimate in px (constant row height; group headers are remeasured). */
|
|
18
|
+
estimateSize: (index: number) => number;
|
|
19
|
+
/**
|
|
20
|
+
* Stable key per row that also folds in the current grouping so the virtualizer
|
|
21
|
+
* resets its measurement cache when grouping changes (mirrors `Table.tsx`).
|
|
22
|
+
*/
|
|
23
|
+
getItemKey: (index: number) => string;
|
|
24
|
+
overscan: number;
|
|
25
|
+
viewportClassName: string;
|
|
26
|
+
listClassName: string;
|
|
27
|
+
renderRow: (row: Row<Type>, meta: RichListVirtualRowMeta) => ReactNode;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Virtualized list body used when the page/window is the scroll container (the default
|
|
31
|
+
* for lists that grow the document, e.g. an un-constrained list page). The `<ul>` is a
|
|
32
|
+
* relatively-positioned spacer sized to the full virtual height; rows are absolutely
|
|
33
|
+
* positioned within it and offset by the list's document offset (`scrollMargin`).
|
|
34
|
+
*/
|
|
35
|
+
declare const RichListWindowBody: <Type>({ rows, estimateSize, getItemKey, overscan, viewportClassName, listClassName, renderRow, }: SharedProps<Type>) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
/**
|
|
37
|
+
* Virtualized list body used when an ancestor constrains the list's height so it scrolls
|
|
38
|
+
* inside its own container (e.g. `fillContainerHeight`, or a fixed-height panel). The
|
|
39
|
+
* viewport `<div>` is the scroll element; the `<ul>` spacer and absolutely-positioned
|
|
40
|
+
* rows live inside it.
|
|
41
|
+
*/
|
|
42
|
+
declare const RichListElementBody: <Type>({ rows, estimateSize, getItemKey, overscan, viewportClassName, listClassName, renderRow, }: SharedProps<Type>) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export { RichListElementBody, RichListWindowBody };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__tanstack_react_virtual_e7b31bc6__ from "@tanstack/react-virtual";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
5
|
+
const measureRichListRow = (element, _entry, instance)=>{
|
|
6
|
+
const rect = element.getBoundingClientRect();
|
|
7
|
+
if (rect.height > 0 && rect.width > 0) return Math.round(rect.height);
|
|
8
|
+
const index = instance.indexFromElement(element);
|
|
9
|
+
return instance.measurementsCache[index]?.size ?? 0;
|
|
10
|
+
};
|
|
11
|
+
const RichListWindowBody = ({ rows, estimateSize, getItemKey, overscan, viewportClassName, listClassName, renderRow })=>{
|
|
12
|
+
const listRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
|
|
13
|
+
const virtualizer = (0, __WEBPACK_EXTERNAL_MODULE__tanstack_react_virtual_e7b31bc6__.useWindowVirtualizer)({
|
|
14
|
+
count: rows.length,
|
|
15
|
+
estimateSize,
|
|
16
|
+
overscan,
|
|
17
|
+
getItemKey,
|
|
18
|
+
scrollMargin: listRef.current?.offsetTop ?? 0,
|
|
19
|
+
initialRect: {
|
|
20
|
+
height: 1080,
|
|
21
|
+
width: 1920
|
|
22
|
+
},
|
|
23
|
+
measureElement: measureRichListRow
|
|
24
|
+
});
|
|
25
|
+
const scrollMargin = virtualizer.options.scrollMargin;
|
|
26
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
27
|
+
className: viewportClassName,
|
|
28
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("ul", {
|
|
29
|
+
ref: listRef,
|
|
30
|
+
className: listClassName,
|
|
31
|
+
style: {
|
|
32
|
+
height: virtualizer.getTotalSize()
|
|
33
|
+
},
|
|
34
|
+
children: virtualizer.getVirtualItems().map((virtualRow)=>renderRow(rows[virtualRow.index], {
|
|
35
|
+
index: virtualRow.index,
|
|
36
|
+
offset: virtualRow.start - scrollMargin,
|
|
37
|
+
measureRef: virtualizer.measureElement
|
|
38
|
+
}))
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
const RichListElementBody = ({ rows, estimateSize, getItemKey, overscan, viewportClassName, listClassName, renderRow })=>{
|
|
43
|
+
const viewportRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
|
|
44
|
+
const virtualizer = (0, __WEBPACK_EXTERNAL_MODULE__tanstack_react_virtual_e7b31bc6__.useVirtualizer)({
|
|
45
|
+
count: rows.length,
|
|
46
|
+
estimateSize,
|
|
47
|
+
overscan,
|
|
48
|
+
getItemKey,
|
|
49
|
+
getScrollElement: ()=>viewportRef.current,
|
|
50
|
+
measureElement: measureRichListRow
|
|
51
|
+
});
|
|
52
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
53
|
+
ref: viewportRef,
|
|
54
|
+
className: viewportClassName,
|
|
55
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("ul", {
|
|
56
|
+
className: listClassName,
|
|
57
|
+
style: {
|
|
58
|
+
height: virtualizer.getTotalSize()
|
|
59
|
+
},
|
|
60
|
+
children: virtualizer.getVirtualItems().map((virtualRow)=>renderRow(rows[virtualRow.index], {
|
|
61
|
+
index: virtualRow.index,
|
|
62
|
+
offset: virtualRow.start,
|
|
63
|
+
measureRef: virtualizer.measureElement
|
|
64
|
+
}))
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
export { RichListElementBody, RichListWindowBody };
|
|
@@ -57,15 +57,27 @@
|
|
|
57
57
|
display: flex;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
.
|
|
61
|
-
|
|
60
|
+
.scrollViewport-RvFsVE {
|
|
61
|
+
align-self: stretch;
|
|
62
|
+
width: 100%;
|
|
63
|
+
min-height: 0;
|
|
64
|
+
overflow: hidden auto;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.windowViewport-gkFnVD {
|
|
62
68
|
align-self: stretch;
|
|
69
|
+
width: 100%;
|
|
70
|
+
min-height: 0;
|
|
71
|
+
overflow: visible;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.list-j1kaiA {
|
|
75
|
+
width: 100%;
|
|
63
76
|
min-height: 0;
|
|
64
77
|
margin: 0;
|
|
65
78
|
padding: 0;
|
|
66
79
|
list-style: none;
|
|
67
|
-
|
|
68
|
-
overflow: auto;
|
|
80
|
+
position: relative;
|
|
69
81
|
container-type: inline-size;
|
|
70
82
|
}
|
|
71
83
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CommonProps } from "./shared";
|
|
2
|
+
/**
|
|
3
|
+
* Artificial 10,000-row list to exercise the production-scale behaviour of `RichList`:
|
|
4
|
+
* the wrapper defers its first paint (data is over the 1,000-row threshold), so the
|
|
5
|
+
* baked-in skeleton flashes for ~1–2 frames before the real, virtualized list swaps in.
|
|
6
|
+
* Also a quick way to sanity-check that virtualization keeps the DOM small at scale.
|
|
7
|
+
* Reload the story to see the skeleton flash again.
|
|
8
|
+
*/
|
|
9
|
+
declare const LargeList: ({ compactBreakpoint, contentAlignment, rowHeight }: CommonProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default LargeList;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__icons_components_AssignmentDocument_js_0e5cad31__ from "../../../icons/components/AssignmentDocument.js";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__ from "../../../utils/storybook.js";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__Avatar_js_1229b6e4__ from "../../Avatar.js";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__HStack_js_d2f77bae__ from "../../HStack.js";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__PlainText_js_acfb96d1__ from "../../PlainText.js";
|
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE__RichList_js_64f3f04c__ from "../RichList.js";
|
|
9
|
+
import * as __WEBPACK_EXTERNAL_MODULE__shared_bulkActionStubs_js_0d607dd0__ from "./shared/bulkActionStubs.js";
|
|
10
|
+
const TITLES = [
|
|
11
|
+
"First Aid Certificate",
|
|
12
|
+
"Superannuation",
|
|
13
|
+
"Police Check",
|
|
14
|
+
"Payroll Form",
|
|
15
|
+
"Working With Children Check",
|
|
16
|
+
"Emergency Contact",
|
|
17
|
+
"Bank Details",
|
|
18
|
+
"Tax File Number Declaration",
|
|
19
|
+
"Code of Conduct",
|
|
20
|
+
"IT Policy Acknowledgement"
|
|
21
|
+
];
|
|
22
|
+
const STATUSES = [
|
|
23
|
+
"Active",
|
|
24
|
+
"Expired",
|
|
25
|
+
"Expiring soon",
|
|
26
|
+
"Submitted",
|
|
27
|
+
"Draft"
|
|
28
|
+
];
|
|
29
|
+
const NAMES = [
|
|
30
|
+
"Daisy Smith",
|
|
31
|
+
"Evan Baker",
|
|
32
|
+
"Candice Berry",
|
|
33
|
+
"Olivia Ng",
|
|
34
|
+
"Badai Khan",
|
|
35
|
+
"Henry Jones",
|
|
36
|
+
"Daniel Turner",
|
|
37
|
+
"Sarah Cruden",
|
|
38
|
+
"Marcus Chen",
|
|
39
|
+
"Janice Martin"
|
|
40
|
+
];
|
|
41
|
+
const ROW_COUNT = 10000;
|
|
42
|
+
const rows = Array.from({
|
|
43
|
+
length: ROW_COUNT
|
|
44
|
+
}, (_, i)=>({
|
|
45
|
+
id: `row-${i}`,
|
|
46
|
+
title: `${TITLES[i % TITLES.length]} #${i + 1}`,
|
|
47
|
+
status: STATUSES[i % STATUSES.length],
|
|
48
|
+
assignee: NAMES[i % NAMES.length],
|
|
49
|
+
assigneeImageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(i % 70 + 1)
|
|
50
|
+
}));
|
|
51
|
+
const titleField = {
|
|
52
|
+
label: "Document",
|
|
53
|
+
value: (r)=>r.title,
|
|
54
|
+
enableSorting: true,
|
|
55
|
+
globalFiltering: true,
|
|
56
|
+
render: (r)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__PlainText_js_acfb96d1__["default"], {
|
|
57
|
+
font: "regular-bold",
|
|
58
|
+
children: r.title
|
|
59
|
+
})
|
|
60
|
+
};
|
|
61
|
+
const leadingSlot = {
|
|
62
|
+
id: "type",
|
|
63
|
+
label: "Type",
|
|
64
|
+
render: ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__icons_components_AssignmentDocument_js_0e5cad31__["default"], {}),
|
|
65
|
+
size: 32
|
|
66
|
+
};
|
|
67
|
+
const statusSlot = {
|
|
68
|
+
id: "status",
|
|
69
|
+
label: "Status",
|
|
70
|
+
value: (r)=>r.status,
|
|
71
|
+
enableSorting: true,
|
|
72
|
+
globalFiltering: true,
|
|
73
|
+
filter: {
|
|
74
|
+
isMulti: true,
|
|
75
|
+
label: "Status",
|
|
76
|
+
options: STATUSES.map((status)=>({
|
|
77
|
+
id: `status-${status}`,
|
|
78
|
+
label: status,
|
|
79
|
+
predicate: (r)=>r.status === status
|
|
80
|
+
}))
|
|
81
|
+
},
|
|
82
|
+
render: (r)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__PlainText_js_acfb96d1__["default"], {
|
|
83
|
+
font: "small",
|
|
84
|
+
children: r.status
|
|
85
|
+
}),
|
|
86
|
+
layoutVisibility: "whenWide",
|
|
87
|
+
align: "start",
|
|
88
|
+
size: 200
|
|
89
|
+
};
|
|
90
|
+
const assigneeSlot = {
|
|
91
|
+
id: "assignee",
|
|
92
|
+
label: "Person",
|
|
93
|
+
value: (r)=>r.assignee,
|
|
94
|
+
enableSorting: true,
|
|
95
|
+
globalFiltering: true,
|
|
96
|
+
render: (r)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE__HStack_js_d2f77bae__["default"], {
|
|
97
|
+
spacing: "n2",
|
|
98
|
+
align: "center",
|
|
99
|
+
tagName: "div",
|
|
100
|
+
children: [
|
|
101
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__Avatar_js_1229b6e4__["default"], {
|
|
102
|
+
id: `${r.id}-a`,
|
|
103
|
+
name: r.assignee,
|
|
104
|
+
imageUrl: r.assigneeImageUrl,
|
|
105
|
+
size: "small"
|
|
106
|
+
}),
|
|
107
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__PlainText_js_acfb96d1__["default"], {
|
|
108
|
+
font: "small",
|
|
109
|
+
children: r.assignee
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
}),
|
|
113
|
+
layoutVisibility: "whenWide",
|
|
114
|
+
align: "start",
|
|
115
|
+
size: 200
|
|
116
|
+
};
|
|
117
|
+
const LargeList = ({ compactBreakpoint, contentAlignment, rowHeight })=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__RichList_js_64f3f04c__["default"], {
|
|
118
|
+
bulkActions: (0, __WEBPACK_EXTERNAL_MODULE__shared_bulkActionStubs_js_0d607dd0__.richListStoryPrimaryBulkActions)(),
|
|
119
|
+
compactBreakpoint: compactBreakpoint,
|
|
120
|
+
contentAlignment: contentAlignment,
|
|
121
|
+
contentSlots: [
|
|
122
|
+
statusSlot
|
|
123
|
+
],
|
|
124
|
+
data: rows,
|
|
125
|
+
fillContainerHeight: true,
|
|
126
|
+
getRowId: (r)=>r.id,
|
|
127
|
+
leadingSlot: leadingSlot,
|
|
128
|
+
mainSlot: {
|
|
129
|
+
size: 360,
|
|
130
|
+
primary: titleField
|
|
131
|
+
},
|
|
132
|
+
rowHeight: rowHeight,
|
|
133
|
+
secondaryBulkActions: (0, __WEBPACK_EXTERNAL_MODULE__shared_bulkActionStubs_js_0d607dd0__.richListStorySecondaryBulkActions)(),
|
|
134
|
+
trailingSlot: assigneeSlot
|
|
135
|
+
});
|
|
136
|
+
const LargeList_rslib_entry_ = LargeList;
|
|
137
|
+
export { LargeList_rslib_entry_ as default };
|