@worknice/whiteboard 0.52.0 → 0.53.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.
Files changed (75) hide show
  1. package/dist/{presentation/TableColumnFilterModal.d.ts → controls/FilterModal.d.ts} +10 -3
  2. package/dist/{presentation/TableColumnFilterModal.js → controls/FilterModal.js} +32 -32
  3. package/dist/controls/FilterModal.module.js +13 -0
  4. package/dist/controls/FilterModal_module.css +60 -0
  5. package/dist/controls/MenuButton.js +1 -1
  6. package/dist/icons/MessagesIcon.d.ts +3 -0
  7. package/dist/icons/MessagesIcon.js +11 -0
  8. package/dist/icons/SlidersIcon.d.ts +3 -0
  9. package/dist/icons/SlidersIcon.js +12 -0
  10. package/dist/icons/WarningIcon.js +3 -3
  11. package/dist/icons/index.d.ts +2 -0
  12. package/dist/icons/index.js +3 -1
  13. package/dist/presentation/CustomizableTable/CustomizableTable.d.ts +2 -2
  14. package/dist/presentation/CustomizableTable/CustomizableTable.js +9 -7
  15. package/dist/presentation/RichList/RichList.d.ts +150 -0
  16. package/dist/presentation/RichList/RichList.js +507 -0
  17. package/dist/presentation/RichList/RichList.module.js +12 -0
  18. package/dist/presentation/RichList/RichList.stories.d.ts +24 -0
  19. package/dist/presentation/RichList/RichList.stories.js +334 -0
  20. package/dist/presentation/RichList/RichListBulkActionBar.d.ts +21 -0
  21. package/dist/presentation/RichList/RichListBulkActionBar.js +112 -0
  22. package/dist/presentation/RichList/RichListBulkActionBar.module.js +7 -0
  23. package/dist/presentation/RichList/RichListBulkActionBar_module.css +18 -0
  24. package/dist/presentation/RichList/RichListDisplayModal.d.ts +33 -0
  25. package/dist/presentation/RichList/RichListDisplayModal.js +198 -0
  26. package/dist/presentation/RichList/RichListRow.d.ts +39 -0
  27. package/dist/presentation/RichList/RichListRow.js +278 -0
  28. package/dist/presentation/RichList/RichListRow.module.js +34 -0
  29. package/dist/presentation/RichList/RichListRow_module.css +313 -0
  30. package/dist/presentation/RichList/RichListToolbar.d.ts +21 -0
  31. package/dist/presentation/RichList/RichListToolbar.js +104 -0
  32. package/dist/presentation/RichList/RichListToolbar.module.js +12 -0
  33. package/dist/presentation/RichList/RichListToolbar_module.css +100 -0
  34. package/dist/presentation/RichList/RichList_module.css +77 -0
  35. package/dist/presentation/RichList/helpers.d.ts +77 -0
  36. package/dist/presentation/RichList/helpers.js +121 -0
  37. package/dist/presentation/RichList/stories/ComplianceGroups.d.ts +9 -0
  38. package/dist/presentation/RichList/stories/ComplianceGroups.js +141 -0
  39. package/dist/presentation/RichList/stories/CustomFields.d.ts +13 -0
  40. package/dist/presentation/RichList/stories/CustomFields.js +80 -0
  41. package/dist/presentation/RichList/stories/EmployeeCompliance.d.ts +15 -0
  42. package/dist/presentation/RichList/stories/EmployeeCompliance.js +300 -0
  43. package/dist/presentation/RichList/stories/EmployeePaperwork.d.ts +21 -0
  44. package/dist/presentation/RichList/stories/EmployeePaperwork.js +225 -0
  45. package/dist/presentation/RichList/stories/EmployeePeople.d.ts +10 -0
  46. package/dist/presentation/RichList/stories/EmployeePeople.js +170 -0
  47. package/dist/presentation/RichList/stories/Leave.d.ts +21 -0
  48. package/dist/presentation/RichList/stories/Leave.js +332 -0
  49. package/dist/presentation/RichList/stories/Paperwork.d.ts +22 -0
  50. package/dist/presentation/RichList/stories/Paperwork.js +446 -0
  51. package/dist/presentation/RichList/stories/PaperworkApprovals.d.ts +23 -0
  52. package/dist/presentation/RichList/stories/PaperworkApprovals.js +342 -0
  53. package/dist/presentation/RichList/stories/PeopleList.d.ts +19 -0
  54. package/dist/presentation/RichList/stories/PeopleList.js +391 -0
  55. package/dist/presentation/RichList/stories/PeopleTags.d.ts +14 -0
  56. package/dist/presentation/RichList/stories/PeopleTags.js +106 -0
  57. package/dist/presentation/RichList/stories/Positions.d.ts +22 -0
  58. package/dist/presentation/RichList/stories/Positions.js +519 -0
  59. package/dist/presentation/RichList/stories/SavedQuestions.d.ts +13 -0
  60. package/dist/presentation/RichList/stories/SavedQuestions.js +152 -0
  61. package/dist/presentation/RichList/stories/Tables.d.ts +9 -0
  62. package/dist/presentation/RichList/stories/Tables.js +85 -0
  63. package/dist/presentation/RichList/stories/Tasks.d.ts +16 -0
  64. package/dist/presentation/RichList/stories/Tasks.js +340 -0
  65. package/dist/presentation/RichList/stories/shared/bulkActionStubs.d.ts +9 -0
  66. package/dist/presentation/RichList/stories/shared/bulkActionStubs.js +122 -0
  67. package/dist/presentation/RichList/stories/shared.d.ts +8 -0
  68. package/dist/presentation/RichList/stories/shared.js +2 -0
  69. package/dist/presentation/RichList/types.d.ts +342 -0
  70. package/dist/presentation/RichList/types.js +0 -0
  71. package/dist/presentation/Table.d.ts +1 -1
  72. package/dist/presentation/Table.js +2 -2
  73. package/dist/presentation/Table.module.js +0 -10
  74. package/dist/presentation/Table_module.css +1 -61
  75. package/package.json +2 -2
