playbook_ui 14.24.0.pre.alpha.PLAY2329atstickypinnedborderbug9340 → 14.24.0.pre.alpha.PLAY19989342
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 -34
- data/app/pb_kits/playbook/pb_date/_date.tsx +5 -3
- data/app/pb_kits/playbook/pb_date/date.html.erb +6 -6
- data/app/pb_kits/playbook/pb_date/date.rb +2 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.html.erb +4 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.jsx +17 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.md +1 -0
- data/app/pb_kits/playbook/pb_date/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_date/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +1 -49
- data/dist/chunks/{_weekday_stacked-CCn-qLh_.js → _weekday_stacked-CJIFKKe7.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59c17882526a3b72d9fc83804b03d9b16990cb101e1862b0e52b86302f1d2910
|
4
|
+
data.tar.gz: 2a8bcde09ad5af23d054ddba72d05dd55d18a592e84748435269a933456942ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6e0c7da6c2b966bef964121f3f25a0c4d5f141be242d977d173e14f063dd7c3dd96cb81eedd14bf6cfa06838719ad76470b5e76d5c9b8818d5314b7a4234e13
|
7
|
+
data.tar.gz: 95e0c86be7672a3370c39a60ccdcb2cd5e31112c921b407cea885baf651560869bef742c89716510a5f714f1b768b30472895da6f8f04ac2ac101839ce41082b
|
@@ -971,40 +971,6 @@
|
|
971
971
|
}
|
972
972
|
}
|
973
973
|
}
|
974
|
-
|
975
|
-
// Firefox-specific fix for last-header-cell and last-cell vertical borders
|
976
|
-
@-moz-document url-prefix() {
|
977
|
-
.pb_advanced_table_header {
|
978
|
-
.last-header-cell {
|
979
|
-
border-right: none !important;
|
980
|
-
box-shadow: 1px 0 0 0 $border_light !important;
|
981
|
-
}
|
982
|
-
}
|
983
|
-
|
984
|
-
.pb_advanced_table_body {
|
985
|
-
.last-cell {
|
986
|
-
border-right: none !important;
|
987
|
-
box-shadow: 1px 0 0 0 $border_light !important;
|
988
|
-
}
|
989
|
-
}
|
990
|
-
|
991
|
-
// Dark mode Firefox fixes
|
992
|
-
&.dark {
|
993
|
-
.pb_advanced_table_header {
|
994
|
-
.last-header-cell {
|
995
|
-
border-right: none !important;
|
996
|
-
box-shadow: 1px 0 0 0 $border_dark !important;
|
997
|
-
}
|
998
|
-
}
|
999
|
-
|
1000
|
-
.pb_advanced_table_body {
|
1001
|
-
.last-cell {
|
1002
|
-
border-right: none !important;
|
1003
|
-
box-shadow: 1px 0 0 0 $border_dark !important;
|
1004
|
-
}
|
1005
|
-
}
|
1006
|
-
}
|
1007
|
-
}
|
1008
974
|
}
|
1009
975
|
|
1010
976
|
// Outside of the pb_advanced_table class for popover
|
@@ -19,6 +19,7 @@ type PbDateProps = {
|
|
19
19
|
htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
|
20
20
|
id?: string;
|
21
21
|
showDayOfWeek?: boolean;
|
22
|
+
showCurrentYear?: boolean;
|
22
23
|
showIcon?: boolean;
|
23
24
|
size?: "sm" | "md" | "lg";
|
24
25
|
unstyled?: boolean;
|
@@ -35,6 +36,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
|
|
35
36
|
htmlOptions = {},
|
36
37
|
id,
|
37
38
|
showDayOfWeek = false,
|
39
|
+
showCurrentYear = false,
|
38
40
|
showIcon = false,
|
39
41
|
size = "md",
|
40
42
|
unstyled = false,
|
@@ -90,7 +92,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
|
|
90
92
|
{month} {day}
|
91
93
|
</span>
|
92
94
|
|
93
|
-
{currentYear
|
95
|
+
{(currentYear !== year || showCurrentYear) && <span>{`, ${year}`}</span>}
|
94
96
|
</span>
|
95
97
|
</>
|
96
98
|
: size == "md" || size == "lg"
|
@@ -124,7 +126,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
|
|
124
126
|
<span>
|
125
127
|
{month} {day}
|
126
128
|
</span>
|
127
|
-
{currentYear
|
129
|
+
{(currentYear !== year || showCurrentYear) && <span>{`, ${year}`}</span>}
|
128
130
|
</Title>
|
129
131
|
)
|
130
132
|
: (
|
@@ -158,7 +160,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
|
|
158
160
|
<Caption dark={dark}
|
159
161
|
tag="span">
|
160
162
|
{month} {day}
|
161
|
-
{currentYear
|
163
|
+
{(currentYear !== year || showCurrentYear) && <>{`, ${year}`}</>}
|
162
164
|
</Caption>
|
163
165
|
</>
|
164
166
|
)}
|
@@ -13,8 +13,8 @@
|
|
13
13
|
<% end %>
|
14
14
|
|
15
15
|
<!-- month day, year -->
|
16
|
-
<%# if not current year %>
|
17
|
-
<% if object.year.to_s == DateTime.now.year.to_s %>
|
16
|
+
<%# if not current year or show_current_year is false %>
|
17
|
+
<% if object.year.to_s == DateTime.now.year.to_s && !object.show_current_year %>
|
18
18
|
<span><%= "#{object.month} #{object.day}" %></span>
|
19
19
|
<%# if is current year %>
|
20
20
|
<% else %>
|
@@ -44,8 +44,8 @@
|
|
44
44
|
|
45
45
|
<!-- month day, year -->
|
46
46
|
|
47
|
-
<%# if not current year %>
|
48
|
-
<% if object.year.to_s == DateTime.now.year.to_s %>
|
47
|
+
<%# if not current year or show_current_year is false %>
|
48
|
+
<% if object.year.to_s == DateTime.now.year.to_s && !object.show_current_year %>
|
49
49
|
<%= pb_rails("title", props: { tag: "div", text: "#{object.month} #{object.day}", size: 4 }) %>
|
50
50
|
<%# if is current year %>
|
51
51
|
<% else %>
|
@@ -74,8 +74,8 @@
|
|
74
74
|
|
75
75
|
<!-- month day, year -->
|
76
76
|
|
77
|
-
<%# if not current year %>
|
78
|
-
<% if object.year.to_s == DateTime.now.year.to_s %>
|
77
|
+
<%# if not current year or show_current_year is false %>
|
78
|
+
<% if object.year.to_s == DateTime.now.year.to_s && !object.show_current_year %>
|
79
79
|
<%= pb_rails("caption", props: { tag: "span", text: "#{object.month} #{object.day}" }) %>
|
80
80
|
<%# if is current year %>
|
81
81
|
<% else %>
|
@@ -11,6 +11,8 @@ module Playbook
|
|
11
11
|
default: false
|
12
12
|
prop :show_day_of_week, type: Playbook::Props::Boolean,
|
13
13
|
default: false
|
14
|
+
prop :show_current_year, type: Playbook::Props::Boolean,
|
15
|
+
default: false
|
14
16
|
prop :size, type: Playbook::Props::Enum,
|
15
17
|
values: %w[lg md sm xs],
|
16
18
|
default: "md"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import FormattedDate from '../../pb_date/_date'
|
4
|
+
|
5
|
+
const DateWithShowCurrentYear = (props) => {
|
6
|
+
return (
|
7
|
+
<>
|
8
|
+
<FormattedDate
|
9
|
+
showCurrentYear
|
10
|
+
value={new Date()}
|
11
|
+
{...props}
|
12
|
+
/>
|
13
|
+
</>
|
14
|
+
)
|
15
|
+
}
|
16
|
+
|
17
|
+
export default DateWithShowCurrentYear
|
@@ -0,0 +1 @@
|
|
1
|
+
By default, the Date kit does NOT display the year if it is the current year. If you want to display the current year you can do so by setting `showCurrentYear`/`show_current_year` to true as shown here.
|
@@ -5,12 +5,14 @@ examples:
|
|
5
5
|
- date_variants: Variants
|
6
6
|
- date_alignment: Alignment
|
7
7
|
- date_timezone: Timezones
|
8
|
+
- date_with_show_current_year: Show Current Year
|
8
9
|
- date_unstyled: Unstyled
|
9
10
|
|
10
11
|
react:
|
11
12
|
- date_default: Default
|
12
13
|
- date_variants: Variants
|
13
14
|
- date_alignment: Alignment
|
15
|
+
- date_with_show_current_year: Show Current Year
|
14
16
|
- date_unstyled: Unstyled
|
15
17
|
|
16
18
|
swift:
|
@@ -2,3 +2,4 @@ export { default as DateDefault } from './_date_default.jsx'
|
|
2
2
|
export { default as DateVariants } from './_date_variants.jsx'
|
3
3
|
export { default as DateAlignment } from './_date_alignment.jsx'
|
4
4
|
export { default as DateUnstyled } from './_date_unstyled.jsx'
|
5
|
+
export { default as DateWithShowCurrentYear } from './_date_with_show_current_year.jsx'
|
@@ -7,7 +7,7 @@
|
|
7
7
|
thead tr:not(:first-child) th {
|
8
8
|
border-right: 1px solid $border_light !important;
|
9
9
|
}
|
10
|
-
|
10
|
+
|
11
11
|
@media screen and (min-width: $screen-xs-min) {
|
12
12
|
tr:hover, .pb_table_tr:hover {
|
13
13
|
td:last-child, .pb_table_td:last-child {
|
@@ -15,53 +15,5 @@
|
|
15
15
|
}
|
16
16
|
}
|
17
17
|
}
|
18
|
-
|
19
|
-
// Firefox-specific fix for sticky elements
|
20
|
-
@-moz-document url-prefix() {
|
21
|
-
// Target sticky headers
|
22
|
-
&.sticky-header {
|
23
|
-
th:not(:last-child) {
|
24
|
-
border-right: none !important;
|
25
|
-
box-shadow: 1px 0 0 0 $border_light !important;
|
26
|
-
}
|
27
|
-
|
28
|
-
.pb_advanced_table_body {
|
29
|
-
.pinned-row {
|
30
|
-
td:not(:first-child):not(:last-child) {
|
31
|
-
border-right: none !important;
|
32
|
-
box-shadow: 1px 0 0 0 $border_light !important;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
}
|
36
|
-
}
|
37
|
-
|
38
|
-
// Target sticky left columns
|
39
|
-
&.sticky-left-column {
|
40
|
-
td[style="left"], th[style="left"] {
|
41
|
-
border-right: none !important;
|
42
|
-
box-shadow: 1px 0 0 0 $border_light !important;
|
43
|
-
}
|
44
|
-
}
|
45
|
-
|
46
|
-
// Target sticky right columns
|
47
|
-
&.sticky-right-column {
|
48
|
-
td[style="right"], th[style="right"] {
|
49
|
-
border-right: none !important;
|
50
|
-
box-shadow: 1px 0 0 0 $border_light !important;
|
51
|
-
}
|
52
|
-
}
|
53
|
-
|
54
|
-
// Handle hover states in Firefox
|
55
|
-
@media screen and (min-width: $screen-xs-min) {
|
56
|
-
tr:hover, .pb_table_tr:hover {
|
57
|
-
td:last-child, .pb_table_td:last-child {
|
58
|
-
&[style="left"], &[style="right"] {
|
59
|
-
border-right: none !important;
|
60
|
-
box-shadow: 1px 0 0 0 darken($border_light, 10%) !important;
|
61
|
-
}
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
65
|
-
}
|
66
18
|
}
|
67
19
|
}
|