playbook_ui 14.13.0.pre.alpha.PBNTR5596084 → 14.13.0.pre.alpha.PLAY1873rails86087

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: a3d8f304390d68b67ec72165d7759d59c5f1f35fd02c1ad803f62fcb04e39058
4
- data.tar.gz: 2e740481d027db9bed21f7cf8a44c4d8bb9c37d1e7a4258132447423e4f9649e
3
+ metadata.gz: e08365da5253269e56718df0229fb325a9904ae790a197f4d9498972990d5e20
4
+ data.tar.gz: 2fd146a0b22bd09f5b4dbe54a16a3b438a7a24bb360f3a476c307645e8b6fc5b
5
5
  SHA512:
6
- metadata.gz: e7a393c56605d3dab94dc839550ad37e2510a04f6fd3cb1fb7dcd111a1e960697872c658cba608dca30cf0830c3ca44dfede96abfb193e7a4352042539133d63
7
- data.tar.gz: 8e2aadc02eabaafbdfc0f380316c1ab0d7e4b606e0034abaa7a39ea136b78bfaf44789bf09f5d86a298edd9f73a31d8638e7df267e180fe34b9e5d8adb6731cf
6
+ metadata.gz: 79d14e319ea738d2959955de82a9eac69637d27eba8efad3549f520b7c9ce95ee4ed704e4e7451f8aca6ffc633cccab31a1306bd03ca8b6127eaceeb3f16a01c
7
+ data.tar.gz: 734cff649221dc31c3a2eb03c73d9bc27df9aa28642bb0e190f41317ef0896fd8b9decc85e2e6587d7c2f7a660e1cefd2f7a151dd4ec4264652e6eb44f610557
@@ -43,9 +43,9 @@
43
43
  <% end %>
44
44
  <% end %>
45
45
 
46
- <%= pb_rails("table/table_body", props: {draggable_container: true}) do %>
46
+ <%= pb_rails("draggable/draggable_container", props: {tag:"tbody"}) do %>
47
47
  <% initial_items.each do |item| %>
48
- <%= pb_rails("table/table_row", props:{drag_id: item[:id], draggable_item: true}) do %>
48
+ <%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id], tag:"tr"}) do %>
49
49
  <%= pb_rails("table/table_cell", props: { text: item[:id]}) %>
50
50
  <%= pb_rails("table/table_cell") do %>
51
51
  <%= pb_rails("flex", props:{align:"center"}) do %>
@@ -1,4 +1 @@
1
- The draggable kit can also be used in conjunction with the table kit to create draggable table rows. To do this:
2
-
3
- - use the `draggable_container` prop on the table/table_body to designate it as the Draggable Container
4
- - use the `draggable_item` prop on the table/table_row to designate it as the Draggable Item. Make sure to also pass id to the `drag_id` prop here.
1
+ The draggable kit can also be used in conjunction with the table kit to create draggable table rows. To do this, make use of the `tag` prop on the draggable_container to set it to 'tbody' and the same prop on the draggable_item to set that to 'tr'. This will create the functionality seen here.
@@ -4,9 +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_with_table_react: Draggable with Table
8
7
  - draggable_multiple_containers: Dragging Across Multiple Containers
9
-
10
8
  rails:
11
9
  - draggable_default_rails: Default
12
10
  - draggable_with_list_rails: Draggable with List Kit
@@ -2,5 +2,4 @@ export { default as DraggableDefault } from './_draggable_default.jsx'
2
2
  export { default as DraggableWithCards } from './_draggable_with_cards.jsx'
3
3
  export { default as DraggableWithList } from './_draggable_with_list.jsx'
4
4
  export { default as DraggableWithSelectableList } from './_draggable_with_selectable_list.jsx'
5
- export { default as DraggableMultipleContainers } from './_draggable_multiple_containers.jsx'
6
- export { default as DraggableWithTableReact } from './_draggable_with_table_react.jsx'
5
+ export { default as DraggableMultipleContainers } from './_draggable_multiple_containers.jsx'
@@ -17,11 +17,10 @@ type DraggableContainerProps = {
17
17
  data?: { [key: string]: string };
18
18
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
19
19
  id?: string;
20
- tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'tr' | 'th' | 'td' | 'thead' | 'col' | 'tbody',
21
20
  };
22
21
 
23
22
  const DraggableContainer = (props: DraggableContainerProps) => {
24
- const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id, tag="div" } = props;
23
+ const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id } = props;
25
24
 
26
25
  const { handleDragOver, handleDrop, activeContainer } = DraggableContext();
27
26
 
