playbook_ui 15.5.0 → 15.6.0.pre.rc.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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +96 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +156 -6
- data/app/pb_kits/playbook/pb_draggable/context/types.ts +8 -3
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.jsx +180 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.md +22 -0
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +3 -2
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +77 -1
- data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +49 -0
- data/dist/chunks/_typeahead-DUmTKJUc.js +6 -0
- data/dist/chunks/{lib-Dk4GKPut.js → lib-CgpqUb6l.js} +2 -2
- data/dist/chunks/vendor.js +2 -2
- 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 +2 -2
- metadata +6 -5
- data/app/pb_kits/playbook/pb_bar_graph/BarGraphStyles.scss +0 -58
- data/dist/chunks/_typeahead-Bx4QsIEU.js +0 -6
|
@@ -255,4 +255,80 @@ test("line dropZone with horizontal direction applies 'line_horizontal' class to
|
|
|
255
255
|
const container = kit.querySelector(".pb_draggable_container");
|
|
256
256
|
|
|
257
257
|
expect(container).toHaveClass("line_horizontal");
|
|
258
|
-
});
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// Cross-container drag tests
|
|
261
|
+
const multiContainerData = [
|
|
262
|
+
{ id: "1", container: "To Do", text: "Task 1" },
|
|
263
|
+
{ id: "2", container: "To Do", text: "Task 2" },
|
|
264
|
+
{ id: "3", container: "In Progress", text: "Task 3" },
|
|
265
|
+
{ id: "4", container: "Done", text: "Task 4" },
|
|
266
|
+
];
|
|
267
|
+
|
|
268
|
+
const containers = ["To Do", "In Progress", "Done"];
|
|
269
|
+
|
|
270
|
+
const DraggableMultipleContainers = () => {
|
|
271
|
+
const [initialState, setInitialState] = useState(multiContainerData);
|
|
272
|
+
|
|
273
|
+
return (
|
|
274
|
+
<div data-testid={testId}>
|
|
275
|
+
<DraggableProvider
|
|
276
|
+
dropZone={{ type: "outline" }}
|
|
277
|
+
initialItems={multiContainerData}
|
|
278
|
+
onReorder={(items) => setInitialState(items)}
|
|
279
|
+
>
|
|
280
|
+
{containers.map((container) => (
|
|
281
|
+
<Draggable.Container
|
|
282
|
+
container={container}
|
|
283
|
+
data={{testid:`container-${container}`}}
|
|
284
|
+
key={container}
|
|
285
|
+
>
|
|
286
|
+
{initialState
|
|
287
|
+
.filter((item) => item.container === container)
|
|
288
|
+
.map(({ id, text }) => (
|
|
289
|
+
<Draggable.Item
|
|
290
|
+
container={container}
|
|
291
|
+
data-testid={`item-${id}`}
|
|
292
|
+
dragId={id}
|
|
293
|
+
key={id}
|
|
294
|
+
>
|
|
295
|
+
{text}
|
|
296
|
+
</Draggable.Item>
|
|
297
|
+
))}
|
|
298
|
+
</Draggable.Container>
|
|
299
|
+
))}
|
|
300
|
+
</DraggableProvider>
|
|
301
|
+
</div>
|
|
302
|
+
);
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
test("renders multiple containers with correct items", () => {
|
|
306
|
+
render(<DraggableMultipleContainers />);
|
|
307
|
+
|
|
308
|
+
const kit = screen.getByTestId(testId);
|
|
309
|
+
expect(kit).toBeInTheDocument();
|
|
310
|
+
|
|
311
|
+
containers.forEach((container) => {
|
|
312
|
+
const containerEl = kit.querySelector(`[data-testid="container-${container}"]`);
|
|
313
|
+
expect(containerEl).toBeInTheDocument();
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
// Check items are in correct containers
|
|
317
|
+
expect(screen.getByText("Task 1")).toBeInTheDocument();
|
|
318
|
+
expect(screen.getByText("Task 2")).toBeInTheDocument();
|
|
319
|
+
expect(screen.getByText("Task 3")).toBeInTheDocument();
|
|
320
|
+
expect(screen.getByText("Task 4")).toBeInTheDocument();
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
test("items have correct container association", () => {
|
|
324
|
+
const { container } = render(<DraggableMultipleContainers />);
|
|
325
|
+
|
|
326
|
+
// items rendered within their respective containers
|
|
327
|
+
const todoContainer = container.querySelector('[data-testid="container-To Do"]');
|
|
328
|
+
const inProgressContainer = container.querySelector('[data-testid="container-In Progress"]');
|
|
329
|
+
const doneContainer = container.querySelector('[data-testid="container-Done"]');
|
|
330
|
+
|
|
331
|
+
expect(todoContainer.querySelectorAll('.pb_draggable_item')).toHaveLength(2);
|
|
332
|
+
expect(inProgressContainer.querySelectorAll('.pb_draggable_item')).toHaveLength(1);
|
|
333
|
+
expect(doneContainer.querySelectorAll('.pb_draggable_item')).toHaveLength(1);
|
|
334
|
+
})
|
|
@@ -8,6 +8,25 @@
|
|
|
8
8
|
border-right: 1px solid $border_light !important;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
// **Advanced Table** specific rules to eliminate double borders when vertical-border is active
|
|
12
|
+
.pb_advanced_table &,
|
|
13
|
+
&[data-vertical-border="true"] {
|
|
14
|
+
// Remove first column box-shadow (preserve border-right in Chrome and use CSS var to respect column group border colors)
|
|
15
|
+
.table-header-cells:first-child,
|
|
16
|
+
.table-header-cells-custom:first-child,
|
|
17
|
+
td:first-child,
|
|
18
|
+
.pb_table_td:first-child,
|
|
19
|
+
.checkbox-cell.checkbox-cell-header:first-child {
|
|
20
|
+
box-shadow: none !important;
|
|
21
|
+
border-right: 1px solid var(--column-border-color, #{$border_light}) !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.pb_table_td:nth-child(2) {
|
|
25
|
+
box-shadow: none !important;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// --- End Advanced Table First Column Code Section ---
|
|
29
|
+
|
|
11
30
|
@media screen and (min-width: $screen-xs-min) {
|
|
12
31
|
tr:hover, .pb_table_tr:hover {
|
|
13
32
|
td:last-child, .pb_table_td:last-child {
|
|
@@ -63,5 +82,35 @@
|
|
|
63
82
|
}
|
|
64
83
|
}
|
|
65
84
|
}
|
|
85
|
+
|
|
86
|
+
// Dark mode support for advanced tables
|
|
87
|
+
.pb_advanced_table.dark & {
|
|
88
|
+
td, th, .pb_table_td, .pb_table_th {
|
|
89
|
+
border-right: 1px solid $border_dark !important;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
thead tr th {
|
|
93
|
+
border-right: 1px solid $border_dark !important;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&[data-vertical-border="true"] {
|
|
97
|
+
.table-header-cells:first-child,
|
|
98
|
+
.table-header-cells-custom:first-child,
|
|
99
|
+
td:first-child,
|
|
100
|
+
.pb_table_td:first-child,
|
|
101
|
+
.checkbox-cell.checkbox-cell-header:first-child {
|
|
102
|
+
border-right: 1px solid var(--column-border-color, #{$border_dark}) !important;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@media screen and (min-width: $screen-xs-min) {
|
|
107
|
+
tr:hover, .pb_table_tr:hover {
|
|
108
|
+
td:last-child, .pb_table_td:last-child {
|
|
109
|
+
border-right-color: darken($border_dark, 10%) !important;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// --- End Advanced Table Dark Mode Code Section ---
|
|
66
115
|
}
|
|
67
116
|
}
|