playbook_ui 14.9.0.pre.alpha.PLAY16264952 → 14.9.0.pre.alpha.pbntr700newresettodefaultprop4736
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +17 -61
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +3 -5
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +2 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +49 -53
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +36 -29
- data/app/pb_kits/playbook/pb_body/_body.scss +13 -14
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +16 -22
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.jsx +0 -6
- data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +1 -2
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +26 -33
- data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +6 -7
- data/app/pb_kits/playbook/pb_checkbox/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +4 -9
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +2 -2
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +5 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +10 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +0 -5
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +2 -7
- data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +2 -8
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -1
- data/app/pb_kits/playbook/pb_link/_link.scss +3 -3
- data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +1 -11
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +2 -16
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
- data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +2 -2
- data/app/pb_kits/playbook/pb_select/_select.tsx +14 -20
- data/app/pb_kits/playbook/pb_select/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_select/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +4 -4
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +36 -44
- data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +4 -4
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -5
- data/app/pb_kits/playbook/pb_table/docs/index.js +0 -5
- data/app/pb_kits/playbook/pb_table/index.ts +26 -100
- data/app/pb_kits/playbook/pb_table/styles/_all.scss +1 -2
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +1 -106
- data/app/pb_kits/playbook/pb_table/table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/table.rb +2 -17
- data/app/pb_kits/playbook/pb_title/_title.scss +5 -6
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +0 -13
- data/app/pb_kits/playbook/tokens/_titles.scss +8 -0
- data/app/pb_kits/playbook/utilities/_hover.scss +2 -11
- data/app/pb_kits/playbook/utilities/globalProps.ts +0 -2
- data/app/pb_kits/playbook/utilities/test/globalProps/hover.test.js +0 -15
- data/dist/chunks/_typeahead-DU1QgR52.js +22 -0
- data/dist/chunks/_weekday_stacked-BLOmRNnB.js +45 -0
- data/dist/chunks/lib-Ce7MLbJk.js +29 -0
- data/dist/chunks/{pb_form_validation-D37k10a0.js → pb_form_validation-kPWA1Z2g.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/hover.rb +1 -7
- data/lib/playbook/version.rb +1 -1
- metadata +6 -27
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +0 -50
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +0 -57
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_pagination_mock_data.json +0 -5600
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_form.jsx +0 -138
- data/app/pb_kits/playbook/pb_select/docs/_select_form.jsx +0 -109
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +0 -95
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +0 -75
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +0 -108
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.md +0 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +0 -94
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.md +0 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.jsx +0 -83
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +0 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.jsx +0 -120
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +0 -1
- data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +0 -35
- data/app/pb_kits/playbook/utilities/hookFormProps.ts +0 -22
- data/app/pb_kits/playbook/utilities/withReactHookForm.tsx +0 -64
- data/dist/chunks/_typeahead-BqHgiHoJ.js +0 -22
- data/dist/chunks/_weekday_stacked-BAk0aNPW.js +0 -45
- data/dist/chunks/lib-CuCy3_xO.js +0 -29
@@ -1,11 +1,9 @@
|
|
1
1
|
import React, { useEffect, useRef } from 'react'
|
2
|
-
import { FieldValues } from 'react-hook-form'
|
3
2
|
import Body from '../pb_body/_body'
|
4
3
|
import Icon from '../pb_icon/_icon'
|
5
4
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
6
5
|
import classnames from 'classnames'
|
7
6
|
import { globalProps, GlobalProps } from '../utilities/globalProps'
|
8
|
-
import { withReactHookForm, WithReactHookFormProps } from '../utilities/withReactHookForm'
|
9
7
|
|
10
8
|
type CheckboxProps = {
|
11
9
|
aria?: {[key: string]: string},
|
@@ -15,7 +13,7 @@ type CheckboxProps = {
|
|
15
13
|
dark?: boolean,
|
16
14
|
data?: {[key: string]: string},
|
17
15
|
disabled?: boolean,
|
18
|
-
error?: boolean
|
16
|
+
error?: boolean,
|
19
17
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
20
18
|
id?: string,
|
21
19
|
indeterminate?: boolean,
|
@@ -26,26 +24,27 @@ type CheckboxProps = {
|
|
26
24
|
value?: string,
|
27
25
|
} & GlobalProps
|
28
26
|
|
29
|
-
const Checkbox = React.
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
}
|
48
|
-
|
27
|
+
const Checkbox = (props: CheckboxProps): React.ReactElement => {
|
28
|
+
const {
|
29
|
+
aria = {},
|
30
|
+
checked = false,
|
31
|
+
children,
|
32
|
+
className,
|
33
|
+
dark = false,
|
34
|
+
data = {},
|
35
|
+
disabled = false,
|
36
|
+
error = false,
|
37
|
+
htmlOptions = {},
|
38
|
+
id,
|
39
|
+
indeterminate = false,
|
40
|
+
name = '',
|
41
|
+
onChange = () => { void 0 },
|
42
|
+
tabIndex,
|
43
|
+
text = '',
|
44
|
+
value = '',
|
45
|
+
} = props
|
46
|
+
|
47
|
+
const checkRef = useRef(null)
|
49
48
|
const ariaProps = buildAriaProps(aria)
|
50
49
|
const dataProps = buildDataProps(data)
|
51
50
|
const htmlProps = buildHtmlProps(htmlOptions)
|
@@ -69,12 +68,11 @@ const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(({
|
|
69
68
|
else
|
70
69
|
return (
|
71
70
|
<input
|
72
|
-
{...props}
|
73
71
|
defaultChecked={checked}
|
74
72
|
disabled={disabled}
|
75
73
|
name={name}
|
76
74
|
onChange={onChange}
|
77
|
-
ref={
|
75
|
+
ref={checkRef}
|
78
76
|
tabIndex={tabIndex}
|
79
77
|
type="checkbox"
|
80
78
|
value={value}
|
@@ -114,18 +112,13 @@ const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(({
|
|
114
112
|
<Body
|
115
113
|
className="pb_checkbox_label"
|
116
114
|
dark={dark}
|
117
|
-
status={
|
115
|
+
status={error ? 'negative' : null}
|
118
116
|
variant={null}
|
119
117
|
>
|
120
118
|
{text}
|
121
119
|
</Body>
|
122
120
|
</label>
|
123
121
|
)
|
124
|
-
}
|
125
|
-
|
126
|
-
Checkbox.displayName = 'Checkbox'
|
127
|
-
|
128
|
-
export type CheckboxWithHookFormProps<T extends FieldValues = FieldValues> = CheckboxProps & WithReactHookFormProps<T>
|
122
|
+
}
|
129
123
|
|
130
|
-
|
131
|
-
export default CheckboxWithHookForm
|
124
|
+
export default Checkbox
|
@@ -9,13 +9,12 @@ examples:
|
|
9
9
|
- checkbox_disabled: Disabled Checkbox
|
10
10
|
|
11
11
|
react:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
- checkbox_form: Checkbox Form
|
12
|
+
- checkbox_default: Default
|
13
|
+
- checkbox_checked: Load as checked
|
14
|
+
- checkbox_custom: Custom Checkbox
|
15
|
+
- checkbox_error: Default w/ Error
|
16
|
+
- checkbox_indeterminate: Indeterminate Checkbox
|
17
|
+
- checkbox_disabled: Disabled Checkbox
|
19
18
|
|
20
19
|
swift:
|
21
20
|
- checkbox_default_swift: Default
|
@@ -4,4 +4,3 @@ export { default as CheckboxError } from './_checkbox_error.jsx'
|
|
4
4
|
export { default as CheckboxChecked } from './_checkbox_checked.jsx'
|
5
5
|
export { default as CheckboxIndeterminate } from './_checkbox_indeterminate.jsx'
|
6
6
|
export { default as CheckboxDisabled } from './_checkbox_disabled.jsx'
|
7
|
-
export { default as CheckboxForm } from './_checkbox_form.jsx'
|
@@ -2,7 +2,7 @@ import React, { useEffect, ReactElement } from 'react'
|
|
2
2
|
import classnames from 'classnames'
|
3
3
|
import useCollapsible from './useCollapsible'
|
4
4
|
|
5
|
-
import { globalProps, globalInlineProps
|
5
|
+
import { globalProps, globalInlineProps } from '../utilities/globalProps'
|
6
6
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
7
7
|
|
8
8
|
import CollapsibleContent from './child_kits/CollapsibleContent'
|
@@ -32,7 +32,6 @@ type CollapsibleProps = {
|
|
32
32
|
onClick?: ()=> void,
|
33
33
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
34
34
|
id?: string,
|
35
|
-
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'tr' | 'th' | 'td' | 'thead' | 'col',
|
36
35
|
}
|
37
36
|
|
38
37
|
const Collapsible = ({
|
@@ -48,9 +47,8 @@ const Collapsible = ({
|
|
48
47
|
onIconClick,
|
49
48
|
onClick,
|
50
49
|
id,
|
51
|
-
tag = 'div',
|
52
50
|
...props
|
53
|
-
}: CollapsibleProps
|
51
|
+
}: CollapsibleProps): React.ReactElement => {
|
54
52
|
const [isCollapsed, toggle, setIsCollapsed] = useCollapsible(collapsed)
|
55
53
|
|
56
54
|
useEffect(()=> {
|
@@ -78,12 +76,9 @@ const Collapsible = ({
|
|
78
76
|
className
|
79
77
|
)
|
80
78
|
const dynamicInlineProps = globalInlineProps(props)
|
81
|
-
|
82
|
-
const Tag: React.ReactElement | any = `${tag}`;
|
83
|
-
|
84
79
|
return (
|
85
80
|
<CollapsibleContext.Provider value={{ collapsed: isCollapsed, toggle, icon, iconSize, iconColor, onIconClick, onClick }}>
|
86
|
-
<
|
81
|
+
<div
|
87
82
|
{...ariaProps}
|
88
83
|
{...dataProps}
|
89
84
|
{...htmlProps}
|
@@ -101,7 +96,7 @@ const Collapsible = ({
|
|
101
96
|
<CollapsibleContent {...contentProps}>
|
102
97
|
{contentChildren}
|
103
98
|
</CollapsibleContent>
|
104
|
-
</
|
99
|
+
</div>
|
105
100
|
</CollapsibleContext.Provider>
|
106
101
|
)
|
107
102
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import classnames from 'classnames'
|
2
2
|
import React, { useContext, useRef, useEffect } from 'react'
|
3
3
|
import { buildCss } from '../../utilities/props'
|
4
|
-
import { globalProps
|
4
|
+
import { globalProps } from '../../utilities/globalProps'
|
5
5
|
import { hideElement, showElement } from '../_helper_functions'
|
6
6
|
|
7
7
|
import CollapsibleContext from '../context'
|
@@ -15,7 +15,7 @@ const CollapsibleContent = ({
|
|
15
15
|
children,
|
16
16
|
className,
|
17
17
|
...props
|
18
|
-
}: CollapsibleContentProps
|
18
|
+
}: CollapsibleContentProps): React.ReactElement => {
|
19
19
|
const context: {[key: string]: boolean | string} = useContext(CollapsibleContext)
|
20
20
|
const contentCSS = buildCss('pb_collapsible_content_kit')
|
21
21
|
const contentSpacing = globalProps(props)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import classnames from 'classnames'
|
4
4
|
import React, { useContext } from 'react'
|
5
5
|
import { buildCss } from '../../utilities/props'
|
6
|
-
import { globalProps
|
6
|
+
import { globalProps } from '../../utilities/globalProps'
|
7
7
|
|
8
8
|
import Flex from '../../pb_flex/_flex'
|
9
9
|
import FlexItem from '../../pb_flex/_flex_item'
|
@@ -25,7 +25,7 @@ const CollapsibleMain = ({
|
|
25
25
|
className,
|
26
26
|
cursor = 'pointer',
|
27
27
|
...props
|
28
|
-
}: CollapsibleMainProps
|
28
|
+
}: CollapsibleMainProps): React.ReactElement=> {
|
29
29
|
const {collapsed, toggle, icon, iconSize, iconColor, onIconClick, onClick}: any = useContext(CollapsibleContext)
|
30
30
|
const mainCSS = buildCss('pb_collapsible_main_kit')
|
31
31
|
const mainSpacing = globalProps(props, { cursor })
|
@@ -40,6 +40,8 @@ module Playbook
|
|
40
40
|
default: {}
|
41
41
|
prop :input_data, type: Playbook::Props::HashProp,
|
42
42
|
default: {}
|
43
|
+
prop :input_options, type: Playbook::Props::HashProp,
|
44
|
+
default: {}
|
43
45
|
prop :max_date, type: Playbook::Props::String
|
44
46
|
prop :min_date, type: Playbook::Props::String
|
45
47
|
prop :name, type: Playbook::Props::String
|
@@ -55,6 +57,8 @@ module Playbook
|
|
55
57
|
prop :position, type: Playbook::Props::String,
|
56
58
|
default: "auto"
|
57
59
|
prop :position_element, type: Playbook::Props::String
|
60
|
+
prop :reset_to_default, type: Playbook::Props::Boolean,
|
61
|
+
default: false
|
58
62
|
prop :scroll_container, type: Playbook::Props::String
|
59
63
|
prop :selection_type, type: Playbook::Props::Enum,
|
60
64
|
values: %w[week month quickpick none],
|
@@ -98,6 +102,7 @@ module Playbook
|
|
98
102
|
plugins: plugins,
|
99
103
|
position: position,
|
100
104
|
positionElement: position_element,
|
105
|
+
resetToDefault: reset_to_default,
|
101
106
|
required: required,
|
102
107
|
selectionType: selection_type,
|
103
108
|
showTimezone: show_timezone,
|
@@ -24,9 +24,11 @@ type DatePickerConfig = {
|
|
24
24
|
required: boolean,
|
25
25
|
hideIcon?: boolean;
|
26
26
|
inLine?: boolean,
|
27
|
+
inputValue: string,
|
27
28
|
onChange: (dateStr: string, selectedDates: Date[]) => void,
|
28
29
|
selectionType?: "month" | "week" | "quickpick" | "",
|
29
30
|
onClose: (dateStr: Date[] | string, selectedDates: Date[] | string) => void,
|
31
|
+
resetToDefault?: boolean,
|
30
32
|
showTimezone?: boolean,
|
31
33
|
staticPosition: boolean,
|
32
34
|
thisRangesEndToday?: boolean,
|
@@ -50,6 +52,7 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
50
52
|
disableWeekdays,
|
51
53
|
enableTime,
|
52
54
|
format,
|
55
|
+
inputValue,
|
53
56
|
maxDate,
|
54
57
|
minDate,
|
55
58
|
mode,
|
@@ -59,6 +62,7 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
59
62
|
plugins,
|
60
63
|
position = "auto",
|
61
64
|
positionElement,
|
65
|
+
resetToDefault,
|
62
66
|
required,
|
63
67
|
selectionType,
|
64
68
|
showTimezone,
|
@@ -242,6 +246,12 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
242
246
|
picker.changeYear(Number(e.target.value))
|
243
247
|
})
|
244
248
|
|
249
|
+
// add data atrribute for reset to default
|
250
|
+
const element = document.querySelector(`#${pickerId}`);
|
251
|
+
if (resetToDefault && defaultDate && element) {
|
252
|
+
element.setAttribute("data-pb-date-picker", defaultDate?.toString());
|
253
|
+
}
|
254
|
+
|
245
255
|
// Reverse month and year dropdown reset on form.reset()
|
246
256
|
if (picker.input.form) {
|
247
257
|
picker.input.form.addEventListener('reset', () => {
|
@@ -13,7 +13,6 @@ type FileUploadProps = {
|
|
13
13
|
accept?: string[],
|
14
14
|
className?: string,
|
15
15
|
customMessage?: string,
|
16
|
-
dark?: boolean,
|
17
16
|
data?: {[key: string]: string | number},
|
18
17
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
19
18
|
acceptedFilesDescription?: string,
|
@@ -32,7 +31,6 @@ const FileUpload = (props: FileUploadProps): React.ReactElement => {
|
|
32
31
|
acceptedFilesDescription = '',
|
33
32
|
className,
|
34
33
|
customMessage,
|
35
|
-
dark = false,
|
36
34
|
data = {},
|
37
35
|
htmlOptions = {},
|
38
36
|
maxSize,
|
@@ -96,12 +94,9 @@ const FileUpload = (props: FileUploadProps): React.ReactElement => {
|
|
96
94
|
{...htmlProps}
|
97
95
|
{...getRootProps()}
|
98
96
|
>
|
99
|
-
<Card
|
97
|
+
<Card>
|
100
98
|
<input {...getInputProps()} />
|
101
|
-
<Body
|
102
|
-
color="light"
|
103
|
-
dark={dark}
|
104
|
-
>
|
99
|
+
<Body color="light">
|
105
100
|
{isDragActive ?
|
106
101
|
<p>{'Drop the files here ...'}</p>
|
107
102
|
:
|
@@ -5,17 +5,11 @@
|
|
5
5
|
id: object.id,
|
6
6
|
**combined_html_options) do %>
|
7
7
|
<%= pb_rails("form_group", props: {cursor: "pointer", full_width: object.full_width}) do %>
|
8
|
-
<label
|
9
|
-
for="upload-<%= object.id %>"
|
10
|
-
class="pb_button_kit_secondary_inline_enabled <%= 'dark' if object.dark %>"
|
11
|
-
>
|
12
|
-
<%= "#{object.label}" %>
|
13
|
-
</label>
|
8
|
+
<label for="upload-<%= object.id %>" class="pb_button_kit_secondary_inline_enabled"><%= "#{object.label}" %></label>
|
14
9
|
<%= pb_rails("text_input", props: {
|
15
10
|
type: "file",
|
16
|
-
dark: object.dark,
|
17
11
|
input_options: {
|
18
|
-
id: "upload-#{object.id}",
|
12
|
+
id: "upload-#{object.id}",
|
19
13
|
classname: "cursor_pointer",
|
20
14
|
}.merge(object.input_options)
|
21
15
|
}) %>
|
@@ -45,11 +45,12 @@
|
|
45
45
|
class: "checkbox-class"
|
46
46
|
%>
|
47
47
|
<%= form.date_picker :example_date_picker_1, props: { label: true } %>
|
48
|
+
<%= form.date_picker :example_date_picker_2, props: { label: true, reset_to_default: true, default_date: "06/09/1994" } %>
|
48
49
|
<%= form.star_rating_field :example_star_rating, props: { variant: "interactive", label: true } %>
|
49
50
|
|
50
51
|
<%= form.actions do |action| %>
|
51
52
|
<%= action.submit %>
|
52
|
-
<%= action.button props: { type: "reset", text: "Cancel", variant: "secondary" } %>
|
53
|
+
<%= action.button props: { type: "reset", text: "Cancel", variant: "secondary", onclick: "resetDates()" } %>
|
53
54
|
<% end %>
|
54
55
|
<% end %>
|
55
56
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
outline-offset: 2px;
|
18
18
|
}
|
19
19
|
&:visited {
|
20
|
-
color:
|
20
|
+
color: $data_3;
|
21
21
|
}
|
22
22
|
&.dark {
|
23
23
|
@include pb_link($active_dark);
|
@@ -34,7 +34,7 @@
|
|
34
34
|
}
|
35
35
|
|
36
36
|
&:visited {
|
37
|
-
color:
|
37
|
+
color: $data_3;
|
38
38
|
}
|
39
39
|
}
|
40
40
|
}
|
@@ -48,7 +48,7 @@
|
|
48
48
|
}
|
49
49
|
|
50
50
|
&:visited {
|
51
|
-
color:
|
51
|
+
color: $data_3;
|
52
52
|
}
|
53
53
|
}
|
54
54
|
}
|
@@ -223,7 +223,6 @@
|
|
223
223
|
}
|
224
224
|
}
|
225
225
|
[class*="pb_collapsible_nav_item"][class*="pb_nav_list_item_link_collapsible"][class*="pb_nav_list_kit_item"] {
|
226
|
-
box-shadow: unset !important;
|
227
226
|
.pb_nav_list_item_text_collapsible {
|
228
227
|
color: $white !important;
|
229
228
|
}
|
@@ -241,17 +240,11 @@
|
|
241
240
|
|
242
241
|
.pb_collapsible_main_kit:hover {
|
243
242
|
background-color: mix($white, $card_dark, 20%);
|
244
|
-
.pb_nav_list_item_text_collapsible
|
245
|
-
color: $white !important;
|
246
|
-
}
|
247
|
-
}
|
248
|
-
|
249
|
-
.pb_collapsible_main_kit {
|
243
|
+
.pb_nav_list_item_text_collapsible,
|
250
244
|
svg {
|
251
|
-
color: $
|
245
|
+
color: $white !important;
|
252
246
|
}
|
253
247
|
}
|
254
|
-
|
255
248
|
.icon_wrapper:hover {
|
256
249
|
background-color: mix($white, $card_dark, 40%);
|
257
250
|
}
|
@@ -263,13 +256,6 @@
|
|
263
256
|
}
|
264
257
|
}
|
265
258
|
}
|
266
|
-
|
267
|
-
&[class*="_active"] {
|
268
|
-
> .pb_collapsible_main_kit {
|
269
|
-
background-color: $primary;
|
270
|
-
box-shadow: 0 2px 10px 0 $shadow_dark;
|
271
|
-
}
|
272
|
-
}
|
273
259
|
}
|
274
260
|
}
|
275
261
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
2
|
import classnames from 'classnames'
|
3
|
-
import {
|
3
|
+
import { globalProps } from '../utilities/globalProps'
|
4
4
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
5
5
|
import Icon from '../pb_icon/_icon';
|
6
6
|
|
@@ -14,7 +14,7 @@ type PaginationProps = {
|
|
14
14
|
onChange?: (pageNumber: number) => void;
|
15
15
|
range?: number;
|
16
16
|
total?: number;
|
17
|
-
}
|
17
|
+
};
|
18
18
|
|
19
19
|
const Pagination = ( props: PaginationProps) => {
|
20
20
|
const {
|
@@ -1,12 +1,10 @@
|
|
1
|
-
import React from 'react'
|
1
|
+
import React, { forwardRef } from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
|
-
import { FieldValues } from 'react-hook-form'
|
4
3
|
|
5
4
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
6
5
|
import { globalProps, GlobalProps, domSafeProps } from '../utilities/globalProps'
|
7
6
|
import type { InputCallback } from '../types'
|
8
7
|
import { getAllIcons } from "../utilities/icons/allicons"
|
9
|
-
import { withReactHookForm, WithReactHookFormProps } from '../utilities/withReactHookForm'
|
10
8
|
|
11
9
|
import Body from '../pb_body/_body'
|
12
10
|
import Caption from '../pb_caption/_caption'
|
@@ -32,12 +30,11 @@ type SelectProps = {
|
|
32
30
|
includeBlank?: string,
|
33
31
|
inline?: boolean,
|
34
32
|
label?: string,
|
35
|
-
margin
|
36
|
-
marginBottom
|
37
|
-
marginTop?: string,
|
33
|
+
margin: string,
|
34
|
+
marginBottom: string,
|
38
35
|
multiple?: boolean,
|
39
36
|
name?: string,
|
40
|
-
onChange
|
37
|
+
onChange: InputCallback<HTMLSelectElement>,
|
41
38
|
options: SelectOption[],
|
42
39
|
required?: boolean,
|
43
40
|
showArrow?: boolean,
|
@@ -54,7 +51,7 @@ const createOptions = (options: SelectOption[]) => options.map((option, index) =
|
|
54
51
|
</option>
|
55
52
|
))
|
56
53
|
|
57
|
-
const Select =
|
54
|
+
const Select = ({
|
58
55
|
aria = {},
|
59
56
|
blankSelection,
|
60
57
|
children,
|
@@ -68,13 +65,13 @@ const Select = React.forwardRef<HTMLSelectElement, SelectProps>(({
|
|
68
65
|
inline = false,
|
69
66
|
multiple = false,
|
70
67
|
name,
|
71
|
-
onChange,
|
68
|
+
onChange = () => undefined,
|
72
69
|
options = [],
|
73
70
|
required = false,
|
74
71
|
showArrow = false,
|
75
72
|
value,
|
76
73
|
...props
|
77
|
-
}, ref) => {
|
74
|
+
}: SelectProps, ref: React.LegacyRef<HTMLSelectElement>) => {
|
78
75
|
const ariaProps = buildAriaProps(aria)
|
79
76
|
const dataProps = buildDataProps(data)
|
80
77
|
const htmlProps = buildHtmlProps(htmlOptions)
|
@@ -94,14 +91,14 @@ const Select = React.forwardRef<HTMLSelectElement, SelectProps>(({
|
|
94
91
|
compactClass
|
95
92
|
);
|
96
93
|
|
97
|
-
const
|
98
|
-
const angleDown = icons?.angleDown?.icon
|
94
|
+
const angleDown = getAllIcons()["angleDown"].icon as unknown as { [key: string]: SVGElement }
|
99
95
|
|
100
96
|
const selectWrapperClass = classnames(buildCss('pb_select_kit_wrapper'), { error }, className)
|
101
97
|
const selectBody =(() =>{
|
102
98
|
if (children) return children
|
103
99
|
return (
|
104
100
|
<select
|
101
|
+
{...htmlOptions}
|
105
102
|
{...domSafeProps(props)}
|
106
103
|
disabled={disabled}
|
107
104
|
id={name}
|
@@ -138,12 +135,14 @@ const Select = React.forwardRef<HTMLSelectElement, SelectProps>(({
|
|
138
135
|
htmlFor={name}
|
139
136
|
>
|
140
137
|
{selectBody}
|
141
|
-
{ multiple !== true
|
138
|
+
{ multiple !== true ?
|
142
139
|
<Icon
|
143
140
|
className="pb_select_kit_caret svg-inline--fa"
|
144
141
|
customIcon={angleDown}
|
145
142
|
fixedWidth
|
146
143
|
/>
|
144
|
+
:
|
145
|
+
null
|
147
146
|
}
|
148
147
|
{error &&
|
149
148
|
<Body
|
@@ -154,11 +153,6 @@ const Select = React.forwardRef<HTMLSelectElement, SelectProps>(({
|
|
154
153
|
</label>
|
155
154
|
</div>
|
156
155
|
)
|
157
|
-
}
|
158
|
-
|
159
|
-
Select.displayName = 'Select'
|
160
|
-
|
161
|
-
export type SelectWithHookFormProps<T extends FieldValues = FieldValues> = SelectProps & WithReactHookFormProps<T>
|
156
|
+
}
|
162
157
|
|
163
|
-
|
164
|
-
export default SelectWithHookForm
|
158
|
+
export default forwardRef(Select)
|
@@ -10,4 +10,3 @@ export { default as SelectInline } from './_select_inline.jsx'
|
|
10
10
|
export { default as SelectInlineShowArrow } from './_select_inline_show_arrow.jsx'
|
11
11
|
export { default as SelectInlineCompact } from './_select_inline_compact.jsx'
|
12
12
|
export { default as SelectMultiple } from './_select_multiple.jsx'
|
13
|
-
export { default as SelectForm } from './_select_form.jsx'
|
@@ -151,7 +151,7 @@ $pb_selectable_paddings: (
|
|
151
151
|
input[type="radio"] {
|
152
152
|
&:checked ~ label {
|
153
153
|
border-width: $pb_card_border_width;
|
154
|
-
outline: 1px solid $
|
154
|
+
outline: 1px solid $primary;
|
155
155
|
}
|
156
156
|
}
|
157
157
|
}
|
@@ -161,11 +161,11 @@ $pb_selectable_paddings: (
|
|
161
161
|
color: $white;
|
162
162
|
> label {
|
163
163
|
@include pb_card_dark;
|
164
|
-
background:
|
164
|
+
background: transparent;
|
165
165
|
|
166
166
|
.pb_selectable_card_circle {
|
167
167
|
border-color: $bg_dark;
|
168
|
-
background: $
|
168
|
+
background: $primary-action;
|
169
169
|
}
|
170
170
|
}
|
171
171
|
|
@@ -173,7 +173,7 @@ $pb_selectable_paddings: (
|
|
173
173
|
input[type="radio"] {
|
174
174
|
&:checked ~ label {
|
175
175
|
@include pb_card_selected_dark;
|
176
|
-
background:
|
176
|
+
background: transparent;
|
177
177
|
}
|
178
178
|
}
|
179
179
|
|