playbook_ui 12.31.0.pre.alpha.customiconsfa928 → 12.31.0.pre.alpha.multilevelnopillsdesigns941
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/index.js +1 -2
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +3 -9
- data/app/pb_kits/playbook/pb_icon/icon.rb +2 -8
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +17 -2
- data/dist/playbook-rails.js +4 -4
- data/lib/playbook/version.rb +1 -1
- metadata +2 -3
- data/app/pb_kits/playbook/custom-icons.js +0 -355
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6338c934943b1c56fef912cfbe032aa415b7288be0d44b23df01b858c4a12c0c
|
4
|
+
data.tar.gz: 55f1ac8191a65068030e682e8f7d50e337ce6c74c07ad160c5dd61b795d88bbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 309bd3c9d0885a98a6a280aa7182bcc7617d83cc7f788a435649c832d1188b972c22c4382530c0e30d02c680daa648ce9d0cfb65ee3b2b510ee42a5492440ded
|
7
|
+
data.tar.gz: 1f8e1b6f661fa9554fa85e9c75a2f5145745179361392a86eddbc8c11a1c8c165e82d8a9040b34daca088e0b73155e8b984c78d12d85a9df2fc3fb7beaf2a0bf
|
@@ -2,7 +2,6 @@
|
|
2
2
|
import './_playbook.scss'
|
3
3
|
import 'lazysizes/plugins/attrchange/ls.attrchange'
|
4
4
|
import 'lazysizes'
|
5
|
-
import './custom-icons'
|
6
5
|
|
7
6
|
// vvv React Component JSX Imports from the React Kits vvv
|
8
7
|
export { default as Avatar } from './pb_avatar/_avatar'
|
@@ -130,4 +129,4 @@ export { default as PbTypeahead } from './pb_typeahead'
|
|
130
129
|
export { default as dialogHelper } from './pb_dialog/dialogHelper'
|
131
130
|
|
132
131
|
//Theming
|
133
|
-
export {default as mapTheme} from './pb_map/pbMapTheme'
|
132
|
+
export {default as mapTheme} from './pb_map/pbMapTheme'
|
@@ -34,7 +34,7 @@ type IconProps = {
|
|
34
34
|
pulse?: boolean,
|
35
35
|
rotation?: 90 | 180 | 270,
|
36
36
|
size?: IconSizes,
|
37
|
-
fontStyle?: 'far' | 'fas' | 'fab'
|
37
|
+
fontStyle?: 'far' | 'fas' | 'fab',
|
38
38
|
spin?: boolean,
|
39
39
|
} & GlobalProps
|
40
40
|
|
@@ -76,7 +76,6 @@ const Icon = (props: IconProps) => {
|
|
76
76
|
[`fa-${size}`]: size,
|
77
77
|
[`fa-pull-${pull}`]: pull,
|
78
78
|
[`fa-rotate-${rotation}`]: rotation,
|
79
|
-
|
80
79
|
}
|
81
80
|
|
82
81
|
// Lets check and see if the icon prop is referring to a custom Power icon...
|
@@ -84,15 +83,11 @@ const Icon = (props: IconProps) => {
|
|
84
83
|
// this ensures the JS will not do any further operations
|
85
84
|
// faClasses[`fa-${icon}`] = customIcon ? 'custom' : icon
|
86
85
|
if (!customIcon) faClasses[`fa-${icon}`] = icon
|
87
|
-
|
88
|
-
const whiteList = [
|
89
|
-
'greensky', 'powergon'
|
90
|
-
]
|
91
|
-
|
86
|
+
|
92
87
|
const classes = classnames(
|
93
88
|
flipMap[flip],
|
94
89
|
'pb_icon_kit',
|
95
|
-
customIcon ? '' :
|
90
|
+
customIcon ? '' : fontStyle,
|
96
91
|
faClasses,
|
97
92
|
globalProps(props),
|
98
93
|
className
|
@@ -115,7 +110,6 @@ const Icon = (props: IconProps) => {
|
|
115
110
|
return emojiRegex.test(emoji);
|
116
111
|
};
|
117
112
|
|
118
|
-
|
119
113
|
// Add a conditional here to show only the SVG if custom
|
120
114
|
const displaySVG = (customIcon: any) => {
|
121
115
|
if (customIcon)
|
@@ -33,7 +33,7 @@ module Playbook
|
|
33
33
|
values: ["lg", "xs", "sm", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x", nil],
|
34
34
|
default: nil
|
35
35
|
prop :font_style, type: Playbook::Props::Enum,
|
36
|
-
values: %w[far fas fab
|
36
|
+
values: %w[far fas fab],
|
37
37
|
default: "far"
|
38
38
|
prop :spin, type: Playbook::Props::Boolean,
|
39
39
|
default: false
|
@@ -140,13 +140,7 @@ module Playbook
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def font_style_class
|
143
|
-
|
144
|
-
|
145
|
-
if white_list.include?(icon)
|
146
|
-
"fak"
|
147
|
-
elsif font_style
|
148
|
-
font_style.to_s
|
149
|
-
end
|
143
|
+
font_style ? font_style.to_s : "far"
|
150
144
|
end
|
151
145
|
|
152
146
|
def spin_class
|
@@ -6,6 +6,7 @@ import Checkbox from "../pb_checkbox/_checkbox"
|
|
6
6
|
import Icon from "../pb_icon/_icon"
|
7
7
|
import FormPill from "../pb_form_pill/_form_pill"
|
8
8
|
import CircleIconButton from "../pb_circle_icon_button/_circle_icon_button"
|
9
|
+
import Body from "../pb_body/_body"
|
9
10
|
import { cloneDeep } from "lodash"
|
10
11
|
|
11
12
|
import {
|
@@ -250,6 +251,15 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
250
251
|
}
|
251
252
|
}
|
252
253
|
|
254
|
+
const itemsSelectedLength = () => {
|
255
|
+
let items
|
256
|
+
if (returnAllSelected && returnedArray && returnedArray.length) {
|
257
|
+
items = returnedArray.length
|
258
|
+
} else if (!returnAllSelected && defaultReturn && defaultReturn.length) {
|
259
|
+
items = defaultReturn.length
|
260
|
+
}
|
261
|
+
return items
|
262
|
+
}
|
253
263
|
//rendering formattedData to UI based on typeahead
|
254
264
|
const renderNestedOptions = (items: { [key: string]: any }[]) => {
|
255
265
|
return (
|
@@ -310,7 +320,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
310
320
|
<div {...ariaProps} {...dataProps} className={classes} id={id}>
|
311
321
|
<div ref={dropdownRef} className='wrapper'>
|
312
322
|
<div className='input_wrapper' onClick={handleInputWrapperClick}>
|
313
|
-
<div className='input_inner_container'>
|
323
|
+
<div className='input_inner_container' style={{display: `${inputDisplay === "none" && "flex"}`}}>
|
314
324
|
{returnedArray.length !== 0 && returnAllSelected
|
315
325
|
? returnedArray.map((item) => (
|
316
326
|
<input type='hidden' name={`${name}[]`} value={item.id} />
|
@@ -339,6 +349,11 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
339
349
|
))
|
340
350
|
: null
|
341
351
|
}
|
352
|
+
{
|
353
|
+
inputDisplay === "none" && itemsSelectedLength() && (
|
354
|
+
<Body paddingRight="xs">{`${itemsSelectedLength()} ${itemsSelectedLength() === 1 ? 'item' : 'items'} selected`}</Body>
|
355
|
+
)
|
356
|
+
}
|
342
357
|
{returnedArray.length !== 0 && returnAllSelected && inputDisplay === "pills" && <br />}
|
343
358
|
{defaultReturn.length !== 0 && !returnAllSelected && inputDisplay === "pills" && <br />}
|
344
359
|
<input
|
@@ -346,7 +361,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
346
361
|
onChange={(e) => {
|
347
362
|
setFilterItem(e.target.value)
|
348
363
|
}}
|
349
|
-
placeholder=
|
364
|
+
placeholder={inputDisplay === "none" && itemsSelectedLength() ? "" : "Start typing..."}
|
350
365
|
value={filterItem}
|
351
366
|
onClick={() => setIsClosed(false)}
|
352
367
|
/>
|