playbook_ui 12.31.0.pre.alpha.datepickerdisableddatefix931 → 12.31.0.pre.alpha.hoverrails951
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_button/docs/_button_hover.html.erb +3 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +31 -37
- data/app/pb_kits/playbook/pb_message/docs/_message_hover.html.erb +25 -0
- data/app/pb_kits/playbook/pb_message/docs/example.yml +1 -0
- data/app/pb_kits/playbook/utilities/_hover.scss +1 -1
- data/app/pb_kits/playbook/utilities/globalProps.ts +1 -1
- data/dist/playbook-rails.js +2 -2
- data/lib/playbook/border_radius.rb +29 -0
- data/lib/playbook/classnames.rb +2 -0
- data/lib/playbook/hover.rb +60 -0
- data/lib/playbook/kit_base.rb +4 -0
- data/lib/playbook/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3126e0971e1092c47d8dfa988f36a2dca2ac152bd0ef7f5437d44ef25696931e
|
4
|
+
data.tar.gz: e25f1f5019db99a6b314df9c6eda14cdd4a63ac544b160c0d8d044418b25c6ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a3838e0866216c40824eb2fa6e314a4e80c5b3c189b1e15402f7e326dcfb5246580504684a09691e9ebdbdb7d91aaca1fe5824f6c69b95cd85d5e1241b2f10b
|
7
|
+
data.tar.gz: d69a65e9e3b64dcef3a777a63d20e2bded1768d791dd1b48117d026a7f1b7ce59d4ead07c4ce523644847bc39957f207fad0eb2470d5c13e10c34d01ad18323a
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<%= pb_rails("button", props: { hover: { shadow: "deep"}, text: "Shadow Deep", margin_right: "lg" }) %>
|
2
|
+
<%= pb_rails("button", props: { hover: { shadow: "deeper"}, text: "Shadow Deeper", margin_right: "lg" }) %>
|
3
|
+
<%= pb_rails("button", props: { hover: { shadow: "deepest"}, text: "Shadow Deepest", margin_right: "lg" }) %>
|
@@ -71,42 +71,13 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
71
71
|
}
|
72
72
|
}
|
73
73
|
const disabledParser = () => {
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
}
|
82
|
-
|
83
|
-
const disabledWeekDays = () => {
|
84
|
-
return (
|
85
|
-
[
|
86
|
-
(date:any) => {
|
87
|
-
const weekdayObj: {
|
88
|
-
[day: string]: number
|
89
|
-
} = {
|
90
|
-
Sunday: 0,
|
91
|
-
Monday: 1,
|
92
|
-
Tuesday: 2,
|
93
|
-
Wednesday: 3,
|
94
|
-
Thursday: 4,
|
95
|
-
Friday: 5,
|
96
|
-
Saturday: 6,
|
97
|
-
}
|
98
|
-
return (
|
99
|
-
date.getDay() === weekdayObj[disableWeekdays[0]] ||
|
100
|
-
date.getDay() === weekdayObj[disableWeekdays[1]] ||
|
101
|
-
date.getDay() === weekdayObj[disableWeekdays[2]] ||
|
102
|
-
date.getDay() === weekdayObj[disableWeekdays[3]] ||
|
103
|
-
date.getDay() === weekdayObj[disableWeekdays[4]] ||
|
104
|
-
date.getDay() === weekdayObj[disableWeekdays[5]] ||
|
105
|
-
date.getDay() === weekdayObj[disableWeekdays[6]]
|
106
|
-
)
|
107
|
-
},
|
108
|
-
]
|
109
|
-
)
|
74
|
+
if (disableDate && disableDate.length > 0) {
|
75
|
+
return disableDate
|
76
|
+
} else if (disableRange && disableRange.length > 0) {
|
77
|
+
return disableRange
|
78
|
+
} else {
|
79
|
+
return []
|
80
|
+
}
|
110
81
|
}
|
111
82
|
const calendarResizer = () => {
|
112
83
|
const cal = document.querySelector(`#cal-${pickerId}.open`) as HTMLElement
|
@@ -156,7 +127,30 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
156
127
|
disableMobile: true,
|
157
128
|
dateFormat: getDateFormat(),
|
158
129
|
defaultDate: defaultDateGetter(),
|
159
|
-
disable:
|
130
|
+
disable: disableWeekdays && disableWeekdays.length > 0 ? [
|
131
|
+
(date) => {
|
132
|
+
const weekdayObj: {
|
133
|
+
[day: string]: number
|
134
|
+
} = {
|
135
|
+
Sunday: 0,
|
136
|
+
Monday: 1,
|
137
|
+
Tuesday: 2,
|
138
|
+
Wednesday: 3,
|
139
|
+
Thursday: 4,
|
140
|
+
Friday: 5,
|
141
|
+
Saturday: 6,
|
142
|
+
}
|
143
|
+
return (
|
144
|
+
date.getDay() === weekdayObj[disableWeekdays[0]] ||
|
145
|
+
date.getDay() === weekdayObj[disableWeekdays[1]] ||
|
146
|
+
date.getDay() === weekdayObj[disableWeekdays[2]] ||
|
147
|
+
date.getDay() === weekdayObj[disableWeekdays[3]] ||
|
148
|
+
date.getDay() === weekdayObj[disableWeekdays[4]] ||
|
149
|
+
date.getDay() === weekdayObj[disableWeekdays[5]] ||
|
150
|
+
date.getDay() === weekdayObj[disableWeekdays[6]]
|
151
|
+
)
|
152
|
+
},
|
153
|
+
] : disabledParser(),
|
160
154
|
enableTime,
|
161
155
|
locale: {
|
162
156
|
rangeSeparator: ' to '
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= pb_rails("message", props: {
|
2
|
+
avatar_name: "Mike Bishop",
|
3
|
+
avatar_status: "online",
|
4
|
+
avatar_url: "https://randomuser.me/api/portraits/men/50.jpg",
|
5
|
+
border_radius: "rounded",
|
6
|
+
hover: { background: "success_subtle" },
|
7
|
+
label: "Anna Black",
|
8
|
+
message: "How can we assist you today?",
|
9
|
+
padding: "xs",
|
10
|
+
}) %>
|
11
|
+
|
12
|
+
<br><br>
|
13
|
+
|
14
|
+
<%= pb_rails("message", props: {
|
15
|
+
align_timestamp: "left",
|
16
|
+
avatar_name: "Lucille Sanchez",
|
17
|
+
avatar_url: "https://randomuser.me/api/portraits/women/50.jpg",
|
18
|
+
border_radius: "rounded",
|
19
|
+
hover: { shadow: "deepest" },
|
20
|
+
label: "Becca Jacobs",
|
21
|
+
message: "Application for Kate Smith is waiting for your approval",
|
22
|
+
padding: "xs",
|
23
|
+
}) %>
|
24
|
+
|
25
|
+
<br><br>
|
@@ -147,7 +147,7 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
147
147
|
let css = '';
|
148
148
|
if (!hover) return css;
|
149
149
|
css += hover.shadow ? `hover_shadow_${hover.shadow} ` : '';
|
150
|
-
css += hover.background ? `
|
150
|
+
css += hover.background ? `hover_background_${hover.background } ` : '';
|
151
151
|
css += hover.scale ? `hover_scale_${hover.scale} ` : '';
|
152
152
|
return css;
|
153
153
|
},
|