playbook_ui 14.17.0.pre.alpha.PBNTR925railstablecustomheaders7163 → 14.17.0.pre.alpha.PBNTR935draggablelinedesign7118
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_draggable/_draggable.scss +43 -20
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.jsx +102 -105
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.md +3 -3
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.jsx +50 -48
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.md +1 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.jsx +115 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.md +5 -0
- data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table_react.jsx → _draggable_with_table.jsx} +1 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +3 -1
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +9 -6
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +4 -1
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +68 -0
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +4 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_react.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_table/table.rb +1 -13
- data/app/pb_kits/playbook/pb_table/table_header.rb +1 -13
- data/dist/chunks/{_typeahead-7W5Ha5Td.js → _typeahead-HqfDnjRe.js} +1 -1
- data/dist/chunks/{_weekday_stacked-DSKatW3m.js → _weekday_stacked-DVQITtQ9.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +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 +18 -20
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless.html.erb +0 -34
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless_rails.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating.html.erb +0 -36
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_rails.md +0 -1
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default_rails.html.erb → _draggable_default.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default.md → _draggable_default_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers_rails.html.erb → _draggable_multiple_containers.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers.md → _draggable_multiple_containers_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards_rails.html.erb → _draggable_with_cards.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards.md → _draggable_with_cards_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list_rails.html.erb → _draggable_with_list.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list.md → _draggable_with_list_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list_rails.html.erb → _draggable_with_selectable_list.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list.md → _draggable_with_selectable_list_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table.md → _draggable_with_table_rails.md} +0 -0
@@ -128,6 +128,58 @@ const DraggableKitWithCard = () => {
|
|
128
128
|
);
|
129
129
|
};
|
130
130
|
|
131
|
+
const DraggableWithLineVertical = () => {
|
132
|
+
const [initialState, setInitialState] = useState(data);
|
133
|
+
return (
|
134
|
+
<div data-testid={testId}>
|
135
|
+
<DraggableProvider
|
136
|
+
dropZone={{ type: "line" }}
|
137
|
+
initialItems={data}
|
138
|
+
onReorder={(items) => setInitialState(items)}
|
139
|
+
>
|
140
|
+
<Draggable>
|
141
|
+
<Draggable.Container>
|
142
|
+
{initialState.map(({ id, text }) => (
|
143
|
+
<Draggable.Item
|
144
|
+
dragId={id}
|
145
|
+
key={id}
|
146
|
+
>
|
147
|
+
{text}
|
148
|
+
</Draggable.Item>
|
149
|
+
))}
|
150
|
+
</Draggable.Container>
|
151
|
+
</Draggable>
|
152
|
+
</DraggableProvider>
|
153
|
+
</div>
|
154
|
+
);
|
155
|
+
};
|
156
|
+
|
157
|
+
const DraggableWithLineHorizontal = () => {
|
158
|
+
const [initialState, setInitialState] = useState(data);
|
159
|
+
return (
|
160
|
+
<div data-testid={testId}>
|
161
|
+
<DraggableProvider
|
162
|
+
dropZone={{ type: "line", direction: "horizontal" }}
|
163
|
+
initialItems={data}
|
164
|
+
onReorder={(items) => setInitialState(items)}
|
165
|
+
>
|
166
|
+
<Draggable>
|
167
|
+
<Draggable.Container>
|
168
|
+
{initialState.map(({ id, text }) => (
|
169
|
+
<Draggable.Item
|
170
|
+
dragId={id}
|
171
|
+
key={id}
|
172
|
+
>
|
173
|
+
{text}
|
174
|
+
</Draggable.Item>
|
175
|
+
))}
|
176
|
+
</Draggable.Container>
|
177
|
+
</Draggable>
|
178
|
+
</DraggableProvider>
|
179
|
+
</div>
|
180
|
+
);
|
181
|
+
};
|
182
|
+
|
131
183
|
test("generated default kit and classname", () => {
|
132
184
|
render(<DefaultDraggableKit />);
|
133
185
|
const kit = screen.getByTestId(testId);
|
@@ -188,3 +240,19 @@ test("generated dragHandle with Card", () => {
|
|
188
240
|
const dragHandle = card.querySelector(".pb_custom_icon");
|
189
241
|
expect(dragHandle).toBeInTheDocument();
|
190
242
|
});
|
243
|
+
|
244
|
+
test("line dropZone with default direction applies 'line_vertical' class to container", () => {
|
245
|
+
render(<DraggableWithLineVertical />);
|
246
|
+
const kit = screen.getByTestId(testId);
|
247
|
+
const container = kit.querySelector(".pb_draggable_container");
|
248
|
+
|
249
|
+
expect(container).toHaveClass("line_vertical");
|
250
|
+
});
|
251
|
+
|
252
|
+
test("line dropZone with horizontal direction applies 'line_horizontal' class to container", () => {
|
253
|
+
render(<DraggableWithLineHorizontal />);
|
254
|
+
const kit = screen.getByTestId(testId);
|
255
|
+
const container = kit.querySelector(".pb_draggable_container");
|
256
|
+
|
257
|
+
expect(container).toHaveClass("line_horizontal");
|
258
|
+
});
|
@@ -31,7 +31,7 @@ const DraggableContainer = (props: DraggableContainerProps) => {
|
|
31
31
|
} = contextValues;
|
32
32
|
|
33
33
|
// Only get direction if dropZone is 'line'
|
34
|
-
const direction = dropZone === 'line' ? (contextValues.direction || 'vertical') :
|
34
|
+
const direction = dropZone === 'line' ? (contextValues.direction || 'vertical') : null;
|
35
35
|
|
36
36
|
const ariaProps = buildAriaProps(aria);
|
37
37
|
const dataProps = buildDataProps(data);
|
@@ -41,8 +41,9 @@ const DraggableContainer = (props: DraggableContainerProps) => {
|
|
41
41
|
const classes = classnames(
|
42
42
|
buildCss("pb_draggable_container"),
|
43
43
|
`${activeContainer === container ? "active" : ""}`,
|
44
|
-
//
|
45
|
-
|
44
|
+
// Line variant gets line_{direction} classname on container no matter what
|
45
|
+
dropZone === 'line' && direction === 'vertical' ? 'line_vertical' : '',
|
46
|
+
dropZone === 'line' && direction === 'horizontal' ? 'line_horizontal' : '',
|
46
47
|
globalProps(props),
|
47
48
|
className
|
48
49
|
);
|
@@ -1 +1 @@
|
|
1
|
-
Further customize your header by using the [table with background kit](https://playbook.powerapp.cloud/kits/table/react#table-with-background-kit) logic to give your table header a custom background color. Use the `headerStyle="floating"` prop to visually nest the borderless table within a card or collapsible with a matching background color (the `backgroundColor` passed to Background kit should match the `
|
1
|
+
Further customize your header by using the [table with background kit](https://playbook.powerapp.cloud/kits/table/react#table-with-background-kit) logic to give your table header a custom background color. Use the `headerStyle="floating"` prop to visually nest the borderless table within a card or collapsible with a matching background color (the `backgroundColor` passed to Background kit should match the `backgroundColor` for the element in which it is nested).
|
@@ -37,8 +37,6 @@ examples:
|
|
37
37
|
- table_with_collapsible_with_nested_table_rails: Table with Collapsible with Nested Table
|
38
38
|
- table_with_clickable_rows: Table with Clickable Rows
|
39
39
|
- table_with_selectable_rows: Table with Selectable Rows
|
40
|
-
- table_with_header_style_borderless: Header Style Borderless
|
41
|
-
- table_with_header_style_floating: Header Style Floating
|
42
40
|
|
43
41
|
react:
|
44
42
|
- table_sm: Small
|
@@ -37,16 +37,13 @@ module Playbook
|
|
37
37
|
prop :outer_padding, type: Playbook::Props::Enum,
|
38
38
|
values: ["none", "xxs", "xs", "sm", "md", "lg", "xl", nil],
|
39
39
|
default: nil
|
40
|
-
prop :header_style, type: Playbook::Props::Enum,
|
41
|
-
values: %w[default borderless floating],
|
42
|
-
default: "default"
|
43
40
|
|
44
41
|
def classname
|
45
42
|
generate_classname(
|
46
43
|
"pb_table", "table-#{size}", single_line_class, dark_class,
|
47
44
|
disable_hover_class, container_class, data_table_class, sticky_class, sticky_left_column_class,
|
48
45
|
sticky_right_column_class, collapse_class, vertical_border_class, striped_class, outer_padding_class,
|
49
|
-
"table-responsive-#{responsive}",
|
46
|
+
"table-responsive-#{responsive}", separator: " "
|
50
47
|
)
|
51
48
|
end
|
52
49
|
|
@@ -126,15 +123,6 @@ module Playbook
|
|
126
123
|
outer_padding.present? ? "outer_padding_#{space_css_name}#{outer_padding}" : nil
|
127
124
|
end
|
128
125
|
end
|
129
|
-
|
130
|
-
def header_style_class
|
131
|
-
case header_style
|
132
|
-
when "borderless"
|
133
|
-
"header-borderless"
|
134
|
-
when "floating"
|
135
|
-
"header-floating"
|
136
|
-
end
|
137
|
-
end
|
138
126
|
end
|
139
127
|
end
|
140
128
|
end
|
@@ -26,12 +26,9 @@ module Playbook
|
|
26
26
|
prop :tag, type: Playbook::Props::Enum,
|
27
27
|
values: %w[table div],
|
28
28
|
default: "table"
|
29
|
-
prop :header_style, type: Playbook::Props::Enum,
|
30
|
-
values: %w[default borderless floating],
|
31
|
-
default: "default"
|
32
29
|
|
33
30
|
def classname
|
34
|
-
generate_classname("pb_table_header_kit", align_class
|
31
|
+
generate_classname("pb_table_header_kit", align_class) + tag_class
|
35
32
|
end
|
36
33
|
|
37
34
|
def tag_class
|
@@ -109,15 +106,6 @@ module Playbook
|
|
109
106
|
end
|
110
107
|
active_item
|
111
108
|
end
|
112
|
-
|
113
|
-
def header_style_class
|
114
|
-
case header_style
|
115
|
-
when "borderless"
|
116
|
-
"header-borderless"
|
117
|
-
when "floating"
|
118
|
-
"header-floating"
|
119
|
-
end
|
120
|
-
end
|
121
109
|
end
|
122
110
|
end
|
123
111
|
end
|