playbook_ui_docs 16.11.0.pre.alpha.testkey2 → 16.11.0.pre.alpha.typeaheadsmartreset17862
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_advanced_table/docs/_advanced_table_column_styling.md +8 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.html.erb +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.md +3 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width.md +6 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.html.erb +5 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.md +3 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.json +1 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.overrides.json +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_avatar/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_card/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_currency/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_date_range_stacked/docs/_playground.json +1 -3
- data/app/pb_kits/playbook/pb_date_stacked/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_date_year_stacked/docs/_playground.json +1 -2
- data/app/pb_kits/playbook/pb_filter/docs/_playground.json +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_icon/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_layout/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_list/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_loading_inline/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_map/docs/_playground.json +0 -7
- data/app/pb_kits/playbook/pb_map/docs/_playground.overrides.json +0 -5
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_playground.json +0 -9
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_playground.overrides.json +0 -6
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_playground.json +0 -9
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_playground.overrides.json +0 -6
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_playground.json +0 -9
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_playground.overrides.json +0 -6
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_playground.json +0 -9
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_playground.overrides.json +0 -6
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_pill/docs/_playground.json +0 -11
- data/app/pb_kits/playbook/pb_pill/docs/_playground.overrides.json +1 -11
- data/app/pb_kits/playbook/pb_pill/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_pill/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_progress_simple/docs/_playground.json +2 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.json +0 -11
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.overrides.json +0 -11
- data/app/pb_kits/playbook/pb_section_separator/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_playground.json +4 -5
- data/app/pb_kits/playbook/pb_time_picker/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_time_range_inline/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.html.erb +0 -15
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.jsx +0 -19
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.md +1 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_playground.json +0 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.md +2 -2
- metadata +2 -19
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width_rails.html.erb +0 -41
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width_rails.md +0 -49
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell.jsx +0 -69
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell_rails.html.erb +0 -49
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell_rails.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both_rails.html.erb +0 -57
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom_rails.html.erb +0 -57
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers.html.erb +0 -40
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers.jsx +0 -55
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers_react.md +0 -1
- data/app/pb_kits/playbook/pb_pill/docs/_pill_size.html.erb +0 -1
- data/app/pb_kits/playbook/pb_pill/docs/_pill_size.jsx +0 -16
- data/app/pb_kits/playbook/pb_pill/docs/_pill_size.md +0 -1
|
@@ -127,17 +127,6 @@
|
|
|
127
127
|
"type": "info"
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
|
-
"externalDependencies": {
|
|
131
|
-
"packages": [
|
|
132
|
-
"react-trix",
|
|
133
|
-
"trix",
|
|
134
|
-
"@tiptap/react",
|
|
135
|
-
"@tiptap/starter-kit",
|
|
136
|
-
"@tiptap/extension-link"
|
|
137
|
-
],
|
|
138
|
-
"optional": true,
|
|
139
|
-
"note": "Default React editor uses Trix (pass TrixEditor from react-trix). Advanced editor uses TipTap. The host app must already have the needed packages installed. Agents must not install packages — tell the user if they are missing. Rails advanced TipTap may load via the kit’s esm.sh script."
|
|
140
|
-
},
|
|
141
130
|
"structureModes": {
|
|
142
131
|
"default": "advanced",
|
|
143
132
|
"modes": {
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"externalDependencies": {
|
|
3
|
-
"packages": [
|
|
4
|
-
"react-trix",
|
|
5
|
-
"trix",
|
|
6
|
-
"@tiptap/react",
|
|
7
|
-
"@tiptap/starter-kit",
|
|
8
|
-
"@tiptap/extension-link"
|
|
9
|
-
],
|
|
10
|
-
"optional": true,
|
|
11
|
-
"note": "Default React editor uses Trix (pass TrixEditor from react-trix). Advanced editor uses TipTap. The host app must already have the needed packages installed. Agents must not install packages — tell the user if they are missing. Rails advanced TipTap may load via the kit’s esm.sh script."
|
|
12
|
-
},
|
|
13
2
|
"structureModes": {
|
|
14
3
|
"default": "advanced",
|
|
15
4
|
"modes": {
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
"template": "<SkeletonLoading{{props}} />",
|
|
3
3
|
"propTargets": {},
|
|
4
4
|
"defaults": {
|
|
5
|
-
"height": "16px",
|
|
6
|
-
"width": "100%",
|
|
7
|
-
"borderRadius": "sm",
|
|
8
|
-
"gap": "xxs",
|
|
9
5
|
"stack": 1,
|
|
10
6
|
"color": "default",
|
|
11
|
-
"
|
|
7
|
+
"borderRadius": "sm",
|
|
8
|
+
"gap": "xxs",
|
|
9
|
+
"height": "16px",
|
|
10
|
+
"width": "100%"
|
|
12
11
|
},
|
|
13
12
|
"groups": [
|
|
14
13
|
{
|
|
@@ -63,18 +63,3 @@
|
|
|
63
63
|
}) %>
|
|
64
64
|
|
|
65
65
|
<br>
|
|
66
|
-
|
|
67
|
-
<%= pb_rails("timestamp", props: {
|
|
68
|
-
timestamp: DateTime.now,
|
|
69
|
-
show_date: false,
|
|
70
|
-
show_timezone: true,
|
|
71
|
-
timezone: "Eastern Time (US & Canada)",
|
|
72
|
-
}) %>
|
|
73
|
-
|
|
74
|
-
<br>
|
|
75
|
-
|
|
76
|
-
<%= pb_rails("timestamp", props: {
|
|
77
|
-
timestamp: DateTime.now,
|
|
78
|
-
show_timezone: true,
|
|
79
|
-
timezone: "Pacific Time (US & Canada)",
|
|
80
|
-
}) %>
|
|
@@ -85,25 +85,6 @@ const TimestampTimezones = (props) => {
|
|
|
85
85
|
timezone="Asia/Hong_Kong"
|
|
86
86
|
{...props}
|
|
87
87
|
/>
|
|
88
|
-
|
|
89
|
-
<br />
|
|
90
|
-
|
|
91
|
-
<Timestamp
|
|
92
|
-
showDate={false}
|
|
93
|
-
showTimezone
|
|
94
|
-
timestamp={todaysDate}
|
|
95
|
-
timezone="Eastern Time (US & Canada)"
|
|
96
|
-
{...props}
|
|
97
|
-
/>
|
|
98
|
-
|
|
99
|
-
<br />
|
|
100
|
-
|
|
101
|
-
<Timestamp
|
|
102
|
-
showTimezone
|
|
103
|
-
timestamp={todaysDate}
|
|
104
|
-
timezone="Pacific Time (US & Canada)"
|
|
105
|
-
{...props}
|
|
106
|
-
/>
|
|
107
88
|
</div>
|
|
108
89
|
)
|
|
109
90
|
}
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
The `showTimezone`/`show_timezone` prop can be used to show the timezone as well. This is set to false by default. **NOTE**: This prop must be used in conjunction with the `timezone` prop to specify which timezone to display.
|
|
2
|
-
|
|
3
|
-
The `timezone` prop accepts both IANA timezone identifiers (e.g. `America/New_York`) and ActiveSupport timezone names (e.g. `Eastern Time (US & Canada)`).
|
|
1
|
+
The `showTimezone`/`show_timezone` prop can be used to show the timezone as well. This is set to false by default. **NOTE**: This prop must be used in conjunction with the `timezone` prop to specify which timezone to display.
|
|
@@ -8,7 +8,7 @@ You can also pass `default_options` which will populate the initial pill selecti
|
|
|
8
8
|
|
|
9
9
|
`default_options: [{ label: 'Windows', value: '#FFA500' }]`
|
|
10
10
|
|
|
11
|
-
When present, the kit root
|
|
11
|
+
When present, the kit root is stamped with `data-default-value` (JSON of those initial options) for restore-after-clear via `:set`.
|
|
12
12
|
|
|
13
13
|
#### Rails: Subscribing to JS Events
|
|
14
14
|
|
|
@@ -25,7 +25,7 @@ The same rule regarding the `id` prop applies to publishing JS events. The examp
|
|
|
25
25
|
|
|
26
26
|
`pb-typeahead-kit-typeahead-pills-example1:clear` event to clear all options.
|
|
27
27
|
|
|
28
|
-
`pb-typeahead-kit-typeahead-pills-example1:set` event to set options
|
|
28
|
+
`pb-typeahead-kit-typeahead-pills-example1:set` event to set options. Pass `detail` as `[{ label, value }, ...]` (or a single object for single-select):
|
|
29
29
|
|
|
30
30
|
```js
|
|
31
31
|
document.dispatchEvent(new CustomEvent('pb-typeahead-kit-typeahead-pills-example1:set', {
|
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.11.0.pre.alpha.
|
|
4
|
+
version: 16.11.0.pre.alpha.typeaheadsmartreset17862
|
|
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-07-
|
|
12
|
+
date: 2026-07-22 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: playbook_ui
|
|
@@ -78,8 +78,6 @@ files:
|
|
|
78
78
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.md
|
|
79
79
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width.jsx
|
|
80
80
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width.md
|
|
81
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width_rails.html.erb
|
|
82
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width_rails.md
|
|
83
81
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_visibility.jsx
|
|
84
82
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_visibility.md
|
|
85
83
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_visibility_custom.jsx
|
|
@@ -102,10 +100,6 @@ files:
|
|
|
102
100
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.md
|
|
103
101
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
|
|
104
102
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.md
|
|
105
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell.jsx
|
|
106
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell.md
|
|
107
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell_rails.html.erb
|
|
108
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell_rails.md
|
|
109
103
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_grouped_headers_composition.jsx
|
|
110
104
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_grouped_headers_composition.md
|
|
111
105
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx
|
|
@@ -136,12 +130,8 @@ files:
|
|
|
136
130
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md
|
|
137
131
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx
|
|
138
132
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both.jsx
|
|
139
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both_rails.html.erb
|
|
140
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both_rails.md
|
|
141
133
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both_react.md
|
|
142
134
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom.jsx
|
|
143
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom_rails.html.erb
|
|
144
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom_rails.md
|
|
145
135
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom_react.md
|
|
146
136
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.html.erb
|
|
147
137
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.md
|
|
@@ -171,10 +161,6 @@ files:
|
|
|
171
161
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_react.md
|
|
172
162
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb
|
|
173
163
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md
|
|
174
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers.html.erb
|
|
175
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers.jsx
|
|
176
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers_rails.md
|
|
177
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers_react.md
|
|
178
164
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.jsx
|
|
179
165
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.md
|
|
180
166
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.jsx
|
|
@@ -2078,9 +2064,6 @@ files:
|
|
|
2078
2064
|
- app/pb_kits/playbook/pb_pill/docs/_pill_example.jsx
|
|
2079
2065
|
- app/pb_kits/playbook/pb_pill/docs/_pill_example.md
|
|
2080
2066
|
- app/pb_kits/playbook/pb_pill/docs/_pill_props_swift.md
|
|
2081
|
-
- app/pb_kits/playbook/pb_pill/docs/_pill_size.html.erb
|
|
2082
|
-
- app/pb_kits/playbook/pb_pill/docs/_pill_size.jsx
|
|
2083
|
-
- app/pb_kits/playbook/pb_pill/docs/_pill_size.md
|
|
2084
2067
|
- app/pb_kits/playbook/pb_pill/docs/_pill_variants.html.erb
|
|
2085
2068
|
- app/pb_kits/playbook/pb_pill/docs/_pill_variants.jsx
|
|
2086
2069
|
- app/pb_kits/playbook/pb_pill/docs/_pill_variants_swift.md
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width_rails.html.erb
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<% column_definitions = [
|
|
2
|
-
{
|
|
3
|
-
accessor: "year",
|
|
4
|
-
label: "Year (fixed)",
|
|
5
|
-
cellAccessors: ["quarter", "month", "day"],
|
|
6
|
-
# width alone locks min + max to the same value (128px).
|
|
7
|
-
column_styling: { width: 128 },
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
accessor: "newEnrollments",
|
|
11
|
-
label: "Enrollments (floor)",
|
|
12
|
-
column_styling: { min_width: 160 },
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
accessor: "scheduledMeetings",
|
|
16
|
-
label: "Meetings (preferred)",
|
|
17
|
-
column_styling: { width: 200, min_width: 160, max_width: 240 },
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
accessor: "attendanceRate",
|
|
21
|
-
label: "Attendance (min / pref / max)",
|
|
22
|
-
column_styling: { min_width: 108, width: 124, max_width: 168 },
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
accessor: "completedClasses",
|
|
26
|
-
label: "Completed",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
accessor: "classCompletionRate",
|
|
30
|
-
label: "Completion %",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
accessor: "graduatedStudents",
|
|
34
|
-
label: "Graduated",
|
|
35
|
-
},
|
|
36
|
-
] %>
|
|
37
|
-
|
|
38
|
-
<%= pb_rails("advanced_table", props: { id: "column-styling-width", table_data: @table_data, column_definitions: column_definitions }) do %>
|
|
39
|
-
<%= pb_rails("advanced_table/table_header", props: { table_id: "column-styling-width", column_definitions: column_definitions }) %>
|
|
40
|
-
<%= pb_rails("advanced_table/table_body", props: { table_id: "column-styling-width", table_data: @table_data, column_definitions: column_definitions }) %>
|
|
41
|
-
<% end %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width_rails.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
AdvancedTable column width is controlled on each leaf `column_definitions` entry via `column_styling`. Playbook maps these keys to inline styles on header and body cells.
|
|
2
|
-
|
|
3
|
-
**1)** `column_styling` width keys:
|
|
4
|
-
|
|
5
|
-
- Preferred / target width: `width`
|
|
6
|
-
- Minimum width (floor): `min_width`
|
|
7
|
-
- Maximum width (ceiling): `max_width`
|
|
8
|
-
|
|
9
|
-
Numbers are pixels. You can also pass CSS length strings (e.g. `"12rem"`, `"200px"`).
|
|
10
|
-
|
|
11
|
-
**2)** Fixed width: set `width` only
|
|
12
|
-
|
|
13
|
-
If you pass only `width` and do not set `min_width` / `max_width`, Playbook treats that as a fixed column: it sets all three to the same value under the hood so you do not have to repeat yourself.
|
|
14
|
-
|
|
15
|
-
```ruby
|
|
16
|
-
column_styling: { width: 128 }
|
|
17
|
-
# Applied as width, min-width, and max-width: 128px
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Use this when the column should stay one width (e.g. a hierarchy column with expand controls).
|
|
21
|
-
|
|
22
|
-
**3)** Floor only: `min_width`
|
|
23
|
-
|
|
24
|
-
Set only a minimum when the column may grow with the table or content but must not shrink below a baseline (common fix for horizontal “jump” when rows expand):
|
|
25
|
-
|
|
26
|
-
```ruby
|
|
27
|
-
column_styling: { min_width: 160 }
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**4)** Flexible band: min + preferred + max
|
|
31
|
-
|
|
32
|
-
Set two or three values when you want a range. CSS uses preferred `width` clamped between `min_width` and `max_width`:
|
|
33
|
-
|
|
34
|
-
- `min_width`: won’t shrink below this.
|
|
35
|
-
- `width`: preferred size when space allows.
|
|
36
|
-
- `max_width`: won’t grow above this.
|
|
37
|
-
|
|
38
|
-
Example from the table below (Attendance): `min_width: 108`, `width: 124`, `max_width: 168` → preferred 124px, allowed between 108 and 168.
|
|
39
|
-
|
|
40
|
-
You only need all three when you want that band. If min and max are omitted, `width` alone is enough for a fixed column.
|
|
41
|
-
|
|
42
|
-
**5)** What the example table shows
|
|
43
|
-
|
|
44
|
-
- Year (fixed): `column_styling: { width: 128 }` — locked to 128px.
|
|
45
|
-
- Enrollments (floor): `column_styling: { min_width: 160 }` — at least 160px; can grow.
|
|
46
|
-
- Meetings (preferred): `width` / `min_width` / `max_width` — preferred 200px, between 160–240.
|
|
47
|
-
- Attendance (min / pref / max): all three — preferred 124px, between 108–168.
|
|
48
|
-
|
|
49
|
-
Grouped columns: put width options on leaf definitions (columns with an `accessor`), not on parent group headers.
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
|
3
|
-
import Flex from "../../pb_flex/_flex"
|
|
4
|
-
import Badge from "../../pb_badge/_badge"
|
|
5
|
-
import Title from "../../pb_title/_title"
|
|
6
|
-
import MOCK_DATA from "./advanced_table_mock_data.json"
|
|
7
|
-
|
|
8
|
-
const AdvancedTableFullWidthCell = (props) => {
|
|
9
|
-
const columnDefinitions = [
|
|
10
|
-
{
|
|
11
|
-
accessor: "year",
|
|
12
|
-
label: "Year",
|
|
13
|
-
cellAccessors: ["quarter", "month", "day"],
|
|
14
|
-
customRenderer: (row, value) => (
|
|
15
|
-
<Flex justify="between">
|
|
16
|
-
<Title size={4}
|
|
17
|
-
text={value}
|
|
18
|
-
/>
|
|
19
|
-
<Badge dark
|
|
20
|
-
marginLeft="xxs"
|
|
21
|
-
text={row.original.newEnrollments > 20 ? "High" : "Low"}
|
|
22
|
-
variant="neutral"
|
|
23
|
-
/>
|
|
24
|
-
</Flex>
|
|
25
|
-
),
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
accessor: "newEnrollments",
|
|
29
|
-
label: "New Enrollments",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
accessor: "scheduledMeetings",
|
|
33
|
-
label: "Scheduled Meetings",
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
accessor: "attendanceRate",
|
|
37
|
-
label: "Attendance Rate",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
accessor: "completedClasses",
|
|
41
|
-
label: "Completed Classes",
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
accessor: "classCompletionRate",
|
|
45
|
-
label: "Class Completion Rate",
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
accessor: "graduatedStudents",
|
|
49
|
-
label: "Graduated Students",
|
|
50
|
-
},
|
|
51
|
-
]
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<div>
|
|
55
|
-
<AdvancedTable
|
|
56
|
-
columnDefinitions={columnDefinitions}
|
|
57
|
-
enableToggleExpansion="all"
|
|
58
|
-
fullWidthCell
|
|
59
|
-
tableData={MOCK_DATA}
|
|
60
|
-
{...props}
|
|
61
|
-
>
|
|
62
|
-
<AdvancedTable.Header enableSorting />
|
|
63
|
-
<AdvancedTable.Body />
|
|
64
|
-
</AdvancedTable>
|
|
65
|
-
</div>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export default AdvancedTableFullWidthCell
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
`fullWidthCell` is an optional boolean prop that defaults to `false`. When set to `true`, the first column's cell content takes up the full available width of the cell.
|
|
2
|
-
|
|
3
|
-
This is especially useful with custom cell renderers that need horizontal space — for example, a `Flex` with `justify="between"` that places content on both the left and right edges of the cell.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_full_width_cell_rails.html.erb
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
column_definitions = [
|
|
3
|
-
{
|
|
4
|
-
accessor: "year",
|
|
5
|
-
label: "Year",
|
|
6
|
-
cellAccessors: ["quarter", "month", "day"],
|
|
7
|
-
custom_renderer: ->(row, value) {
|
|
8
|
-
capture do
|
|
9
|
-
pb_rails("flex", props: { justify: "between" }) do
|
|
10
|
-
pb_rails("title", props: { text: value, size: 4 }) +
|
|
11
|
-
pb_rails("badge", props: { dark: true, margin_left: "xxs", text: row[:newEnrollments].to_i > 20 ? "High" : "Low", variant: "neutral" })
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
accessor: "newEnrollments",
|
|
18
|
-
label: "New Enrollments",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
accessor: "scheduledMeetings",
|
|
22
|
-
label: "Scheduled Meetings",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
accessor: "attendanceRate",
|
|
26
|
-
label: "Attendance Rate",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
accessor: "completedClasses",
|
|
30
|
-
label: "Completed Classes",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
accessor: "classCompletionRate",
|
|
34
|
-
label: "Class Completion Rate",
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
accessor: "graduatedStudents",
|
|
38
|
-
label: "Graduated Students",
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
%>
|
|
42
|
-
|
|
43
|
-
<%= pb_rails("advanced_table", props: {
|
|
44
|
-
id: "full_width_cell",
|
|
45
|
-
table_data: @table_data,
|
|
46
|
-
column_definitions: column_definitions,
|
|
47
|
-
enable_toggle_expansion: "all",
|
|
48
|
-
full_width_cell: true
|
|
49
|
-
}) %>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
`full_width_cell` is an optional boolean prop that defaults to `false`. When set to `true`, the first column's cell content takes up the full available width of the cell.
|
|
2
|
-
|
|
3
|
-
This is especially useful with custom cell renderers that need horizontal space — for example, a `Flex` with `justify: "between"` that places content on both the left and right edges of the cell.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both_rails.html.erb
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<%# Example sort method for demonstration purposes %>
|
|
2
|
-
<% if params["sort"] %>
|
|
3
|
-
<% sort_param = params["sort"].gsub(/_(asc|desc)\z/, "") %>
|
|
4
|
-
<% sort_direction = params["sort"].end_with?("_asc") ? 1 : -1 %>
|
|
5
|
-
<% @table_data_with_id.sort! do |a, b|
|
|
6
|
-
value_a = a[sort_param] || a[sort_param.to_sym]
|
|
7
|
-
value_b = b[sort_param] || b[sort_param.to_sym]
|
|
8
|
-
|
|
9
|
-
value_a = value_a.to_i if value_a.is_a?(String) && value_a.match?(/^\d+$/)
|
|
10
|
-
value_b = value_b.to_i if value_b.is_a?(String) && value_b.match?(/^\d+$/)
|
|
11
|
-
|
|
12
|
-
sort_direction * (value_a <=> value_b)
|
|
13
|
-
end %>
|
|
14
|
-
<% end %>
|
|
15
|
-
|
|
16
|
-
<% column_definitions = [
|
|
17
|
-
{
|
|
18
|
-
accessor: "year",
|
|
19
|
-
label: "Year",
|
|
20
|
-
cellAccessors: ["quarter", "month", "day"],
|
|
21
|
-
sort_menu: [
|
|
22
|
-
{ item: "Year", link: "?sort=year_asc#pinned_rows_both_table", active: params["sort"] == "year_asc", direction: "asc" },
|
|
23
|
-
{ item: "Year", link: "?sort=year_desc#pinned_rows_both_table", active: params["sort"] == "year_desc", direction: "desc" }
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
accessor: "newEnrollments",
|
|
28
|
-
label: "New Enrollments",
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
accessor: "scheduledMeetings",
|
|
32
|
-
label: "Scheduled Meetings",
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
accessor: "attendanceRate",
|
|
36
|
-
label: "Attendance Rate",
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
accessor: "completedClasses",
|
|
40
|
-
label: "Completed Classes",
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
accessor: "classCompletionRate",
|
|
44
|
-
label: "Class Completion Rate",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
accessor: "graduatedStudents",
|
|
48
|
-
label: "Graduated Students",
|
|
49
|
-
}
|
|
50
|
-
] %>
|
|
51
|
-
|
|
52
|
-
<% pinned_rows = { top: ["8"], bottom: ["1"] } %>
|
|
53
|
-
|
|
54
|
-
<%= pb_rails("advanced_table", props: { id: "pinned_rows_both_table", table_data: @table_data_with_id, column_definitions: column_definitions, max_height: "xs", pinned_rows: pinned_rows, responsive: "none", table_props: { sticky: true }}) do %>
|
|
55
|
-
<%= pb_rails("advanced_table/table_header", props: { table_id: "pinned_rows_both_table", column_definitions: column_definitions }) %>
|
|
56
|
-
<%= pb_rails("advanced_table/table_body", props: { table_id: "pinned_rows_both_table", table_data: @table_data_with_id, column_definitions: column_definitions, pinned_rows: pinned_rows }) %>
|
|
57
|
-
<% end %>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
This code snippet demonstrates `pinned_rows` taking a hash with an array of row ids to both the `top` and `bottom` keys.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom_rails.html.erb
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<%# Example sort method for demonstration purposes %>
|
|
2
|
-
<% if params["sort"] %>
|
|
3
|
-
<% sort_param = params["sort"].gsub(/_(asc|desc)\z/, "") %>
|
|
4
|
-
<% sort_direction = params["sort"].end_with?("_asc") ? 1 : -1 %>
|
|
5
|
-
<% @table_data_with_id.sort! do |a, b|
|
|
6
|
-
value_a = a[sort_param] || a[sort_param.to_sym]
|
|
7
|
-
value_b = b[sort_param] || b[sort_param.to_sym]
|
|
8
|
-
|
|
9
|
-
value_a = value_a.to_i if value_a.is_a?(String) && value_a.match?(/^\d+$/)
|
|
10
|
-
value_b = value_b.to_i if value_b.is_a?(String) && value_b.match?(/^\d+$/)
|
|
11
|
-
|
|
12
|
-
sort_direction * (value_a <=> value_b)
|
|
13
|
-
end %>
|
|
14
|
-
<% end %>
|
|
15
|
-
|
|
16
|
-
<% column_definitions = [
|
|
17
|
-
{
|
|
18
|
-
accessor: "year",
|
|
19
|
-
label: "Year",
|
|
20
|
-
cellAccessors: ["quarter", "month", "day"],
|
|
21
|
-
sort_menu: [
|
|
22
|
-
{ item: "Year", link: "?sort=year_asc#pinned_rows_bottom_table", active: params["sort"] == "year_asc", direction: "asc" },
|
|
23
|
-
{ item: "Year", link: "?sort=year_desc#pinned_rows_bottom_table", active: params["sort"] == "year_desc", direction: "desc" }
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
accessor: "newEnrollments",
|
|
28
|
-
label: "New Enrollments",
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
accessor: "scheduledMeetings",
|
|
32
|
-
label: "Scheduled Meetings",
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
accessor: "attendanceRate",
|
|
36
|
-
label: "Attendance Rate",
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
accessor: "completedClasses",
|
|
40
|
-
label: "Completed Classes",
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
accessor: "classCompletionRate",
|
|
44
|
-
label: "Class Completion Rate",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
accessor: "graduatedStudents",
|
|
48
|
-
label: "Graduated Students",
|
|
49
|
-
}
|
|
50
|
-
] %>
|
|
51
|
-
|
|
52
|
-
<% pinned_rows = { bottom: ["8"] } %>
|
|
53
|
-
|
|
54
|
-
<%= pb_rails("advanced_table", props: { id: "pinned_rows_bottom_table", table_data: @table_data_with_id, column_definitions: column_definitions, max_height: "xs", pinned_rows: pinned_rows, responsive: "none", table_props: { sticky: true }}) do %>
|
|
55
|
-
<%= pb_rails("advanced_table/table_header", props: { table_id: "pinned_rows_bottom_table", column_definitions: column_definitions }) %>
|
|
56
|
-
<%= pb_rails("advanced_table/table_body", props: { table_id: "pinned_rows_bottom_table", table_data: @table_data_with_id, column_definitions: column_definitions, pinned_rows: pinned_rows }) %>
|
|
57
|
-
<% end %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom_rails.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
This code snippet demonstrates `pinned_rows` taking a hash with an array of row ids to the `bottom` key.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_skipping_subrow_headers.html.erb
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
column_definitions = [
|
|
3
|
-
{
|
|
4
|
-
accessor: "year",
|
|
5
|
-
label: "Year",
|
|
6
|
-
cellAccessors: ["quarter", "month", "day"],
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
accessor: "newEnrollments",
|
|
10
|
-
label: "New Enrollments",
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
accessor: "scheduledMeetings",
|
|
14
|
-
label: "Scheduled Meetings",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
accessor: "attendanceRate",
|
|
18
|
-
label: "Attendance Rate",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
accessor: "completedClasses",
|
|
22
|
-
label: "Completed Classes",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
accessor: "classCompletionRate",
|
|
26
|
-
label: "Class Completion Rate",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
accessor: "graduatedStudents",
|
|
30
|
-
label: "Graduated Students",
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
|
|
34
|
-
subrow_headers = ["Quarter", "", "Day"]
|
|
35
|
-
%>
|
|
36
|
-
|
|
37
|
-
<%= pb_rails("advanced_table", props: { id: "skipping-subrow-headers", table_data: @table_data, column_definitions: column_definitions }) do %>
|
|
38
|
-
<%= pb_rails("advanced_table/table_header", props: { table_id: "skipping-subrow-headers", column_definitions: column_definitions }) %>
|
|
39
|
-
<%= pb_rails("advanced_table/table_body", props: { table_id: "skipping-subrow-headers", table_data: @table_data, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all" }) %>
|
|
40
|
-
<% end %>
|