playbook_ui 16.4.0.pre.alpha.PLAY2863railsselectlabelsfor15352 → 16.4.0.pre.alpha.PLAY2864circleiconbuttonloadingalignrails15138
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/_advanced_table.scss +0 -19
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +2 -6
- data/app/pb_kits/playbook/pb_button/docs/_button_full_width.md +1 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_loading.html.erb +25 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_loading.jsx +97 -38
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -3
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +0 -3
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.test.jsx +0 -27
- data/app/pb_kits/playbook/pb_select/docs/_select_attributes.html.erb +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_blank.html.erb +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_custom_select.html.erb +1 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_custom_select_subheaders.html.erb +1 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_default.html.erb +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_disabled.html.erb +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_disabled_options.html.erb +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_error.html.erb +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_inline.html.erb +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_inline_compact.html.erb +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_inline_show_arrow.html.erb +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_multiple.html.erb +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_required.html.erb +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_required_indicator.html.erb +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_value_text_same.html.erb +0 -1
- data/app/pb_kits/playbook/pb_select/select.html.erb +5 -5
- data/app/pb_kits/playbook/pb_select/select.rb +0 -5
- data/app/pb_kits/playbook/pb_table/docs/_sections.yml +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.md +1 -2
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_table/table.html.erb +2 -5
- data/app/pb_kits/playbook/pb_table/table.rb +0 -4
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +8 -20
- data/app/pb_kits/playbook/utilities/_hover.scss +3 -6
- data/dist/chunks/_typeahead-Bh0RF1X-.js +1 -0
- data/dist/chunks/vendor.js +2 -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/version.rb +1 -1
- metadata +4 -11
- data/app/pb_kits/playbook/pb_button/docs/_button_full_width_rails.md +0 -19
- data/app/pb_kits/playbook/pb_button/docs/_button_full_width_react.md +0 -23
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_placeholder.html.erb +0 -109
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_placeholder.jsx +0 -127
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_placeholder.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_external_filter_rails.html.erb +0 -45
- data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_external_filter_rails.md +0 -39
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.md +0 -3
- data/dist/chunks/_typeahead-BNp_YiTh.js +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 21855ec8daced0bc073482bcbf66b959ad76a196a6ea7a974d9a7de932f1b1a9
|
|
4
|
+
data.tar.gz: 32376b89618eee8730e81f9c15905713a1a8e9e133c678351002a254532cc687
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 64a631056bcb1f146451812f20a591fca787188feded58d5b78aebbd4616fe9b52c4e11750fbcdb446b5debd2d5aa391a264d0073deb499583db556f87dabeb5
|
|
7
|
+
data.tar.gz: 1163aebdf5a6439e03ab5fd670e8a4fdd97c05c663c96967687df221eba7ca822cc81915e2ba0351c509118f0ad105f494560fcd4f54b74baf04554f914065aa
|
|
@@ -674,18 +674,12 @@
|
|
|
674
674
|
@each $color_name, $color_value in $border_color_options {
|
|
675
675
|
&.column-group-border-#{$color_name} {
|
|
676
676
|
@if $theme == "light" {
|
|
677
|
-
&:not(.advanced-table-no-table-container) {
|
|
678
|
-
@include advanced-table-sticky-wrapper-frame($color_value);
|
|
679
|
-
}
|
|
680
677
|
@include advanced-table-sticky-mixin(
|
|
681
678
|
$color_value,
|
|
682
679
|
$white,
|
|
683
680
|
lighten($silver, $opacity_7)
|
|
684
681
|
);
|
|
685
682
|
} @else if $theme == "dark" {
|
|
686
|
-
&:not(.advanced-table-no-table-container) {
|
|
687
|
-
@include advanced-table-sticky-wrapper-frame($color_value);
|
|
688
|
-
}
|
|
689
683
|
@include advanced-table-sticky-mixin(
|
|
690
684
|
$color_value,
|
|
691
685
|
$bg_dark_card,
|
|
@@ -721,10 +715,6 @@
|
|
|
721
715
|
width: 100%;
|
|
722
716
|
@include scrollbar-styling;
|
|
723
717
|
|
|
724
|
-
&:not(.advanced-table-no-table-container) {
|
|
725
|
-
@include advanced-table-sticky-wrapper-frame($border_light);
|
|
726
|
-
}
|
|
727
|
-
|
|
728
718
|
// These are the responsive borders that should NOT inherit the custom color
|
|
729
719
|
@include advanced-table-sticky-mixin(
|
|
730
720
|
$border_light,
|
|
@@ -1018,11 +1008,6 @@
|
|
|
1018
1008
|
.sticky-left {
|
|
1019
1009
|
background-color: $bg_dark;
|
|
1020
1010
|
}
|
|
1021
|
-
|
|
1022
|
-
&:not(.advanced-table-no-table-container) {
|
|
1023
|
-
@include advanced-table-sticky-wrapper-frame($border_dark);
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
1011
|
@include advanced-table-sticky-mixin(
|
|
1027
1012
|
$border_dark,
|
|
1028
1013
|
$bg_dark_card,
|
|
@@ -1041,10 +1026,6 @@
|
|
|
1041
1026
|
}
|
|
1042
1027
|
}
|
|
1043
1028
|
|
|
1044
|
-
&:not(.advanced-table-no-table-container) {
|
|
1045
|
-
@include advanced-table-sticky-wrapper-frame($border_dark);
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
1029
|
// These are the responsive borders that should NOT inherit the custom color
|
|
1049
1030
|
@include advanced-table-sticky-mixin(
|
|
1050
1031
|
$border_dark,
|
|
@@ -127,8 +127,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
127
127
|
fullScreenControl,
|
|
128
128
|
} = props;
|
|
129
129
|
|
|
130
|
-
const noTableCardContainer = tableProps?.container === false;
|
|
131
|
-
|
|
132
130
|
// Component refs
|
|
133
131
|
const tableWrapperRef = useRef<HTMLDivElement>(null);
|
|
134
132
|
|
|
@@ -283,7 +281,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
283
281
|
'hidden-action-bar': (selectableRows || columnVisibilityControl) && !isActionBarVisible,
|
|
284
282
|
},
|
|
285
283
|
{'advanced-table-sticky-left-columns': stickyLeftColumn && stickyLeftColumn.length > 0},
|
|
286
|
-
{ 'advanced-table-no-table-container': noTableCardContainer },
|
|
287
284
|
columnGroupBorderColor ? `column-group-border-${columnGroupBorderColor}` : '',
|
|
288
285
|
scrollBarNone ? 'advanced-table-hide-scrollbar' : '',
|
|
289
286
|
globalProps(props),
|
|
@@ -48,16 +48,9 @@ module Playbook
|
|
|
48
48
|
hidden_action_bar_class,
|
|
49
49
|
]
|
|
50
50
|
additional_classes << "column-group-border-#{column_group_border_color}" if column_group_border_color != "none"
|
|
51
|
-
additional_classes << "advanced-table-no-table-container" if no_table_card_container?
|
|
52
51
|
generate_classname("pb_advanced_table", *additional_classes, separator: " ")
|
|
53
52
|
end
|
|
54
53
|
|
|
55
|
-
def no_table_card_container?
|
|
56
|
-
return false unless table_props.is_a?(Hash)
|
|
57
|
-
|
|
58
|
-
table_props[:container] == false || table_props["container"] == false
|
|
59
|
-
end
|
|
60
|
-
|
|
61
54
|
def responsive_classname
|
|
62
55
|
responsive == "scroll" ? "advanced-table-responsive-scroll" : "advanced-table-responsive-none"
|
|
63
56
|
end
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
// Acts as outer “card frame” on the advanced-table wrapper (table-card from Table) is included from `_advanced_table.scss` only when `:not(.advanced-table-no-table-container)`/container: false is not present.
|
|
2
|
-
@mixin advanced-table-sticky-wrapper-frame($border-color) {
|
|
3
|
-
border-radius: 4px;
|
|
4
|
-
box-shadow: 1px 0 0 0px $border-color, -1px 0 0 0px $border-color;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
1
|
@mixin advanced-table-sticky-mixin(
|
|
8
2
|
$border-color,
|
|
9
3
|
$bg-main,
|
|
@@ -11,6 +5,8 @@
|
|
|
11
5
|
$highlight: #E5EEFA,
|
|
12
6
|
$highlight-dark: #202850,
|
|
13
7
|
) {
|
|
8
|
+
border-radius: 4px;
|
|
9
|
+
box-shadow: 1px 0 0 0px $border-color, -1px 0 0 0px $border-color;
|
|
14
10
|
display: block;
|
|
15
11
|
[class^="pb_table"].table-sm.table-card thead tr th:first-child,
|
|
16
12
|
[class^="pb_table"].table-sm:not(.no-hover).table-card
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This button is used many times for mobile or other things like cards and sidebars.
|
|
@@ -27,3 +27,28 @@
|
|
|
27
27
|
icon: "user",
|
|
28
28
|
loading: true
|
|
29
29
|
}) %>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<%= pb_rails("button", props: { margin_top: "md", text: "Open Dialog to confirm PLAY-2837 fix still works", data: {"open-dialog": "dialog-1"} }) %>
|
|
33
|
+
|
|
34
|
+
<%= pb_rails("dialog", props: {
|
|
35
|
+
id:"dialog-1",
|
|
36
|
+
size: "md",
|
|
37
|
+
title: "Header Title is the Title Prop"
|
|
38
|
+
}) do %>
|
|
39
|
+
<%= pb_rails("dialog/dialog_body") do %>
|
|
40
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, loading: true, margin_right: "lg", text: "Button Primary" }) %>
|
|
41
|
+
<%= pb_rails("circle_icon_button", props: { loading: true, icon: "plus" }) %>
|
|
42
|
+
<div style="height: 800px; background-color: lightgray;"></div>
|
|
43
|
+
<%= pb_rails("button", props: { loading: true, text: "Loading..." }) %>
|
|
44
|
+
<%= pb_rails("circle_icon_button", props: { loading: true, icon: "plus" }) %>
|
|
45
|
+
<% end %>
|
|
46
|
+
|
|
47
|
+
<%= pb_rails("dialog/dialog_footer") do %>
|
|
48
|
+
<%= pb_rails("flex", props: { spacing: "between", padding_x: "md", padding_bottom: "md", padding: "sm" }) do %>
|
|
49
|
+
<%= pb_rails("button", props: { loading: true, text: "Send My Issue" }) %>
|
|
50
|
+
<%= pb_rails("circle_icon_button", props: { loading: true, icon: "plus" }) %>
|
|
51
|
+
<%= pb_rails("button", props: { text: "Back", variant: "link", data: {"close-dialog": "dialog-1"} }) %>
|
|
52
|
+
<% end %>
|
|
53
|
+
<% end %>
|
|
54
|
+
<% end %>
|
|
@@ -1,43 +1,102 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import CircleIconButton from '../_circle_icon_button'
|
|
4
|
+
import Dialog from '../../pb_dialog/_dialog'
|
|
5
|
+
import Button from '../../pb_button/_button'
|
|
4
6
|
|
|
5
|
-
const CircleIconButtonLoading = (props) =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
7
|
+
const CircleIconButtonLoading = (props) => {
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const [isOpen, setIsOpen] = useState(false)
|
|
11
|
+
const close = () => setIsOpen(false)
|
|
12
|
+
const open = () => setIsOpen(true)
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div>
|
|
16
|
+
<CircleIconButton
|
|
17
|
+
icon="plus"
|
|
18
|
+
loading
|
|
19
|
+
variant="primary"
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<br />
|
|
24
|
+
|
|
25
|
+
<CircleIconButton
|
|
26
|
+
icon="pen"
|
|
27
|
+
loading
|
|
28
|
+
variant="secondary"
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
<br />
|
|
33
|
+
|
|
34
|
+
<CircleIconButton
|
|
35
|
+
disabled
|
|
36
|
+
icon="times"
|
|
37
|
+
loading
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
|
|
41
|
+
<br />
|
|
42
|
+
|
|
43
|
+
<CircleIconButton
|
|
44
|
+
icon="user"
|
|
45
|
+
loading
|
|
46
|
+
variant="link"
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
<>
|
|
50
|
+
<Button marginTop="md"
|
|
51
|
+
onClick={open}
|
|
52
|
+
>
|
|
53
|
+
{'Open Dialog to confirm PLAY-2837 fix still works for circle icon buttons'}
|
|
54
|
+
</Button>
|
|
55
|
+
<Dialog
|
|
56
|
+
onCancel={close}
|
|
57
|
+
onClose={close}
|
|
58
|
+
onConfirm={close}
|
|
59
|
+
opened={isOpen}
|
|
60
|
+
size="md"
|
|
61
|
+
title="Header Title is the Title Prop"
|
|
62
|
+
>
|
|
63
|
+
<Dialog.Body>
|
|
64
|
+
<Button
|
|
65
|
+
aria={{ label: 'Loading' }}
|
|
66
|
+
loading
|
|
67
|
+
text="Button Primary"
|
|
68
|
+
/>
|
|
69
|
+
<CircleIconButton
|
|
70
|
+
icon="plus"
|
|
71
|
+
loading
|
|
72
|
+
/>
|
|
73
|
+
<div style={{height: '800px', backgroundColor: 'lightgray'}} />
|
|
74
|
+
<Button
|
|
75
|
+
loading
|
|
76
|
+
text="Loading..."
|
|
77
|
+
/>
|
|
78
|
+
<CircleIconButton
|
|
79
|
+
icon="plus"
|
|
80
|
+
loading
|
|
81
|
+
/>
|
|
82
|
+
</Dialog.Body>
|
|
83
|
+
<Dialog.Footer>
|
|
84
|
+
<Button
|
|
85
|
+
loading
|
|
86
|
+
text="Send My Issue"
|
|
87
|
+
/>
|
|
88
|
+
<CircleIconButton
|
|
89
|
+
icon="plus"
|
|
90
|
+
loading
|
|
91
|
+
/>
|
|
92
|
+
<Button variant="link">
|
|
93
|
+
{"Back"}
|
|
94
|
+
</Button>
|
|
95
|
+
</Dialog.Footer>
|
|
96
|
+
</Dialog>
|
|
97
|
+
</>
|
|
98
|
+
</div>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
42
101
|
|
|
43
102
|
export default CircleIconButtonLoading
|
|
@@ -51,7 +51,6 @@ type MultiLevelSelectProps = {
|
|
|
51
51
|
treeData?: { [key: string]: string }[] | any;
|
|
52
52
|
onChange?: (event: { target: { name?: string; value: any } }) => void;
|
|
53
53
|
onSelect?: (prop: { [key: string]: any }) => void;
|
|
54
|
-
placeholder?: string;
|
|
55
54
|
selectedIds?: string[] | any;
|
|
56
55
|
variant?: "multi" | "single";
|
|
57
56
|
wrapped?: boolean;
|
|
@@ -101,7 +100,6 @@ const MultiLevelSelect = forwardRef<HTMLInputElement, MultiLevelSelectProps>(
|
|
|
101
100
|
treeData,
|
|
102
101
|
onChange = () => null,
|
|
103
102
|
onSelect = () => null,
|
|
104
|
-
placeholder: placeholderText = "Start typing...",
|
|
105
103
|
selectedIds,
|
|
106
104
|
variant = "multi",
|
|
107
105
|
wrapped,
|
|
@@ -677,7 +675,7 @@ const MultiLevelSelect = forwardRef<HTMLInputElement, MultiLevelSelectProps>(
|
|
|
677
675
|
? `${itemsSelectedLength()} ${
|
|
678
676
|
itemsSelectedLength() === 1 ? "item" : "items"
|
|
679
677
|
} selected`
|
|
680
|
-
:
|
|
678
|
+
: "Start typing..."
|
|
681
679
|
}
|
|
682
680
|
required={required}
|
|
683
681
|
value={singleSelectedItem.value || filterItem}
|
|
@@ -18,7 +18,6 @@ examples:
|
|
|
18
18
|
- multi_level_select_disabled_options_parent: Disabled Parent Option (Return All Selected)
|
|
19
19
|
- multi_level_select_single_disabled: Disabled Options (Single Select)
|
|
20
20
|
- multi_level_select_required_indicator: Required Indicator
|
|
21
|
-
- multi_level_select_placeholder: Placeholder
|
|
22
21
|
|
|
23
22
|
react:
|
|
24
23
|
- multi_level_select_default: Default
|
|
@@ -41,4 +40,3 @@ examples:
|
|
|
41
40
|
- multi_level_select_single_disabled: Disabled Options (Single Select)
|
|
42
41
|
- multi_level_select_required_indicator: Required Indicator
|
|
43
42
|
- multi_level_select_react_reset_key: Reset with Key (React)
|
|
44
|
-
- multi_level_select_placeholder: Placeholder
|
|
@@ -18,4 +18,3 @@ export { default as MultiLevelSelectLabel } from "./_multi_level_select_label.js
|
|
|
18
18
|
export { default as MultiLevelSelectSingleDisabled } from "./_multi_level_select_single_disabled.jsx"
|
|
19
19
|
export { default as MultiLevelSelectRequiredIndicator } from "./_multi_level_select_required_indicator.jsx"
|
|
20
20
|
export { default as MultiLevelSelectReactResetKey } from "./_multi_level_select_react_reset_key.jsx"
|
|
21
|
-
export { default as MultiLevelSelectPlaceholder } from "./_multi_level_select_placeholder.jsx"
|
|
@@ -32,8 +32,6 @@ module Playbook
|
|
|
32
32
|
default: ""
|
|
33
33
|
prop :label, type: Playbook::Props::String,
|
|
34
34
|
default: ""
|
|
35
|
-
prop :placeholder, type: Playbook::Props::String,
|
|
36
|
-
default: "Start typing..."
|
|
37
35
|
prop :required_indicator, type: Playbook::Props::Boolean,
|
|
38
36
|
default: false
|
|
39
37
|
prop :show_checked_children, type: Playbook::Props::Boolean,
|
|
@@ -52,7 +50,6 @@ module Playbook
|
|
|
52
50
|
inputDisplay: input_display,
|
|
53
51
|
name: name,
|
|
54
52
|
label: label,
|
|
55
|
-
placeholder: placeholder,
|
|
56
53
|
treeData: tree_data,
|
|
57
54
|
required: required,
|
|
58
55
|
requiredIndicator: required_indicator,
|
|
@@ -173,33 +173,6 @@ describe('MultiLevelSelect', () => {
|
|
|
173
173
|
expect(label).toHaveTextContent("Select Location")
|
|
174
174
|
expect(label).not.toHaveTextContent("*")
|
|
175
175
|
})
|
|
176
|
-
|
|
177
|
-
test('should use default placeholder when none is passed', () => {
|
|
178
|
-
render(
|
|
179
|
-
<MultiLevelSelect
|
|
180
|
-
data={{ testid: testId }}
|
|
181
|
-
id="mls-placeholder-default"
|
|
182
|
-
treeData={treeData}
|
|
183
|
-
/>
|
|
184
|
-
)
|
|
185
|
-
expect(
|
|
186
|
-
screen.getByPlaceholderText('Start typing...')
|
|
187
|
-
).toBeInTheDocument()
|
|
188
|
-
})
|
|
189
|
-
|
|
190
|
-
test('should use custom placeholder when passed', () => {
|
|
191
|
-
render(
|
|
192
|
-
<MultiLevelSelect
|
|
193
|
-
data={{ testid: testId }}
|
|
194
|
-
id="mls-placeholder-custom"
|
|
195
|
-
placeholder="Choose items…"
|
|
196
|
-
treeData={treeData}
|
|
197
|
-
/>
|
|
198
|
-
)
|
|
199
|
-
expect(
|
|
200
|
-
screen.getByPlaceholderText('Choose items…')
|
|
201
|
-
).toBeInTheDocument()
|
|
202
|
-
})
|
|
203
176
|
})
|
|
204
177
|
|
|
205
178
|
describe('MultiLevelSelect multi variant', () => {
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
id: nil,
|
|
3
3
|
class: object.classnames ) do %>
|
|
4
4
|
<% if object.label %>
|
|
5
|
-
|
|
5
|
+
<label class="pb_select_kit_label" for="<%= object.input_options[:id] || object.name %>">
|
|
6
6
|
<% if object.required_indicator %>
|
|
7
7
|
<%= pb_rails("caption", props: { color: "lighter", dark: object.dark }) do %>
|
|
8
8
|
<%= object.label %><span style="color: #DA0014;"> *</span>
|
|
9
|
-
<% end %>
|
|
9
|
+
<% end %>
|
|
10
10
|
<% else %>
|
|
11
11
|
<%= pb_rails("caption", props: { color: "lighter", text: object.label, dark: object.dark }) %>
|
|
12
12
|
<% end %>
|
|
13
|
-
|
|
13
|
+
</label>
|
|
14
14
|
<% end %>
|
|
15
|
-
|
|
15
|
+
<label class="<%= object.select_wrapper_class %>" for="<%= object.input_options[:id] || object.name %>">
|
|
16
16
|
<% if content.present? %>
|
|
17
17
|
<%= content %>
|
|
18
18
|
<%= pb_rails("body", props: { status: "negative", text: object.error }) %>
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
<% if object.multiple != true %>
|
|
33
33
|
<%= pb_rails("icon", props: { custom_icon: Playbook::Engine::root.join(angle_down_path), fixed_width: true, classname: "pb_select_kit_caret"}) %>
|
|
34
34
|
<% end %>
|
|
35
|
-
|
|
35
|
+
</label>
|
|
36
36
|
<% end %>
|
|
@@ -46,11 +46,6 @@ module Playbook
|
|
|
46
46
|
}.merge(attributes).merge(input_options)
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
-
# Same resolved id as the native +<select>+ (+all_attributes[:id]+) for label +for+.
|
|
50
|
-
def select_input_id
|
|
51
|
-
all_attributes[:id].presence
|
|
52
|
-
end
|
|
53
|
-
|
|
54
49
|
def classname
|
|
55
50
|
generate_classname("pb_select", select_margin_bottom, separator: " ")
|
|
56
51
|
end
|
|
@@ -26,9 +26,8 @@ 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.
|
|
30
29
|
|
|
31
30
|
**IMPORTANT NOTE**:
|
|
32
31
|
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.
|
|
33
32
|
|
|
34
|
-
If you are looking for more customization than this embedded variant provides, you may be better served by using the individual kits as
|
|
33
|
+
If you are looking for more customization than this embedded variant provides, you may be better served by using the individual kits as demonstrating in our Table Filter Card Building Block as seen [here](https://playbook.powerapp.cloud/building_blocks/table_filter_card/rails).
|
|
@@ -41,7 +41,6 @@ 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)
|
|
45
44
|
- table_with_filter_variant_with_pagination_rails: Variant with Filter and Pagination
|
|
46
45
|
- table_with_filter_with_card_title_props_rails: Variant with Filter (with Card and Title Props)
|
|
47
46
|
|
|
@@ -16,10 +16,7 @@
|
|
|
16
16
|
flex_direction: "column",
|
|
17
17
|
gap: "none"
|
|
18
18
|
}) do %>
|
|
19
|
-
<%
|
|
20
|
-
<% if object.filter.present? %>
|
|
21
|
-
<%= object.filter %>
|
|
22
|
-
<% elsif object.filter_content.present? %>
|
|
19
|
+
<% if object.filter_content.present? %>
|
|
23
20
|
<%
|
|
24
21
|
default_filter_props = {
|
|
25
22
|
background: false,
|
|
@@ -34,7 +31,7 @@
|
|
|
34
31
|
<%= object.filter_content %>
|
|
35
32
|
<% end %>
|
|
36
33
|
<% end %>
|
|
37
|
-
<%= pb_rails("section_separator") if
|
|
34
|
+
<%= pb_rails("section_separator") if object.filter_content.present? %>
|
|
38
35
|
<% if object.pagination.present? %>
|
|
39
36
|
<%= object.pagination %>
|
|
40
37
|
<%= pb_rails("section_separator") %>
|
|
@@ -46,10 +46,6 @@ module Playbook
|
|
|
46
46
|
prop :filter_props, type: Playbook::Props::HashProp,
|
|
47
47
|
default: {}
|
|
48
48
|
prop :filter_content
|
|
49
|
-
# Pre-rendered filter slot (e.g. output of capture { your_filter_helper }).
|
|
50
|
-
# When present, this is rendered as-is; filter_content and filter_props are ignored.
|
|
51
|
-
# Use this for manual filter submission or app-specific filter helpers.
|
|
52
|
-
prop :filter
|
|
53
49
|
prop :pagination
|
|
54
50
|
prop :title, type: Playbook::Props::String,
|
|
55
51
|
default: nil
|