@@ -29,8 +28,6 @@ const DraggableContainer = (props: DraggableContainerProps) => {
29
28
  const dataProps = buildDataProps(data);
30
29
  const htmlProps = buildHtmlProps(htmlOptions);
31
30
 
32
- const Tag: React.ReactElement | any = `${tag}`;
33
-
34
31
  const classes = classnames(
35
32
  buildCss("pb_draggable_container"),
36
33
  `${activeContainer === container ? "active" : ""}`,
@@ -39,18 +36,18 @@ const DraggableContainer = (props: DraggableContainerProps) => {
39
36
  );
40
37
 
41
38
  return (
42
- <Tag
39
+ <div
43
40
  {...ariaProps}
44
41
  {...dataProps}
45
42
  {...htmlProps}
46
43
  className={classes}
47
44
  id={id}
48
45
  key={container}
49
- onDragOver={(e: Event) => handleDragOver(e, container)}
46
+ onDragOver={(e) => handleDragOver(e, container)}
50
47
  onDrop={() => handleDrop(container)}
51
48
  >
52
49
  {children}
53
- </Tag>
50
+ </div>
54
51
  );
55
52
  };
56
53
 
@@ -18,11 +18,10 @@ type DraggableItemProps = {
18
18
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
19
19
  id?: string;
20
20
  dragId?: string;
21
- tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'tr' | 'th' | 'td' | 'thead' | 'col' | 'tbody',
22
21
  };
23
22
 
24
23
  const DraggableItem = (props: DraggableItemProps) => {
25
- const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id, dragId, tag="div" } = props;
24
+ const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id, dragId } = props;
26
25
 
27
26
  const { isDragging, handleDragStart, handleDragEnter, handleDragEnd } =
28
27
  DraggableContext();
