playbook_ui 12.22.0.pre.alpha.PBNTR12checkingemptyfilters686 → 12.22.0.pre.alpha.play698responsivespacingglobalprop690
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_filter/Filter/CurrentFilters.tsx +1 -1
- data/app/pb_kits/playbook/pb_filter/filter.html.erb +15 -16
- data/app/pb_kits/playbook/utilities/_spacing.scss +27 -1
- data/app/pb_kits/playbook/utilities/globalProps.ts +60 -15
- data/lib/playbook/spacing.rb +20 -5
- 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: 383851d079d36f1d554a0e282c498a4fc6847f4b5454e7235949dac02a03d72b
|
4
|
+
data.tar.gz: a16155b3649ed77452c42f37b2dba7453759265c5fa8670ae8bafc5d110db796
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bf064f59ae1cb0b15bf62cfd577d92f08a106f58ed014a142b656bf101cc5915b3598f83c2ef26fcb225b8f44a601a193a9b7893503e36dd1a097a3a43ee24e
|
7
|
+
data.tar.gz: f715563781a813989eb0a90910db0034ce7f117a133708a449abeb2c7631b65b2e4fdd14361c93a7524ba521bc1ea31d4352f7e62dc79c7433e2a8772479284d
|
@@ -9,23 +9,22 @@
|
|
9
9
|
<div class="maskContainer">
|
10
10
|
<div class="filters">
|
11
11
|
<div class="left_gradient"></div>
|
12
|
-
<%
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
<% end %>
|
23
|
-
<% object.filters&.each do |filter| %>
|
24
|
-
<% if filter[:name].present? %>
|
25
|
-
<div class="filter">
|
26
|
-
<%= pb_rails("caption", props: { text: filter[:name]}) %>
|
27
|
-
<%= pb_rails("title", props: { size: 4, tag:"h4", text: filter[:value]}) %>
|
12
|
+
<% object.filters.each do |filter| %>
|
13
|
+
<% if filter[:name] == "" %>
|
14
|
+
<div>
|
15
|
+
<%= pb_rails("body", props: {
|
16
|
+
color: "light",
|
17
|
+
padding_left: "xs",
|
18
|
+
size: 4,
|
19
|
+
tag:"h4",
|
20
|
+
text: "No Filter Selected"
|
21
|
+
}) %>
|
28
22
|
</div>
|
23
|
+
<% else %>
|
24
|
+
<div class="filter">
|
25
|
+
<%= pb_rails("caption", props: { text: filter[:name]}) %>
|
26
|
+
<%= pb_rails("title", props: { size: 4, tag:"h4", text: filter[:value]}) %>
|
27
|
+
</div>
|
29
28
|
<% end %>
|
30
29
|
<% end %>
|
31
30
|
<div class="right_gradient"></div>
|
@@ -7,7 +7,10 @@ $space_classes: (
|
|
7
7
|
md: $space_md,
|
8
8
|
lg: $space_lg,
|
9
9
|
xl: $space_xl,
|
10
|
-
none: 0
|
10
|
+
none: 0,
|
11
|
+
auto: auto,
|
12
|
+
initial: initial,
|
13
|
+
inherit: inherit
|
11
14
|
);
|
12
15
|
|
13
16
|
$positions: (
|
@@ -41,3 +44,26 @@ $positions: (
|
|
41
44
|
}
|
42
45
|
}
|
43
46
|
}
|
47
|
+
|
48
|
+
@each $size, $size_value in $breakpoints_grid {
|
49
|
+
@each $position_name, $position in $positions {
|
50
|
+
@each $space_name, $space in $space_classes {
|
51
|
+
$min_size: map-get($size_value, "min");
|
52
|
+
$max_size: map-get($size_value, "max");
|
53
|
+
.#{$position_name}_#{$size}_#{$space_name} {
|
54
|
+
@if type-of($position)=="list" {
|
55
|
+
@each $coordinate in $position {
|
56
|
+
@include break_on($min_size, $max_size) {
|
57
|
+
#{$coordinate}: #{$space} !important;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
61
|
+
@else {
|
62
|
+
@include break_on($min_size, $max_size) {
|
63
|
+
#{$position}: #{$space} !important;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|
@@ -153,22 +153,67 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
153
153
|
padding,
|
154
154
|
}: Margin & Padding) => {
|
155
155
|
let css = ''
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
156
|
+
const spacingProps = {
|
157
|
+
marginRight,
|
158
|
+
marginLeft,
|
159
|
+
marginTop,
|
160
|
+
marginBottom,
|
161
|
+
marginX,
|
162
|
+
marginY,
|
163
|
+
margin,
|
164
|
+
paddingRight,
|
165
|
+
paddingLeft,
|
166
|
+
paddingTop,
|
167
|
+
paddingBottom,
|
168
|
+
paddingX,
|
169
|
+
paddingY,
|
170
|
+
padding,
|
171
|
+
};
|
172
|
+
|
173
|
+
function handleObjectValue(properties: Margin | Padding, prefix: string) {
|
174
|
+
let classResult = '';
|
175
|
+
|
176
|
+
Object.entries(properties).forEach(([key, value]) => {
|
177
|
+
classResult += `${prefix}_${key}_${value} `;
|
178
|
+
});
|
179
|
+
|
180
|
+
return classResult;
|
181
|
+
}
|
182
|
+
|
183
|
+
function getPrefix(key: string) {
|
184
|
+
const prefixes: Record<string, string> = {
|
185
|
+
marginRight: 'mr',
|
186
|
+
marginLeft: 'ml',
|
187
|
+
marginTop: 'mt',
|
188
|
+
marginBottom: 'mb',
|
189
|
+
marginX: 'mx',
|
190
|
+
marginY: 'my',
|
191
|
+
margin: 'm',
|
192
|
+
paddingRight: 'pr',
|
193
|
+
paddingLeft: 'pl',
|
194
|
+
paddingTop: 'pt',
|
195
|
+
paddingBottom: 'pb',
|
196
|
+
paddingX: 'px',
|
197
|
+
paddingY: 'py',
|
198
|
+
padding: 'p',
|
199
|
+
};
|
200
|
+
|
201
|
+
return prefixes[key];
|
202
|
+
}
|
203
|
+
|
204
|
+
Object.entries(spacingProps).forEach(([key, value]) => {
|
205
|
+
if (value) {
|
206
|
+
if (typeof value === 'object') {
|
207
|
+
css += handleObjectValue(value, getPrefix(key));
|
208
|
+
} else {
|
209
|
+
const prefix = getPrefix(key);
|
210
|
+
css += `${prefix}_${value} `;
|
211
|
+
}
|
212
|
+
}
|
213
|
+
});
|
214
|
+
return css.trim();
|
171
215
|
},
|
216
|
+
|
172
217
|
darkProps: ({ dark }: Dark) => dark ? 'dark' : '',
|
173
218
|
numberSpacingProps: ({ numberSpacing }: NumberSpacing) => {
|
174
219
|
let css = ''
|
data/lib/playbook/spacing.rb
CHANGED
@@ -50,17 +50,32 @@ module Playbook
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def spacing_values
|
53
|
-
%w[none xxs xs sm md lg xl]
|
53
|
+
%w[none xxs xs sm md lg xl auto initial inherit]
|
54
|
+
end
|
55
|
+
|
56
|
+
def screen_size_values
|
57
|
+
%w[xs sm md lg xl]
|
54
58
|
end
|
55
59
|
|
56
60
|
def spacing_props
|
57
61
|
selected_props = spacing_options.keys.select { |sk| try(sk) }
|
58
62
|
return nil unless selected_props.present?
|
59
63
|
|
60
|
-
selected_props.
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
+
responsive = selected_props.present? && try(selected_props.first).is_a?(::Hash)
|
65
|
+
css = ""
|
66
|
+
selected_props.each do |prop|
|
67
|
+
spacing_value = send(prop)
|
68
|
+
prefix = spacing_options[prop]
|
69
|
+
if responsive
|
70
|
+
spacing_value.each do |key, value|
|
71
|
+
css += "#{prefix}_#{key}_#{value} " if screen_size_values.include?(key.to_s) && spacing_values.include?(value.to_s)
|
72
|
+
end
|
73
|
+
elsif spacing_values.include?(spacing_value)
|
74
|
+
css += "#{prefix}_#{spacing_value} "
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
css.strip unless css.blank?
|
64
79
|
end
|
65
80
|
|
66
81
|
def max_width_props
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.22.0.pre.alpha.
|
4
|
+
version: 12.22.0.pre.alpha.play698responsivespacingglobalprop690
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-05-
|
12
|
+
date: 2023-05-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|