playbook_ui_docs 16.9.0.pre.alpha.playgroundsmore17219 → 16.9.0.pre.alpha.touchdragmulticontainers17268

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7628ce4f621fc87039b362062a83883d9c3bdf76c2db5623478a97bb88bc3a2
4
- data.tar.gz: 96cd08c752b7c8553a7c494b6c73bd182472eaf227f703ce79e9e07e3da4f05e
3
+ metadata.gz: e2c32f971081626554bec6d9f40a909665aa951c104366ff197cf1fd0df49f93
4
+ data.tar.gz: b1f8a7023fe018eff0b3e5fb37809fe1d5aa5e982fb9c51adede24a189d98f72
5
5
  SHA512:
6
- metadata.gz: b3699b83e14edcf2b743b2d527124d744811cb6d6f55a89bcb1538ca73e38705fd22a3394eb208881c4edd929bbd8ee1ab5a9ee322d00144c8cf88d0f5a7600d
7
- data.tar.gz: a0ad05f12115696be6dae32c355dc4961962e137753a7400b81acd54a33ce5fcde7f476545d31f40ebcb1288374d79c4b7ad7fe0aee91c690c3ee83d43fa4e38
6
+ metadata.gz: 8520420a311da432758df9ce8078b71c23305564b4473e3606a0c4b2bd0d4ea3dcb02334ad96c5e04ecd8e39f5c8e5c617c40e565987bf7a68120d1457c36fdd
7
+ data.tar.gz: 5cb487bb21001a5cc580d95a046fd98e46d1ff4136ef6c62cadca4552f5c4b5773ca4bdad2d83d40a28a0b7681e8447d768d3d83cb9bde5b592d9903d0cc8c50
@@ -1,6 +1,6 @@
1
1
  import React from "react"
2
2
  import AdvancedTable from '../_advanced_table'
3
- import MOCK_DATA from "./advanced_table_mock_data_with_id.json"
3
+ import MOCK_DATA_WITH_ID from "./advanced_table_mock_data_with_id.json"
4
4
  import colors from '../../tokens/exports/_colors.module.scss'
5
5
 
6
6
 
@@ -55,7 +55,7 @@ const rowStyling = [
55
55
  <AdvancedTable
56
56
  columnDefinitions={columnDefinitions}
57
57
  rowStyling={rowStyling}
58
- tableData={MOCK_DATA}
58
+ tableData={MOCK_DATA_WITH_ID}
59
59
  {...props}
60
60
  />
61
61
  </div>
@@ -1,47 +1,39 @@
1
1
  <% column_definitions = [
2
- {
3
- accessor: "year",
4
- label: "Year",
5
- },
6
- {
7
- accessor: "newEnrollments",
8
- label: "New Enrollments",
9
- },
10
- {
11
- accessor: "scheduledMeetings",
12
- label: "Scheduled Meetings",
13
- },
14
- {
15
- accessor: "attendanceRate",
16
- label: "Attendance Rate",
17
- },
18
- {
19
- accessor: "completedClasses",
20
- label: "Completed Classes",
21
- },
22
- {
23
- accessor: "classCompletionRate",
24
- label: "Class Completion Rate",
25
- },
26
- {
27
- accessor: "graduatedStudents",
28
- label: "Graduated Students",
29
- }
30
- ] %>
31
-
32
- <% table_data = 15.times.map do |index|
33
2
  {
34
- year: (2020 + index).to_s,
35
- id: (2020 + index).to_s,
36
- newEnrollments: (20 + index).to_s,
37
- scheduledMeetings: (10 + index).to_s,
38
- attendanceRate: "#{50 + index}%",
39
- completedClasses: (3 + index).to_s,
40
- classCompletionRate: "#{30 + index}%",
41
- graduatedStudents: (19 + index).to_s,
42
- }
43
- end %>
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ accessor: "newEnrollments",
9
+ label: "New Enrollments",
10
+ },
11
+ {
12
+ accessor: "scheduledMeetings",
13
+ label: "Scheduled Meetings",
14
+ },
15
+ {
16
+ accessor: "attendanceRate",
17
+ label: "Attendance Rate",
18
+ },
19
+ {
20
+ accessor: "completedClasses",
21
+ label: "Completed Classes",
22
+ },
23
+ {
24
+ accessor: "classCompletionRate",
25
+ label: "Class Completion Rate",
26
+ },
27
+ {
28
+ accessor: "graduatedStudents",
29
+ label: "Graduated Students",
30
+ },
31
+ ] %>
44
32
 
