playbook_ui 16.3.0 → 16.4.0.pre.alpha.PLAY2846reactadvancedtablecalcheaderpinnedrows15356
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/Components/CustomCell.tsx +17 -4
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/Context/AdvancedTableContext.tsx +5 -2
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +21 -9
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +5 -2
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +9 -11
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/ExpansionControlHelpers.tsx +25 -1
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowModelUtils.ts +100 -0
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +65 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +12 -2
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +9 -0
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +109 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_cascade_collapse.jsx +50 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_cascade_collapse.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.html.erb +57 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.md +7 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_parent_only.jsx +175 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_parent_only.md +5 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/index.js +130 -29
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +6 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +21 -4
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +115 -9
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +12 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +4 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +9 -1
- data/app/pb_kits/playbook/pb_button/_button_mixins.scss +6 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_full_width_rails.md +19 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_full_width_react.md +23 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +5 -0
- data/app/pb_kits/playbook/pb_collapsible/index.js +15 -26
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +3 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +1 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.jsx +6 -3
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.jsx +6 -3
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.jsx +6 -3
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +3 -0
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_closing_options_rails.html.erb +16 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_closing_options_rails.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_event_type.html.erb +224 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_event_type.md +7 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +8 -1
- data/app/pb_kits/playbook/pb_dropdown/index.js +255 -46
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +19 -14
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.scss +4 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +3 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_nav_margin.html.erb +46 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_nav_margin.jsx +42 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_nav_margin_rails.md +1 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_nav_margin_react.md +1 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +7 -1
- data/app/pb_kits/playbook/pb_icon/icon.rb +7 -1
- data/app/pb_kits/playbook/pb_list/_list_mixin.scss +4 -4
- data/app/pb_kits/playbook/pb_multi_level_select/_helper_functions.tsx +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +27 -16
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_placeholder.html.erb +109 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_placeholder.jsx +127 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_placeholder.md +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +3 -0
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.test.jsx +27 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_placement.jsx +81 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_placement_react.md +1 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_position.html.erb +128 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_position_rails.md +1 -0
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_popover/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +35 -134
- data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_editor.tsx +51 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/_trix_editor.tsx +206 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.jsx +56 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +13 -21
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +0 -10
- data/app/pb_kits/playbook/pb_rich_text_editor/inlineFocus.ts +5 -4
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.scss +19 -1
- data/app/pb_kits/playbook/pb_table/_table.tsx +24 -21
- 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/_table_with_filter_with_card_title_props.jsx +152 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props.md +17 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props_rails.html.erb +121 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_with_card_title_props_rails.md +17 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_table/table.html.erb +17 -13
- data/app/pb_kits/playbook/pb_table/table.rb +8 -0
- data/app/pb_kits/playbook/pb_table/table.test.js +33 -0
- data/app/pb_kits/playbook/pb_textarea/_textarea.scss +4 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +105 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +20 -8
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.md +3 -0
- data/app/pb_kits/playbook/utilities/_hover.scss +6 -3
- data/app/pb_kits/playbook/utilities/domHelpers.ts +50 -0
- data/dist/chunks/{_pb_line_graph-CKBPxTmM.js → _pb_line_graph-D6s5rymw.js} +1 -1
- data/dist/chunks/_typeahead-BNp_YiTh.js +1 -0
- data/dist/chunks/componentRegistry-DRSp5D_e.js +1 -0
- data/dist/chunks/{globalProps-DLCfJwiU.js → globalProps-Ds_6HBhX.js} +1 -1
- data/dist/chunks/lib-BaO72ugL.js +29 -0
- data/dist/chunks/vendor.js +5 -5
- data/dist/menu.yml +3 -2
- 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/pb_forms_helper.rb +3 -0
- data/lib/playbook/version.rb +2 -2
- metadata +42 -32
- data/app/pb_kits/playbook/pb_button/docs/_button_full_width.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.html.erb +0 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.jsx +0 -15
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.html.erb +0 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.jsx +0 -17
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.html.erb +0 -6
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.jsx +0 -16
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.jsx +0 -28
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +0 -35
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.jsx +0 -45
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.html.erb +0 -10
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.jsx +0 -22
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.md +0 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.html.erb +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.jsx +0 -13
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.html.erb +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.jsx +0 -15
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_templates.html.erb +0 -115
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_templates.jsx +0 -42
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_bottom.html.erb +0 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_bottom.jsx +0 -14
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.html.erb +0 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +0 -63
- data/dist/chunks/_typeahead-B7bktFm6.js +0 -1
- data/dist/chunks/componentRegistry-DzmmLR2x.js +0 -1
- data/dist/chunks/lib-QT_7rPYf.js +0 -29
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
|
|
3
|
+
import Caption from '../../pb_caption/_caption'
|
|
4
|
+
// The TrixEditor and Trix imports are required for the Legacy RichTextEditor to work
|
|
5
|
+
// They are passed as props to the RichTextEditor kit
|
|
6
|
+
import { TrixEditor } from 'react-trix'
|
|
7
|
+
import Trix from 'trix'
|
|
3
8
|
|
|
4
9
|
const RichTextEditorDefault = (props) => {
|
|
5
10
|
const [value, setValue] = useState('Add your text here. You can format your text, add links, quotes, and bullets.'),
|
|
@@ -7,11 +12,62 @@ const RichTextEditorDefault = (props) => {
|
|
|
7
12
|
|
|
8
13
|
return (
|
|
9
14
|
<div>
|
|
15
|
+
<Caption marginBottom="xs"
|
|
16
|
+
text="Default"
|
|
17
|
+
/>
|
|
10
18
|
<RichTextEditor
|
|
19
|
+
TrixEditor={TrixEditor}
|
|
11
20
|
onChange={handleOnChange}
|
|
21
|
+
trixInstance={Trix}
|
|
12
22
|
value={value}
|
|
13
23
|
{...props}
|
|
14
24
|
/>
|
|
25
|
+
<br/>
|
|
26
|
+
<Caption marginBottom="xs"
|
|
27
|
+
text="Simple"
|
|
28
|
+
/>
|
|
29
|
+
<RichTextEditor
|
|
30
|
+
TrixEditor={TrixEditor}
|
|
31
|
+
simple
|
|
32
|
+
trixInstance={Trix}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
<br/>
|
|
36
|
+
<Caption marginBottom="xs"
|
|
37
|
+
text="Focus"
|
|
38
|
+
/>
|
|
39
|
+
<RichTextEditor
|
|
40
|
+
TrixEditor={TrixEditor}
|
|
41
|
+
focus
|
|
42
|
+
trixInstance={Trix}
|
|
43
|
+
{...props}
|
|
44
|
+
/>
|
|
45
|
+
<br/>
|
|
46
|
+
<Caption marginBottom="xs"
|
|
47
|
+
text="Inline"
|
|
48
|
+
/>
|
|
49
|
+
<RichTextEditor
|
|
50
|
+
TrixEditor={TrixEditor}
|
|
51
|
+
id="inline"
|
|
52
|
+
inline
|
|
53
|
+
toolbarBottom
|
|
54
|
+
trixInstance={Trix}
|
|
55
|
+
value="Try hovering over this text. Then try modifying it or adding more of your own text."
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
58
|
+
<br/>
|
|
59
|
+
<Caption marginBottom="xs"
|
|
60
|
+
text="Sticky"
|
|
61
|
+
/>
|
|
62
|
+
<RichTextEditor
|
|
63
|
+
TrixEditor={TrixEditor}
|
|
64
|
+
id="sticky"
|
|
65
|
+
sticky
|
|
66
|
+
trixInstance={Trix}
|
|
67
|
+
value="In this example, when you scroll down, the rich text editor's toolbar will scroll along with the page and it will no longer be visible at the top of the page. Dummy text to enable scroll.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis."
|
|
68
|
+
{...props}
|
|
69
|
+
/>
|
|
70
|
+
|
|
15
71
|
</div>
|
|
16
72
|
)
|
|
17
73
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
**IMPORTANT**: The Trix version of the RichTextEditor is a Legacy kit and no longer being actively maintained. Please use the advanced Editor above.
|
|
@@ -1,40 +1,32 @@
|
|
|
1
1
|
examples:
|
|
2
2
|
|
|
3
3
|
rails:
|
|
4
|
-
- rich_text_editor_default: Default
|
|
5
|
-
- rich_text_editor_simple: Simple
|
|
6
|
-
- rich_text_editor_attributes: Attributes
|
|
7
|
-
- rich_text_editor_focus: Focus
|
|
8
|
-
- rich_text_editor_sticky: Sticky
|
|
9
|
-
- rich_text_editor_templates: Templates
|
|
10
|
-
# - rich_text_editor_toolbar_bottom: Toolbar Bottom
|
|
11
|
-
- rich_text_editor_inline: Inline
|
|
12
|
-
- rich_text_editor_required_indicator: Required Indicator
|
|
13
|
-
- rich_text_editor_preview: Preview
|
|
14
4
|
|
|
15
5
|
react:
|
|
16
|
-
- rich_text_editor_default: Default
|
|
17
6
|
- rich_text_editor_advanced_default: Advanced Default
|
|
18
7
|
- rich_text_editor_more_extensions: Advanced (Extra Extensions)
|
|
19
8
|
- rich_text_editor_toolbar_disabled: Advanced (Toolbar disabled)
|
|
20
|
-
- rich_text_editor_simple: Simple
|
|
21
9
|
- rich_text_editor_advanced_simple: Advanced (Simple)
|
|
22
|
-
- rich_text_editor_attributes: Attributes
|
|
23
10
|
- rich_text_editor_advanced_attributes: Advanced (Attributes)
|
|
24
|
-
- rich_text_editor_focus: Focus
|
|
25
11
|
- rich_text_editor_advanced_focus: Advanced (Focus)
|
|
26
|
-
- rich_text_editor_sticky: Sticky
|
|
27
12
|
- rich_text_editor_advanced_sticky: Advanced (Sticky)
|
|
28
|
-
- rich_text_editor_templates: Templates
|
|
29
13
|
- rich_text_editor_advanced_templates: Advanced (Templates)
|
|
30
|
-
# - rich_text_editor_toolbar_bottom: Toolbar Bottom
|
|
31
|
-
- rich_text_editor_inline: Inline
|
|
32
14
|
- rich_text_editor_advanced_inline: Advanced (Inline)
|
|
33
15
|
- rich_text_editor_advanced_height: Advanced Height
|
|
34
16
|
- rich_text_editor_advanced_min_height: Advanced Min Height
|
|
35
|
-
- rich_text_editor_label: Label
|
|
36
17
|
- rich_text_editor_advanced_label: Advanced (Label)
|
|
37
|
-
- rich_text_editor_required_indicator: Required Indicator
|
|
38
18
|
- rich_text_editor_advanced_required_indicator: Advanced Required Indicator
|
|
39
|
-
- rich_text_editor_preview: Preview
|
|
40
19
|
- rich_text_editor_advanced_preview: Advanced Preview
|
|
20
|
+
- rich_text_editor_default: Legacy Default (Trix)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
export { default as RichTextEditorDefault } from './_rich_text_editor_default.jsx'
|
|
2
|
-
export { default as RichTextEditorSimple } from './_rich_text_editor_simple.jsx'
|
|
3
|
-
export { default as RichTextEditorAttributes } from './_rich_text_editor_attributes.jsx'
|
|
4
|
-
export { default as RichTextEditorFocus } from './_rich_text_editor_focus.jsx'
|
|
5
|
-
export { default as RichTextEditorSticky } from './_rich_text_editor_sticky.jsx'
|
|
6
|
-
export { default as RichTextEditorTemplates } from './_rich_text_editor_templates.jsx'
|
|
7
|
-
export { default as RichTextEditorToolbarBottom } from './_rich_text_editor_toolbar_bottom.jsx'
|
|
8
|
-
export { default as RichTextEditorInline } from './_rich_text_editor_inline.jsx'
|
|
9
|
-
export { default as RichTextEditorPreview } from './_rich_text_editor_preview.jsx'
|
|
10
2
|
export { default as RichTextEditorAdvancedDefault } from './_rich_text_editor_advanced_default.jsx'
|
|
11
3
|
export { default as RichTextEditorMoreExtensions } from './_rich_text_editor_more_extensions.jsx'
|
|
12
4
|
export { default as RichTextEditorToolbarDisabled } from './_rich_text_editor_toolbar_disabled.jsx'
|
|
@@ -19,7 +11,5 @@ export { default as RichTextEditorAdvancedSticky } from './_rich_text_editor_adv
|
|
|
19
11
|
export { default as RichTextEditorAdvancedInline } from './_rich_text_editor_advanced_inline.jsx'
|
|
20
12
|
export { default as RichTextEditorAdvancedHeight } from './_rich_text_editor_advanced_height.jsx'
|
|
21
13
|
export { default as RichTextEditorAdvancedMinHeight } from './_rich_text_editor_advanced_min_height.jsx'
|
|
22
|
-
export { default as RichTextEditorRequiredIndicator } from './_rich_text_editor_required_indicator.jsx'
|
|
23
14
|
export { default as RichTextEditorAdvancedRequiredIndicator } from './_rich_text_editor_advanced_required_indicator.jsx'
|
|
24
|
-
export { default as RichTextEditorLabel } from './_rich_text_editor_label.jsx'
|
|
25
15
|
export { default as RichTextEditorAdvancedLabel } from './_rich_text_editor_advanced_label.jsx'
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
const inlineFocus = () => {
|
|
2
|
-
const trixEditorElement = event.target
|
|
3
|
-
|
|
1
|
+
const inlineFocus = (event: Event) => {
|
|
2
|
+
const trixEditorElement = event.target
|
|
3
|
+
if (!(trixEditorElement instanceof Element)) return
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const trixEditorContainer = trixEditorElement.closest('.pb_rich_text_editor_kit')
|
|
6
|
+
if (!trixEditorContainer?.classList.contains('inline')) return
|
|
6
7
|
|
|
7
8
|
trixEditorContainer.classList.toggle('focused')
|
|
8
9
|
}
|
|
@@ -3,7 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
.pb_selectable_list_kit {
|
|
5
5
|
margin-bottom: 0px;
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
li {
|
|
8
|
+
border-bottom-color: $input_border_default;
|
|
9
|
+
|
|
10
|
+
&:before {
|
|
11
|
+
color: $text_lighter;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
7
15
|
.pb_item_kit,
|
|
8
16
|
.pb_item_kit_checked_item {
|
|
9
17
|
&:hover {
|
|
@@ -14,4 +22,14 @@
|
|
|
14
22
|
.checked_item {
|
|
15
23
|
background-color: $active_light;
|
|
16
24
|
}
|
|
25
|
+
|
|
26
|
+
.dark {
|
|
27
|
+
li {
|
|
28
|
+
border-bottom-color: $input_border_default_dark;
|
|
29
|
+
|
|
30
|
+
&:before {
|
|
31
|
+
color: $text_lighter_dark;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
17
35
|
}
|
|
@@ -20,6 +20,7 @@ type TableProps = {
|
|
|
20
20
|
aria?: { [key: string]: string },
|
|
21
21
|
children: React.ReactNode[] | React.ReactNode,
|
|
22
22
|
className: string,
|
|
23
|
+
cardProps?: { [key: string]: any },
|
|
23
24
|
collapse?: "sm" | "md" | "lg",
|
|
24
25
|
container?: boolean,
|
|
25
26
|
dark?: boolean,
|
|
@@ -42,6 +43,7 @@ type TableProps = {
|
|
|
42
43
|
striped?: boolean,
|
|
43
44
|
tag?: "table" | "div",
|
|
44
45
|
title?: string,
|
|
46
|
+
titleProps?: { [key: string]: any },
|
|
45
47
|
variant?: "default" | "withFilter",
|
|
46
48
|
verticalBorder?: boolean,
|
|
47
49
|
} & GlobalProps
|
|
@@ -52,6 +54,8 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
|
52
54
|
const {
|
|
53
55
|
aria = {},
|
|
54
56
|
variant = 'default',
|
|
57
|
+
cardProps = {},
|
|
58
|
+
titleProps = {},
|
|
55
59
|
children,
|
|
56
60
|
className,
|
|
57
61
|
collapse = variant === 'withFilter' ? 'md' : 'sm',
|
|
@@ -348,34 +352,33 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
|
348
352
|
|
|
349
353
|
// Merge default props with user-provided props (user props override defaults)
|
|
350
354
|
const mergedFilterProps = { ...defaultFilterProps, ...filterProps }
|
|
355
|
+
|
|
356
|
+
// Default card props that CAN be overridden (All props from Card kit CAN be used, but these are the ones we set as defaults)
|
|
357
|
+
const defaultCardProps: { [key: string]: any } = {
|
|
358
|
+
padding: "none",
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// Merge default props with user-provided props (user props override defaults)
|
|
362
|
+
const mergedCardProps = { ...defaultCardProps, ...cardProps }
|
|
363
|
+
|
|
364
|
+
// Default title props that CAN be overridden (All props from Title kit CAN be used, but these are the ones we set as defaults)
|
|
365
|
+
const defaultTitleProps: { [key: string]: any } = {
|
|
366
|
+
size: 3,
|
|
367
|
+
paddingY: "md",
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// Merge default props with user-provided props (user props override defaults)
|
|
371
|
+
const mergedTitleProps = { ...defaultTitleProps, ...titleProps }
|
|
351
372
|
|
|
352
373
|
return (
|
|
353
374
|
<>
|
|
354
375
|
{title && (
|
|
355
|
-
<Title
|
|
356
|
-
paddingLeft={{
|
|
357
|
-
xs: "sm",
|
|
358
|
-
sm: "sm",
|
|
359
|
-
md: "xl",
|
|
360
|
-
lg: "xl",
|
|
361
|
-
xl: "xl",
|
|
362
|
-
default: "xl",
|
|
363
|
-
} as any}
|
|
364
|
-
paddingY="md"
|
|
365
|
-
size={3}
|
|
376
|
+
<Title {...mergedTitleProps}
|
|
366
377
|
text={title}
|
|
367
|
-
/>
|
|
378
|
+
/>
|
|
368
379
|
)}
|
|
369
380
|
<Card
|
|
370
|
-
|
|
371
|
-
xs: "sm",
|
|
372
|
-
sm: "sm",
|
|
373
|
-
md: "xl",
|
|
374
|
-
lg: "xl",
|
|
375
|
-
xl: "xl",
|
|
376
|
-
default: "xl",
|
|
377
|
-
} as any}
|
|
378
|
-
padding="none"
|
|
381
|
+
{...mergedCardProps}
|
|
379
382
|
>
|
|
380
383
|
<Flex
|
|
381
384
|
align="stretch"
|
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).
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import React, { useState } from "react"
|
|
2
|
+
import { Button, Date as DateKit, DatePicker, Dropdown, Select, Table, TextInput, Typeahead, Flex } from "playbook-ui"
|
|
3
|
+
|
|
4
|
+
// Mock Data for Table
|
|
5
|
+
const users = [
|
|
6
|
+
{ id: 1, name: "Jennifer", title: "Associate Scrum Master", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-01" },
|
|
7
|
+
{ id: 2, name: "Nick", title: "UX Engineer II", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-02" },
|
|
8
|
+
{ id: 3, name: "Nida", title: "Senior UX Engineer", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-03" },
|
|
9
|
+
{ id: 4, name: "Justin", title: "Director of User Experience Engineering", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-04" },
|
|
10
|
+
{ id: 5, name: "Edward", title: "UX Designer II", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-05" },
|
|
11
|
+
{ id: 6, name: "Elisa", title: "UX Engineer", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-06" },
|
|
12
|
+
{ id: 7, name: "Gary", title: "UX Engineer", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-07" },
|
|
13
|
+
{ id: 8, name: "Barkley", title: "Nitro Quality Ninja", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-08" },
|
|
14
|
+
{ id: 9, name: "Aaron", title: "Associate Nitro Quality Ninja", department: "Business Technology", branch: "Philadelphia", startDate: "2025-01-09" },
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
const TableWithFilterWithCardTitleProps = () => {
|
|
18
|
+
const [territory, setTerritory] = useState("")
|
|
19
|
+
|
|
20
|
+
// --------Filter content example ------
|
|
21
|
+
const filterContent = ({ closePopover }) => (
|
|
22
|
+
<>
|
|
23
|
+
<TextInput
|
|
24
|
+
label="Territory ID"
|
|
25
|
+
onChange={event => setTerritory(event.target.value)}
|
|
26
|
+
value={territory}
|
|
27
|
+
/>
|
|
28
|
+
|
|
29
|
+
<Typeahead
|
|
30
|
+
label="Title"
|
|
31
|
+
options={[
|
|
32
|
+
{ key: "senior-ux-engineer", label: "Senior UX Engineer", value: "senior-ux-engineer" },
|
|
33
|
+
{ key: "ux-engineer", label: "UX Engineer", value: "ux-engineer" },
|
|
34
|
+
{ key: "ux-designer", label: "UX Designer", value: "ux-designer" }
|
|
35
|
+
]}
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<Select
|
|
39
|
+
blankSelection="All Departments"
|
|
40
|
+
label="Department"
|
|
41
|
+
options={[
|
|
42
|
+
{ value: "Business Technology", label: "Business Technology", key: "business-technology" },
|
|
43
|
+
{ value: "Customer Development", label: "Customer Development", key: "customer-development" },
|
|
44
|
+
{ value: "Talent Acquisition", label: "Talent Acquisition", key: "talent-acquisition" }
|
|
45
|
+
]}
|
|
46
|
+
/>
|
|
47
|
+
|
|
48
|
+
<Dropdown
|
|
49
|
+
label="Branch"
|
|
50
|
+
options={[
|
|
51
|
+
{ key: "Philadelphia", label: "Philadelphia", value: "philadelphia" },
|
|
52
|
+
{ key: "New York", label: "New York", value: "new-york" },
|
|
53
|
+
{ key: "Austin", label: "Austin", value: "austin" }
|
|
54
|
+
]}
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
<DatePicker
|
|
58
|
+
label="Start Date"
|
|
59
|
+
paddingY="sm"
|
|
60
|
+
pickerId="startedOn"
|
|
61
|
+
/>
|
|
62
|
+
<Flex spacing="between">
|
|
63
|
+
<Button
|
|
64
|
+
onClick={() => {
|
|
65
|
+
alert("No filtering functionality - just a pattern demo!")
|
|
66
|
+
closePopover()
|
|
67
|
+
}}
|
|
68
|
+
text="Filter"
|
|
69
|
+
/>
|
|
70
|
+
<Button
|
|
71
|
+
text="Defaults"
|
|
72
|
+
variant="secondary"
|
|
73
|
+
/>
|
|
74
|
+
</Flex>
|
|
75
|
+
</>
|
|
76
|
+
)
|
|
77
|
+
// -------End Filter content example ------
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<Table
|
|
81
|
+
cardProps={{marginX: {
|
|
82
|
+
xs: "sm",
|
|
83
|
+
sm: "sm",
|
|
84
|
+
md: "xl",
|
|
85
|
+
lg: "xl",
|
|
86
|
+
xl: "xl",
|
|
87
|
+
default: "xl",
|
|
88
|
+
}}}
|
|
89
|
+
filterContent={filterContent}
|
|
90
|
+
filterProps={{
|
|
91
|
+
results: 50,
|
|
92
|
+
sortOptions: {
|
|
93
|
+
territory_id: "Territory ID",
|
|
94
|
+
first_name: "Name",
|
|
95
|
+
started_on: "Start Date",
|
|
96
|
+
department_name: "Department",
|
|
97
|
+
title_name: "Title",
|
|
98
|
+
branch_branch_name: "Branch",
|
|
99
|
+
},
|
|
100
|
+
sortValue: [{ name: 'started_on', dir: 'asc' }],
|
|
101
|
+
}}
|
|
102
|
+
title="Table Title Here"
|
|
103
|
+
titleProps={{
|
|
104
|
+
paddingLeft:{
|
|
105
|
+
xs: "sm",
|
|
106
|
+
sm: "sm",
|
|
107
|
+
md: "xl",
|
|
108
|
+
lg: "xl",
|
|
109
|
+
xl: "xl",
|
|
110
|
+
default: "xl",
|
|
111
|
+
}
|
|
112
|
+
}}
|
|
113
|
+
variant="withFilter"
|
|
114
|
+
>
|
|
115
|
+
<Table.Head>
|
|
116
|
+
<Table.Row>
|
|
117
|
+
<Table.Header>{'Territory ID'}</Table.Header>
|
|
118
|
+
<Table.Header>{'Name'}</Table.Header>
|
|
119
|
+
<Table.Header>{'Title'}</Table.Header>
|
|
120
|
+
<Table.Header>{'Department'}</Table.Header>
|
|
121
|
+
<Table.Header>{'Branch'}</Table.Header>
|
|
122
|
+
<Table.Header textAlign="right">{'Start Date'}</Table.Header>
|
|
123
|
+
</Table.Row>
|
|
124
|
+
</Table.Head>
|
|
125
|
+
<Table.Body>
|
|
126
|
+
{users.map((user) => (
|
|
127
|
+
<Table.Row key={user.id}>
|
|
128
|
+
<Table.Cell
|
|
129
|
+
marginX={{ xs: "sm" }}
|
|
130
|
+
numberSpacing="tabular"
|
|
131
|
+
>
|
|
132
|
+
{user.id}
|
|
133
|
+
</Table.Cell>
|
|
134
|
+
<Table.Cell marginX={{ xs: "sm" }}>{user.name}</Table.Cell>
|
|
135
|
+
<Table.Cell marginX={{ xs: "sm" }}>{user.title}</Table.Cell>
|
|
136
|
+
<Table.Cell marginX={{ xs: "sm" }}>{user.department}</Table.Cell>
|
|
137
|
+
<Table.Cell marginX={{ xs: "sm" }}>{user.branch}</Table.Cell>
|
|
138
|
+
<Table.Cell marginX={{ xs: "sm" }}>
|
|
139
|
+
<DateKit
|
|
140
|
+
alignment="right"
|
|
141
|
+
showCurrentYear
|
|
142
|
+
value={user.startDate}
|
|
143
|
+
/>
|
|
144
|
+
</Table.Cell>
|
|
145
|
+
</Table.Row>
|
|
146
|
+
))}
|
|
147
|
+
</Table.Body>
|
|
148
|
+
</Table>
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export default TableWithFilterWithCardTitleProps
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
The `withFilter` variant also offers 2 additional optional props:
|
|
2
|
+
|
|
3
|
+
`cardProps`: An object containing Card-specific props.
|
|
4
|
+
`titleProps`: An object containing Title-specific props.
|
|
5
|
+
|
|
6
|
+
#### Default Card Props
|
|
7
|
+
|
|
8
|
+
The Table kit automatically sets these Card defaults (which you can override via `cardProps`):
|
|
9
|
+
|
|
10
|
+
- `padding="none"`
|
|
11
|
+
|
|
12
|
+
#### Default Title Props
|
|
13
|
+
|
|
14
|
+
The Table kit automatically sets these Title defaults (which you can override via `titleProps`):
|
|
15
|
+
|
|
16
|
+
- `size={3}`
|
|
17
|
+
- `paddingY="md"`
|