playbook_ui 14.17.0.pre.alpha.PBNTR935draggablelinedesign7118 → 14.17.0.pre.alpha.play1499backgroundkitoverlay7105
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_background/_background.scss +26 -0
- data/app/pb_kits/playbook/pb_background/_background.tsx +8 -4
- data/app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx +36 -0
- data/app/pb_kits/playbook/pb_background/docs/_background_overlay.md +1 -0
- data/app/pb_kits/playbook/pb_background/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_background/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_draggable/_draggable.scss +20 -43
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.jsx +105 -102
- 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 +48 -50
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.md +1 -1
- data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table.jsx → _draggable_with_table_react.jsx} +1 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +1 -3
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +6 -9
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -4
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +0 -68
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +3 -4
- data/dist/chunks/{_typeahead-HqfDnjRe.js → _typeahead-ySWHB-7p.js} +1 -1
- data/dist/chunks/{_weekday_stacked-DVQITtQ9.js → _weekday_stacked-36N8xzXL.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 -18
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.jsx +0 -115
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.md +0 -5
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default_react.md → _draggable_default.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default.html.erb → _draggable_default_rails.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers_react.md → _draggable_multiple_containers.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers.html.erb → _draggable_multiple_containers_rails.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards_react.md → _draggable_with_cards.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards.html.erb → _draggable_with_cards_rails.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list_react.md → _draggable_with_list.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list.html.erb → _draggable_with_list_rails.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list_react.md → _draggable_with_selectable_list.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list.html.erb → _draggable_with_selectable_list_rails.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table_rails.md → _draggable_with_table.md} +0 -0
@@ -4,17 +4,14 @@ 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
|
-
-
|
7
|
+
- draggable_with_table_react: Draggable with Table
|
8
8
|
- draggable_multiple_containers: Dragging Across Multiple Containers
|
9
|
-
- draggable_drop_zones: Draggable Drop Zones
|
10
|
-
- draggable_drop_zones_colors: Draggable Drop Zones Colors
|
11
|
-
- draggable_drop_zones_line: Draggable Drop Zones Line
|
12
9
|
|
13
10
|
rails:
|
14
|
-
-
|
15
|
-
-
|
16
|
-
-
|
17
|
-
-
|
11
|
+
- draggable_default_rails: Default
|
12
|
+
- draggable_with_list_rails: Draggable with List Kit
|
13
|
+
- draggable_with_selectable_list_rails: Draggable with SelectableList Kit
|
14
|
+
- draggable_with_cards_rails: Draggable with Cards
|
18
15
|
- draggable_with_table: Draggable with Table
|
19
|
-
-
|
16
|
+
- draggable_multiple_containers_rails: Dragging Across Multiple Containers
|
20
17
|
|
@@ -3,7 +3,4 @@ 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
5
|
export { default as DraggableMultipleContainers } from './_draggable_multiple_containers.jsx'
|
6
|
-
export { default as
|
7
|
-
export { default as DraggableDropZones } from './_draggable_drop_zones.jsx'
|
8
|
-
export { default as DraggableDropZonesColors } from './_draggable_drop_zones_colors.jsx'
|
9
|
-
export { default as DraggableDropZonesLine } from './_draggable_drop_zones_line.jsx'
|
6
|
+
export { default as DraggableWithTableReact } from './_draggable_with_table_react.jsx'
|
@@ -128,58 +128,6 @@ 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
|
-
|
183
131
|
test("generated default kit and classname", () => {
|
184
132
|
render(<DefaultDraggableKit />);
|
185
133
|
const kit = screen.getByTestId(testId);
|
@@ -240,19 +188,3 @@ test("generated dragHandle with Card", () => {
|
|
240
188
|
const dragHandle = card.querySelector(".pb_custom_icon");
|
241
189
|
expect(dragHandle).toBeInTheDocument();
|
242
190
|
});
|
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') : 'vertical';
|
35
35
|
|
36
36
|
const ariaProps = buildAriaProps(aria);
|
37
37
|
const dataProps = buildDataProps(data);
|
@@ -41,9 +41,8 @@ const DraggableContainer = (props: DraggableContainerProps) => {
|
|
41
41
|
const classes = classnames(
|
42
42
|
buildCss("pb_draggable_container"),
|
43
43
|
`${activeContainer === container ? "active" : ""}`,
|
44
|
-
//
|
45
|
-
dropZone === 'line' && direction === 'vertical' ? '
|
46
|
-
dropZone === 'line' && direction === 'horizontal' ? 'line_horizontal' : '',
|
44
|
+
// Only add vertical class if dropZone is 'line' and direction is 'vertical'
|
45
|
+
(dropZone === 'line' && direction === 'vertical') ? 'vertical' : '',
|
47
46
|
globalProps(props),
|
48
47
|
className
|
49
48
|
);
|