playbook_ui 18.3.0.pre.alpha.PLAY3366externalruntimeguard21028 → 18.3.0.pre.alpha.forwardrefwarnings20879
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx +1 -8
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +8 -39
- data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +4 -24
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +0 -29
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +5 -72
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +0 -8
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +0 -467
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.json +1 -10
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.overrides.json +1 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/index.js +2 -39
- data/app/pb_kits/playbook/pb_advanced_table/kit.schema.json +0 -8
- data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +23 -53
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +0 -2
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +4 -4
- data/app/pb_kits/playbook/pb_collapsible/collapsible.test.js +0 -80
- data/app/pb_kits/playbook/pb_form/form.rb +1 -1
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -6
- data/app/pb_kits/playbook/pb_icon/kit.schema.json +0 -1
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +1 -3
- data/app/pb_kits/playbook/pb_icon_circle/kit.schema.json +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +4 -1
- data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +0 -17
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +7 -3
- data/app/pb_kits/playbook/pb_phone_number_input/intlTelInput.scss +6 -13
- data/app/pb_kits/playbook/pb_popover/index.ts +8 -47
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +4 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +4 -1
- data/app/pb_kits/playbook/utilities/test/globalProps/onClick.test.js +0 -169
- data/dist/ai/all-schemas.json +0 -10
- data/dist/ai/forms.json +1 -1
- data/dist/ai/index.json +2 -2
- data/dist/ai/kits/advanced_table.schema.json +0 -8
- data/dist/ai/kits/icon.schema.json +0 -1
- data/dist/ai/kits/icon_circle.schema.json +0 -1
- data/dist/ai/playgrounds/advanced_table.json +1 -1
- data/dist/ai/playgrounds/index.json +1 -1
- data/dist/chunks/_pagination-CARbC_IN.js +1 -0
- data/dist/chunks/{_pb_line_graph-DyvH5Zj1.js → _pb_line_graph-BKwbOeqo.js} +1 -1
- data/dist/chunks/{_tooltip-CFbtqu-E.js → _tooltip-UkcgcThO.js} +1 -1
- data/dist/chunks/{_typeahead-C3MN3apM.js → _typeahead-D_li2Zx8.js} +1 -1
- data/dist/chunks/{globalProps-xfGTpdLP.js → globalProps-BivjwRew.js} +1 -1
- data/dist/chunks/{lib-Cu_i0y0k.js → lib-C50eCpoN.js} +1 -1
- data/dist/chunks/{time_picker_helper-B82MORju.js → time_picker_helper-DfKvHCJu.js} +1 -1
- data/dist/chunks/vendor.js +2 -2
- data/dist/menu.yml +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +10 -21
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_group_separators.jsx +0 -67
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_group_separators.md +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_group_separators_rails.html.erb +0 -78
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_group_separators_rails.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_group_separators.json +0 -328
- data/app/pb_kits/playbook/pb_phone_number_input/img/flags.webp +0 -0
- data/app/pb_kits/playbook/pb_phone_number_input/img/flags@2x.webp +0 -0
- data/app/pb_kits/playbook/pb_phone_number_input/img/globe.webp +0 -0
- data/app/pb_kits/playbook/pb_phone_number_input/img/globe@2x.webp +0 -0
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input_assets.test.js +0 -61
- data/app/pb_kits/playbook/pb_popover/popover_index.test.js +0 -456
- data/dist/chunks/_pagination-DZ0eQuH2.js +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: af48353705b1ce87159c9761f41618cbb21c66e593c0e6c3a7eca1ba3cd7d2a3
|
|
4
|
+
data.tar.gz: ab45901796d0cfff09d8d199d320c83cd58429b7831544aa427865306d6e5d96
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fcdf296d7ddc231a54b735b920bc650387c76f8364531ee44950d80d4e819b16dc188a102b4ca44d92964a60498272d00b33d5fbdaf4edd3bdfb4e7c9a466e7a
|
|
7
|
+
data.tar.gz: 0142e30f5c5b217699a9e3b2059117fd350cfa51dac2ab3fc6c3e2c9b700707f068412da119e437b81574b4f4844f7781ce9f6bd9ea075717c6127400bf1a3c4
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
import AdvancedTableContext from "../Context/AdvancedTableContext"
|
|
1
|
+
import React from "react"
|
|
4
2
|
|
|
5
3
|
//CollapsibleTrail component
|
|
6
4
|
const CollapsibleTrail = ({ leftOffset }: { leftOffset: number }) => {
|
|
7
|
-
const { groupSeparators } = useContext(AdvancedTableContext)
|
|
8
5
|
const style: { [key: string]: string | number } = {
|
|
9
6
|
left: `${leftOffset}em`,
|
|
10
7
|
}
|
|
11
|
-
// Read by groupSeparators CSS to decide which trails stop at the stroke
|
|
12
|
-
if (groupSeparators) {
|
|
13
|
-
style["--collapsible-trail-left"] = `${leftOffset}em`
|
|
14
|
-
}
|
|
15
8
|
|
|
16
9
|
return (
|
|
17
10
|
<div
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useContext, useEffect
|
|
1
|
+
import React, { useContext, useEffect } from "react"
|
|
2
2
|
import classnames from "classnames"
|
|
3
3
|
import { flexRender, Row, Cell } from "@tanstack/react-table"
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ import { GenericObject } from "../../types"
|
|
|
6
6
|
import { isChrome } from "../Utilities/BrowserCheck"
|
|
7
7
|
import { findColumnDefByAccessor } from "../Utilities/ColumnStylingHelper"
|
|
8
8
|
import { playbookColumnLayoutStylesFromMeta } from "../Utilities/ColumnLayoutHelper"
|
|
9
|
-
import {
|
|
9
|
+
import { getFontWeight, getRowColorClass, getRowStyle, shouldShowLoadingIndicator } from "../Utilities/RowUtils"
|
|
10
10
|
|
|
11
11
|
import LoadingInline from "../../pb_loading_inline/_loading_inline"
|
|
12
12
|
import Checkbox from "../../pb_checkbox/_checkbox"
|
|
@@ -125,7 +125,6 @@ export const RegularTableView = ({
|
|
|
125
125
|
}: RegularTableViewProps) => {
|
|
126
126
|
const {
|
|
127
127
|
enableToggleExpansion,
|
|
128
|
-
groupSeparators,
|
|
129
128
|
handleExpandOrCollapse,
|
|
130
129
|
inlineRowLoading,
|
|
131
130
|
loading,
|
|
@@ -159,30 +158,14 @@ export const RegularTableView = ({
|
|
|
159
158
|
(obj: Record<string, unknown>) => "columns" in obj
|
|
160
159
|
);
|
|
161
160
|
|
|
162
|
-
//
|
|
163
|
-
|
|
164
|
-
const rowModelRows = table.getRowModel().rows
|
|
165
|
-
const groupSeparatorInsets = useMemo(
|
|
166
|
-
() => (groupSeparators ? buildGroupSeparatorInsets(rowModelRows) : new Map<string, number>()),
|
|
167
|
-
[groupSeparators, rowModelRows]
|
|
168
|
-
)
|
|
169
|
-
|
|
170
|
-
function PinnedRow({
|
|
171
|
-
position,
|
|
172
|
-
row,
|
|
173
|
-
}: {
|
|
174
|
-
position: 'top' | 'bottom'
|
|
175
|
-
row: Row<any>
|
|
176
|
-
}) {
|
|
161
|
+
// Row pinning
|
|
162
|
+
function PinnedRow({ row, position }: { row: Row<any>; position: 'top' | 'bottom' }) {
|
|
177
163
|
const customRowStyle = getRowStyle(rowStyling, row);
|
|
178
164
|
const bottomRowsCount = table.getBottomRows().length;
|
|
179
|
-
const groupSeparatorInsetEm = groupSeparatorInsets.get(row.id)
|
|
180
|
-
const showGroupSeparator = groupSeparatorInsetEm !== undefined
|
|
181
165
|
|
|
182
166
|
return (
|
|
183
167
|
<tr
|
|
184
168
|
className={classnames('pinned-row', {
|
|
185
|
-
'group-separator-row': showGroupSeparator,
|
|
186
169
|
'pinned-row-bottom': position === 'bottom',
|
|
187
170
|
})}
|
|
188
171
|
style={{
|
|
@@ -199,9 +182,6 @@ export const RegularTableView = ({
|
|
|
199
182
|
: undefined,
|
|
200
183
|
zIndex: '3',
|
|
201
184
|
fontWeight: getFontWeight(customRowStyle),
|
|
202
|
-
...(showGroupSeparator && {
|
|
203
|
-
["--group-separator-inset" as string]: `${groupSeparatorInsetEm}em`,
|
|
204
|
-
}),
|
|
205
185
|
}}
|
|
206
186
|
>
|
|
207
187
|
<TableCellRenderer
|
|
@@ -218,13 +198,11 @@ export const RegularTableView = ({
|
|
|
218
198
|
)
|
|
219
199
|
}
|
|
220
200
|
|
|
221
|
-
const totalRows = pinnedRows ? table.getCenterRows() :
|
|
222
|
-
const topRows = pinnedRows ? table.getTopRows() : []
|
|
223
|
-
const bottomRows = pinnedRows ? table.getBottomRows() : []
|
|
201
|
+
const totalRows = pinnedRows ? table.getCenterRows() : table.getRowModel().rows
|
|
224
202
|
|
|
225
203
|
return (
|
|
226
204
|
<>
|
|
227
|
-
{
|
|
205
|
+
{pinnedRows && table.getTopRows().map((row: Row<GenericObject>) => (
|
|
228
206
|
<PinnedRow key={row.id}
|
|
229
207
|
position="top"
|
|
230
208
|
row={row}
|
|
@@ -241,8 +219,6 @@ export const RegularTableView = ({
|
|
|
241
219
|
// Use functions from RowUtils for consistent cell coloring
|
|
242
220
|
const rowColor = getRowColorClass(row, inlineRowLoading || false);
|
|
243
221
|
const isDataLoading = shouldShowLoadingIndicator(row, inlineRowLoading || false, columnDefinitions[0]?.cellAccessors?.length || 0);
|
|
244
|
-
const groupSeparatorInsetEm = groupSeparatorInsets.get(row.id)
|
|
245
|
-
const showGroupSeparator = groupSeparatorInsetEm !== undefined
|
|
246
222
|
|
|
247
223
|
return (
|
|
248
224
|
<React.Fragment key={`${row.index}-${row.id}-${row.depth}-row`}>
|
|
@@ -258,20 +234,13 @@ export const RegularTableView = ({
|
|
|
258
234
|
)}
|
|
259
235
|
|
|
260
236
|
<tr
|
|
261
|
-
className={
|
|
262
|
-
rowColor,
|
|
263
|
-
row.depth > 0 && `depth-sub-row-${row.depth}`,
|
|
264
|
-
showGroupSeparator && "group-separator-row"
|
|
265
|
-
)}
|
|
237
|
+
className={`${rowColor} ${row.depth > 0 ? `depth-sub-row-${row.depth}` : ""}`}
|
|
266
238
|
id={`${row.index}-${row.id}-${row.depth}-row`}
|
|
267
239
|
ref={isFirstRegularRow ? sampleRowRef : null}
|
|
268
240
|
style={{
|
|
269
241
|
backgroundColor: customRowStyle?.backgroundColor,
|
|
270
242
|
color: customRowStyle?.fontColor,
|
|
271
243
|
fontWeight: getFontWeight(customRowStyle),
|
|
272
|
-
...(showGroupSeparator && {
|
|
273
|
-
["--group-separator-inset" as string]: `${groupSeparatorInsetEm}em`,
|
|
274
|
-
}),
|
|
275
244
|
}}
|
|
276
245
|
>
|
|
277
246
|
{/* Render custom checkbox column when we want selectableRows for non-expanding tables */}
|
|
@@ -311,7 +280,7 @@ export const RegularTableView = ({
|
|
|
311
280
|
</React.Fragment>
|
|
312
281
|
);
|
|
313
282
|
})}
|
|
314
|
-
{
|
|
283
|
+
{pinnedRows && table.getBottomRows().map((row: Row<GenericObject>) => (
|
|
315
284
|
<PinnedRow key={row.id}
|
|
316
285
|
position="bottom"
|
|
317
286
|
row={row}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useContext,
|
|
1
|
+
import React, { useContext, useLayoutEffect, useState, useEffect, useRef } from "react"
|
|
2
2
|
import classnames from "classnames"
|
|
3
3
|
import { flexRender, Cell, Row } from "@tanstack/react-table"
|
|
4
4
|
import { VirtualItem } from "@tanstack/react-virtual"
|
|
@@ -7,7 +7,7 @@ import { GenericObject } from "../../types"
|
|
|
7
7
|
|
|
8
8
|
import { isChrome } from "../Utilities/BrowserCheck"
|
|
9
9
|
import { getVirtualizedRowStyle } from "../Utilities/TableContainerStyles"
|
|
10
|
-
import {
|
|
10
|
+
import { getRowColorClass } from "../Utilities/RowUtils"
|
|
11
11
|
|
|
12
12
|
import LoadingInline from "../../pb_loading_inline/_loading_inline"
|
|
13
13
|
import Checkbox from "../../pb_checkbox/_checkbox"
|
|
@@ -34,7 +34,6 @@ export const VirtualizedTableView = ({
|
|
|
34
34
|
}: VirtualizedTableViewProps) => {
|
|
35
35
|
const {
|
|
36
36
|
enableToggleExpansion,
|
|
37
|
-
groupSeparators,
|
|
38
37
|
handleExpandOrCollapse,
|
|
39
38
|
inlineRowLoading,
|
|
40
39
|
loading,
|
|
@@ -120,13 +119,6 @@ export const VirtualizedTableView = ({
|
|
|
120
119
|
};
|
|
121
120
|
}, [table, selectableRows, hasAnySubRows]);
|
|
122
121
|
|
|
123
|
-
// Memoize against scroll-driven re-renders; only rebuild when the row model changes.
|
|
124
|
-
const rowModelRows = table.getRowModel().rows
|
|
125
|
-
const groupSeparatorInsets = useMemo(
|
|
126
|
-
() => (groupSeparators ? buildGroupSeparatorInsets(rowModelRows) : new Map<string, number>()),
|
|
127
|
-
[groupSeparators, rowModelRows]
|
|
128
|
-
)
|
|
129
|
-
|
|
130
122
|
// Safety check
|
|
131
123
|
if (!virtualizer || !flattenedItems) {
|
|
132
124
|
return (
|
|
@@ -188,17 +180,10 @@ export const VirtualizedTableView = ({
|
|
|
188
180
|
|
|
189
181
|
// Use the utility function to get consistent row color
|
|
190
182
|
const rowColor = getRowColorClass(row, inlineRowLoading || false);
|
|
191
|
-
const groupSeparatorInsetEm = groupSeparatorInsets.get(row.id)
|
|
192
|
-
const showGroupSeparator = groupSeparatorInsetEm !== undefined
|
|
193
183
|
|
|
194
184
|
return (
|
|
195
185
|
<tr
|
|
196
|
-
className={
|
|
197
|
-
"virtualized-table-row",
|
|
198
|
-
rowColor,
|
|
199
|
-
row.depth > 0 && `depth-sub-row-${row.depth}`,
|
|
200
|
-
showGroupSeparator && "group-separator-row"
|
|
201
|
-
)}
|
|
186
|
+
className={`virtualized-table-row ${rowColor} ${row.depth > 0 ? `depth-sub-row-${row.depth}` : ""}`}
|
|
202
187
|
data-index={virtualRow.index}
|
|
203
188
|
key={`row-${item.id}-sort-${sortingState}`}
|
|
204
189
|
ref={(node) => {
|
|
@@ -210,12 +195,7 @@ export const VirtualizedTableView = ({
|
|
|
210
195
|
}
|
|
211
196
|
}
|
|
212
197
|
}}
|
|
213
|
-
style={
|
|
214
|
-
...virtualItemStyle,
|
|
215
|
-
...(showGroupSeparator && {
|
|
216
|
-
["--group-separator-inset" as string]: `${groupSeparatorInsetEm}em`,
|
|
217
|
-
}),
|
|
218
|
-
}}
|
|
198
|
+
style={virtualItemStyle}
|
|
219
199
|
>
|
|
220
200
|
{/* Render custom checkbox column when we want selectableRows for non-expanding tables */}
|
|
221
201
|
{selectableRows && !hasAnySubRows && (
|
|
@@ -53,35 +53,6 @@ export const getFontWeight = (rowStyle?: GenericObject) => {
|
|
|
53
53
|
if (rowStyle?.fontWeight === "regular") return 400
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
// Matches the `left` of the nth collapsible-trail (see CollapsibleTrail.tsx).
|
|
57
|
-
const getCollapsibleTrailLeftEm = (trailIndex: number): number =>
|
|
58
|
-
trailIndex * 1.0 + (trailIndex > 1 ? (trailIndex - 1) * 0.25 : 0)
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* One O(n) pass over the full visible row model → Map of row id to its
|
|
62
|
-
* `--group-separator-inset` (em). Call once (and memoize) for the whole table —
|
|
63
|
-
* do not rebuild per pinned section, or a pinned non-last sibling can look like
|
|
64
|
-
* a last sibling and invent a second separator.
|
|
65
|
-
*
|
|
66
|
-
* A row closes every group between its depth and the next visible row's depth
|
|
67
|
-
* (so expanded parents defer to their last visible descendant, and sort/filter
|
|
68
|
-
* is respected). One stroke is drawn, inset to the outermost closed group:
|
|
69
|
-
* year-level → 0 / full-bleed, otherwise that group's collapsible-trail.
|
|
70
|
-
*/
|
|
71
|
-
export const buildGroupSeparatorInsets = (
|
|
72
|
-
visibleRows: Row<GenericObject>[]
|
|
73
|
-
): Map<string, number> => {
|
|
74
|
-
const insets = new Map<string, number>()
|
|
75
|
-
|
|
76
|
-
visibleRows.forEach((row, index) => {
|
|
77
|
-
if (row.depth === 0) return
|
|
78
|
-
const nextDepth = visibleRows[index + 1]?.depth ?? 0
|
|
79
|
-
if (nextDepth >= row.depth) return
|
|
80
|
-
insets.set(row.id, nextDepth === 0 ? 0 : getCollapsibleTrailLeftEm(nextDepth + 1))
|
|
81
|
-
})
|
|
82
|
-
return insets
|
|
83
|
-
}
|
|
84
|
-
|
|
85
56
|
/**
|
|
86
57
|
* Creates a virtual item style object for virtualized rows
|
|
87
58
|
*/
|
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
|
|
16
16
|
// Base vertical border color variable setup
|
|
17
17
|
--column-border-color: #{$border_light};
|
|
18
|
-
--group-separator-color: #{$input_border_default};
|
|
19
|
-
--group-separator-row-border-color: #{$border_light};
|
|
20
18
|
|
|
21
19
|
// Define color tokens once
|
|
22
20
|
$border_color_options: (
|
|
@@ -526,48 +524,6 @@
|
|
|
526
524
|
border-bottom-color: $border_light !important;
|
|
527
525
|
}
|
|
528
526
|
|
|
529
|
-
// 2px group separator on last sibling of each nested group. It replaces the
|
|
530
|
-
// default border-bottom: the border goes transparent and the stroke paints
|
|
531
|
-
// over its spot, with a 1px default line underneath for any part left of
|
|
532
|
-
// --group-separator-inset (0 = year-level full-bleed). Rails:
|
|
533
|
-
// .group-separator-expanded defers to the leaf.
|
|
534
|
-
tr.group-separator-row:not(.group-separator-expanded) {
|
|
535
|
-
> td,
|
|
536
|
-
> .pb_table_td {
|
|
537
|
-
border-bottom-color: transparent !important;
|
|
538
|
-
background-image:
|
|
539
|
-
linear-gradient(var(--group-separator-color), var(--group-separator-color)),
|
|
540
|
-
linear-gradient(var(--group-separator-row-border-color), var(--group-separator-row-border-color));
|
|
541
|
-
// Padding-box origin so the inset matches the trails' `left` (a first-cell
|
|
542
|
-
// border-left would otherwise shift the stroke 1px past its trail); the
|
|
543
|
-
// +1px pushes both layers down over the 1px bottom border.
|
|
544
|
-
background-origin: padding-box;
|
|
545
|
-
background-position: 0 calc(100% + 1px), 0 calc(100% + 1px);
|
|
546
|
-
background-repeat: no-repeat;
|
|
547
|
-
background-size: 100% 2px, 100% 1px;
|
|
548
|
-
// Table hover sets `transition: all` on cells, which slides the stroke in
|
|
549
|
-
// from the top when a row becomes a separator. Keep only the hover border fade.
|
|
550
|
-
transition-property: border-color !important;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
> td:first-child:not(.checkbox-cell),
|
|
554
|
-
> .pb_table_td:first-child:not(.checkbox-cell),
|
|
555
|
-
> td.checkbox-cell + td,
|
|
556
|
-
> td.checkbox-cell + .pb_table_td {
|
|
557
|
-
background-position: var(--group-separator-inset, 0em) calc(100% + 1px), 0 calc(100% + 1px);
|
|
558
|
-
background-size: calc(100% - var(--group-separator-inset, 0em)) 2px, 100% 1px;
|
|
559
|
-
|
|
560
|
-
// Trails left of the inset belong to groups that stay open, so they run
|
|
561
|
-
// through; trails at or past it stop on top of the stroke, which rises
|
|
562
|
-
// 1px above the (now transparent) border (0 or 1px).
|
|
563
|
-
// Avoid `* 1000` inside this clamp: dart-sass strips the calc() and leaves
|
|
564
|
-
// `(var() - var()) * 1000`, which SassC rejects when nitro recompiles playbook.css.
|
|
565
|
-
.collapsible-trail {
|
|
566
|
-
bottom: clamp(0px, calc(var(--collapsible-trail-left, 0em) - var(--group-separator-inset, 0em) + 1px), 1px);
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
|
|
571
527
|
// Apply border colors when columnGroupBorderColor is set
|
|
572
528
|
&[class*="column-group-border-"] {
|
|
573
529
|
// For top-level column groups
|
|
@@ -833,8 +789,6 @@
|
|
|
833
789
|
&.dark {
|
|
834
790
|
// Override default border color for dark mode
|
|
835
791
|
--column-border-color: #{$border_dark};
|
|
836
|
-
--group-separator-color: #{$input_border_default_dark};
|
|
837
|
-
--group-separator-row-border-color: #{$border_dark};
|
|
838
792
|
|
|
839
793
|
// Dark mode default border colors for trails and horizontal borders
|
|
840
794
|
.collapsible-trail {
|
|
@@ -846,26 +800,6 @@
|
|
|
846
800
|
border-bottom-color: $border_dark !important;
|
|
847
801
|
}
|
|
848
802
|
|
|
849
|
-
// table-dark sets `border-color: … !important` (rest + hover), and
|
|
850
|
-
// column-group-border sets `.toggle-content td { border-bottom: … !important }`.
|
|
851
|
-
// Those beat the shared separator rule, so the opaque border paints over the
|
|
852
|
-
// 2px stroke. Reassert transparent bottom with higher specificity.
|
|
853
|
-
.pb_table.dark,
|
|
854
|
-
.pb_table.table-dark {
|
|
855
|
-
tbody > tr.group-separator-row:not(.group-separator-expanded),
|
|
856
|
-
.pb_table_tbody > .pb_table_tr.group-separator-row:not(.group-separator-expanded) {
|
|
857
|
-
> td,
|
|
858
|
-
> .pb_table_td {
|
|
859
|
-
border-bottom-color: transparent !important;
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
&:hover > td,
|
|
863
|
-
&:hover > .pb_table_td {
|
|
864
|
-
border-bottom-color: transparent !important;
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
|
|
869
803
|
.pb-bg-row-white {
|
|
870
804
|
background: $bg_dark_card;
|
|
871
805
|
}
|
|
@@ -874,22 +808,21 @@
|
|
|
874
808
|
background: $bg_dark;
|
|
875
809
|
}
|
|
876
810
|
|
|
877
|
-
// Dark mode virtualized rows
|
|
878
|
-
// shorthand) so group-separator background-image is not cleared.
|
|
811
|
+
// Dark mode virtualized rows
|
|
879
812
|
.virtualized-table-row {
|
|
880
813
|
&.pb-bg-row-white {
|
|
881
|
-
background
|
|
814
|
+
background: $bg_dark_card !important;
|
|
882
815
|
|
|
883
816
|
td:first-child {
|
|
884
|
-
background
|
|
817
|
+
background: $bg_dark_card !important;
|
|
885
818
|
}
|
|
886
819
|
}
|
|
887
820
|
|
|
888
821
|
&.bg-silver {
|
|
889
|
-
background
|
|
822
|
+
background: $bg_dark;
|
|
890
823
|
|
|
891
824
|
td:first-child {
|
|
892
|
-
background
|
|
825
|
+
background: $bg_dark;
|
|
893
826
|
}
|
|
894
827
|
}
|
|
895
828
|
}
|
|
@@ -37,7 +37,6 @@ type AdvancedTableProps = {
|
|
|
37
37
|
expandByDepth?: GenericObject[]
|
|
38
38
|
onExpandByDepthClick?: (arg: number, arg1: any) => void
|
|
39
39
|
fullWidthCell?: boolean
|
|
40
|
-
groupSeparators?: boolean
|
|
41
40
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
|
42
41
|
id?: string
|
|
43
42
|
initialLoadingRowsCount?: number
|
|
@@ -101,7 +100,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
101
100
|
expandByDepth,
|
|
102
101
|
onExpandByDepthClick,
|
|
103
102
|
fullWidthCell = false,
|
|
104
|
-
groupSeparators = false,
|
|
105
103
|
htmlOptions = {},
|
|
106
104
|
id,
|
|
107
105
|
initialLoadingRowsCount = 10,
|
|
@@ -328,7 +326,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
328
326
|
expandByDepth={expandByDepth}
|
|
329
327
|
expanded={expanded}
|
|
330
328
|
expandedControl={expandedControl}
|
|
331
|
-
groupSeparators={groupSeparators}
|
|
332
329
|
handleExpandOrCollapse={handleExpandOrCollapse}
|
|
333
330
|
hasAnySubRows={hasAnySubRows}
|
|
334
331
|
inlineRowLoading={inlineRowLoading}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<% content.presence %>
|
|
13
13
|
<% else %>
|
|
14
14
|
<%= pb_rails("advanced_table/table_header", props: { table_id: object.id, column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, show_actions_bar: object.show_actions_bar, inline_row_loading: object.inline_row_loading, persist_toggle_expansion_button: object.persist_toggle_expansion_button, table_data: object.table_data }) %>
|
|
15
|
-
<%= pb_rails("advanced_table/table_body", props: { table_id: object.id, table_data: object.table_data, column_definitions: object.column_definitions, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, enable_toggle_expansion: object.enable_toggle_expansion, row_styling: object.row_styling, inline_row_loading: object.inline_row_loading, full_width_cell: object.full_width_cell,
|
|
15
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: object.id, table_data: object.table_data, column_definitions: object.column_definitions, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, enable_toggle_expansion: object.enable_toggle_expansion, row_styling: object.row_styling, inline_row_loading: object.inline_row_loading, full_width_cell: object.full_width_cell, pinned_rows: object.pinned_rows }) %>
|
|
16
16
|
<% end %>
|
|
17
17
|
<% end %>
|
|
18
18
|
<% end %>
|
|
@@ -37,19 +37,11 @@ module Playbook
|
|
|
37
37
|
default: false
|
|
38
38
|
prop :full_width_cell, type: Playbook::Props::Boolean,
|
|
39
39
|
default: false
|
|
40
|
-
prop :group_separators, type: Playbook::Props::Boolean,
|
|
41
|
-
default: false
|
|
42
40
|
prop :persist_toggle_expansion_button, type: Playbook::Props::Boolean,
|
|
43
41
|
default: false
|
|
44
42
|
prop :pinned_rows, type: Playbook::Props::HashProp,
|
|
45
43
|
default: {}
|
|
46
44
|
|
|
47
|
-
# Marker for Rails JS: only toggle group-separator-expanded when this is set.
|
|
48
|
-
# Use merge (not tap/mutate) so we don't write onto the shared default {} or a caller-owned data hash.
|
|
49
|
-
def data
|
|
50
|
-
Hash(prop(:data)).merge(group_separators ? { group_separators: true } : {})
|
|
51
|
-
end
|
|
52
|
-
|
|
53
45
|
def classname
|
|
54
46
|
additional_classes = [
|
|
55
47
|
responsive_classname,
|