@worknice/whiteboard 0.61.0 → 0.63.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/icons/components/ArrowsCompress.d.ts +5 -0
- package/dist/icons/components/ArrowsCompress.js +14 -0
- package/dist/icons/components/ArrowsExpand.d.ts +5 -0
- package/dist/icons/components/ArrowsExpand.js +14 -0
- package/dist/icons/components/FitView.d.ts +5 -0
- package/dist/icons/components/FitView.js +14 -0
- package/dist/icons/components/index.d.ts +3 -0
- package/dist/icons/components/index.js +7 -1
- package/dist/icons/svgs/ArrowsCompress.js +2 -0
- package/dist/icons/svgs/ArrowsExpand.js +2 -0
- package/dist/icons/svgs/FitView.js +2 -0
- package/dist/presentation/CustomizableTable/CustomizableTable.js +2 -1
- package/dist/presentation/RichList/RichList.d.ts +8 -2
- package/dist/presentation/RichList/RichList.js +43 -29
- package/dist/presentation/RichList/RichListDisplayModal.d.ts +11 -3
- package/dist/presentation/RichList/RichListDisplayModal.js +59 -6
- package/dist/presentation/RichList/RichListRow.d.ts +7 -4
- package/dist/presentation/RichList/RichListRow.js +42 -54
- package/dist/presentation/RichList/RichListRow.module.js +2 -1
- package/dist/presentation/RichList/RichListRow_module.css +23 -11
- package/dist/presentation/RichList/RichList_module.css +1 -0
- package/dist/presentation/RichList/helpers.d.ts +18 -2
- package/dist/presentation/RichList/helpers.js +14 -4
- package/dist/presentation/RichList/stories/EmployeePeople.d.ts +2 -0
- package/dist/presentation/RichList/stories/EmployeePeople.js +49 -17
- package/dist/presentation/RichList/stories/shared.d.ts +2 -1
- package/dist/presentation/RichList/types.d.ts +12 -0
- package/dist/presentation/SheetHeader_module.css +10 -0
- package/dist/presentation/TagSet.d.ts +7 -1
- package/dist/presentation/TagSet.js +70 -7
- package/dist/presentation/TagSet.module.js +2 -1
- package/dist/presentation/TagSet_module.css +10 -0
- package/dist/static/svg/ArrowsCompress.svg +3 -0
- package/dist/static/svg/ArrowsExpand.svg +3 -0
- package/dist/static/svg/FitView.svg +3 -0
- package/package.json +2 -2
|
@@ -20,13 +20,12 @@ function contentSlotAlignClass(align) {
|
|
|
20
20
|
return __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].contentSlotStart;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
const RichListRow = ({ row, table, enableRowSelection, href, onClick, normalizedLeadingSlots, normalizedPrimary, normalizedSecondary, mainSlotMaxWidthPx, normalizedContentSlots, normalizedTrailingSlots, isCompactContentSlots, rowMainHidesContentSlotColumns, contentSlotsJustifyContent, actionsForRow,
|
|
23
|
+
const RichListRow = ({ row, table, groupEntry, enableRowSelection, href, onClick, normalizedLeadingSlots, normalizedPrimary, normalizedSecondary, mainSlotMaxWidthPx, normalizedContentSlots, normalizedTrailingSlots, isCompactContentSlots, rowMainHidesContentSlotColumns, contentSlotsJustifyContent, actionsForRow, lastSelectedRowRef })=>{
|
|
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;
|
|
27
27
|
const alwaysVisibleActions = actionsForRow.filter((action)=>action.alwaysVisible);
|
|
28
28
|
const overflowActions = actionsForRow.filter((action)=>!action.alwaysVisible);
|
|
29
|
-
const alwaysVisiblePlaceholderCount = Math.max(0, maxAlwaysVisibleActions - alwaysVisibleActions.length);
|
|
30
29
|
const isSlotVisible = (slot)=>(table.getColumn(slot.id)?.getIsVisible() ?? true) && (0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.isVisibleAtBreakpoint)(slot.layoutVisibility, isCompactContentSlots);
|
|
31
30
|
const visibleContentSlots = normalizedContentSlots.filter(isSlotVisible);
|
|
32
31
|
const visibleLeadingSlots = normalizedLeadingSlots.filter(isSlotVisible);
|
|
@@ -140,6 +139,16 @@ const RichListRow = ({ row, table, enableRowSelection, href, onClick, normalized
|
|
|
140
139
|
},
|
|
141
140
|
onChange: (value)=>row.toggleSelected(value)
|
|
142
141
|
});
|
|
142
|
+
if (row.getIsGrouped() && groupEntry) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("li", {
|
|
143
|
+
className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].listItem,
|
|
144
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
145
|
+
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),
|
|
146
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
147
|
+
className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].groupHeader,
|
|
148
|
+
children: groupEntry.grouping.header(rowOriginal)
|
|
149
|
+
})
|
|
150
|
+
})
|
|
151
|
+
});
|
|
143
152
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("li", {
|
|
144
153
|
className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].listItem,
|
|
145
154
|
"data-selected": row.getIsSelected() ? "" : void 0,
|
|
@@ -230,67 +239,46 @@ const RichListRow = ({ row, table, enableRowSelection, href, onClick, normalized
|
|
|
230
239
|
}, slot.id))
|
|
231
240
|
]
|
|
232
241
|
}),
|
|
233
|
-
|
|
242
|
+
alwaysVisibleActions.length > 0 ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
234
243
|
className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].actionsLane,
|
|
235
244
|
onClick: (event)=>event.stopPropagation(),
|
|
236
|
-
children:
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}),
|
|
264
|
-
Array.from({
|
|
265
|
-
length: alwaysVisiblePlaceholderCount
|
|
266
|
-
}).map((_, index)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
267
|
-
"aria-hidden": true,
|
|
268
|
-
className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].actionPlaceholder,
|
|
269
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__controls_Button_js_2f50b64a__["default"], {
|
|
270
|
-
type: "ghost",
|
|
271
|
-
size: "small",
|
|
272
|
-
icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__icons_components_Overflow_js_e85d27d7__["default"], {})
|
|
273
|
-
})
|
|
274
|
-
}, `placeholder-${index}`))
|
|
275
|
-
]
|
|
245
|
+
children: alwaysVisibleActions.map((action)=>{
|
|
246
|
+
if ("link" === action.type) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__controls_ButtonLink_js_4cb13ec4__["default"], {
|
|
247
|
+
id: action.id,
|
|
248
|
+
type: "ghost",
|
|
249
|
+
size: "normal",
|
|
250
|
+
icon: action.icon,
|
|
251
|
+
tooltip: action.label,
|
|
252
|
+
href: action.href(rowOriginal),
|
|
253
|
+
external: action.external
|
|
254
|
+
}, action.id);
|
|
255
|
+
if ("onClick" === action.type) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__controls_Button_js_2f50b64a__["default"], {
|
|
256
|
+
id: action.id,
|
|
257
|
+
type: "ghost",
|
|
258
|
+
size: "normal",
|
|
259
|
+
icon: action.icon,
|
|
260
|
+
tooltip: action.label,
|
|
261
|
+
onClick: ()=>action.onClick(rowOriginal)
|
|
262
|
+
}, action.id);
|
|
263
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__controls_Disclosure_js_07249afc__["default"], {
|
|
264
|
+
id: action.id,
|
|
265
|
+
type: "ghost",
|
|
266
|
+
size: "normal",
|
|
267
|
+
icon: action.icon,
|
|
268
|
+
tooltip: action.label,
|
|
269
|
+
render: (onClose)=>action.render(onClose)
|
|
270
|
+
}, action.id);
|
|
271
|
+
})
|
|
276
272
|
}) : null,
|
|
277
|
-
|
|
273
|
+
overflowActions.length > 0 ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
278
274
|
className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].overflowLane,
|
|
279
275
|
onClick: (event)=>event.stopPropagation(),
|
|
280
|
-
children:
|
|
276
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__controls_MenuButton_js_fa7c5c89__["default"], {
|
|
281
277
|
type: "ghost",
|
|
282
|
-
size: "
|
|
278
|
+
size: "normal",
|
|
283
279
|
ariaLabel: "More actions",
|
|
284
280
|
options: overflowActions.map((action)=>(0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.richListRowActionToMenuOption)(action, rowOriginal)),
|
|
285
281
|
icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__icons_components_Overflow_js_e85d27d7__["default"], {})
|
|
286
|
-
}) : /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
287
|
-
"aria-hidden": true,
|
|
288
|
-
className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].actionPlaceholder,
|
|
289
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__controls_Button_js_2f50b64a__["default"], {
|
|
290
|
-
type: "ghost",
|
|
291
|
-
size: "small",
|
|
292
|
-
icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__icons_components_Overflow_js_e85d27d7__["default"], {})
|
|
293
|
-
})
|
|
294
282
|
})
|
|
295
283
|
}) : null
|
|
296
284
|
]
|
|
@@ -2,6 +2,8 @@ import "./RichListRow_module.css";
|
|
|
2
2
|
const RichListRow_module_rslib_entry_ = {
|
|
3
3
|
listItem: "listItem-HfVE7t",
|
|
4
4
|
row: "row-qNQike",
|
|
5
|
+
groupHeader: "groupHeader-XItOuo",
|
|
6
|
+
rowGrouped: "rowGrouped-M7DdXT",
|
|
5
7
|
clickableZone: "clickableZone-KG4Ygg",
|
|
6
8
|
clickableZoneActive: "clickableZoneActive-OtaDew",
|
|
7
9
|
leadingLane: "leadingLane-oEnTWq",
|
|
@@ -27,7 +29,6 @@ const RichListRow_module_rslib_entry_ = {
|
|
|
27
29
|
primaryText: "primaryText-vd9ry0",
|
|
28
30
|
secondaryText: "secondaryText-DmPdJ2",
|
|
29
31
|
mainSlotAdornment: "mainSlotAdornment-IQslEw",
|
|
30
|
-
actionPlaceholder: "actionPlaceholder-yugzJR",
|
|
31
32
|
rowListAtCompactBreakpoint: "rowListAtCompactBreakpoint-g6EL_A",
|
|
32
33
|
textFieldAdornment: "textFieldAdornment-LP2CuE"
|
|
33
34
|
};
|
|
@@ -7,6 +7,14 @@
|
|
|
7
7
|
border-top: solid var(--size-n5) var(--color-grey-t09);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
.groupHeader-XItOuo {
|
|
11
|
+
flex: auto;
|
|
12
|
+
align-items: center;
|
|
13
|
+
width: 100%;
|
|
14
|
+
min-width: 0;
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
10
18
|
.row-qNQike {
|
|
11
19
|
--row-bg: transparent;
|
|
12
20
|
--row-hover-bg: var(--color-grey-t10);
|
|
@@ -40,6 +48,20 @@
|
|
|
40
48
|
.listItem-HfVE7t[data-selected] > .row-qNQike:hover {
|
|
41
49
|
background-color: var(--color-purple-t09);
|
|
42
50
|
}
|
|
51
|
+
|
|
52
|
+
.row-qNQike.rowGrouped-M7DdXT:hover {
|
|
53
|
+
background-color: var(--color-grey-t10);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.row-qNQike.rowGrouped-M7DdXT {
|
|
58
|
+
--row-bg: var(--color-grey-t10);
|
|
59
|
+
--row-hover-bg: var(--color-grey-t10);
|
|
60
|
+
background-color: var(--color-grey-t10);
|
|
61
|
+
height: auto;
|
|
62
|
+
min-height: 0;
|
|
63
|
+
padding: var(--size-00);
|
|
64
|
+
overflow: visible;
|
|
43
65
|
}
|
|
44
66
|
|
|
45
67
|
.clickableZone-KG4Ygg {
|
|
@@ -58,7 +80,7 @@
|
|
|
58
80
|
cursor: pointer;
|
|
59
81
|
}
|
|
60
82
|
|
|
61
|
-
.clickableZoneActive-OtaDew :is(.leadingLane-oEnTWq, .rowMain-ekCI8x, .trailingLane-J4qLz8) a[href],
|
|
83
|
+
.clickableZoneActive-OtaDew :is(.leadingLane-oEnTWq, .rowMain-ekCI8x, .trailingLane-J4qLz8) :is(a[href], a[role="link"], button), .clickableZoneActive-OtaDew .contentSlot-xgewfJ :is(a[href], a[role="link"], button) {
|
|
62
84
|
pointer-events: auto;
|
|
63
85
|
z-index: 2;
|
|
64
86
|
position: relative;
|
|
@@ -239,10 +261,6 @@
|
|
|
239
261
|
display: flex;
|
|
240
262
|
}
|
|
241
263
|
|
|
242
|
-
.primaryLine-Sedy1b {
|
|
243
|
-
font: var(--font-regular-bold);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
264
|
.secondaryLine-iySU25 {
|
|
247
265
|
color: var(--color-grey-s03);
|
|
248
266
|
}
|
|
@@ -301,12 +319,6 @@
|
|
|
301
319
|
display: flex;
|
|
302
320
|
}
|
|
303
321
|
|
|
304
|
-
.actionPlaceholder-yugzJR {
|
|
305
|
-
pointer-events: none;
|
|
306
|
-
visibility: hidden;
|
|
307
|
-
display: inline-flex;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
322
|
.rowListAtCompactBreakpoint-g6EL_A .textFieldAdornment-LP2CuE {
|
|
311
323
|
display: none;
|
|
312
324
|
}
|
|
@@ -28,13 +28,29 @@ export declare const formatSlotSize: (size: RichListSlotSize) => string;
|
|
|
28
28
|
* `data-richlist-compact` attribute that JS sets on `.richListQueryScope` from
|
|
29
29
|
* `isCompactContentSlots` (driven by this prop).
|
|
30
30
|
* - The Display dialog's column-visibility section is hidden (no room).
|
|
31
|
+
* - `rowHeight` object form picks `whenCompact` vs `whenWide` (see `RichListRowHeight`).
|
|
31
32
|
*/
|
|
32
33
|
export declare const RICH_LIST_CONTENT_COMPACT_MAX_PX = 1024;
|
|
33
34
|
export declare const ROW_HEIGHT_PRESETS: {
|
|
34
35
|
readonly small: 56;
|
|
35
36
|
readonly medium: 72;
|
|
36
|
-
readonly large:
|
|
37
|
+
readonly large: 96;
|
|
37
38
|
};
|
|
39
|
+
export type RichListRowHeightValue = number | keyof typeof ROW_HEIGHT_PRESETS;
|
|
40
|
+
type AtLeastOne<T, K extends keyof T = keyof T> = K extends keyof T ? Pick<T, K> & Partial<Omit<T, K>> : never;
|
|
41
|
+
/** Breakpoint-specific row height; at least one of `whenWide` / `whenCompact` required. */
|
|
42
|
+
export type RichListRowHeightByBreakpoint = AtLeastOne<{
|
|
43
|
+
whenWide: RichListRowHeightValue;
|
|
44
|
+
whenCompact: RichListRowHeightValue;
|
|
45
|
+
}>;
|
|
46
|
+
export type RichListRowHeight = RichListRowHeightValue | RichListRowHeightByBreakpoint;
|
|
47
|
+
export declare const isRichListRowHeightByBreakpoint: (rowHeight: RichListRowHeight) => rowHeight is RichListRowHeightByBreakpoint;
|
|
48
|
+
export declare const richListRowHeightToPx: (value: RichListRowHeightValue) => number;
|
|
49
|
+
/**
|
|
50
|
+
* Picks the scalar height for the current compact state.
|
|
51
|
+
* Missing side falls back to `defaultValue` (RichList default: `"medium"`).
|
|
52
|
+
*/
|
|
53
|
+
export declare const resolveRichListRowHeightValue: (rowHeight: RichListRowHeight | undefined, isCompact: boolean, defaultValue?: RichListRowHeightValue) => RichListRowHeightValue;
|
|
38
54
|
/**
|
|
39
55
|
* Horizontal padding (px) applied across the whole list (toolbar, rows, empty state)
|
|
40
56
|
* at each row height preset. Forwarded as the `--richlist-padding-inline` custom
|
|
@@ -44,7 +60,7 @@ export declare const ROW_HEIGHT_PRESETS: {
|
|
|
44
60
|
export declare const RICH_LIST_INLINE_PAD_PRESET_PX: {
|
|
45
61
|
[K in keyof typeof ROW_HEIGHT_PRESETS]: number;
|
|
46
62
|
};
|
|
47
|
-
export declare const richListInlinePaddingPx: (rowHeight:
|
|
63
|
+
export declare const richListInlinePaddingPx: (rowHeight: RichListRowHeightValue) => number;
|
|
48
64
|
export declare const SELECT_COLUMN_ID = "_richListSelect";
|
|
49
65
|
export declare const normalizeTextField: <Type>(field: RichListTextField<Type>, position: "primary" | "secondary") => NormalizedTextField<Type>;
|
|
50
66
|
/**
|
|
@@ -13,7 +13,15 @@ const RICH_LIST_CONTENT_COMPACT_MAX_PX = 1024;
|
|
|
13
13
|
const ROW_HEIGHT_PRESETS = {
|
|
14
14
|
small: 56,
|
|
15
15
|
medium: 72,
|
|
16
|
-
large:
|
|
16
|
+
large: 96
|
|
17
|
+
};
|
|
18
|
+
const isRichListRowHeightByBreakpoint = (rowHeight)=>"object" == typeof rowHeight && null !== rowHeight;
|
|
19
|
+
const richListRowHeightToPx = (value)=>"number" == typeof value ? value : ROW_HEIGHT_PRESETS[value];
|
|
20
|
+
const resolveRichListRowHeightValue = (rowHeight, isCompact, defaultValue = "medium")=>{
|
|
21
|
+
const input = rowHeight ?? defaultValue;
|
|
22
|
+
if (!isRichListRowHeightByBreakpoint(input)) return input;
|
|
23
|
+
const selected = isCompact ? input.whenCompact : input.whenWide;
|
|
24
|
+
return selected ?? defaultValue;
|
|
17
25
|
};
|
|
18
26
|
const RICH_LIST_INLINE_PAD_PRESET_PX = {
|
|
19
27
|
small: 12,
|
|
@@ -51,7 +59,8 @@ const normalizeTextField = (field, position)=>{
|
|
|
51
59
|
csvExport: field.csvExport ?? false,
|
|
52
60
|
enableSorting: field.enableSorting ?? false,
|
|
53
61
|
sortingFn: field.sortingFn,
|
|
54
|
-
layoutVisibility: field.layoutVisibility ?? "always"
|
|
62
|
+
layoutVisibility: field.layoutVisibility ?? "always",
|
|
63
|
+
grouping: field.grouping
|
|
55
64
|
};
|
|
56
65
|
};
|
|
57
66
|
const normalizeSlot = (slot, position, positionIndex)=>{
|
|
@@ -90,7 +99,8 @@ const normalizeSlot = (slot, position, positionIndex)=>{
|
|
|
90
99
|
hiddenByDefault: slot.hiddenByDefault ?? false,
|
|
91
100
|
csvExport: slot.csvExport ?? false,
|
|
92
101
|
enableSorting: slot.enableSorting ?? false,
|
|
93
|
-
sortingFn: slot.sortingFn
|
|
102
|
+
sortingFn: slot.sortingFn,
|
|
103
|
+
grouping: slot.grouping
|
|
94
104
|
};
|
|
95
105
|
};
|
|
96
106
|
const isVisibleAtBreakpoint = (layoutVisibility, isCompactContentSlots)=>{
|
|
@@ -148,4 +158,4 @@ const richListRowActionToMenuOption = (action, row)=>{
|
|
|
148
158
|
render: action.render
|
|
149
159
|
};
|
|
150
160
|
};
|
|
151
|
-
export { RICH_LIST_CONTENT_COMPACT_MAX_PX, RICH_LIST_INLINE_PAD_PRESET_PX, ROW_HEIGHT_PRESETS, SELECT_COLUMN_ID, formatSlotSize, handleDownloadCsv, isColumnWithVisibilityState, isToggleableContentColumn, isVisibleAtBreakpoint, normalizeSlot, normalizeTextField, richListInlinePaddingPx, richListRowActionToMenuOption };
|
|
161
|
+
export { RICH_LIST_CONTENT_COMPACT_MAX_PX, RICH_LIST_INLINE_PAD_PRESET_PX, ROW_HEIGHT_PRESETS, SELECT_COLUMN_ID, formatSlotSize, handleDownloadCsv, isColumnWithVisibilityState, isRichListRowHeightByBreakpoint, isToggleableContentColumn, isVisibleAtBreakpoint, normalizeSlot, normalizeTextField, resolveRichListRowHeightValue, richListInlinePaddingPx, richListRowActionToMenuOption, richListRowHeightToPx };
|
|
@@ -5,6 +5,8 @@ export type EmployeePeopleRow = {
|
|
|
5
5
|
imageUrl: string | null;
|
|
6
6
|
/** “Role at location” (single line, may truncate in the list). */
|
|
7
7
|
line: string;
|
|
8
|
+
workEmail: string | null;
|
|
9
|
+
workPhone: string | null;
|
|
8
10
|
};
|
|
9
11
|
declare const EmployeePeopleList: ({ compactBreakpoint, contentAlignment, rowHeight }: CommonProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export default EmployeePeopleList;
|
|
@@ -11,91 +11,121 @@ const employees = [
|
|
|
11
11
|
id: "e1",
|
|
12
12
|
name: "Sarah Jenkins",
|
|
13
13
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(19),
|
|
14
|
-
line: "VP of Engineering at New York"
|
|
14
|
+
line: "VP of Engineering at New York",
|
|
15
|
+
workEmail: "sarah.jenkins@example.com",
|
|
16
|
+
workPhone: "+1 212 555 0101"
|
|
15
17
|
},
|
|
16
18
|
{
|
|
17
19
|
id: "e2",
|
|
18
20
|
name: "David Miller",
|
|
19
21
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(20),
|
|
20
|
-
line: "Product Manager at London"
|
|
22
|
+
line: "Product Manager at London",
|
|
23
|
+
workEmail: "david.miller@example.com",
|
|
24
|
+
workPhone: null
|
|
21
25
|
},
|
|
22
26
|
{
|
|
23
27
|
id: "e3",
|
|
24
28
|
name: "Emily Chen",
|
|
25
29
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(21),
|
|
26
|
-
line: "Frontend Developer at Remote"
|
|
30
|
+
line: "Frontend Developer at Remote",
|
|
31
|
+
workEmail: null,
|
|
32
|
+
workPhone: "+1 415 555 0103"
|
|
27
33
|
},
|
|
28
34
|
{
|
|
29
35
|
id: "e4",
|
|
30
36
|
name: "James Washington",
|
|
31
37
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(22),
|
|
32
|
-
line: "HR Specialist at Chicago"
|
|
38
|
+
line: "HR Specialist at Chicago",
|
|
39
|
+
workEmail: null,
|
|
40
|
+
workPhone: null
|
|
33
41
|
},
|
|
34
42
|
{
|
|
35
43
|
id: "e5",
|
|
36
44
|
name: "Priya Shah",
|
|
37
45
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(23),
|
|
38
|
-
line: "Director of Finance at Sydney"
|
|
46
|
+
line: "Director of Finance at Sydney",
|
|
47
|
+
workEmail: "priya.shah@example.com",
|
|
48
|
+
workPhone: "+61 2 5555 0105"
|
|
39
49
|
},
|
|
40
50
|
{
|
|
41
51
|
id: "e6",
|
|
42
52
|
name: "Marcus Webb",
|
|
43
53
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(24),
|
|
44
|
-
line: "Warehouse Lead at Melbourne"
|
|
54
|
+
line: "Warehouse Lead at Melbourne",
|
|
55
|
+
workEmail: "marcus.webb@example.com",
|
|
56
|
+
workPhone: null
|
|
45
57
|
},
|
|
46
58
|
{
|
|
47
59
|
id: "e7",
|
|
48
60
|
name: "Nina Okonkwo",
|
|
49
61
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(25),
|
|
50
|
-
line: "Legal Counsel at Head Office"
|
|
62
|
+
line: "Legal Counsel at Head Office",
|
|
63
|
+
workEmail: null,
|
|
64
|
+
workPhone: "+44 20 7946 0107"
|
|
51
65
|
},
|
|
52
66
|
{
|
|
53
67
|
id: "e8",
|
|
54
68
|
name: "Oliver Grant",
|
|
55
69
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(26),
|
|
56
|
-
line: "Sales Manager at Remote"
|
|
70
|
+
line: "Sales Manager at Remote",
|
|
71
|
+
workEmail: null,
|
|
72
|
+
workPhone: null
|
|
57
73
|
},
|
|
58
74
|
{
|
|
59
75
|
id: "e9",
|
|
60
76
|
name: "Rachel Kim",
|
|
61
77
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(27),
|
|
62
|
-
line: "UX Researcher at San Francisco"
|
|
78
|
+
line: "UX Researcher at San Francisco",
|
|
79
|
+
workEmail: "rachel.kim@example.com",
|
|
80
|
+
workPhone: "+1 415 555 0109"
|
|
63
81
|
},
|
|
64
82
|
{
|
|
65
83
|
id: "e10",
|
|
66
84
|
name: "Samuel Ortiz",
|
|
67
85
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(28),
|
|
68
|
-
line: "DevOps Engineer at Austin"
|
|
86
|
+
line: "DevOps Engineer at Austin",
|
|
87
|
+
workEmail: "samuel.ortiz@example.com",
|
|
88
|
+
workPhone: null
|
|
69
89
|
},
|
|
70
90
|
{
|
|
71
91
|
id: "e11",
|
|
72
92
|
name: "Tessa Bloom",
|
|
73
93
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(29),
|
|
74
|
-
line: "Chief of Staff at Seattle"
|
|
94
|
+
line: "Chief of Staff at Seattle",
|
|
95
|
+
workEmail: null,
|
|
96
|
+
workPhone: "+1 206 555 0111"
|
|
75
97
|
},
|
|
76
98
|
{
|
|
77
99
|
id: "e12",
|
|
78
100
|
name: "Victor Ng",
|
|
79
101
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(30),
|
|
80
|
-
line: "Data Analyst at Singapore"
|
|
102
|
+
line: "Data Analyst at Singapore",
|
|
103
|
+
workEmail: null,
|
|
104
|
+
workPhone: null
|
|
81
105
|
},
|
|
82
106
|
{
|
|
83
107
|
id: "e13",
|
|
84
108
|
name: "Yuki Tanaka",
|
|
85
109
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(31),
|
|
86
|
-
line: "Account Executive at Tokyo"
|
|
110
|
+
line: "Account Executive at Tokyo",
|
|
111
|
+
workEmail: "yuki.tanaka@example.com",
|
|
112
|
+
workPhone: "+81 3 5555 0113"
|
|
87
113
|
},
|
|
88
114
|
{
|
|
89
115
|
id: "e14",
|
|
90
116
|
name: "Zara Ali",
|
|
91
117
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(32),
|
|
92
|
-
line: "Customer Success at Dubai"
|
|
118
|
+
line: "Customer Success at Dubai",
|
|
119
|
+
workEmail: "zara.ali@example.com",
|
|
120
|
+
workPhone: null
|
|
93
121
|
},
|
|
94
122
|
{
|
|
95
123
|
id: "e15",
|
|
96
124
|
name: "Ben Carter",
|
|
97
125
|
imageUrl: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_9566133d__.avatarUrl)(33),
|
|
98
|
-
line: "Facilities Coordinator at Manchester"
|
|
126
|
+
line: "Facilities Coordinator at Manchester",
|
|
127
|
+
workEmail: null,
|
|
128
|
+
workPhone: "+44 161 555 0115"
|
|
99
129
|
}
|
|
100
130
|
];
|
|
101
131
|
const rowActions = ()=>[
|
|
@@ -105,7 +135,8 @@ const rowActions = ()=>[
|
|
|
105
135
|
alwaysVisible: true,
|
|
106
136
|
icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__icons_components_Email_js_c0058dca__["default"], {}),
|
|
107
137
|
type: "link",
|
|
108
|
-
|
|
138
|
+
predicate: (row)=>Boolean(row.workEmail),
|
|
139
|
+
href: (row)=>`mailto:${row.workEmail}`
|
|
109
140
|
},
|
|
110
141
|
{
|
|
111
142
|
id: "phone",
|
|
@@ -113,7 +144,8 @@ const rowActions = ()=>[
|
|
|
113
144
|
alwaysVisible: true,
|
|
114
145
|
icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__icons_components_Phone_js_aed4f2f1__["default"], {}),
|
|
115
146
|
type: "link",
|
|
116
|
-
|
|
147
|
+
predicate: (row)=>Boolean(row.workPhone),
|
|
148
|
+
href: (row)=>`tel:${row.workPhone}`
|
|
117
149
|
}
|
|
118
150
|
];
|
|
119
151
|
const leadingSlot = {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
|
+
import type { RichListRowHeight } from "../helpers";
|
|
2
3
|
export type CommonProps = {
|
|
3
4
|
compactBreakpoint?: number;
|
|
4
5
|
contentAlignment?: NonNullable<CSSProperties["justifyContent"]>;
|
|
5
|
-
rowHeight?:
|
|
6
|
+
rowHeight?: RichListRowHeight;
|
|
6
7
|
};
|
|
@@ -2,6 +2,12 @@ import type { SortingColumnDef } from "@tanstack/react-table";
|
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
import { type Filter } from "../../controls/FilterModal";
|
|
4
4
|
import { type PrimitiveValue } from "../../utils/tables";
|
|
5
|
+
/** Row grouping config. */
|
|
6
|
+
export type RichListGrouping<Type> = {
|
|
7
|
+
fn: (row: Type) => string;
|
|
8
|
+
header: (row: Type) => ReactNode;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
5
11
|
/**
|
|
6
12
|
* Column width. Use a number (pixels) or a percentage string such as `"30%"` if the
|
|
7
13
|
* track should grow or shrink with the list width.
|
|
@@ -106,6 +112,8 @@ export type RichListTextField<Type> = ((row: Type) => ReactNode) | {
|
|
|
106
112
|
* @default `"always"`
|
|
107
113
|
*/
|
|
108
114
|
layoutVisibility?: RichListLayoutVisibility;
|
|
115
|
+
/** When set, this field can group rows in the list toolbar. */
|
|
116
|
+
grouping?: RichListGrouping<Type>;
|
|
109
117
|
};
|
|
110
118
|
/**
|
|
111
119
|
* Primary and optional secondary lines stacked in the row’s main column (same horizontal
|
|
@@ -196,6 +204,8 @@ type RichListBaseSlotObject<Type> = {
|
|
|
196
204
|
* @default `"always"`
|
|
197
205
|
*/
|
|
198
206
|
layoutVisibility?: RichListLayoutVisibility;
|
|
207
|
+
/** When set, this column can group rows in the list toolbar. */
|
|
208
|
+
grouping?: RichListGrouping<Type>;
|
|
199
209
|
};
|
|
200
210
|
/**
|
|
201
211
|
* A **leading** or **trailing** column. The row order is: leading, main slot (primary /
|
|
@@ -277,6 +287,7 @@ export type NormalizedTextField<Type> = {
|
|
|
277
287
|
sortingFn?: SortingColumnDef<Type>["sortingFn"];
|
|
278
288
|
/** @default `"always"` */
|
|
279
289
|
layoutVisibility: RichListLayoutVisibility;
|
|
290
|
+
grouping?: RichListGrouping<Type>;
|
|
280
291
|
};
|
|
281
292
|
/**
|
|
282
293
|
* Internal shape after `normalizeSlot` in `helpers.ts`. See `RichListSlot` and
|
|
@@ -318,6 +329,7 @@ export type NormalizedSlot<Type> = {
|
|
|
318
329
|
enableSorting: boolean;
|
|
319
330
|
/** @default `"auto"` */
|
|
320
331
|
sortingFn?: SortingColumnDef<Type>["sortingFn"];
|
|
332
|
+
grouping?: RichListGrouping<Type>;
|
|
321
333
|
};
|
|
322
334
|
/**
|
|
323
335
|
* One action for a row: an icon in the action strip and/or an item in the “more” menu.
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
type Props = {
|
|
3
3
|
direction?: "row" | "column";
|
|
4
|
+
/**
|
|
5
|
+
* When set, at most this many tags are rendered, followed by a "+N" count
|
|
6
|
+
* of the remaining tags. The set becomes a button that opens a modal
|
|
7
|
+
* listing every tag.
|
|
8
|
+
*/
|
|
9
|
+
maxVisibleTags?: number;
|
|
4
10
|
tags: Array<{
|
|
5
11
|
key: string;
|
|
6
12
|
value: ReactNode;
|
|
@@ -11,5 +17,5 @@ type Props = {
|
|
|
11
17
|
* nothing will be rendered. If there's not enough space, the tags will wrap
|
|
12
18
|
* (using flexbox) or be truncated.
|
|
13
19
|
*/
|
|
14
|
-
declare const TagSet: ({ tags, direction }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
20
|
+
declare const TagSet: ({ tags, direction, maxVisibleTags }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
15
21
|
export default TagSet;
|