playbook_ui 14.9.0.pre.alpha.play1703errorstatealignment5060 → 14.9.0.pre.alpha.play1742globalheightfixes4766
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/CollapsibleTrail.tsx +6 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +0 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +2 -4
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +3 -5
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +0 -8
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +0 -8
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +0 -2
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +2 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +49 -53
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +36 -29
- data/app/pb_kits/playbook/pb_body/_body.scss +13 -14
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +16 -22
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.jsx +0 -6
- data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +1 -2
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -1
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +4 -9
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +2 -2
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +2 -2
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +0 -5
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +2 -7
- data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +2 -8
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +2 -11
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +1 -17
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.html.erb +1 -17
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.jsx +0 -15
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.md +1 -2
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +1 -15
- data/app/pb_kits/playbook/pb_link/_link.scss +3 -3
- data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +1 -11
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +2 -16
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +4 -4
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.jsx +0 -2
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +36 -44
- data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +4 -4
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -5
- data/app/pb_kits/playbook/pb_table/docs/index.js +0 -5
- data/app/pb_kits/playbook/pb_table/index.ts +26 -100
- data/app/pb_kits/playbook/pb_table/styles/_all.scss +1 -2
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +1 -106
- data/app/pb_kits/playbook/pb_table/table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/table.rb +2 -17
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +3 -35
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_text_input/text_input.test.js +2 -139
- data/app/pb_kits/playbook/pb_title/_title.scss +5 -6
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +0 -13
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +46 -115
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +2 -9
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -3
- data/app/pb_kits/playbook/tokens/_titles.scss +8 -0
- data/app/pb_kits/playbook/utilities/_hover.scss +2 -11
- data/app/pb_kits/playbook/utilities/globalProps.ts +0 -2
- data/app/pb_kits/playbook/utilities/test/globalProps/hover.test.js +0 -15
- data/dist/chunks/_typeahead-B8fkIeXA.js +22 -0
- data/dist/chunks/_weekday_stacked-DjRTXEi-.js +45 -0
- data/dist/chunks/{lib-CuCy3_xO.js → lib-SyD3buPZ.js} +3 -3
- data/dist/chunks/{pb_form_validation-D37k10a0.js → pb_form_validation-Dt8UJgrJ.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/hover.rb +1 -7
- data/lib/playbook/version.rb +1 -1
- metadata +6 -27
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.html.erb +0 -36
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.md +0 -1
- data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +0 -57
- data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.html.erb +0 -32
- data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.rb +0 -29
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_filter.jsx +0 -166
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_user.jsx +0 -89
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +0 -95
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +0 -75
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +0 -108
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.md +0 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +0 -94
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.md +0 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.jsx +0 -83
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +0 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.jsx +0 -120
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +0 -1
- data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +0 -35
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.jsx +0 -88
- data/app/pb_kits/playbook/pb_text_input/inputMask.ts +0 -64
- data/dist/chunks/_typeahead-l1kq1p9m.js +0 -22
- data/dist/chunks/_weekday_stacked-DkCMUF58.js +0 -45
@@ -13,7 +13,6 @@ type FileUploadProps = {
|
|
13
13
|
accept?: string[],
|
14
14
|
className?: string,
|
15
15
|
customMessage?: string,
|
16
|
-
dark?: boolean,
|
17
16
|
data?: {[key: string]: string | number},
|
18
17
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
19
18
|
acceptedFilesDescription?: string,
|
@@ -32,7 +31,6 @@ const FileUpload = (props: FileUploadProps): React.ReactElement => {
|
|
32
31
|
acceptedFilesDescription = '',
|
33
32
|
className,
|
34
33
|
customMessage,
|
35
|
-
dark = false,
|
36
34
|
data = {},
|
37
35
|
htmlOptions = {},
|
38
36
|
maxSize,
|
@@ -96,12 +94,9 @@ const FileUpload = (props: FileUploadProps): React.ReactElement => {
|
|
96
94
|
{...htmlProps}
|
97
95
|
{...getRootProps()}
|
98
96
|
>
|
99
|
-
<Card
|
97
|
+
<Card>
|
100
98
|
<input {...getInputProps()} />
|
101
|
-
<Body
|
102
|
-
color="light"
|
103
|
-
dark={dark}
|
104
|
-
>
|
99
|
+
<Body color="light">
|
105
100
|
{isDragActive ?
|
106
101
|
<p>{'Drop the files here ...'}</p>
|
107
102
|
:
|
@@ -5,17 +5,11 @@
|
|
5
5
|
id: object.id,
|
6
6
|
**combined_html_options) do %>
|
7
7
|
<%= pb_rails("form_group", props: {cursor: "pointer", full_width: object.full_width}) do %>
|
8
|
-
<label
|
9
|
-
for="upload-<%= object.id %>"
|
10
|
-
class="pb_button_kit_secondary_inline_enabled <%= 'dark' if object.dark %>"
|
11
|
-
>
|
12
|
-
<%= "#{object.label}" %>
|
13
|
-
</label>
|
8
|
+
<label for="upload-<%= object.id %>" class="pb_button_kit_secondary_inline_enabled"><%= "#{object.label}" %></label>
|
14
9
|
<%= pb_rails("text_input", props: {
|
15
10
|
type: "file",
|
16
|
-
dark: object.dark,
|
17
11
|
input_options: {
|
18
|
-
id: "upload-#{object.id}",
|
12
|
+
id: "upload-#{object.id}",
|
19
13
|
classname: "cursor_pointer",
|
20
14
|
}.merge(object.input_options)
|
21
15
|
}) %>
|
@@ -1,6 +1,3 @@
|
|
1
|
-
@import "../tokens/spacing";
|
2
|
-
@import "./error_state_mixin";
|
3
|
-
|
4
1
|
[class^=pb_form_group_kit] {
|
5
2
|
display: inline-flex;
|
6
3
|
flex-direction: row;
|
@@ -15,12 +12,6 @@
|
|
15
12
|
}
|
16
13
|
}
|
17
14
|
|
18
|
-
@include error-state-flex-start-selectors;
|
19
|
-
@include error-state-center-selectors;
|
20
|
-
@include error-state-flex-end-selectors;
|
21
|
-
@include error-state-left-side-select-kit;
|
22
|
-
@include error-state-right-side-select-kit;
|
23
|
-
|
24
15
|
& [class^=pb_text_input_kit] .text_input_wrapper,
|
25
16
|
& [class^=pb_date_picker_kit] .input_wrapper,
|
26
17
|
& [class^=pb_select] {
|
@@ -36,7 +27,7 @@
|
|
36
27
|
border-bottom-right-radius: 0;
|
37
28
|
border-top-right-radius: 0;
|
38
29
|
border-right-width: 0;
|
39
|
-
|
30
|
+
|
40
31
|
&:focus {
|
41
32
|
outline: $primary solid 1px;
|
42
33
|
outline-offset: -1px;
|
@@ -159,7 +150,7 @@
|
|
159
150
|
& > [class^=pb_selectable_card_kit] input[type="checkbox"]:not(:checked) ~ label, [class^=pb_selectable_card_kit] input[type="radio"]:not(:checked) ~ label {
|
160
151
|
&:hover {
|
161
152
|
border-right-color: $slate;
|
162
|
-
}
|
153
|
+
}
|
163
154
|
}
|
164
155
|
|
165
156
|
& > [class^=pb_selectable_card_kit]:not(:first-child) label {
|
@@ -18,7 +18,7 @@ type HomeAddressStreetProps = {
|
|
18
18
|
className?: string,
|
19
19
|
data?: { [key: string]: string },
|
20
20
|
dark?: boolean,
|
21
|
-
emphasis: "street" | "city"
|
21
|
+
emphasis: "street" | "city",
|
22
22
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
23
23
|
homeId: string,
|
24
24
|
houseStyle: string,
|
@@ -129,22 +129,6 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
|
|
129
129
|
</div>
|
130
130
|
</div>
|
131
131
|
}
|
132
|
-
{emphasis == 'none' &&
|
133
|
-
<div>
|
134
|
-
<Body dark={dark}>
|
135
|
-
{joinPresent([titleize(address), houseStyle], ' · ')}
|
136
|
-
</Body>
|
137
|
-
<Body dark={dark}>{titleize(addressCont)}</Body>
|
138
|
-
<div>
|
139
|
-
<Body
|
140
|
-
color="light"
|
141
|
-
dark={dark}
|
142
|
-
>
|
143
|
-
{`${titleize(city)}, ${state} ${zipcode}`}
|
144
|
-
</Body>
|
145
|
-
</div>
|
146
|
-
</div>
|
147
|
-
}
|
148
132
|
{homeId &&
|
149
133
|
<Hashtag
|
150
134
|
classname="home-hashtag"
|
data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.html.erb
CHANGED
@@ -24,20 +24,4 @@
|
|
24
24
|
state: "PA",
|
25
25
|
zipcode: "19382",
|
26
26
|
territory: "PHL",
|
27
|
-
}) %>
|
28
|
-
|
29
|
-
<br>
|
30
|
-
<br>
|
31
|
-
|
32
|
-
<%= pb_rails("home_address_street", props: {
|
33
|
-
address: "70 Prospect Ave",
|
34
|
-
address_cont: "Apt M18",
|
35
|
-
city: "West Chester",
|
36
|
-
emphasis: "none",
|
37
|
-
home_id: 8250263,
|
38
|
-
home_url: "https://powerhrg.com/",
|
39
|
-
house_style: "Colonial",
|
40
|
-
state: "PA",
|
41
|
-
zipcode: "19382",
|
42
|
-
territory: "PHL",
|
43
|
-
}) %>
|
27
|
+
}) %>
|
@@ -32,21 +32,6 @@ const HomeAddressStreetEmphasis = (props) => {
|
|
32
32
|
zipcode="19382"
|
33
33
|
{...props}
|
34
34
|
/>
|
35
|
-
<br />
|
36
|
-
<br />
|
37
|
-
<HomeAddressStreet
|
38
|
-
address="70 Prospect Ave"
|
39
|
-
addressCont="Apt M18"
|
40
|
-
city="West Chester"
|
41
|
-
emphasis="none"
|
42
|
-
homeId="8250263"
|
43
|
-
homeUrl="https://powerhrg.com/"
|
44
|
-
houseStyle="Colonial"
|
45
|
-
state="PA"
|
46
|
-
territory="PHL"
|
47
|
-
zipcode="19382"
|
48
|
-
{...props}
|
49
|
-
/>
|
50
35
|
</div>
|
51
36
|
)
|
52
37
|
}
|
@@ -7,7 +7,7 @@ module Playbook
|
|
7
7
|
prop :address_cont
|
8
8
|
prop :city
|
9
9
|
prop :emphasis, type: Playbook::Props::Enum,
|
10
|
-
values: %w[street city
|
10
|
+
values: %w[street city],
|
11
11
|
default: "street"
|
12
12
|
prop :home_id, type: Playbook::Props::Number
|
13
13
|
prop :home_url
|
@@ -77,20 +77,6 @@ module Playbook
|
|
77
77
|
}
|
78
78
|
end
|
79
79
|
|
80
|
-
def none_emphasis_props
|
81
|
-
{
|
82
|
-
address_house_style: address_house_style,
|
83
|
-
address_house_style2: address_house_style2,
|
84
|
-
city_state_zip: city_state_zip,
|
85
|
-
dark: dark,
|
86
|
-
home_id: home_id,
|
87
|
-
home_url: home_url,
|
88
|
-
target: target_option,
|
89
|
-
new_window: new_window,
|
90
|
-
territory: territory,
|
91
|
-
}
|
92
|
-
end
|
93
|
-
|
94
80
|
def target_option
|
95
81
|
if target && home_url
|
96
82
|
target
|
@@ -17,7 +17,7 @@
|
|
17
17
|
outline-offset: 2px;
|
18
18
|
}
|
19
19
|
&:visited {
|
20
|
-
color:
|
20
|
+
color: $data_3;
|
21
21
|
}
|
22
22
|
&.dark {
|
23
23
|
@include pb_link($active_dark);
|
@@ -34,7 +34,7 @@
|
|
34
34
|
}
|
35
35
|
|
36
36
|
&:visited {
|
37
|
-
color:
|
37
|
+
color: $data_3;
|
38
38
|
}
|
39
39
|
}
|
40
40
|
}
|
@@ -48,7 +48,7 @@
|
|
48
48
|
}
|
49
49
|
|
50
50
|
&:visited {
|
51
|
-
color:
|
51
|
+
color: $data_3;
|
52
52
|
}
|
53
53
|
}
|
54
54
|
}
|
@@ -223,7 +223,6 @@
|
|
223
223
|
}
|
224
224
|
}
|
225
225
|
[class*="pb_collapsible_nav_item"][class*="pb_nav_list_item_link_collapsible"][class*="pb_nav_list_kit_item"] {
|
226
|
-
box-shadow: unset !important;
|
227
226
|
.pb_nav_list_item_text_collapsible {
|
228
227
|
color: $white !important;
|
229
228
|
}
|
@@ -241,17 +240,11 @@
|
|
241
240
|
|
242
241
|
.pb_collapsible_main_kit:hover {
|
243
242
|
background-color: mix($white, $card_dark, 20%);
|
244
|
-
.pb_nav_list_item_text_collapsible
|
245
|
-
color: $white !important;
|
246
|
-
}
|
247
|
-
}
|
248
|
-
|
249
|
-
.pb_collapsible_main_kit {
|
243
|
+
.pb_nav_list_item_text_collapsible,
|
250
244
|
svg {
|
251
|
-
color: $
|
245
|
+
color: $white !important;
|
252
246
|
}
|
253
247
|
}
|
254
|
-
|
255
248
|
.icon_wrapper:hover {
|
256
249
|
background-color: mix($white, $card_dark, 40%);
|
257
250
|
}
|
@@ -263,13 +256,6 @@
|
|
263
256
|
}
|
264
257
|
}
|
265
258
|
}
|
266
|
-
|
267
|
-
&[class*="_active"] {
|
268
|
-
> .pb_collapsible_main_kit {
|
269
|
-
background-color: $primary;
|
270
|
-
box-shadow: 0 2px 10px 0 $shadow_dark;
|
271
|
-
}
|
272
|
-
}
|
273
259
|
}
|
274
260
|
}
|
275
261
|
}
|
@@ -151,7 +151,7 @@ $pb_selectable_paddings: (
|
|
151
151
|
input[type="radio"] {
|
152
152
|
&:checked ~ label {
|
153
153
|
border-width: $pb_card_border_width;
|
154
|
-
outline: 1px solid $
|
154
|
+
outline: 1px solid $primary;
|
155
155
|
}
|
156
156
|
}
|
157
157
|
}
|
@@ -161,11 +161,11 @@ $pb_selectable_paddings: (
|
|
161
161
|
color: $white;
|
162
162
|
> label {
|
163
163
|
@include pb_card_dark;
|
164
|
-
background:
|
164
|
+
background: transparent;
|
165
165
|
|
166
166
|
.pb_selectable_card_circle {
|
167
167
|
border-color: $bg_dark;
|
168
|
-
background: $
|
168
|
+
background: $primary-action;
|
169
169
|
}
|
170
170
|
}
|
171
171
|
|
@@ -173,7 +173,7 @@ $pb_selectable_paddings: (
|
|
173
173
|
input[type="radio"] {
|
174
174
|
&:checked ~ label {
|
175
175
|
@include pb_card_selected_dark;
|
176
|
-
background:
|
176
|
+
background: transparent;
|
177
177
|
}
|
178
178
|
}
|
179
179
|
|
@@ -20,7 +20,6 @@ const SkeletonLoadingHeightWidth = (props) => (
|
|
20
20
|
<Card htmlOptions={{ style: { height: '200px', width: '100%' }}}
|
21
21
|
marginBottom="md"
|
22
22
|
padding="none"
|
23
|
-
{...props}
|
24
23
|
>
|
25
24
|
<SkeletonLoading
|
26
25
|
borderRadius="md"
|
@@ -32,7 +31,6 @@ const SkeletonLoadingHeightWidth = (props) => (
|
|
32
31
|
</Card>
|
33
32
|
<Card htmlOptions={{ style: { height: '200px', width: '100%' }}}
|
34
33
|
padding="none"
|
35
|
-
{...props}
|
36
34
|
>
|
37
35
|
<SkeletonLoading
|
38
36
|
borderRadius="md"
|
@@ -3,5 +3,3 @@ export { default as SkeletonLoadingColor } from './_skeleton_loading_color.jsx'
|
|
3
3
|
export { default as SkeletonLoadingLayout } from './_skeleton_loading_layout.jsx'
|
4
4
|
export { default as SkeletonLoadingBorderRadius } from './_skeleton_loading_border_radius.jsx'
|
5
5
|
export { default as SkeletonLoadingHeightWidth } from './_skeleton_loading_height_width.jsx'
|
6
|
-
export { default as SkeletonLoadingUser } from './_skeleton_loading_user.jsx'
|
7
|
-
export { default as SkeletonLoadingFilter } from './_skeleton_loading_filter.jsx'
|
@@ -1,46 +1,40 @@
|
|
1
|
-
import React from
|
2
|
-
import classnames from
|
1
|
+
import React from 'react'
|
2
|
+
import classnames from 'classnames'
|
3
3
|
|
4
|
-
import { buildCss, buildHtmlProps } from
|
5
|
-
import { globalProps } from
|
4
|
+
import { buildCss, buildHtmlProps } from '../utilities/props'
|
5
|
+
import { globalProps } from '../utilities/globalProps'
|
6
6
|
|
7
|
-
import Body from
|
8
|
-
import Icon from
|
7
|
+
import Body from '../pb_body/_body'
|
8
|
+
import Icon from '../pb_icon/_icon'
|
9
9
|
|
10
|
-
const statusMap: {
|
11
|
-
|
12
|
-
decrease:
|
13
|
-
|
14
|
-
} = {
|
15
|
-
increase: "positive",
|
16
|
-
decrease: "negative",
|
17
|
-
neutral: "neutral",
|
10
|
+
const statusMap: {neutral: 'neutral', decrease: 'negative' ,increase: 'positive'} = {
|
11
|
+
increase: 'positive',
|
12
|
+
decrease: 'negative',
|
13
|
+
neutral: 'neutral',
|
18
14
|
}
|
19
15
|
|
20
16
|
const iconMap = {
|
21
|
-
increase:
|
22
|
-
decrease:
|
17
|
+
increase: 'arrow-up',
|
18
|
+
decrease: 'arrow-down',
|
23
19
|
}
|
24
20
|
|
25
21
|
type StatChangeProps = {
|
26
|
-
change?:
|
27
|
-
className?: string
|
28
|
-
|
29
|
-
|
30
|
-
id?: string
|
31
|
-
|
32
|
-
value?: string | number
|
22
|
+
change?: 'increase' | 'decrease' | 'neutral',
|
23
|
+
className?: string,
|
24
|
+
icon?: string,
|
25
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
26
|
+
id?: string,
|
27
|
+
value?: string | number,
|
33
28
|
}
|
34
29
|
|
35
30
|
const StatChange = (props: StatChangeProps): React.ReactElement => {
|
36
|
-
const {
|
37
|
-
change =
|
38
|
-
className,
|
39
|
-
dark = false,
|
31
|
+
const {
|
32
|
+
change = 'neutral',
|
33
|
+
className,
|
40
34
|
htmlOptions = {},
|
41
|
-
icon,
|
42
|
-
id,
|
43
|
-
value
|
35
|
+
icon,
|
36
|
+
id,
|
37
|
+
value
|
44
38
|
} = props
|
45
39
|
|
46
40
|
const status = statusMap[change as keyof typeof statusMap]
|
@@ -53,32 +47,30 @@ const StatChange = (props: StatChangeProps): React.ReactElement => {
|
|
53
47
|
|
54
48
|
return (
|
55
49
|
<>
|
56
|
-
{value &&
|
50
|
+
{value &&
|
57
51
|
<div
|
58
52
|
className={classnames(
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
53
|
+
buildCss('pb_stat_change_kit', status),
|
54
|
+
globalProps(props),
|
55
|
+
className
|
56
|
+
)}
|
63
57
|
id={id}
|
64
58
|
{...htmlProps}
|
65
59
|
>
|
66
|
-
<Body
|
67
|
-
|
68
|
-
>
|
69
|
-
{" "}
|
70
|
-
{returnedIcon && (
|
60
|
+
<Body status={status}>
|
61
|
+
{returnedIcon &&
|
71
62
|
<>
|
72
|
-
<Icon
|
63
|
+
<Icon
|
73
64
|
fixed_width
|
74
65
|
icon={returnedIcon}
|
75
|
-
/>
|
66
|
+
/>
|
67
|
+
{' '}
|
76
68
|
</>
|
77
|
-
|
69
|
+
}
|
78
70
|
{`${value}%`}
|
79
71
|
</Body>
|
80
72
|
</div>
|
81
|
-
|
73
|
+
}
|
82
74
|
</>
|
83
75
|
)
|
84
76
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= pb_content_tag do %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
<%= pb_rails("body", props: { status: object.status }) do %>
|
3
|
+
<%= pb_rails("icon", props: { fixed_width: true, icon: object.returned_icon }) if object.returned_icon %>
|
4
|
+
<%= "#{object.value}%" if object.value %>
|
5
|
+
<% end %>
|
6
6
|
<% end %>
|
@@ -55,8 +55,3 @@ examples:
|
|
55
55
|
- table_with_subcomponents: Table with Sub Components (Table Elements)
|
56
56
|
- table_with_subcomponents_as_divs: Table with Sub Components (Divs)
|
57
57
|
- table_outer_padding: Outer Padding
|
58
|
-
- table_with_collapsible: Table with Collapsible
|
59
|
-
- table_with_collapsible_with_custom_click: Table with Collapsible with Custom Click
|
60
|
-
- table_with_collapsible_with_custom_content: Table with Collapsible with Custom Content
|
61
|
-
- table_with_collapsible_with_nested_rows: Table with Collapsible with Nested Rows
|
62
|
-
- table_with_collapsible_with_nested_table: Table with Collapsible with Nested Table
|
@@ -26,8 +26,3 @@ export { default as TableWithSubcomponents } from './_table_with_subcomponents.j
|
|
26
26
|
export { default as TableWithSubcomponentsAsDivs } from './_table_with_subcomponents_as_divs.jsx'
|
27
27
|
export { default as TableOuterPadding } from './_table_outer_padding.jsx'
|
28
28
|
export { default as TableStickyLeftColumns } from './_table_sticky_left_columns.jsx'
|
29
|
-
export { default as TableWithCollapsible } from './_table_with_collapsible.jsx'
|
30
|
-
export { default as TableWithCollapsibleWithCustomContent } from './_table_with_collapsible_with_custom_content.jsx'
|
31
|
-
export { default as TableWithCollapsibleWithNestedTable } from './_table_with_collapsible_with_nested_table.jsx'
|
32
|
-
export { default as TableWithCollapsibleWithNestedRows } from './_table_with_collapsible_with_nested_rows.jsx'
|
33
|
-
export { default as TableWithCollapsibleWithCustomClick } from './_table_with_collapsible_with_custom_click.jsx'
|
@@ -1,106 +1,32 @@
|
|
1
1
|
import PbEnhancedElement from '../pb_enhanced_element'
|
2
2
|
|
3
3
|
export default class PbTable extends PbEnhancedElement {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
//
|
14
|
-
|
15
|
-
|
16
|
-
const
|
17
|
-
|
18
|
-
|
19
|
-
for (let i = 0; i < colSpan; i++) {
|
20
|
-
headers.push(header.textContent.replace(/\r?\n|\r/, ''));
|
21
|
-
}
|
22
|
-
});
|
23
|
-
// for each row in tbody
|
24
|
-
[].forEach.call(table.querySelectorAll('tbody tr'), (row: HTMLTableRowElement) => {
|
25
|
-
// for each cell
|
26
|
-
[].forEach.call(row.cells, (cell: HTMLTableCellElement, headerIndex: number) => {
|
27
|
-
// apply the attribute
|
28
|
-
cell.setAttribute('data-title', headers[headerIndex])
|
29
|
-
})
|
30
|
-
})
|
31
|
-
});
|
32
|
-
|
33
|
-
// New sticky columns logic
|
34
|
-
this.initStickyColumns();
|
35
|
-
}
|
36
|
-
|
37
|
-
private initStickyColumns(): void {
|
38
|
-
// Find tables with sticky-left-column class
|
39
|
-
const tables = document.querySelectorAll('.sticky-left-column');
|
40
|
-
|
41
|
-
tables.forEach((table) => {
|
42
|
-
// Extract sticky left column IDs by looking at the component's class
|
43
|
-
const classList = Array.from(table.classList);
|
44
|
-
|
45
|
-
// Look for classes in the format sticky-left-column-{ids}
|
46
|
-
const stickyColumnClass = classList.find(cls => cls.startsWith('sticky-columns-'));
|
47
|
-
if (stickyColumnClass) {
|
48
|
-
// Extract the IDs from the class name
|
49
|
-
this.stickyLeftColumns = stickyColumnClass
|
50
|
-
.replace('sticky-columns-', '')
|
51
|
-
.split('-');
|
52
|
-
|
53
|
-
if (this.stickyLeftColumns.length > 0) {
|
54
|
-
this.handleStickyColumnsRef = this.handleStickyColumns.bind(this);
|
55
|
-
this.handleStickyColumns();
|
56
|
-
window.addEventListener('resize', this.handleStickyColumnsRef);
|
57
|
-
}
|
4
|
+
static get selector(): string {
|
5
|
+
return '.table-responsive-collapse'
|
6
|
+
}
|
7
|
+
|
8
|
+
connect(): void {
|
9
|
+
const tables = document.querySelectorAll('.table-responsive-collapse');
|
10
|
+
|
11
|
+
// Each Table
|
12
|
+
[].forEach.call(tables, (table: HTMLTableElement) => {
|
13
|
+
// Header Titles
|
14
|
+
const headers: string[] = [];
|
15
|
+
[].forEach.call(table.querySelectorAll('th'), (header: HTMLTableCellElement) => {
|
16
|
+
const colSpan = header.colSpan
|
17
|
+
for (let i = 0; i < colSpan; i++) {
|
18
|
+
headers.push(header.textContent.replace(/\r?\n|\r/, ''));
|
58
19
|
}
|
59
20
|
});
|
60
|
-
}
|
61
|
-
|
62
|
-
private handleStickyColumns(): void {
|
63
|
-
let accumulatedWidth = 0;
|
64
21
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
header.classList.remove('sticky-shadow');
|
77
|
-
} else {
|
78
|
-
header.classList.remove('with-border');
|
79
|
-
header.classList.add('sticky-shadow');
|
80
|
-
}
|
81
|
-
|
82
|
-
accumulatedWidth += (header as HTMLElement).offsetWidth;
|
83
|
-
}
|
84
|
-
|
85
|
-
cells.forEach((cell) => {
|
86
|
-
cell.classList.add('sticky');
|
87
|
-
(cell as HTMLElement).style.left = `${accumulatedWidth - (header as HTMLElement).offsetWidth}px`;
|
88
|
-
|
89
|
-
if (!isLastColumn) {
|
90
|
-
cell.classList.add('with-border');
|
91
|
-
cell.classList.remove('sticky-shadow');
|
92
|
-
} else {
|
93
|
-
cell.classList.remove('with-border');
|
94
|
-
cell.classList.add('sticky-shadow');
|
95
|
-
}
|
96
|
-
});
|
97
|
-
});
|
98
|
-
}
|
99
|
-
|
100
|
-
// Cleanup method to remove event listener
|
101
|
-
disconnect(): void {
|
102
|
-
if (this.handleStickyColumnsRef) {
|
103
|
-
window.removeEventListener('resize', this.handleStickyColumnsRef);
|
104
|
-
}
|
105
|
-
}
|
106
|
-
}
|
22
|
+
// for each row in tbody
|
23
|
+
[].forEach.call(table.querySelectorAll('tbody tr'), (row: HTMLTableRowElement) => {
|
24
|
+
// for each cell
|
25
|
+
[].forEach.call(row.cells, (cell: HTMLTableCellElement, headerIndex: number) => {
|
26
|
+
// apply the attribute
|
27
|
+
cell.setAttribute('data-title', headers[headerIndex])
|
28
|
+
})
|
29
|
+
})
|
30
|
+
})
|
31
|
+
}
|
32
|
+
}
|