playbook_ui_docs 16.4.0.pre.alpha.play2838formcustomvalidationsconsistency15233 → 16.4.0.pre.alpha.play2838formcustomvalidationsconsistency15237
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_table/docs/_sections.yml +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_external_filter_rails.html.erb +45 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_external_filter_rails.md +39 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.md +2 -1
- data/app/pb_kits/playbook/pb_table/docs/example.yml +1 -0
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3eee8a43070237b0bc8afdb7b78ae8805cab43795176afd9b2fc7ecb5ede5d3c
|
|
4
|
+
data.tar.gz: 7269d69e505ad1470f34c6d73c9780f8dceae1252a053cda965be479b2f45849
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d5da77f1299be81586a01ac39a963bceec0817cd6f167cd955098ca5af9f3ee0932adbdbb5b9eef9821b9bcd3b848ae4c49a1421b20c8bc3a37bff081d11f55
|
|
7
|
+
data.tar.gz: afa0c11cdc8f1af76a15b31812f7255d3af8739fae76fcfbae835fc2a989b01f62cfac80378d2eff039b80b544e35a189aae4ef210a40d50fe6b1c40b04139b3
|
data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_external_filter_rails.html.erb
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<%# External filter: capture any filter markup and pass it via the filter prop.
|
|
2
|
+
Use your own helper (e.g. a search/filter form) or pb_rails("filter") as shown here. %>
|
|
3
|
+
<% users = [
|
|
4
|
+
{ name: "Alex", role: "Engineer" },
|
|
5
|
+
{ name: "Sam", role: "Designer" },
|
|
6
|
+
{ name: "Jordan", role: "Manager" },
|
|
7
|
+
] %>
|
|
8
|
+
|
|
9
|
+
<% filter_output = capture do %>
|
|
10
|
+
<%= pb_rails("filter", props: {
|
|
11
|
+
id: "external-filter-demo",
|
|
12
|
+
template: "single",
|
|
13
|
+
results: 3,
|
|
14
|
+
background: false,
|
|
15
|
+
sort_menu: [
|
|
16
|
+
{ item: "Name", link: "#", active: true, direction: "asc" },
|
|
17
|
+
{ item: "Role", link: "#", active: false },
|
|
18
|
+
],
|
|
19
|
+
}) do %>
|
|
20
|
+
<%= pb_rails("text_input", props: { label: "Name", placeholder: "Search by name" }) %>
|
|
21
|
+
<%= pb_rails("text_input", props: { label: "Role", placeholder: "e.g. Engineer, Designer" }) %>
|
|
22
|
+
<%= pb_rails("button", props: { text: "Apply" }) %>
|
|
23
|
+
<% end %>
|
|
24
|
+
<% end %>
|
|
25
|
+
|
|
26
|
+
<%= pb_rails("table", props: {
|
|
27
|
+
variant: "with_filter",
|
|
28
|
+
title: "Table with External Filter",
|
|
29
|
+
filter: filter_output,
|
|
30
|
+
}) do %>
|
|
31
|
+
<%= pb_rails("table/table_head") do %>
|
|
32
|
+
<%= pb_rails("table/table_row") do %>
|
|
33
|
+
<%= pb_rails("table/table_header", props: { text: "Name" }) %>
|
|
34
|
+
<%= pb_rails("table/table_header", props: { text: "Role" }) %>
|
|
35
|
+
<% end %>
|
|
36
|
+
<% end %>
|
|
37
|
+
<%= pb_rails("table/table_body") do %>
|
|
38
|
+
<% users.each do |user| %>
|
|
39
|
+
<%= pb_rails("table/table_row") do %>
|
|
40
|
+
<%= pb_rails("table/table_cell") { user[:name] } %>
|
|
41
|
+
<%= pb_rails("table/table_cell") { user[:role] } %>
|
|
42
|
+
<% end %>
|
|
43
|
+
<% end %>
|
|
44
|
+
<% end %>
|
|
45
|
+
<% end %>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Use the **"with_filter"** variant with an **external filter** (Option B): pass pre-rendered filter markup via the `filter` prop. Same layout as Variant with Filter (card, title, separator, flex); only the filter slot is supplied by you. Use this when you need:
|
|
2
|
+
|
|
3
|
+
- **Manual filter submission** – Apply / Filter button instead of automatic application
|
|
4
|
+
- **Full control** – Over filter props, template, sort menu, and submission
|
|
5
|
+
- **Custom or app-specific filter helpers** – Any helper that returns filter markup (e.g. search/filter forms)
|
|
6
|
+
|
|
7
|
+
#### Required props
|
|
8
|
+
|
|
9
|
+
- `variant: "with_filter"`
|
|
10
|
+
- `filter` – Pre-rendered filter HTML (e.g. from `capture { ... }`)
|
|
11
|
+
|
|
12
|
+
When `filter` is present, `filter_content` and `filter_props` are ignored.
|
|
13
|
+
|
|
14
|
+
#### How to do it
|
|
15
|
+
|
|
16
|
+
1. **Render your filter** (e.g. `pb_rails("filter", ...)` or any helper that returns filter markup).
|
|
17
|
+
2. **Capture the output** with `capture do ... end`.
|
|
18
|
+
3. **Pass it to the Table** as the `filter` prop.
|
|
19
|
+
|
|
20
|
+
**Example (generic pattern):**
|
|
21
|
+
|
|
22
|
+
```erb
|
|
23
|
+
<% filter_output = capture do %>
|
|
24
|
+
<%= pb_rails("filter", props: { template: "single", results: 10, background: false }) do %>
|
|
25
|
+
<%= pb_rails("text_input", props: { label: "Name", placeholder: "Search by name" }) %>
|
|
26
|
+
<%= pb_rails("button", props: { text: "Apply" }) %>
|
|
27
|
+
<% end %>
|
|
28
|
+
<% end %>
|
|
29
|
+
|
|
30
|
+
<%= pb_rails("table", props: {
|
|
31
|
+
variant: "with_filter",
|
|
32
|
+
title: "My Table",
|
|
33
|
+
filter: filter_output,
|
|
34
|
+
}) do %>
|
|
35
|
+
<%# table_head / table_body ... %>
|
|
36
|
+
<% end %>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
For Nitro apps that use a shared search/filter pattern, reference the example on Alpha for implementation details.
|
|
@@ -26,8 +26,9 @@ The Table kit automatically sets these Filter defaults (which you can override v
|
|
|
26
26
|
- `min_width: "xs"`
|
|
27
27
|
- `popover_props: { width: "350px" }`
|
|
28
28
|
|
|
29
|
+
Alternatively, you can pass pre-rendered filter markup via the `filter` prop (e.g. for manual submission or custom filter helpers)—scroll down for that approach.
|
|
29
30
|
|
|
30
31
|
**IMPORTANT NOTE**:
|
|
31
32
|
The purpose of this variant is to provide an easy way to set up a Table with a Filter with Design standards applied by default.
|
|
32
33
|
|
|
33
|
-
If you are looking for more customization than this embedded variant provides, you may be better served by using the individual kits as
|
|
34
|
+
If you are looking for more customization than this embedded variant provides, you may be better served by using the individual kits as demonstrated in our Table Filter Card Building Block as seen [here](https://playbook.powerapp.cloud/building_blocks/table_filter_card/rails).
|
|
@@ -41,6 +41,7 @@ examples:
|
|
|
41
41
|
- table_with_header_style_borderless: Header Style Borderless
|
|
42
42
|
- table_with_header_style_floating: Header Style Floating
|
|
43
43
|
- table_with_filter_variant_rails: Variant with Filter
|
|
44
|
+
- table_with_filter_variant_external_filter_rails: Variant with Filter (External Filter)
|
|
44
45
|
- table_with_filter_variant_with_pagination_rails: Variant with Filter and Pagination
|
|
45
46
|
- table_with_filter_with_card_title_props_rails: Variant with Filter (with Card and Title Props)
|
|
46
47
|
|
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.4.0.pre.alpha.
|
|
4
|
+
version: 16.4.0.pre.alpha.play2838formcustomvalidationsconsistency15237
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Power UX
|
|
@@ -2304,6 +2304,8 @@ files:
|
|
|
2304
2304
|
- app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible_react.md
|
|
2305
2305
|
- app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.jsx
|
|
2306
2306
|
- app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.md
|
|
2307
|
+
- app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_external_filter_rails.html.erb
|
|
2308
|
+
- app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_external_filter_rails.md
|
|
2307
2309
|
- app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.html.erb
|
|
2308
2310
|
- app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.md
|
|
2309
2311
|
- app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.jsx
|