playbook_ui 9.10.0 → 9.14.1.alpha.highcharts9
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/_playbook.scss +1 -0
- data/app/pb_kits/playbook/data/menu.yml +26 -22
- data/app/pb_kits/playbook/index.js +1 -0
- data/app/pb_kits/playbook/pb_background/background.rb +0 -1
- data/app/pb_kits/playbook/pb_badge/_badge.jsx +26 -1
- data/app/pb_kits/playbook/pb_badge/_badge.scss +1 -1
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.jsx +51 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.jsx +49 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +55 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumb_item.html.erb +9 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumb_item.rb +12 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumbs.html.erb +7 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumbs.rb +11 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumbs.test.js +35 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.html.erb +17 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.jsx +56 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_button/button.rb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +9 -10
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +4 -2
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +6 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +3 -0
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.jsx +45 -11
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +17 -6
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.rb +18 -13
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_bold.html.erb +5 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_bold.jsx +38 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_date_stacked/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.jsx +32 -16
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.scss +23 -4
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +12 -8
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.rb +9 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +35 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_default.html.erb +8 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_default.jsx +19 -1
- data/app/pb_kits/playbook/pb_dialog/dialog.test.jsx +1 -1
- data/app/pb_kits/playbook/pb_distribution_bar/distribution_bar.rb +2 -2
- data/app/pb_kits/playbook/pb_filter/filter.rb +1 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex.jsx +6 -1
- data/app/pb_kits/playbook/pb_flex/flex.rb +4 -4
- data/app/pb_kits/playbook/pb_form/form.rb +1 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +12 -2
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +19 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_size.html.erb +13 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_size.jsx +25 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.html.erb +4 -5
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.jsx +2 -6
- data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +5 -0
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.rb +0 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +6 -2
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.jsx +14 -11
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +18 -13
- data/app/pb_kits/playbook/pb_pill/_pill.jsx +1 -0
- data/app/pb_kits/playbook/pb_pill/pill.html.erb +1 -1
- data/app/pb_kits/playbook/pb_progress_pills/progress_pills.rb +2 -1
- data/app/pb_kits/playbook/pb_progress_step/progress_step.rb +1 -1
- data/app/pb_kits/playbook/pb_progress_step/progress_step_item.rb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx +10 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +61 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.html.erb +6 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.jsx +16 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_bottom.html.erb +4 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_bottom.jsx +14 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +9 -2
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +7 -3
- data/app/pb_kits/playbook/pb_select/_select.jsx +5 -5
- data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.rb +1 -1
- data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.rb +1 -1
- data/app/pb_kits/playbook/pb_stat_change/stat_change.rb +8 -12
- data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +83 -31
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +106 -0
- data/app/pb_kits/playbook/pb_text_input/add_on.html.erb +13 -0
- data/app/pb_kits/playbook/pb_text_input/add_on.rb +30 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_add_on.html.erb +24 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_add_on.jsx +82 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_custom.html.erb +1 -1
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_inline.html.erb +5 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_inline.jsx +22 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +7 -16
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +43 -3
- data/app/pb_kits/playbook/pb_time_stacked/time_stacked.html.erb +2 -2
- data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +1 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +11 -2
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +23 -0
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +23 -11
- data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.jsx +17 -4
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_createable.jsx +25 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_inline.html.erb +36 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_inline.jsx +43 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_multi_kit.html.erb +35 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_multi_kit.jsx +44 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +8 -5
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +1 -1
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +18 -2
- data/app/pb_kits/playbook/pb_user_badge/user_badge.rb +1 -1
- data/lib/playbook/forms/builder/action_area.rb +2 -2
- data/lib/playbook/forms/builder/collection_select_field.rb +2 -2
- data/lib/playbook/forms/builder/select_field.rb +1 -1
- data/lib/playbook/kit_resolver.rb +1 -1
- data/lib/playbook/markdown/template_handler.rb +4 -2
- data/lib/playbook/pb_doc_helper.rb +4 -2
- data/lib/playbook/props.rb +2 -4
- data/lib/playbook/props/base.rb +1 -2
- data/lib/playbook/props/nested_props.rb +23 -0
- data/lib/playbook/version.rb +2 -1
- metadata +58 -24
@@ -1,13 +1,26 @@
|
|
1
1
|
/* @flow */
|
2
2
|
|
3
3
|
import React from 'react'
|
4
|
+
import { Flex, Icon } from '../../'
|
4
5
|
import { components } from 'react-select'
|
5
6
|
|
6
7
|
const Placeholder = (props: any) => (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
<>
|
9
|
+
<Flex
|
10
|
+
align="center"
|
11
|
+
className="placeholder"
|
12
|
+
>
|
13
|
+
<components.IndicatorsContainer
|
14
|
+
{...props}
|
15
|
+
/>
|
16
|
+
<If condition={props.selectProps.plusIcon}>
|
17
|
+
<Icon
|
18
|
+
className="typeahead-plus-icon"
|
19
|
+
icon="plus"
|
20
|
+
/>
|
21
|
+
</If>
|
22
|
+
</Flex>
|
23
|
+
</>
|
11
24
|
)
|
12
25
|
|
13
26
|
export default Placeholder
|
@@ -0,0 +1,25 @@
|
|
1
|
+
// @flow
|
2
|
+
|
3
|
+
import React from 'react'
|
4
|
+
import { Typeahead } from '../..'
|
5
|
+
|
6
|
+
const options = [
|
7
|
+
{ label: 'Jardim', value: 'Portuguese' },
|
8
|
+
{ label: 'Garten', value: 'German' },
|
9
|
+
{ label: 'Giardino', value: 'Italian' },
|
10
|
+
{ label: 'Jardín', value: 'Spanish' },
|
11
|
+
]
|
12
|
+
|
13
|
+
const TypeaheadCreateable = (props) => {
|
14
|
+
return (
|
15
|
+
<Typeahead
|
16
|
+
createable
|
17
|
+
isMulti
|
18
|
+
label="User Created Options"
|
19
|
+
options={options}
|
20
|
+
{...props}
|
21
|
+
/>
|
22
|
+
)
|
23
|
+
}
|
24
|
+
|
25
|
+
export default TypeaheadCreateable
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<%
|
2
|
+
synths = [
|
3
|
+
{ label: 'Oberheim', value: 'OBXa' },
|
4
|
+
{ label: 'Moog', value: 'Minimoog' },
|
5
|
+
{ label: 'Roland', value: 'Juno' },
|
6
|
+
{ label: 'Korg', value: 'MS-20' },
|
7
|
+
]
|
8
|
+
%>
|
9
|
+
<%
|
10
|
+
cities = [
|
11
|
+
{ label: 'Budapest', value: 'Hungary' },
|
12
|
+
{ label: 'Singapore', value: 'Singapore' },
|
13
|
+
{ label: 'Oslo', value: 'Norway' },
|
14
|
+
{ label: 'Lagos', value: 'Nigeria' },
|
15
|
+
]
|
16
|
+
%>
|
17
|
+
|
18
|
+
<%= pb_rails("typeahead", props: {
|
19
|
+
default_options: [synths.first],
|
20
|
+
id: "typeahead-inline-example1",
|
21
|
+
inline: true,
|
22
|
+
options: synths,
|
23
|
+
label: "Synths",
|
24
|
+
placeholder: "Add synths",
|
25
|
+
pills: true
|
26
|
+
}) %>
|
27
|
+
|
28
|
+
<%= pb_rails("typeahead", props: {
|
29
|
+
id: "typeahead-inline-example2",
|
30
|
+
inline: true,
|
31
|
+
options: cities,
|
32
|
+
label: "Cities",
|
33
|
+
pills: true,
|
34
|
+
placeholder: "Add cities",
|
35
|
+
plus_icon: true
|
36
|
+
}) %>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
// @flow
|
2
|
+
|
3
|
+
import React from 'react'
|
4
|
+
import { Typeahead } from '../../'
|
5
|
+
|
6
|
+
const synths = [
|
7
|
+
{ label: 'Oberheim', value: 'OBXa' },
|
8
|
+
{ label: 'Moog', value: 'Minimoog' },
|
9
|
+
{ label: 'Roland', value: 'Juno' },
|
10
|
+
{ label: 'Korg', value: 'MS-20' },
|
11
|
+
]
|
12
|
+
|
13
|
+
const cities = [
|
14
|
+
{ label: 'Budapest', value: 'Hungary' },
|
15
|
+
{ label: 'Singapore', value: 'Singapore' },
|
16
|
+
{ label: 'Oslo', value: 'Norway' },
|
17
|
+
{ label: 'Lagos', value: 'Nigeria' },
|
18
|
+
]
|
19
|
+
|
20
|
+
const TypeaheadInline = (props) => {
|
21
|
+
return (
|
22
|
+
<>
|
23
|
+
<Typeahead
|
24
|
+
inline
|
25
|
+
isMulti
|
26
|
+
label="Synths"
|
27
|
+
options={synths}
|
28
|
+
{...props}
|
29
|
+
/>
|
30
|
+
<Typeahead
|
31
|
+
inline
|
32
|
+
isMulti
|
33
|
+
label="Placeholder Plus Icon"
|
34
|
+
options={cities}
|
35
|
+
placeholder="Add cities"
|
36
|
+
plusIcon
|
37
|
+
{...props}
|
38
|
+
/>
|
39
|
+
</>
|
40
|
+
)
|
41
|
+
}
|
42
|
+
|
43
|
+
export default TypeaheadInline
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<%
|
2
|
+
labels = [
|
3
|
+
{ label: 'Verve', value: '1956' },
|
4
|
+
{ label: 'Stax', value: '1957' },
|
5
|
+
{ label: 'Motown', value: '1959' },
|
6
|
+
{ label: 'Kudu', value: '1971' },
|
7
|
+
{ label: 'Stones Throw', value: '1996' },
|
8
|
+
]
|
9
|
+
%>
|
10
|
+
<%
|
11
|
+
expressionists = [
|
12
|
+
{ label: 'Kandinsky', value: 'Russia' },
|
13
|
+
{ label: 'Klee', value: 'Switzerland' },
|
14
|
+
{ label: 'Kokoschka', value: 'Austria' },
|
15
|
+
{ label: 'Kirchner', value: 'Germany' },
|
16
|
+
]
|
17
|
+
%>
|
18
|
+
|
19
|
+
<%= pb_rails("typeahead", props: {
|
20
|
+
default_options: [labels.first],
|
21
|
+
id: "typeahead-multi-kit-example1",
|
22
|
+
options: labels,
|
23
|
+
label: "Badges",
|
24
|
+
multi_kit: "badge",
|
25
|
+
pills: true
|
26
|
+
}) %>
|
27
|
+
|
28
|
+
<%= pb_rails("typeahead", props: {
|
29
|
+
default_options: [expressionists.first],
|
30
|
+
id: "typeahead-multi-kit-example2",
|
31
|
+
options: expressionists,
|
32
|
+
label: "Small Pills",
|
33
|
+
multi_kit: "smallPill",
|
34
|
+
pills: true,
|
35
|
+
}) %>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
// @flow
|
2
|
+
|
3
|
+
import React from 'react'
|
4
|
+
import { Typeahead } from '../../'
|
5
|
+
|
6
|
+
const labels = [
|
7
|
+
{ label: 'Verve', value: '1956' },
|
8
|
+
{ label: 'Stax', value: '1957' },
|
9
|
+
{ label: 'Motown', value: '1959' },
|
10
|
+
{ label: 'Kudu', value: '1971' },
|
11
|
+
{ label: 'Stones Throw', value: '1996' },
|
12
|
+
]
|
13
|
+
|
14
|
+
const expressionists = [
|
15
|
+
{ label: 'Kandinsky', value: 'Russia' },
|
16
|
+
{ label: 'Klee', value: 'Switzerland' },
|
17
|
+
{ label: 'Kokoschka', value: 'Austria' },
|
18
|
+
{ label: 'Kirchner', value: 'Germany' },
|
19
|
+
]
|
20
|
+
|
21
|
+
const TypeaheadMultiKit = (props) => {
|
22
|
+
return (
|
23
|
+
<>
|
24
|
+
<Typeahead
|
25
|
+
defaultValue={[labels[0]]}
|
26
|
+
isMulti
|
27
|
+
label="Badges"
|
28
|
+
multiKit="badge"
|
29
|
+
options={labels}
|
30
|
+
{...props}
|
31
|
+
/>
|
32
|
+
<Typeahead
|
33
|
+
defaultValue={[expressionists[0]]}
|
34
|
+
isMulti
|
35
|
+
label="Small Pills"
|
36
|
+
multiKit="smallPill"
|
37
|
+
options={expressionists}
|
38
|
+
{...props}
|
39
|
+
/>
|
40
|
+
</>
|
41
|
+
)
|
42
|
+
}
|
43
|
+
|
44
|
+
export default TypeaheadMultiKit
|
@@ -5,6 +5,8 @@ examples:
|
|
5
5
|
- typeahead_with_pills: With Pills
|
6
6
|
- typeahead_with_pills_async: With Pills (Async Data)
|
7
7
|
- typeahead_with_pills_async_users: With Pills (Async Data w/ Users)
|
8
|
+
- typeahead_inline: Inline
|
9
|
+
- typeahead_multi_kit: Multi Kit Options
|
8
10
|
|
9
11
|
react:
|
10
12
|
- typeahead_default: Default
|
@@ -12,3 +14,6 @@ examples:
|
|
12
14
|
- typeahead_with_pills_async: With Pills (Async Data)
|
13
15
|
- typeahead_with_pills_async_users: With Pills (Async Data w/ Users)
|
14
16
|
- typeahead_with_pills_async_custom_options: With Pills (Async Data w/ Custom Options)
|
17
|
+
- typeahead_inline: Inline
|
18
|
+
- typeahead_multi_kit: Multi Kit Options
|
19
|
+
- typeahead_createable: Createable
|
@@ -1,5 +1,8 @@
|
|
1
|
-
export { default as TypeaheadDefault } from './_typeahead_default'
|
2
|
-
export { default as TypeaheadWithPills } from './_typeahead_with_pills'
|
3
|
-
export { default as TypeaheadWithPillsAsync } from './_typeahead_with_pills_async'
|
4
|
-
export { default as TypeaheadWithPillsAsyncUsers } from './_typeahead_with_pills_async_users'
|
5
|
-
export { default as TypeaheadWithPillsAsyncCustomOptions } from './_typeahead_with_pills_async_custom_options'
|
1
|
+
export { default as TypeaheadDefault } from './_typeahead_default.jsx'
|
2
|
+
export { default as TypeaheadWithPills } from './_typeahead_with_pills.jsx'
|
3
|
+
export { default as TypeaheadWithPillsAsync } from './_typeahead_with_pills_async.jsx'
|
4
|
+
export { default as TypeaheadWithPillsAsyncUsers } from './_typeahead_with_pills_async_users.jsx'
|
5
|
+
export { default as TypeaheadWithPillsAsyncCustomOptions } from './_typeahead_with_pills_async_custom_options.jsx'
|
6
|
+
export { default as TypeaheadInline } from './_typeahead_inline.jsx'
|
7
|
+
export { default as TypeaheadMultiKit } from './_typeahead_multi_kit.jsx'
|
8
|
+
export { default as TypeaheadCreateable } from './_typeahead_createable.jsx'
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<%= content_tag(:div,
|
5
5
|
id: object.id,
|
6
6
|
data: object.data,
|
7
|
-
class: object.classname) do %>
|
7
|
+
class: object.classname + object.inline_class) do %>
|
8
8
|
<div class="pb_typeahead_wrapper">
|
9
9
|
<div class="pb_typeahead_loading_indicator" data-pb-typeahead-kit-loading-indicator>
|
10
10
|
<%= pb_rails("icon", props: {
|
@@ -8,12 +8,21 @@ module Playbook
|
|
8
8
|
prop :get_option_label
|
9
9
|
prop :get_option_value
|
10
10
|
prop :id
|
11
|
+
prop :inline, type: Playbook::Props::Boolean,
|
12
|
+
default: false
|
11
13
|
prop :label
|
12
14
|
prop :load_options
|
15
|
+
prop :multi_kit, type: Playbook::Props::String,
|
16
|
+
default: ""
|
13
17
|
prop :name
|
14
|
-
prop :options, type: Playbook::Props::HashArray,
|
15
|
-
|
18
|
+
prop :options, type: Playbook::Props::HashArray,
|
19
|
+
default: []
|
20
|
+
prop :pills, type: Playbook::Props::Boolean,
|
21
|
+
default: false
|
22
|
+
|
16
23
|
prop :placeholder
|
24
|
+
prop :plus_icon, type: Playbook::Props::Boolean,
|
25
|
+
default: false
|
17
26
|
prop :search_term_minimum_length, default: 3
|
18
27
|
prop :search_debounce_timeout, default: 250
|
19
28
|
prop :value
|
@@ -22,6 +31,10 @@ module Playbook
|
|
22
31
|
generate_classname("pb_typeahead_kit")
|
23
32
|
end
|
24
33
|
|
34
|
+
def inline_class
|
35
|
+
inline ? " inline" : ""
|
36
|
+
end
|
37
|
+
|
25
38
|
def data
|
26
39
|
Hash(values[:data]).merge(
|
27
40
|
pb_typeahead_kit: true,
|
@@ -35,11 +48,14 @@ module Playbook
|
|
35
48
|
dark: dark,
|
36
49
|
defaultValue: default_options,
|
37
50
|
id: id,
|
51
|
+
inline: inline,
|
38
52
|
isMulti: true,
|
39
53
|
label: label,
|
54
|
+
multiKit: multi_kit,
|
40
55
|
name: name,
|
41
56
|
options: options,
|
42
57
|
placeholder: placeholder,
|
58
|
+
plusIcon: plus_icon,
|
43
59
|
}
|
44
60
|
|
45
61
|
base_options.merge!({ getOptionLabel: get_option_label }) if get_option_label.present?
|
@@ -16,7 +16,7 @@ module Playbook
|
|
16
16
|
button(value, props: props)
|
17
17
|
end
|
18
18
|
|
19
|
-
def button(
|
19
|
+
def button(_value = nil, props:)
|
20
20
|
view_context.content_tag(:li) do
|
21
21
|
view_context.pb_rails("button", props: props)
|
22
22
|
end
|
@@ -28,4 +28,4 @@ module Playbook
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
31
|
-
end
|
31
|
+
end
|
@@ -3,9 +3,9 @@
|
|
3
3
|
module Playbook
|
4
4
|
module Forms
|
5
5
|
class Builder
|
6
|
-
def collection_select(name, collection, value_method, text_method, options = {}, html_options = {}, props: {}
|
6
|
+
def collection_select(name, collection, value_method, text_method, options = {}, html_options = {}, props: {})
|
7
7
|
props[:label] = @template.label(@object_name, name) if props[:label] == true
|
8
|
-
options[:skip_default_ids] = false unless options.
|
8
|
+
options[:skip_default_ids] = false unless options.key?(:skip_default_ids)
|
9
9
|
options[:prompt] = props[:blank_selection] || ""
|
10
10
|
html_options[:required] = "required" if props[:required]
|
11
11
|
input = super(name, collection, value_method, text_method, options, html_options)
|
@@ -5,7 +5,7 @@ module Playbook
|
|
5
5
|
class Builder
|
6
6
|
def select(name, choices = nil, options = {}, html_options = {}, props: {}, &block)
|
7
7
|
props[:label] = @template.label(@object_name, name) if props[:label] == true
|
8
|
-
options[:skip_default_ids] = false unless options.
|
8
|
+
options[:skip_default_ids] = false unless options.key?(:skip_default_ids)
|
9
9
|
options[:prompt] = props[:blank_selection] || ""
|
10
10
|
html_options[:required] = "required" if props[:required]
|
11
11
|
input = super(name, choices, options, html_options, &block)
|
@@ -8,7 +8,7 @@ module Playbook
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def initialize
|
11
|
-
@cache = Hash.new do |
|
11
|
+
@cache = Hash.new do |_cache, kit_name|
|
12
12
|
is_subkit = kit_name.match(%r{[/\\]})
|
13
13
|
folder = is_subkit ? kit_name.split("/")[0] : kit_name
|
14
14
|
item = is_subkit ? kit_name.split("/")[-1] : kit_name
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "redcarpet"
|
2
4
|
|
3
5
|
module Playbook
|
4
6
|
module Markdown
|
@@ -20,7 +22,7 @@ module Playbook
|
|
20
22
|
markdown.render(template).html_safe
|
21
23
|
end
|
22
24
|
|
23
|
-
|
25
|
+
private
|
24
26
|
|
25
27
|
def md_options
|
26
28
|
@md_options ||= {
|
@@ -16,7 +16,7 @@ module Playbook
|
|
16
16
|
example_key: example.keys.first,
|
17
17
|
show_code: show_code,
|
18
18
|
type: type,
|
19
|
-
dark: dark_mode
|
19
|
+
dark: dark_mode,
|
20
20
|
}
|
21
21
|
end.join.yield_self(&method(:raw))
|
22
22
|
end
|
@@ -41,10 +41,12 @@ module Playbook
|
|
41
41
|
raw("<div class='pb--docItem'>" + display_kits.join("</div><div class='pb--docItem'>") + "</div>")
|
42
42
|
end
|
43
43
|
|
44
|
+
# rubocop:disable Naming/AccessorMethodName
|
44
45
|
def get_kits
|
45
46
|
menu = YAML.load_file(Playbook::Engine.root.join("app/pb_kits/playbook/data/menu.yml"))
|
46
47
|
menu["kits"]
|
47
48
|
end
|
49
|
+
# rubocop:enable Naming/AccessorMethodName
|
48
50
|
|
49
51
|
def render_pb_doc_kit(kit, type, limit_examples, code = true, dark_mode = false)
|
50
52
|
title = pb_doc_render_clickable_title(kit, type)
|
@@ -78,7 +80,7 @@ module Playbook
|
|
78
80
|
else
|
79
81
|
kit_show_path(kit)
|
80
82
|
end
|
81
|
-
# FIXME this is here because this helper generates a link for playbook website,
|
83
|
+
# FIXME: this is here because this helper generates a link for playbook website,
|
82
84
|
# but shouldn't do anything when used elsewhere
|
83
85
|
rescue
|
84
86
|
puts "Kit Path Not Avaliable"
|
data/lib/playbook/props.rb
CHANGED
@@ -17,6 +17,7 @@ require_relative "./props/numeric"
|
|
17
17
|
require_relative "./props/percentage"
|
18
18
|
require_relative "./props/proc"
|
19
19
|
require_relative "./props/string"
|
20
|
+
require_relative "./props/nested_props"
|
20
21
|
|
21
22
|
module Playbook
|
22
23
|
module Props
|
@@ -36,9 +37,6 @@ module Playbook
|
|
36
37
|
self.class.props[name].value values[name]
|
37
38
|
end
|
38
39
|
|
39
|
-
attr_accessor :values
|
40
|
-
private :values, :values=
|
41
|
-
|
42
40
|
included do
|
43
41
|
class_attribute :props, default: {}
|
44
42
|
end
|
@@ -50,7 +48,7 @@ module Playbook
|
|
50
48
|
end
|
51
49
|
|
52
50
|
def prop(name, type: Playbook::Props::String, **options)
|
53
|
-
self.props =
|
51
|
+
self.props = props.merge(name => type.new(options.merge(name: name, kit: self)))
|
54
52
|
|
55
53
|
define_method(name) { prop(name) }
|
56
54
|
end
|