@@ -0,0 +1,198 @@
1
+ "use client";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
3
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__controls_Button_js_2f50b64a__ from "../../controls/Button.js";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__controls_FilterModal_js_c5dcd344__ from "../../controls/FilterModal.js";
6
+ import * as __WEBPACK_EXTERNAL_MODULE__controls_FilterModal_module_js_3b5407aa__ from "../../controls/FilterModal.module.js";
7
+ import * as __WEBPACK_EXTERNAL_MODULE__fields_BooleanField_js_6389bc93__ from "../../fields/BooleanField.js";
8
+ import * as __WEBPACK_EXTERNAL_MODULE__fields_SimpleRadioSetField_js_bf559bf6__ from "../../fields/SimpleRadioSetField.js";
9
+ import * as __WEBPACK_EXTERNAL_MODULE__forms_FormButtonSet_js_786d786e__ from "../../forms/FormButtonSet.js";
10
+ import * as __WEBPACK_EXTERNAL_MODULE__forms_useForm_js_e95dafc7__ from "../../forms/useForm.js";
11
+ import * as __WEBPACK_EXTERNAL_MODULE__inputs_SelectInput_js_a37c3c04__ from "../../inputs/SelectInput.js";
12
+ import * as __WEBPACK_EXTERNAL_MODULE__Card_js_2e00482a__ from "../Card.js";
13
+ import * as __WEBPACK_EXTERNAL_MODULE__HStack_js_5c2eb952__ from "../HStack.js";
14
+ import * as __WEBPACK_EXTERNAL_MODULE__Icon_js_e5f9af80__ from "../Icon.js";
15
+ import * as __WEBPACK_EXTERNAL_MODULE__Modal_js_91697624__ from "../Modal.js";
16
+ import * as __WEBPACK_EXTERNAL_MODULE__PlainText_js_6d36b5d5__ from "../PlainText.js";
17
+ import * as __WEBPACK_EXTERNAL_MODULE__VStack_js_6ebc0134__ from "../VStack.js";
18
+ const NO_SORT_ID = "__richListNoSort__";
19
+ function getDisplayFormActiveExpanderCount(hasSortForm, sorting, displayColumnRows) {
20
+ let n = 0;
21
+ if (hasSortForm && void 0 !== sorting[0]) n += 1;
22
+ if (displayColumnRows.some((c)=>c.visible !== c.defaultVisible)) n += 1;
23
+ return n;
24
+ }
25
+ const RichListDisplayModal = ({ onClose, sortableColumns, currentSorting, onApplySorting, displayColumns, onApplyColumnVisibility, defaultSorting, defaultColumnVisibility })=>{
26
+ const sortOptions = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>[
27
+ {
28
+ id: NO_SORT_ID,
29
+ label: "Default order"
30
+ },
31
+ ...sortableColumns
32
+ ], [
33
+ sortableColumns
34
+ ]);
35
+ const firstSort = currentSorting[0];
36
+ const initialSortColumnId = firstSort?.id ?? NO_SORT_ID;
37
+ const initialSortDesc = firstSort?.desc ?? false;
38
+ const initialVisibility = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>Object.fromEntries(displayColumns.map((c)=>[
39
+ c.id,
40
+ c.visible
41
+ ])), [
42
+ displayColumns
43
+ ]);
44
+ const { data, setData, status, submit } = (0, __WEBPACK_EXTERNAL_MODULE__forms_useForm_js_e95dafc7__["default"])({
45
+ initialValues: {
46
+ sortColumnId: initialSortColumnId,
47
+ sortDesc: initialSortDesc,
48
+ visibility: initialVisibility
49
+ },
50
+ onSubmit: async (values)=>{
51
+ const nextSort = values.sortColumnId && values.sortColumnId !== NO_SORT_ID ? [
52
+ {
53
+ id: values.sortColumnId,
54
+ desc: values.sortDesc
55
+ }
56
+ ] : [];
57
+ onApplySorting(nextSort);
58
+ onApplyColumnVisibility(values.visibility);
59
+ }
60
+ });
61
+ const sortColumnOption = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>sortOptions.find((o)=>o.id === data.sortColumnId) ?? sortOptions[0], [
62
+ data.sortColumnId,
63
+ sortOptions
64
+ ]);
65
+ const isSortActive = data.sortColumnId !== NO_SORT_ID;
66
+ const hasSortSection = sortableColumns.length > 0;
67
+ const hasDisplaySection = displayColumns.length > 0;
68
+ const handleReset = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(()=>{
69
+ setData(()=>({
70
+ sortColumnId: defaultSorting[0]?.id ?? NO_SORT_ID,
71
+ sortDesc: defaultSorting[0]?.desc ?? false,
72
+ visibility: {
73
+ ...defaultColumnVisibility
74
+ }
75
+ }));
76
+ }, [
77
+ defaultColumnVisibility,
78
+ defaultSorting,
79
+ setData
80
+ ]);
81
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__Modal_js_91697624__["default"], {
82
+ onClose: onClose,
83
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__Card_js_2e00482a__["default"], {
84
+ header: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__PlainText_js_6d36b5d5__["default"], {
85
+ font: "h6",
86
+ tagName: "h6",
87
+ children: "Display"
88
+ }),
89
+ footer: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE__HStack_js_5c2eb952__["default"], {
90
+ justify: "space-between",
91
+ children: [
92
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__controls_Button_js_2f50b64a__["default"], {
93
+ type: "secondary",
94
+ onClick: handleReset,
95
+ icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__Icon_js_e5f9af80__["default"], {
96
+ symbol: "Restore"
97
+ }),
98
+ disabled: !hasSortSection && !hasDisplaySection,
99
+ children: "Reset"
100
+ }),
101
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__forms_FormButtonSet_js_786d786e__["default"], {
102
+ formStatus: status,
103
+ primary: {
104
+ action: async ()=>{
105
+ submit();
106
+ onClose();
107
+ },
108
+ label: "Apply"
109
+ },
110
+ secondary: {
111
+ action: onClose,
112
+ label: "Cancel",
113
+ type: "ghost"
114
+ }
115
+ })
116
+ ]
117
+ }),
118
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
119
+ className: __WEBPACK_EXTERNAL_MODULE__controls_FilterModal_module_js_3b5407aa__["default"].filterExpandersContainer,
120
+ children: [
121
+ hasSortSection ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__controls_FilterModal_js_c5dcd344__.FilterExpander, {
122
+ label: "Sort",
123
+ highlight: isSortActive,
124
+ defaultOpen: !hasDisplaySection || isSortActive,
125
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE__VStack_js_6ebc0134__["default"], {
126
+ spacing: "n2",
127
+ justifyItems: "start",
128
+ children: [
129
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__inputs_SelectInput_js_a37c3c04__["default"], {
130
+ id: "richListDisplaySortColumn",
131
+ options: sortOptions,
132
+ optionToId: (o)=>o.id,
133
+ optionToLabel: (o)=>o.label,
134
+ value: sortColumnOption,
135
+ onChange: (option)=>{
136
+ setData((prev)=>({
137
+ ...prev,
138
+ sortColumnId: option.id
139
+ }));
140
+ }
141
+ }),
142
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__fields_SimpleRadioSetField_js_bf559bf6__["default"], {
143
+ id: "richListDisplaySortDirection",
144
+ label: "Direction",
145
+ options: [
146
+ {
147
+ id: "asc",
148
+ label: "Ascending"
149
+ },
150
+ {
151
+ id: "desc",
152
+ label: "Descending"
153
+ }
154
+ ],
155
+ value: data.sortDesc ? "desc" : "asc",
156
+ onChange: (id)=>{
157
+ setData((prev)=>({
158
+ ...prev,
159
+ sortDesc: "desc" === id
160
+ }));
161
+ },
162
+ disabled: !isSortActive
163
+ })
164
+ ]
165
+ })
166
+ }) : null,
167
+ hasDisplaySection ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__controls_FilterModal_js_c5dcd344__.FilterExpander, {
168
+ label: "Visible columns",
169
+ highlight: displayColumns.some((c)=>data.visibility[c.id] !== c.defaultVisible),
170
+ defaultOpen: hasDisplaySection && !hasSortSection,
171
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
172
+ className: __WEBPACK_EXTERNAL_MODULE__controls_FilterModal_module_js_3b5407aa__["default"].filterOptions,
173
+ children: displayColumns.map((col)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
174
+ className: __WEBPACK_EXTERNAL_MODULE__controls_FilterModal_module_js_3b5407aa__["default"].filterBooleanFieldWrapper,
175
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__fields_BooleanField_js_6389bc93__["default"], {
176
+ id: `richListDisplayCol-${col.id}`,
177
+ label: col.label,
178
+ value: data.visibility[col.id] ?? col.visible,
179
+ onChange: (checked)=>{
180
+ setData((prev)=>({
181
+ ...prev,
182
+ visibility: {
183
+ ...prev.visibility,
184
+ [col.id]: checked
185
+ }
186
+ }));
187
+ }
188
+ })
189
+ }, col.id))
190
+ })
191
+ }) : null
192
+ ]
193
+ })
194
+ })
195
+ });
196
+ };
197
+ const RichListDisplayModal_rslib_entry_ = RichListDisplayModal;
198
+ export { RichListDisplayModal_rslib_entry_ as default, getDisplayFormActiveExpanderCount };
@@ -0,0 +1,39 @@
1
+ import { type Row, type Table } from "@tanstack/react-table";
2
+ import { type CSSProperties, type MutableRefObject } from "react";
3
+ import { type NormalizedSlot, type NormalizedTextField } from "./types";
4
+ import { type RichListRowAction } from "./types";
5
+ type Props<Type> = {
6
+ row: Row<Type>;
7
+ table: Table<Type>;
8
+ /** When the list has bulk actions, rows can be selected via the checkbox lane. */
9
+ enableRowSelection: boolean;
10
+ href: ((row: Type) => string) | undefined;
11
+ normalizedLeadingSlots: Array<NormalizedSlot<Type>>;
12
+ normalizedPrimary: NormalizedTextField<Type>;
13
+ normalizedSecondary: NormalizedTextField<Type> | null;
14
+ /**
15
+ * From `mainSlot.size`: max width (px) of the main-slot grid column (`--richlist-primary-track`).
16
+ */
17
+ mainSlotMaxWidthPx: number | undefined;
18
+ normalizedContentSlots: Array<NormalizedSlot<Type>>;
19
+ normalizedTrailingSlots: Array<NormalizedSlot<Type>>;
20
+ /**
21
+ * List width is at/under `RichList`’s `compactBreakpoint` — `compactSize` applies to
22
+ * leading/trailing (and not-yet-hidden content slot) widths when set.
23
+ */
24
+ isCompactContentSlots: boolean;
25
+ /**
26
+ * If `true`, the list row uses the “compact” main layout: middle **content** slot
27
+ * columns are hidden. Set when at compact and no content column renders at compact
28
+ * (none has `layoutVisibility` `"always"` or `"whenCompact"`).
29
+ */
30
+ rowMainHidesContentSlotColumns: boolean;
31
+ /** Flex `justify-content` for `.contentSlots`. */
32
+ contentSlotsJustifyContent: NonNullable<CSSProperties["justifyContent"]>;
33
+ actionsForRow: Array<RichListRowAction<Type>>;
34
+ maxAlwaysVisibleActions: number;
35
+ anyRowHasOverflowAction: boolean;
36
+ lastSelectedRowRef: MutableRefObject<Row<Type> | undefined>;
37
+ };
38
+ declare const RichListRow: <Type>({ row, table, enableRowSelection, href, normalizedLeadingSlots, normalizedPrimary, normalizedSecondary, mainSlotMaxWidthPx, normalizedContentSlots, normalizedTrailingSlots, isCompactContentSlots, rowMainHidesContentSlotColumns, contentSlotsJustifyContent, actionsForRow, maxAlwaysVisibleActions, anyRowHasOverflowAction, lastSelectedRowRef, }: Props<Type>) => import("react/jsx-runtime").JSX.Element;
39
+ export default RichListRow;
@@ -0,0 +1,278 @@
1
+ "use client";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
3
+ import * as __WEBPACK_EXTERNAL_MODULE_clsx__ from "clsx";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__controls_Button_js_2f50b64a__ from "../../controls/Button.js";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__controls_MenuButton_js_fa7c5c89__ from "../../controls/MenuButton.js";
6
+ import * as __WEBPACK_EXTERNAL_MODULE__inputs_CheckboxInput_js_0c849015__ from "../../inputs/CheckboxInput.js";
7
+ import * as __WEBPACK_EXTERNAL_MODULE__utils_useNextContext_js_c6ca8eb1__ from "../../utils/useNextContext.js";
8
+ import * as __WEBPACK_EXTERNAL_MODULE__Icon_js_e5f9af80__ from "../Icon.js";
9
+ import * as __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__ from "./helpers.js";
10
+ import * as __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__ from "./RichListRow.module.js";
11
+ function contentSlotAlignClass(align) {
12
+ switch(align){
13
+ case "end":
14
+ return __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].contentSlotEnd;
15
+ case "center":
16
+ return __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].contentSlotCenter;
17
+ default:
18
+ return __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].contentSlotStart;
19
+ }
20
+ }
21
+ const RichListRow = ({ row, table, enableRowSelection, href, normalizedLeadingSlots, normalizedPrimary, normalizedSecondary, mainSlotMaxWidthPx, normalizedContentSlots, normalizedTrailingSlots, isCompactContentSlots, rowMainHidesContentSlotColumns, contentSlotsJustifyContent, actionsForRow, maxAlwaysVisibleActions, anyRowHasOverflowAction, lastSelectedRowRef })=>{
22
+ const { Link } = (0, __WEBPACK_EXTERNAL_MODULE__utils_useNextContext_js_c6ca8eb1__["default"])();
23
+ const rowOriginal = row.original;
24
+ const hrefValue = href ? href(rowOriginal) : void 0;
25
+ const alwaysVisibleActions = actionsForRow.filter((action)=>action.alwaysVisible);
26
+ const overflowActions = actionsForRow.filter((action)=>!action.alwaysVisible);
27
+ const alwaysVisiblePlaceholderCount = Math.max(0, maxAlwaysVisibleActions - alwaysVisibleActions.length);
28
+ const isSlotVisible = (slot)=>(table.getColumn(slot.id)?.getIsVisible() ?? true) && (0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.isVisibleAtBreakpoint)(slot.layoutVisibility, isCompactContentSlots);
29
+ const visibleContentSlots = normalizedContentSlots.filter(isSlotVisible);
30
+ const visibleLeadingSlots = normalizedLeadingSlots.filter(isSlotVisible);
31
+ const visibleTrailingSlots = normalizedTrailingSlots.filter(isSlotVisible);
32
+ const showPrimary = (0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.isVisibleAtBreakpoint)(normalizedPrimary.layoutVisibility, isCompactContentSlots);
33
+ const showSecondary = null !== normalizedSecondary && (0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.isVisibleAtBreakpoint)(normalizedSecondary.layoutVisibility, isCompactContentSlots);
34
+ const isLinkable = Boolean(hrefValue);
35
+ const bulkClickToSelect = enableRowSelection && !isLinkable && row.getCanSelect();
36
+ const isClickable = isLinkable || bulkClickToSelect;
37
+ const applyShiftSelection = ()=>{
38
+ if (!lastSelectedRowRef.current) return false;
39
+ const visibleRows = table.getRowModel().rows;
40
+ const visibleIndex = visibleRows.findIndex((r)=>r.id === row.id);
41
+ const lastIndex = visibleRows.findIndex((r)=>r.id === lastSelectedRowRef.current?.id);
42
+ if (-1 === visibleIndex || -1 === lastIndex) return false;
43
+ const startIndex = Math.min(lastIndex, visibleIndex);
44
+ const endIndex = Math.max(lastIndex, visibleIndex);
45
+ const target = !row.getIsSelected();
46
+ const rowsToSelect = visibleRows.slice(startIndex, endIndex + 1).filter((r)=>r.getCanSelect());
47
+ rowsToSelect.forEach((r)=>r.toggleSelected(target));
48
+ lastSelectedRowRef.current = row;
49
+ return true;
50
+ };
51
+ const handleClickableZoneClick = (event)=>{
52
+ if (!bulkClickToSelect) return;
53
+ if (event.shiftKey && applyShiftSelection()) return;
54
+ lastSelectedRowRef.current = row;
55
+ row.toggleSelected(!row.getIsSelected());
56
+ };
57
+ const contentSlotStyle = (slot)=>{
58
+ const isFixed = "fixed" === slot.columnWidthMode;
59
+ if (void 0 === slot.size) {
60
+ if (isFixed) return {
61
+ flex: "0 0 auto",
62
+ flexShrink: 0,
63
+ maxWidth: "100%",
64
+ minWidth: "min-content"
65
+ };
66
+ return {
67
+ flex: "1 2 0%",
68
+ minWidth: 0,
69
+ maxWidth: "100%"
70
+ };
71
+ }
72
+ const cap = isCompactContentSlots && void 0 !== slot.compactSize ? (0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.formatSlotSize)(slot.compactSize) : (0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.formatSlotSize)(slot.size);
73
+ if (isFixed) return {
74
+ boxSizing: "border-box",
75
+ flex: `0 0 ${cap}`,
76
+ flexShrink: 0,
77
+ maxWidth: cap,
78
+ minWidth: cap,
79
+ width: cap
80
+ };
81
+ return {
82
+ flex: `0 2 ${cap}`,
83
+ maxWidth: cap,
84
+ minWidth: 0
85
+ };
86
+ };
87
+ const trailingLaneStyle = (slot)=>{
88
+ if (void 0 === slot.size) return;
89
+ const cap = isCompactContentSlots && void 0 !== slot.compactSize ? (0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.formatSlotSize)(slot.compactSize) : (0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.formatSlotSize)(slot.size);
90
+ return {
91
+ boxSizing: "border-box",
92
+ flex: `0 0 ${cap}`,
93
+ maxWidth: cap,
94
+ minWidth: 0,
95
+ width: cap
96
+ };
97
+ };
98
+ const leadingLaneStyle = (slot)=>void 0 !== slot.size ? {
99
+ flex: `0 0 ${(0, __WEBPACK_EXTERNAL_MODULE__helpers_js_87289b43__.formatSlotSize)(slot.size)}`
100
+ } : void 0;
101
+ const rowMainStyle = void 0 !== mainSlotMaxWidthPx ? {
102
+ ["--richlist-primary-track"]: `${mainSlotMaxWidthPx}px`
103
+ } : void 0;
104
+ const rowOverlay = hrefValue ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Link, {
105
+ className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].rowLink,
106
+ href: hrefValue,
107
+ "aria-label": void 0
108
+ }) : null;
109
+ const bulkCheckboxId = `richlist-bulk-${row.id}`;
110
+ const handleCheckboxPaddingClick = (event)=>{
111
+ if (event.target !== event.currentTarget) return;
112
+ event.stopPropagation();
113
+ if (event.shiftKey) {
114
+ applyShiftSelection();
115
+ return;
116
+ }
117
+ lastSelectedRowRef.current = row;
118
+ row.toggleSelected(!row.getIsSelected());
119
+ };
120
+ const checkboxInput = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__inputs_CheckboxInput_js_0c849015__["default"], {
121
+ disabled: !row.getCanSelect(),
122
+ id: bulkCheckboxId,
123
+ value: row.getIsSelected(),
124
+ onClick: (event)=>{
125
+ if (event.shiftKey) applyShiftSelection();
126
+ lastSelectedRowRef.current = row;
127
+ },
128
+ onChange: (value)=>row.toggleSelected(value)
129
+ });
130
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("li", {
131
+ className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].listItem,
132
+ "data-selected": row.getIsSelected() ? "" : void 0,
133
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
134
+ 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),
135
+ children: [
136
+ enableRowSelection && row.getCanSelect() ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
137
+ 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),
138
+ onClick: (event)=>{
139
+ event.stopPropagation();
140
+ handleCheckboxPaddingClick(event);
141
+ },
142
+ children: checkboxInput
143
+ }) : null,
144
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
145
+ className: (0, __WEBPACK_EXTERNAL_MODULE_clsx__["default"])(__WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].clickableZone, isClickable && __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].clickableZoneActive),
146
+ onClick: bulkClickToSelect ? handleClickableZoneClick : void 0,
147
+ children: [
148
+ rowOverlay,
149
+ visibleLeadingSlots.map((slot)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
150
+ className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].leadingLane,
151
+ style: leadingLaneStyle(slot),
152
+ children: slot.render(rowOriginal)
153
+ }, slot.id)),
154
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
155
+ className: (0, __WEBPACK_EXTERNAL_MODULE_clsx__["default"])(__WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].rowMain, rowMainHidesContentSlotColumns && __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].rowMainCompact),
156
+ style: rowMainStyle,
157
+ children: [
158
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
159
+ className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].mainSlot,
160
+ children: [
161
+ showPrimary ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("span", {
162
+ className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].primaryLine,
163
+ children: [
164
+ normalizedPrimary.prefixOnWide ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
165
+ className: (0, __WEBPACK_EXTERNAL_MODULE_clsx__["default"])(__WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].mainSlotAdornment, __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].textFieldAdornment),
166
+ children: normalizedPrimary.prefixOnWide(rowOriginal)
167
+ }) : null,
168
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
169
+ className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].primaryText,
170
+ children: normalizedPrimary.render(rowOriginal)
171
+ }),
172
+ normalizedPrimary.suffixOnWide ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
173
+ className: (0, __WEBPACK_EXTERNAL_MODULE_clsx__["default"])(__WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].mainSlotAdornment, __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].textFieldAdornment),
174
+ children: normalizedPrimary.suffixOnWide(rowOriginal)
175
+ }) : null
176
+ ]
177
+ }) : null,
178
+ showSecondary && normalizedSecondary ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("span", {
179
+ className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].secondaryLine,
180
+ children: [
181
+ normalizedSecondary.prefixOnWide ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
182
+ className: (0, __WEBPACK_EXTERNAL_MODULE_clsx__["default"])(__WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].mainSlotAdornment, __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].textFieldAdornment),
183
+ children: normalizedSecondary.prefixOnWide(rowOriginal)
184
+ }) : null,
185
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
186
+ className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].secondaryText,
187
+ children: normalizedSecondary.render(rowOriginal)
188
+ }),
189
+ normalizedSecondary.suffixOnWide ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
190
+ className: (0, __WEBPACK_EXTERNAL_MODULE_clsx__["default"])(__WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].mainSlotAdornment, __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].textFieldAdornment),
191
+ children: normalizedSecondary.suffixOnWide(rowOriginal)
192
+ }) : null
193
+ ]
194
+ }) : null
195
+ ]
196
+ }),
197
+ visibleContentSlots.length > 0 ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
198
+ className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].contentSlots,
199
+ style: {
200
+ justifyContent: contentSlotsJustifyContent
201
+ },
202
+ children: visibleContentSlots.map((slot)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
203
+ className: (0, __WEBPACK_EXTERNAL_MODULE_clsx__["default"])(__WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].slotCell, __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].contentSlot, contentSlotAlignClass(slot.align), "fixed" === slot.columnWidthMode && __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].contentSlotFixed),
204
+ style: contentSlotStyle(slot),
205
+ children: slot.render(rowOriginal)
206
+ }, slot.id))
207
+ }) : null
208
+ ]
209
+ }),
210
+ visibleTrailingSlots.map((slot)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
211
+ className: (0, __WEBPACK_EXTERNAL_MODULE_clsx__["default"])(__WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].slotCell, __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].trailingLane, contentSlotAlignClass(slot.align)),
212
+ style: trailingLaneStyle(slot),
213
+ children: slot.render(rowOriginal)
214
+ }, slot.id))
215
+ ]
216
+ }),
217
+ maxAlwaysVisibleActions > 0 ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
218
+ className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].actionsLane,
219
+ onClick: (event)=>event.stopPropagation(),
220
+ children: [
221
+ alwaysVisibleActions.map((action)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__controls_Button_js_2f50b64a__["default"], {
222
+ id: action.id,
223
+ type: "ghost",
224
+ size: "small",
225
+ icon: action.icon,
226
+ tooltip: action.label,
227
+ onClick: ()=>action.onClick(rowOriginal)
228
+ }, action.id)),
229
+ Array.from({
230
+ length: alwaysVisiblePlaceholderCount
231
+ }).map((_, index)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
232
+ "aria-hidden": true,
233
+ className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].actionPlaceholder,
234
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__controls_Button_js_2f50b64a__["default"], {
235
+ type: "ghost",
236
+ size: "small",
237
+ icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__Icon_js_e5f9af80__["default"], {
238
+ symbol: "Overflow"
239
+ })
240
+ })
241
+ }, `placeholder-${index}`))
242
+ ]
243
+ }) : null,
244
+ anyRowHasOverflowAction ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
245
+ className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].overflowLane,
246
+ onClick: (event)=>event.stopPropagation(),
247
+ children: overflowActions.length > 0 ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__controls_MenuButton_js_fa7c5c89__["default"], {
248
+ type: "ghost",
249
+ size: "small",
250
+ ariaLabel: "More actions",
251
+ options: overflowActions.map((action)=>({
252
+ id: action.id,
253
+ label: action.label,
254
+ icon: action.icon,
255
+ type: "onClick",
256
+ onClick: ()=>action.onClick(rowOriginal)
257
+ })),
258
+ icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__Icon_js_e5f9af80__["default"], {
259
+ symbol: "Overflow"
260
+ })
261
+ }) : /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
262
+ "aria-hidden": true,
263
+ className: __WEBPACK_EXTERNAL_MODULE__RichListRow_module_js_3bb1d324__["default"].actionPlaceholder,
264
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__controls_Button_js_2f50b64a__["default"], {
265
+ type: "ghost",
266
+ size: "small",
267
+ icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__Icon_js_e5f9af80__["default"], {
268
+ symbol: "Overflow"
269
+ })
270
+ })
271
+ })
272
+ }) : null
273
+ ]
274
+ })
275
+ }, row.id);
276
+ };
277
+ const RichListRow_rslib_entry_ = RichListRow;
278
+ export { RichListRow_rslib_entry_ as default };
@@ -0,0 +1,34 @@
1
+ import "./RichListRow_module.css";
2
+ const RichListRow_module_rslib_entry_ = {
3
+ listItem: "listItem-HfVE7t",
4
+ row: "row-qNQike",
5
+ clickableZone: "clickableZone-KG4Ygg",
6
+ clickableZoneActive: "clickableZoneActive-OtaDew",
7
+ leadingLane: "leadingLane-oEnTWq",
8
+ rowMain: "rowMain-ekCI8x",
9
+ trailingLane: "trailingLane-J4qLz8",
10
+ contentSlot: "contentSlot-xgewfJ",
11
+ rowLink: "rowLink-vHZ0y7",
12
+ checkboxLane: "checkboxLane-SxFtCI",
13
+ actionsLane: "actionsLane-JQxqtO",
14
+ overflowLane: "overflowLane-euPsqR",
15
+ checkboxLaneFullTarget: "checkboxLaneFullTarget-J22CW6",
16
+ checkboxLaneActive: "checkboxLaneActive-SAAKUd",
17
+ slotCell: "slotCell-nFtJJc",
18
+ rowMainCompact: "rowMainCompact-FP1jUy",
19
+ mainSlot: "mainSlot-G9ZgMV",
20
+ contentSlots: "contentSlots-_4Kf6I",
21
+ contentSlotFixed: "contentSlotFixed-Saogio",
22
+ contentSlotStart: "contentSlotStart-klEUrD",
23
+ contentSlotEnd: "contentSlotEnd-k2QSDN",
24
+ contentSlotCenter: "contentSlotCenter-elj5Nr",
25
+ primaryLine: "primaryLine-Sedy1b",
26
+ secondaryLine: "secondaryLine-iySU25",
27
+ primaryText: "primaryText-vd9ry0",
28
+ secondaryText: "secondaryText-DmPdJ2",
29
+ mainSlotAdornment: "mainSlotAdornment-IQslEw",
30
+ actionPlaceholder: "actionPlaceholder-yugzJR",
31
+ rowListAtCompactBreakpoint: "rowListAtCompactBreakpoint-g6EL_A",
32
+ textFieldAdornment: "textFieldAdornment-LP2CuE"
33
+ };
34
+ export { RichListRow_module_rslib_entry_ as default };