playbook_ui 13.15.0.pre.alpha.reactselectbump581876 → 13.15.0.pre.alpha.1132globalpropdatepickerspacing1929
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_dashboard/pbChartsDarkTheme.ts +4 -2
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +5 -3
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +2 -3
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +43 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +2 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +15 -1
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +1 -2
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +0 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +4 -1
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +5 -1
- data/dist/playbook-rails.js +6 -14
- data/lib/playbook/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3d5b87f2b6c16e79587bb3c5e948214ab861f720b447f1de049940fe74d6d3f
|
4
|
+
data.tar.gz: 35f0b35d0c9e112c30f0ca5af3916e1b57f05068650e320c1da973a97cf12936
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcec116e1d5fb1e095e0b92fec1a0a80f85407472821bcd7a22bafdafbd6e3d412d72237ab150c3338e934043e7a5427e567ceb87b2615836716e1cf2928c5a1
|
7
|
+
data.tar.gz: 88b6924b8a19996f02acad09f739e80a04aec6c2caf49374bb5ec37709f84939c29ecc8a9e591297d4d436c5e80c2c5060552423a073ba1bc3be4c02e38b4be8
|
@@ -122,9 +122,11 @@ const highchartsDarkTheme: ThemeProps = {
|
|
122
122
|
// specific to gauge
|
123
123
|
// unfilled gauge color
|
124
124
|
pane: {
|
125
|
-
background:
|
125
|
+
background: {
|
126
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
127
|
+
// @ts-ignore
|
126
128
|
borderColor: colors.border_dark,
|
127
|
-
}
|
129
|
+
},
|
128
130
|
},
|
129
131
|
|
130
132
|
plotOptions: {
|
@@ -122,9 +122,11 @@ const highchartsTheme: ThemeProps = {
|
|
122
122
|
// specific to gauge
|
123
123
|
// unfilled gauge color
|
124
124
|
pane: {
|
125
|
-
background:
|
126
|
-
|
127
|
-
|
125
|
+
background: {
|
126
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
127
|
+
// @ts-ignore
|
128
|
+
borderColor: colors.border_light,
|
129
|
+
},
|
128
130
|
},
|
129
131
|
|
130
132
|
plotOptions: {
|
@@ -10,7 +10,6 @@
|
|
10
10
|
|
11
11
|
[class^=pb_date_picker_kit] {
|
12
12
|
.input_wrapper {
|
13
|
-
margin-bottom: $space_sm;
|
14
13
|
position: relative;
|
15
14
|
|
16
15
|
.flatpickr-wrapper {
|
@@ -47,7 +46,7 @@
|
|
47
46
|
.text_input_wrapper_add_on .add-on-right .text_input{
|
48
47
|
cursor: pointer;
|
49
48
|
}
|
50
|
-
|
49
|
+
|
51
50
|
}
|
52
51
|
|
53
52
|
|
@@ -76,4 +75,4 @@
|
|
76
75
|
&:after {
|
77
76
|
content: none;
|
78
77
|
}
|
79
|
-
}
|
78
|
+
}
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import React, { useEffect } from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
3
|
|
4
|
+
import { Spacing } from "../types"
|
5
|
+
|
4
6
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
5
7
|
import { deprecatedProps, globalProps, GlobalProps } from '../utilities/globalProps'
|
6
8
|
|
@@ -9,6 +11,7 @@ import Icon from '../pb_icon/_icon'
|
|
9
11
|
import Caption from '../pb_caption/_caption'
|
10
12
|
import Body from '../pb_body/_body'
|
11
13
|
|
14
|
+
|
12
15
|
type DatePickerProps = {
|
13
16
|
allowInput?: boolean,
|
14
17
|
aria?: { [key: string]: string },
|
@@ -34,6 +37,13 @@ type DatePickerProps = {
|
|
34
37
|
inputOnChange?: (e: React.FormEvent<HTMLInputElement>) => void,
|
35
38
|
inputValue?: string,
|
36
39
|
label?: string,
|
40
|
+
margin?: Spacing;
|
41
|
+
marginBottom?: Spacing;
|
42
|
+
marginTop?: Spacing;
|
43
|
+
marginRight?: Spacing;
|
44
|
+
marginLeft?: Spacing;
|
45
|
+
marginX?: Spacing;
|
46
|
+
marginY?: Spacing;
|
37
47
|
maxDate: string,
|
38
48
|
minDate: string,
|
39
49
|
name: string,
|
@@ -78,6 +88,13 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
78
88
|
inputOnChange,
|
79
89
|
inputValue,
|
80
90
|
label = 'Date Picker',
|
91
|
+
margin,
|
92
|
+
marginBottom = "sm",
|
93
|
+
marginTop,
|
94
|
+
marginRight,
|
95
|
+
marginLeft,
|
96
|
+
marginX,
|
97
|
+
marginY,
|
81
98
|
maxDate,
|
82
99
|
minDate,
|
83
100
|
mode = 'single',
|
@@ -134,8 +151,33 @@ useEffect(() => {
|
|
134
151
|
required: false,
|
135
152
|
}, scrollContainer)
|
136
153
|
})
|
154
|
+
|
155
|
+
const spacingMarginProps = {
|
156
|
+
margin,
|
157
|
+
marginBottom,
|
158
|
+
marginTop,
|
159
|
+
marginRight,
|
160
|
+
marginLeft,
|
161
|
+
marginX,
|
162
|
+
marginY,
|
163
|
+
}
|
164
|
+
|
137
165
|
const filteredProps = {...props}
|
138
166
|
delete filteredProps?.position
|
167
|
+
delete filteredProps?.margin;
|
168
|
+
delete filteredProps?.marginX;
|
169
|
+
delete filteredProps?.marginY;
|
170
|
+
delete filteredProps?.marginBottom;
|
171
|
+
delete filteredProps?.marginTop;
|
172
|
+
delete filteredProps?.marginRight;
|
173
|
+
delete filteredProps?.marginLeft;
|
174
|
+
|
175
|
+
const inputClasses = classnames(
|
176
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
177
|
+
//@ts-ignore
|
178
|
+
globalProps(spacingMarginProps),
|
179
|
+
className
|
180
|
+
)
|
139
181
|
|
140
182
|
const classes = classnames(
|
141
183
|
buildCss('pb_date_picker_kit'),
|
@@ -179,7 +221,7 @@ useEffect(() => {
|
|
179
221
|
text={hideLabel ? null : label}
|
180
222
|
/>
|
181
223
|
<>
|
182
|
-
<div className=
|
224
|
+
<div className={`date_picker_input_wrapper ${inputClasses}`}>
|
183
225
|
<input
|
184
226
|
autoComplete="off"
|
185
227
|
className="date_picker_input"
|
@@ -74,8 +74,22 @@ module Playbook
|
|
74
74
|
prop :year_range, type: Playbook::Props::Array,
|
75
75
|
default: [1900, 2100]
|
76
76
|
|
77
|
+
def margins_to_remove
|
78
|
+
margin_classes_to_remove = []
|
79
|
+
margin_classes_to_remove << "m_#{object.margin}" if object.margin
|
80
|
+
margin_classes_to_remove << "mx_#{object.margin_x}" if object.margin_x
|
81
|
+
margin_classes_to_remove << "my_#{object.margin_y}" if object.margin_y
|
82
|
+
margin_classes_to_remove << "mb_#{object.margin_bottom}" if object.margin_bottom
|
83
|
+
margin_classes_to_remove << "mt_#{object.margin_top}" if object.margin_top
|
84
|
+
margin_classes_to_remove << "mr_#{object.margin_right}" if object.margin_right
|
85
|
+
margin_classes_to_remove << "ml_#{object.margin_left}" if object.margin_left
|
86
|
+
margin_classes_to_remove
|
87
|
+
end
|
88
|
+
|
77
89
|
def classname
|
78
|
-
|
90
|
+
regex = Regexp.union(margins_to_remove)
|
91
|
+
classnames = generate_classname("pb_date_picker_kit")
|
92
|
+
classnames.gsub(regex, "").strip.gsub(/\s+/, " ")
|
79
93
|
end
|
80
94
|
|
81
95
|
def date_picker_config
|
@@ -70,12 +70,15 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
|
|
70
70
|
const shouldShowAddOn = icon !== null
|
71
71
|
const addOnCss = shouldShowAddOn ? 'text_input_wrapper_add_on' : ""
|
72
72
|
const addOnDarkModeCardCss = (shouldShowAddOn && dark) ? 'add-on-card-dark' : ""
|
73
|
+
const defaultMarginBottom = props.marginBottom ?? "mb_sm"
|
74
|
+
|
73
75
|
const css = classnames([
|
74
76
|
'pb_text_input_kit',
|
75
77
|
inline ? 'inline' : "",
|
76
78
|
error ? 'error' : "",
|
77
79
|
globalProps(props),
|
78
80
|
className,
|
81
|
+
defaultMarginBottom
|
79
82
|
])
|
80
83
|
const addOnIcon = (
|
81
84
|
<Icon
|
@@ -144,7 +147,7 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
|
|
144
147
|
{...htmlProps}
|
145
148
|
className={css}
|
146
149
|
>
|
147
|
-
{label &&
|
150
|
+
{label &&
|
148
151
|
<Caption
|
149
152
|
className="pb_text_input_kit_label"
|
150
153
|
text={label}
|
@@ -25,8 +25,12 @@ module Playbook
|
|
25
25
|
prop :add_on, type: Playbook::Props::NestedProps,
|
26
26
|
nested_kit: Playbook::PbTextInput::AddOn
|
27
27
|
|
28
|
+
def default_margin_bottom
|
29
|
+
object.margin_bottom.present? ? "" : " mb_sm"
|
30
|
+
end
|
31
|
+
|
28
32
|
def classname
|
29
|
-
generate_classname("pb_text_input_kit") + error_class + inline_class
|
33
|
+
generate_classname("pb_text_input_kit") + error_class + inline_class + default_margin_bottom
|
30
34
|
end
|
31
35
|
|
32
36
|
def input_tag
|