@@ -31,8 +30,6 @@ const DraggableItem = (props: DraggableItemProps) => {
31
30
  const dataProps = buildDataProps(data);
32
31
  const htmlProps = buildHtmlProps(htmlOptions);
33
32
 
34
- const Tag: React.ReactElement | any = `${tag}`;
35
-
36
33
  const classes = classnames(
37
34
  buildCss("pb_draggable_item"),
38
35
  `${isDragging === dragId ? "is_dragging" : ""}`,
@@ -41,7 +38,7 @@ const DraggableItem = (props: DraggableItemProps) => {
41
38
  );
42
39
 
43
40
  return (
44
- <Tag
41
+ <div
45
42
  {...ariaProps}
46
43
  {...dataProps}
47
44
  {...htmlProps}
@@ -54,7 +51,7 @@ const DraggableItem = (props: DraggableItemProps) => {
54
51
  onDragStart={() => handleDragStart(dragId, container)}
55
52
  >
56
53
  {children}
57
- </Tag>
54
+ </div>
58
55
  );
59
56
  };
60
57
 
@@ -7,14 +7,11 @@ import {
7
7
  } from "../../utilities/props";
8
8
  import { globalProps } from "../../utilities/globalProps";
9
9
 
10
- import Draggable from "../../pb_draggable/_draggable"
11
-
12
10
  type TableBodyPropTypes = {
13
11
  aria?: { [key: string]: string };
14
12
  children: React.ReactNode[] | React.ReactNode;
15
13
  className: string;
16
14
  data?: { [key: string]: string };
17
- draggableContainer?: boolean;
18
15
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
19
16
  id?: string;
20
17
  tag?: "table" | "div";
@@ -26,7 +23,6 @@ const TableBody = (props: TableBodyPropTypes): React.ReactElement => {
26
23
  children,
27
24
  className,
28
25
  data = {},
29
- draggableContainer = false,
30
26
  htmlOptions = {},
31
27
  id,
32
28
  tag = "table",
@@ -41,30 +37,7 @@ const TableBody = (props: TableBodyPropTypes): React.ReactElement => {
41
37
  return (
42
38
  <>
43
39
  {isTableTag ? (
44
- draggableContainer ? (
45
- <Draggable.Container
46
- {...ariaProps}
47
- {...dataProps}
48
- {...htmlProps}
49
- className={classes}
50
- id={id}
51
- tag="tbody"
52
- >
53
- {children}
54
- </Draggable.Container>
55
- ) : (
56
- <tbody
57
- {...ariaProps}
58
- {...dataProps}
59
- {...htmlProps}
60
- className={classes}
61
- id={id}
62
- >
63
- {children}
64
- </tbody>
65
- )
66
- ) : draggableContainer ? (
67
- <Draggable.Container
40
+ <tbody
68
41
  {...ariaProps}
69
42
  {...dataProps}
70
43
  {...htmlProps}
@@ -72,7 +45,7 @@ const TableBody = (props: TableBodyPropTypes): React.ReactElement => {
72
45
  id={id}
73
46
  >
74
47
  {children}
75
- </Draggable.Container>
48
+ </tbody>
76
49
  ) : (
77
50
  <div
78
51
  {...ariaProps}
@@ -9,7 +9,6 @@ import {
9
9
  import { globalProps } from "../../utilities/globalProps";
10
10
  import Collapsible from "../../pb_collapsible/_collapsible";
11
11
  import useCollapsible from "../../pb_collapsible/useCollapsible";
12
- import Draggable from "../../pb_draggable/_draggable";
13
12
 
14
13
  type TableRowPropTypes = {
15
14
  aria?: { [key: string]: string };
@@ -20,8 +19,6 @@ type TableRowPropTypes = {
20
19
  collapsibleSideHighlight?: boolean;
21
20
  data?: { [key: string]: string };
22
21
  dark?: boolean;
23
- dragId?: string;
24
- draggableItem?: boolean;
25
22
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
26
23
  id?: string;
27
24
  toggleCellId?: string;
@@ -39,8 +36,6 @@ const TableRow = (props: TableRowPropTypes): React.ReactElement => {
39
36
  className,
40
37
  data = {},
41
38
  dark = false,
42
- dragId,
43
- draggableItem = false,
44
39
  htmlOptions = {},
45
40
  id,
46
41
  toggleCellId,
@@ -157,38 +152,15 @@ const TableRow = (props: TableRowPropTypes): React.ReactElement => {
157
152
  </>
158
153
  )
159
154
  ) : isTableTag ? (
160
- draggableItem ? (
161
- <Draggable.Item
162
- {...ariaProps}
163
- {...dataProps}
164
- {...htmlProps}
165
- className={classes}
166
- dragId={dragId}
167
- tag="tr"
168
- >
169
- {children}
170
- </Draggable.Item>
171
- ) : (
172
- <tr
173
- {...ariaProps}
174
- {...dataProps}
175
- {...htmlProps}
176
- className={classes}
177
- id={id}
178
- >
179
- {children}
180
- </tr>
181
- )
182
- ) : draggableItem ? (
183
- <Draggable.Item
155
+ <tr
184
156
  {...ariaProps}
185
157
  {...dataProps}
186
158
  {...htmlProps}
187
159
  className={classes}
188
- dragId={dragId}
160
+ id={id}
189
161
  >
190
162
  {children}
191
- </Draggable.Item>
163
+ </tr>
192
164
  ) : (
193
165
  <div
194
166
  {...ariaProps}
@@ -1,17 +1,11 @@
1
1
  <% if object.tag == "table" %>
2
- <% if object.draggable_container %>
3
- <%= pb_rails("draggable/draggable_container", props: { tag: "tbody", classname: object.classname, data: object.data }) do %>
4
- <%= content.presence %>
5
- <% end %>
6
- <% else %>
7
- <%= content_tag(:tbody,
8
- aria: object.aria,
9
- class: object.classname,
10
- data: object.data,
11
- id: object.id,
12
- **combined_html_options) do %>
13
- <%= content.presence %>
14
- <% end %>
2
+ <%= content_tag(:tbody,
3
+ aria: object.aria,
4
+ class: object.classname,
5
+ data: object.data,
6
+ id: object.id,
7
+ **combined_html_options) do %>
8
+ <%= content.presence %>
15
9
  <% end %>
16
10
  <% else %>
17
11
  <%= content_tag(:div,
@@ -6,8 +6,6 @@ module Playbook
6
6
  prop :tag, type: Playbook::Props::Enum,
7
7
  values: %w[table div],
8
8
  default: "table"
9
- prop :draggable_container, type: Playbook::Props::Boolean,
10
- default: false
11
9
 
12
10
  def classname
13
11
  generate_classname("pb_table_tbody")
@@ -18,19 +18,13 @@
18
18
  <% end %>
19
19
  </tr>
20
20
  <% elsif object.tag == "table" %>
21
- <% if object.draggable_item %>
22
- <%= pb_rails("draggable/draggable_item", props:{ drag_id: object.drag_id, tag: "tr", classname: object.classname, data: object.data }) do %>
23
- <%= content.presence %>
24
- <% end %>
25
- <% else %>
26
- <%= content_tag(:tr,
27
- aria: object.aria,
28
- class: object.classname,
29
- data: object.data,
30
- id: object.id,
31
- **combined_html_options) do %>
32
- <%= content.presence %>
33
- <% end %>
21
+ <%= content_tag(:tr,
22
+ aria: object.aria,
23
+ class: object.classname,
24
+ data: object.data,
25
+ id: object.id,
26
+ **combined_html_options) do %>
27
+ <%= content.presence %>
34
28
  <% end %>
35
29
  <% else %>
36
30
  <%= content_tag(:div,
@@ -13,10 +13,6 @@ module Playbook
13
13
  prop :collapsible_content
14
14
  prop :collapsible_side_highlight, type: Playbook::Props::Boolean,
15
15
  default: true
16
- prop :draggable_item, type: Playbook::Props::Boolean,
17
- default: false
18
- prop :drag_id, type: Playbook::Props::String,
19
- default: nil
20
16
 
21
17
  def classname
22
18
  generate_classname("pb_table_row_kit", side_highlight_class) + tag_class