45
- <div style="max-height: 320px; overflow-y: auto;">
46
- <%= pb_rails("advanced_table", props: { id: "table_props_sticky_table", table_data: table_data, column_definitions: column_definitions, table_props: { sticky: true }}) %>
47
- </div>
33
+ <%= pb_rails("advanced_table", props: {
34
+ id: "table_props_sticky_table",
35
+ table_data: @table_data,
36
+ column_definitions: column_definitions,
37
+ max_height: "xs",
38
+ table_props: { sticky: true },
39
+ }) %>
@@ -1,21 +1,13 @@
1
1
  import React from "react"
2
2
  import AdvancedTable from '../../pb_advanced_table/_advanced_table'
3
-
4
- const tableData = Array.from({ length: 15 }, (_, index) => ({
5
- year: String(2020 + index),
6
- newEnrollments: String(20 + index),
7
- scheduledMeetings: String(10 + index),
8
- attendanceRate: `${50 + index}%`,
9
- completedClasses: String(3 + index),
10
- classCompletionRate: `${30 + index}%`,
11
- graduatedStudents: String(19 + index),
12
- }))
3
+ import MOCK_DATA from "./advanced_table_mock_data.json"
13
4
 
14
5
  const AdvancedTableTablePropsStickyHeader = (props) => {
15
6
  const columnDefinitions = [
16
7
  {
17
8
  accessor: "year",
18
9
  label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
19
11
  },
20
12
  {
21
13
  accessor: "newEnrollments",
@@ -44,18 +36,17 @@ const AdvancedTableTablePropsStickyHeader = (props) => {
44
36
  ]
45
37
 
46
38
  const tableProps = {
47
- sticky: true
39
+ sticky: true,
48
40
  }
49
41
 
50
42
  return (
51
- <div style={{ maxHeight: "320px", overflowY: "auto" }}>
52
- <AdvancedTable
53
- columnDefinitions={columnDefinitions}
54
- tableData={tableData}
55
- tableProps={tableProps}
56
- {...props}
57
- />
58
- </div>
43
+ <AdvancedTable
44
+ columnDefinitions={columnDefinitions}
45
+ maxHeight="xs"
46
+ tableData={MOCK_DATA}
47
+ tableProps={tableProps}
48
+ {...props}
49
+ />
59
50
  )
60
51
  }
61
52
 
@@ -2,10 +2,6 @@ Create a sticky header that works for responsive Advanced Tables by setting `sti
2
2
 
3
3
  **NOTE**: This behavior requires a `max_height` to work. The header is sticky within the table container, allowing for it to work along with the first column stickiness of a responsive table on smaller screen sizes.
4
4
 
5
- Scroll inside the table preview to see the header stick.
6
-
7
- This example builds flat table data inline for the docs preview. For typical `table_data` setup, see [Default (Required Props)](/kits/advanced_table/default/rails#advanced_table_beta).
8
-
9
5
  Expand the table above to see this in action.
10
6
 
11
7
  A sticky header on a nonresponsive table is demonstrated in the ["Sticky Header"](https://playbook.powerapp.cloud/kits/advanced_table#sticky-header) doc example above.
@@ -1,9 +1,7 @@
1
- Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `tableProps` and wrapping the table in a scroll container (or using `maxHeight`).
1
+ Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `tableProps` and giving the AdvancedTable a `maxHeight` using our [Max Height](https://playbook.powerapp.cloud/global_props/max_height) global prop.
2
2
 
3
- **NOTE**: The header is sticky within the table scroll area. The live example uses flat rows so you can scroll inside the preview without expanding subrows.
3
+ **NOTE**: This behavior requires a `maxHeight` to work. The header is sticky within the table container, allowing for it to work along with the first column stickiness of a responsive table on smaller screen sizes.
4
4
 
5
- This example builds flat table data inline for the docs preview. For typical `tableData` setup, see [Default (Required Props)](/kits/advanced_table/default/react#advanced_table_default).
6
-
7
- Expand the table above to see responsive behavior in action.
5
+ Expand the table above to see this in action.
8
6
 
9
7
  A sticky header on a nonresponsive table is demonstrated in the ["Sticky Header"](https://playbook.powerapp.cloud/kits/advanced_table/react#sticky-header) doc example above.
@@ -0,0 +1,35 @@
1
+ <% lists = [
2
+ {
3
+ title: "Morning Crew",
4
+ items: [
5
+ { id: "m1", name: "Alice Chen" },
6
+ { id: "m2", name: "Ben Ortiz" },
7
+ { id: "m3", name: "Cara Kim" },
8
+ ],
9
+ },
10
+ {
11
+ title: "Afternoon Crew",
12
+ items: [
13
+ { id: "a1", name: "Diana Patel" },
14
+ { id: "a2", name: "Evan Brooks" },
15
+ { id: "a3", name: "Fiona Lee" },
16
+ ],
17
+ },
18
+ ] %>
19
+
20
+ <%= pb_rails("flex", props: { gap: "md", justify_content: "center", wrap: true }) do %>
21
+ <% lists.each do |list| %>
22
+ <%= pb_rails("flex/flex_item", props: { fixed_size: "220px" }) do %>
23
+ <%= pb_rails("caption", props: { text: list[:title], text_align: "center", margin_bottom: "xs" }) %>
24
+ <%= pb_rails("draggable", props: { initial_items: list[:items] }) do %>
25
+ <%= pb_rails("draggable/draggable_container", props: { padding: "sm" }) do %>
26
+ <% list[:items].each do |item| %>
27
+ <%= pb_rails("draggable/draggable_item", props: { drag_id: item[:id], margin_bottom: "xs" }) do %>
28
+ <%= pb_rails("body", props: { text: item[:name] }) %>
29
+ <% end %>
30
+ <% end %>
31
+ <% end %>
32
+ <% end %>
33
+ <% end %>
34
+ <% end %>
35
+ <% end %>
@@ -0,0 +1,81 @@
1
+ import React, { useState } from "react";
2
+
3
+ import Body from "../../pb_body/_body";
4
+ import Caption from "../../pb_caption/_caption";
5
+ import Draggable from "../../pb_draggable/_draggable";
6
+ import { DraggableProvider } from "../../pb_draggable/context";
7
+ import Flex from "../../pb_flex/_flex";
8
+ import FlexItem from "../../pb_flex/_flex_item";
9
+
10
+ const lists = [
11
+ {
12
+ title: "Morning Crew",
13
+ items: [
14
+ { id: "m1", name: "Alice Chen" },
15
+ { id: "m2", name: "Ben Ortiz" },
16
+ { id: "m3", name: "Cara Kim" },
17
+ ],
18
+ },
19
+ {
20
+ title: "Afternoon Crew",
21
+ items: [
22
+ { id: "a1", name: "Diana Patel" },
23
+ { id: "a2", name: "Evan Brooks" },
24
+ { id: "a3", name: "Fiona Lee" },
25
+ ],
26
+ },
27
+ ];
28
+
29
+ const initialListItems = lists.reduce((acc, list) => {
30
+ acc[list.title] = list.items;
31
+ return acc;
32
+ }, {});
33
+
34
+ const DraggableIndependentContainers = (props) => {
35
+ const [listItems, setListItems] = useState(initialListItems);
36
+
37
+ const handleReorder = (title, items) => {
38
+ setListItems((currentItems) => ({ ...currentItems, [title]: items }));
39
+ };
40
+
41
+ return (
42
+ <Flex gap="md"
43
+ justifyContent="center"
44
+ wrap
45
+ {...props}
46
+ >
47
+ {lists.map((list) => (
48
+ <FlexItem fixedSize="220px"
49
+ key={list.title}
50
+ >
51
+ <Caption marginBottom="xs"
52
+ text={list.title}
53
+ textAlign="center"
54
+ {...props}
55
+ />
56
+ <DraggableProvider
57
+ initialItems={listItems[list.title]}
58
+ onReorder={(items) => handleReorder(list.title, items)}
59
+ >
60
+ <Draggable.Container padding="sm"
61
+ {...props}
62
+ >
63
+ {listItems[list.title].map(({ id, name }) => (
64
+ <Draggable.Item dragId={id}
65
+ key={id}
66
+ marginBottom="xs"
67
+ >
68
+ <Body text={name}
69
+ {...props}
70
+ />
71
+ </Draggable.Item>
72
+ ))}
73
+ </Draggable.Container>
74
+ </DraggableProvider>
75
+ </FlexItem>
76
+ ))}
77
+ </Flex>
78
+ );
79
+ };
80
+
81
+ export default DraggableIndependentContainers;
@@ -0,0 +1,8 @@
1
+ Use a **separate** `draggable` kit for each list when items should reorder within their own column only.
2
+
3
+ Each instance creates its own drag boundary. Items stay inside that list on desktop and touch — they cannot be dropped into a neighboring list.
4
+
5
+ This is different from [Dragging Across Multiple Containers](#draggable_multiple_containers), which uses **one** `draggable` wrapping multiple `draggable/draggable_container` kits so items can move between columns.
6
+
7
+ On touch devices, drag from the grip handle. Swiping outside the handle scrolls as usual.
8
+
@@ -0,0 +1,8 @@
1
+ Use a **separate** `DraggableProvider` for each list when items should reorder within their own column only.
2
+
3
+ Each provider creates its own drag boundary. Items stay inside that list on desktop and touch — they cannot be dropped into a neighboring list.
4
+
5
+ This is different from [Dragging Across Multiple Containers](#draggable_multiple_containers), which uses **one** `DraggableProvider` with multiple `Draggable.Container` components so items can move between columns.
6
+
7
+ On touch devices, drag from the grip handle. Swiping outside the handle scrolls as usual.
8
+
@@ -1 +1,3 @@
1
- The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure.
1
+ The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure — **one** `draggable` wrapping multiple `draggable/draggable_container` kits so items can move between columns.
2
+
3
+ For lists that should stay separate, see [Independent Draggable Containers](#draggable_independent_containers).
@@ -1 +1,3 @@
1
- The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure.
1
+ The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure — **one** `DraggableProvider` with multiple `Draggable.Container` components so items can move between columns.
2
+
3
+ For lists that should stay separate, see [Independent Draggable Containers](#draggable_independent_containers).
@@ -4,6 +4,7 @@ examples:
4
4
  - draggable_with_list: Draggable with List Kit
5
5
  - draggable_with_selectable_list: Draggable with SelectableList Kit
6
6
  - draggable_with_cards: Draggable with Cards
7
+ - draggable_independent_containers: Independent Draggable Containers
7
8
  - draggable_with_table: Draggable with Table
8
9
  - draggable_drop_zones: Draggable Drop Zones
9
10
  - draggable_drop_zones_colors: Draggable Drop Zones Colors
@@ -17,6 +18,7 @@ examples:
17
18
  - draggable_with_list: Draggable with List Kit
18
19
  - draggable_with_selectable_list: Draggable with SelectableList Kit
19
20
  - draggable_with_cards: Draggable with Cards
21
+ - draggable_independent_containers: Independent Draggable Containers
20
22
  - draggable_with_table: Draggable with Table
21
23
  - draggable_drop_zones: Draggable Drop Zones
22
24
  - draggable_drop_zones_colors: Draggable Drop Zones Colors
@@ -1,5 +1,6 @@
1
1
  export { default as DraggableDefault } from './_draggable_default.jsx'
2
2
  export { default as DraggableWithCards } from './_draggable_with_cards.jsx'
3
+ export { default as DraggableIndependentContainers } from './_draggable_independent_containers.jsx'
3
4
  export { default as DraggableWithList } from './_draggable_with_list.jsx'
4
5
  export { default as DraggableWithSelectableList } from './_draggable_with_selectable_list.jsx'
5
6
  export { default as DraggableMultipleContainers } from './_draggable_multiple_containers.jsx'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.9.0.pre.alpha.playgroundsmore17219
4
+ version: 16.9.0.pre.alpha.touchdragmulticontainers17268
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-06-22 00:00:00.000000000 Z
12
+ date: 2026-06-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: playbook_ui
@@ -910,6 +910,10 @@ files:
910
910
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.jsx
911
911
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners_rails.md
912
912
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners_react.md
913
+ - app/pb_kits/playbook/pb_draggable/docs/_draggable_independent_containers.html.erb
914
+ - app/pb_kits/playbook/pb_draggable/docs/_draggable_independent_containers.jsx
915
+ - app/pb_kits/playbook/pb_draggable/docs/_draggable_independent_containers_rails.md
916
+ - app/pb_kits/playbook/pb_draggable/docs/_draggable_independent_containers_react.md
913
917
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.html.erb
914
918
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx
915
919
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.jsx