playbook_ui 14.18.0 → 14.19.0.pre.rc.0
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_circle_chart/_circle_chart.tsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +2 -2
- data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +53 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb +2 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +2 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.jsx +38 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +2 -3
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +12 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +12 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +50 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.jsx +4 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_rails.md +4 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.md +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.md +5 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.jsx +34 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.md +14 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +20 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +14 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +10 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +4 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +0 -1
- data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +3 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +8 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_error.jsx +7 -2
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.jsx +9 -1
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.jsx +7 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.jsx +6 -2
- data/dist/chunks/{_typeahead-C_FX7o_S.js → _typeahead-BX8IifKY.js} +2 -2
- data/dist/chunks/_weekday_stacked-DfMD7HJz.js +45 -0
- data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
- data/dist/chunks/lib-96_ZmvAo.js +29 -0
- data/dist/chunks/{pb_form_validation-BRjyJrKh.js → pb_form_validation-Vv2TqXVC.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/lib/playbook/version.rb +2 -2
- metadata +14 -7
- data/dist/chunks/_weekday_stacked-B4RLTeDo.js +0 -45
- data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
- data/dist/chunks/lib-ySl8uEpT.js +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ae9d27af86020c669d4402b35b61ee356de6cb7a61fdbb177eac964f2765822
|
4
|
+
data.tar.gz: f8e3d579c5e3b29639a3b56a09c3e8e20f48a9089ab4c6a1d6cb3302ecf0119b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b142aba7e0202847db31c8e74164ba49ff77382f5ea97e173af29a3c115627b092b2872d9e82898b32432dbec1fb8b5c82dcc523ded9bea8f93f37b0ffb95fb
|
7
|
+
data.tar.gz: 94c8ff54d18937587afe9fa0ef51e0805686f133e2b230ca0628078cd4b26a19ca4564cb7359a37ada021c884990f16c0bf2940a07d8876386252e2cdb80829a
|
@@ -10,7 +10,7 @@ import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
|
|
10
10
|
import mapColors from "../pb_dashboard/pbChartsColorsHelper";
|
11
11
|
import { globalProps } from "../utilities/globalProps";
|
12
12
|
import { buildAriaProps, buildDataProps, buildHtmlProps } from "../utilities/props";
|
13
|
-
import { merge } from '../utilities/object'
|
13
|
+
import { merge } from '../utilities/object'
|
14
14
|
|
15
15
|
type CircleChartProps = {
|
16
16
|
align?: "left" | "right" | "center";
|
@@ -28,7 +28,7 @@ test('uses exact classname', () => {
|
|
28
28
|
value: 49,
|
29
29
|
},
|
30
30
|
{
|
31
|
-
name: 'After
|
31
|
+
name: 'After Call',
|
32
32
|
value: 10,
|
33
33
|
},
|
34
34
|
]
|
@@ -39,7 +39,7 @@ test('uses exact classname', () => {
|
|
39
39
|
id='circlechartid'
|
40
40
|
/>
|
41
41
|
);
|
42
|
-
|
42
|
+
|
43
43
|
const kit = screen.getByTestId(testId);
|
44
44
|
expect(kit).toHaveClass('pb_circle_chart');
|
45
45
|
});
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import colors from '../tokens/exports/_colors.module.scss'
|
2
|
+
import typography from '../tokens/exports/_typography.module.scss'
|
3
|
+
|
4
|
+
const circleChartTheme = {
|
5
|
+
title: { text: "" },
|
6
|
+
chart: {
|
7
|
+
type: "pie",
|
8
|
+
},
|
9
|
+
tooltip: {
|
10
|
+
backgroundColor: {
|
11
|
+
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
12
|
+
stops: [
|
13
|
+
[0, colors.bg_dark],
|
14
|
+
[1, colors.bg_dark],
|
15
|
+
],
|
16
|
+
},
|
17
|
+
pointFormat:
|
18
|
+
'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: ' +
|
19
|
+
"<b>{point.y}</b>",
|
20
|
+
followPointer: true,
|
21
|
+
shadow: false,
|
22
|
+
borderWidth: 0,
|
23
|
+
borderRadius: 10,
|
24
|
+
style: {
|
25
|
+
fontFamily: typography.font_family_base,
|
26
|
+
color: colors.text_dk_default,
|
27
|
+
fontWeight: typography.regular,
|
28
|
+
fontSize: typography.text_smaller,
|
29
|
+
},
|
30
|
+
},
|
31
|
+
plotOptions: {
|
32
|
+
pie: {
|
33
|
+
dataLabels: {
|
34
|
+
enabled: false,
|
35
|
+
},
|
36
|
+
innerSize: '50%',
|
37
|
+
borderColor: "",
|
38
|
+
borderWidth: null as number | null,
|
39
|
+
colors: [
|
40
|
+
colors.data_1,
|
41
|
+
colors.data_2,
|
42
|
+
colors.data_3,
|
43
|
+
colors.data_4,
|
44
|
+
colors.data_5,
|
45
|
+
colors.data_6,
|
46
|
+
colors.data_7,
|
47
|
+
],
|
48
|
+
},
|
49
|
+
},
|
50
|
+
credits: { enabled: false }
|
51
|
+
}
|
52
|
+
|
53
|
+
export default circleChartTheme;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
value: 49,
|
8
8
|
},
|
9
9
|
{
|
10
|
-
name: 'After
|
10
|
+
name: 'After Call',
|
11
11
|
value: 10,
|
12
12
|
}
|
13
13
|
] %>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
chart_data: data_51,
|
19
19
|
id: "with-a-block-2",
|
20
20
|
rounded: true,
|
21
|
-
}) do %>
|
21
|
+
}) do %>
|
22
22
|
<%= pb_rails('title', props: {text: "83", size: 1, tag: 'div'}) %>
|
23
23
|
<% end %>
|
24
24
|
|
@@ -14,7 +14,7 @@ const CircleChartLiveData = (props) => {
|
|
14
14
|
value: 49,
|
15
15
|
},
|
16
16
|
{
|
17
|
-
name: 'After
|
17
|
+
name: 'After Call',
|
18
18
|
value: 10,
|
19
19
|
},
|
20
20
|
])
|
@@ -29,7 +29,7 @@ const CircleChartLiveData = (props) => {
|
|
29
29
|
value: 12,
|
30
30
|
},
|
31
31
|
{
|
32
|
-
name: 'After
|
32
|
+
name: 'After Call',
|
33
33
|
value: 140,
|
34
34
|
},
|
35
35
|
]
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import circleChartTheme from '../circleChartTheme'
|
3
|
+
import Highcharts from "highcharts"
|
4
|
+
import HighchartsReact from "highcharts-react-official"
|
5
|
+
|
6
|
+
const data = [
|
7
|
+
{
|
8
|
+
name: 'Waiting for Calls',
|
9
|
+
y: 41,
|
10
|
+
},
|
11
|
+
{
|
12
|
+
name: 'On Call',
|
13
|
+
y: 49,
|
14
|
+
},
|
15
|
+
{
|
16
|
+
name: 'After Call',
|
17
|
+
y: 10,
|
18
|
+
},
|
19
|
+
]
|
20
|
+
|
21
|
+
const baseOptions = {
|
22
|
+
series: [{ data: data }],
|
23
|
+
}
|
24
|
+
|
25
|
+
const CircleChartPbStyles = () => {
|
26
|
+
const options = Highcharts.merge({}, circleChartTheme, baseOptions )
|
27
|
+
|
28
|
+
return (
|
29
|
+
<div>
|
30
|
+
<HighchartsReact
|
31
|
+
highcharts={Highcharts}
|
32
|
+
options={options}
|
33
|
+
/>
|
34
|
+
</div>
|
35
|
+
);
|
36
|
+
};
|
37
|
+
|
38
|
+
export default CircleChartPbStyles;
|
@@ -0,0 +1 @@
|
|
1
|
+
You don't need to use the Circle Chart Kit to apply Playbook styles to your Highcharts circle chart. Just import circleChartTheme.ts and merge it with your chart options—Playbook’s styling will apply automatically.
|
@@ -14,6 +14,7 @@ examples:
|
|
14
14
|
|
15
15
|
react:
|
16
16
|
- circle_chart_default: Default Style
|
17
|
+
- circle_chart_pb_styles: Playbook Styles
|
17
18
|
- circle_chart_live_data: Live Data
|
18
19
|
- circle_chart_rounded: Rounded Corners
|
19
20
|
- circle_chart_block: Accepts Any Block
|
@@ -22,7 +23,5 @@ examples:
|
|
22
23
|
- circle_chart_with_legend_kit: Legend
|
23
24
|
- circle_chart_legend_position: Legend Position
|
24
25
|
- circle_chart_with_title: Title
|
25
|
-
- circle_chart_inner_sizes: Inner Circle Size Options
|
26
|
+
- circle_chart_inner_sizes: Inner Circle Size Options
|
26
27
|
- circle_chart_custom_tooltip: Tooltip Customization
|
27
|
-
|
28
|
-
|
@@ -8,4 +8,5 @@ export { default as CircleChartWithLegendKit } from './_circle_chart_with_legend
|
|
8
8
|
export { default as CircleChartLegendPosition } from './_circle_chart_legend_position.jsx'
|
9
9
|
export { default as CircleChartWithTitle } from './_circle_chart_with_title.jsx'
|
10
10
|
export { default as CircleChartInnerSizes } from './_circle_chart_inner_sizes.jsx'
|
11
|
-
export { default as CircleChartCustomTooltip } from "./_circle_chart_custom_tooltip.jsx"
|
11
|
+
export { default as CircleChartCustomTooltip } from "./_circle_chart_custom_tooltip.jsx"
|
12
|
+
export { default as CircleChartPbStyles } from "./_circle_chart_pb_styles.jsx"
|
@@ -50,6 +50,10 @@ type DatePickerProps = {
|
|
50
50
|
timeFormat?: string,
|
51
51
|
type?: string,
|
52
52
|
yearRange?: number[],
|
53
|
+
controlsStartId?: string,
|
54
|
+
controlsEndId?: string,
|
55
|
+
syncStartWith?: string,
|
56
|
+
syncEndWith?: string,
|
53
57
|
} & GlobalProps
|
54
58
|
|
55
59
|
const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
@@ -98,6 +102,10 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
98
102
|
staticPosition = true,
|
99
103
|
thisRangesEndToday = false,
|
100
104
|
yearRange = [1900, 2100],
|
105
|
+
controlsStartId,
|
106
|
+
controlsEndId,
|
107
|
+
syncStartWith,
|
108
|
+
syncEndWith,
|
101
109
|
} = props
|
102
110
|
|
103
111
|
const ariaProps = buildAriaProps(aria)
|
@@ -134,6 +142,10 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
134
142
|
staticPosition,
|
135
143
|
thisRangesEndToday,
|
136
144
|
yearRange,
|
145
|
+
controlsStartId,
|
146
|
+
controlsEndId,
|
147
|
+
syncStartWith,
|
148
|
+
syncEndWith,
|
137
149
|
required: false,
|
138
150
|
}, scrollContainer)
|
139
151
|
}, initializeOnce ? [] : undefined)
|
@@ -77,6 +77,14 @@ module Playbook
|
|
77
77
|
default: ""
|
78
78
|
prop :validation_message, type: Playbook::Props::String,
|
79
79
|
default: ""
|
80
|
+
prop :controls_start_id, type: Playbook::Props::String,
|
81
|
+
default: ""
|
82
|
+
prop :controls_end_id, type: Playbook::Props::String,
|
83
|
+
default: ""
|
84
|
+
prop :sync_start_with, type: Playbook::Props::String,
|
85
|
+
default: ""
|
86
|
+
prop :sync_end_with, type: Playbook::Props::String,
|
87
|
+
default: ""
|
80
88
|
|
81
89
|
def classname
|
82
90
|
default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
|
@@ -108,6 +116,10 @@ module Playbook
|
|
108
116
|
staticPosition: static_position,
|
109
117
|
thisRangesEndToday: this_ranges_end_today,
|
110
118
|
yearRange: year_range,
|
119
|
+
controlsStartId: controls_start_id,
|
120
|
+
controlsEndId: controls_end_id,
|
121
|
+
syncStartWith: sync_start_with,
|
122
|
+
syncEndWith: sync_end_with,
|
111
123
|
}.to_json.html_safe
|
112
124
|
end
|
113
125
|
|
@@ -32,7 +32,11 @@ type DatePickerConfig = {
|
|
32
32
|
thisRangesEndToday?: boolean,
|
33
33
|
timeCaption?: string,
|
34
34
|
timeFormat?: string,
|
35
|
-
yearRange: number[]
|
35
|
+
yearRange: number[],
|
36
|
+
controlsStartId?: string,
|
37
|
+
controlsEndId?: string,
|
38
|
+
syncStartWith?: string,
|
39
|
+
syncEndWith?: string,
|
36
40
|
} & Pick<BaseOptions, "allowInput" | "defaultDate" | "enableTime" | "maxDate" | "minDate" | "mode" | "plugins" | "position" | "positionElement" >
|
37
41
|
|
38
42
|
const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HTMLElement) => {
|
@@ -67,6 +71,10 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
67
71
|
timeCaption = 'Select Time',
|
68
72
|
timeFormat = 'at h:i K',
|
69
73
|
yearRange,
|
74
|
+
controlsStartId,
|
75
|
+
controlsEndId,
|
76
|
+
syncStartWith,
|
77
|
+
syncEndWith,
|
70
78
|
} = config
|
71
79
|
|
72
80
|
// ===========================================================
|
@@ -275,6 +283,47 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
275
283
|
})
|
276
284
|
}
|
277
285
|
|
286
|
+
// === Automatic Sync Logic for 3 input range pattern===
|
287
|
+
|
288
|
+
// If this is a quickpick that controls start and end
|
289
|
+
if (selectionType === "quickpick" && (controlsStartId || controlsEndId)) {
|
290
|
+
picker.config.onClose.push((selectedDates:string) => {
|
291
|
+
const [start, end] = selectedDates;
|
292
|
+
|
293
|
+
if (controlsStartId) {
|
294
|
+
const startPicker = (document.querySelector(`#${controlsStartId}`) as HTMLElement & { _flatpickr?: any })?._flatpickr;
|
295
|
+
startPicker?.setDate(start, true);
|
296
|
+
}
|
297
|
+
|
298
|
+
if (controlsEndId) {
|
299
|
+
const endPicker = (document.querySelector(`#${controlsEndId}`) as HTMLElement & { _flatpickr?: any })?._flatpickr;
|
300
|
+
endPicker?.setDate(end, true);
|
301
|
+
}
|
302
|
+
});
|
303
|
+
}
|
304
|
+
|
305
|
+
// If this is a start picker that syncs with a quickpick
|
306
|
+
if (syncStartWith) {
|
307
|
+
picker.config.onClose.push((selectedDates: string) => {
|
308
|
+
if (selectedDates?.length) {
|
309
|
+
const quickpick = (document.querySelector(`#${syncStartWith}`) as HTMLElement & { _flatpickr?: any })?._flatpickr;
|
310
|
+
quickpick?.clear();
|
311
|
+
}
|
312
|
+
});
|
313
|
+
}
|
314
|
+
|
315
|
+
// If this is an end picker that syncs with a quickpick
|
316
|
+
if (syncEndWith) {
|
317
|
+
picker.config.onClose.push((selectedDates: string) => {
|
318
|
+
if (selectedDates?.length) {
|
319
|
+
const quickpick = (document.querySelector(`#${syncEndWith}`) as HTMLElement & { _flatpickr?: any })?._flatpickr;
|
320
|
+
quickpick?.clear();
|
321
|
+
}
|
322
|
+
});
|
323
|
+
}
|
324
|
+
// === End of Automatic Sync Logic ===
|
325
|
+
|
326
|
+
|
278
327
|
// Adding dropdown icons to year and month select
|
279
328
|
dropdown.insertAdjacentHTML('afterend', `<i class="year-dropdown-icon">${angleDown}</i>`)
|
280
329
|
if (picker.monthElements[0].parentElement) {
|
@@ -1,11 +1,14 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
|
3
3
|
import DatePicker from '../_date_picker'
|
4
|
+
import Icon from '../../pb_icon/_icon'
|
4
5
|
|
5
6
|
const DatePickerError = (props) => (
|
6
7
|
<div>
|
7
8
|
<DatePicker
|
8
|
-
error=
|
9
|
+
error={<>
|
10
|
+
<Icon icon="warning" /> Invalid date. Please pick a valid date.
|
11
|
+
</>}
|
9
12
|
pickerId="date-picker-error"
|
10
13
|
{...props}
|
11
14
|
/>
|
@@ -1,3 +1,7 @@
|
|
1
|
+
To use the `quickpick`:
|
2
|
+
- prop `mode` must be set to `range`
|
3
|
+
- prop `selection_type` must be set to `quickpick`
|
4
|
+
|
1
5
|
This date range variant uses hidden inputs to handle start and end dates. While they are not required props, it is advisable to specify a unique `start_date_id`, `start_date_name`, `end_date_id`, and `end_date_name` for each quick pick instance you place in a form and/or on a page.
|
2
6
|
|
3
7
|
Like all other date pickers, the quick pick does require a `picker_id`.
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Use `this_ranges_end_today`/`thisRangesEndToday` to set end date on all ranges that start with 'this' to today's date. For instance, by default 'This Year' will set end day to 12/31/(current year), but if the `this_ranges_end_today`/`thisRangesEndToday` prop is used, end date on that range will be today's date.
|
@@ -1 +1,5 @@
|
|
1
|
-
|
1
|
+
To use the `quickpick`:
|
2
|
+
- prop `mode` must be set to `range`
|
3
|
+
- prop `selectionType` must be set to `quickpick`
|
4
|
+
|
5
|
+
Use the `onClose` handler function to access the startDate and endDate values. Check the [`onClose` example](https://playbook.powerapp.cloud/kits/date_picker/react#onclose) for more information.
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import DatePicker from "../_date_picker";
|
3
|
+
|
4
|
+
const DatePickerRangePattern = (props) => {
|
5
|
+
return (
|
6
|
+
<>
|
7
|
+
<DatePicker
|
8
|
+
controlsEndId="end-date-picker"
|
9
|
+
controlsStartId="start-date-picker"
|
10
|
+
mode="range"
|
11
|
+
pickerId="quickpick-for-range"
|
12
|
+
placeholder="Select a Range"
|
13
|
+
selectionType="quickpick"
|
14
|
+
{...props}
|
15
|
+
/>
|
16
|
+
|
17
|
+
<DatePicker
|
18
|
+
pickerId="start-date-picker"
|
19
|
+
placeholder="Select a Start Date"
|
20
|
+
syncStartWith="quickpick-for-range"
|
21
|
+
{...props}
|
22
|
+
/>
|
23
|
+
|
24
|
+
<DatePicker
|
25
|
+
pickerId="end-date-picker"
|
26
|
+
placeholder="Select a End Date"
|
27
|
+
syncEndWith="quickpick-for-range"
|
28
|
+
{...props}
|
29
|
+
/>
|
30
|
+
</>
|
31
|
+
);
|
32
|
+
};
|
33
|
+
|
34
|
+
export default DatePickerRangePattern;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
You can link a Quickpick DatePicker to standard DatePickers using the following props:
|
2
|
+
|
3
|
+
**For the Quickpick DatePicker**:
|
4
|
+
`controlsStartId`: ID of the DatePicker that should receive the start date.
|
5
|
+
|
6
|
+
`controlsEndId`: ID of the DatePicker that should receive the end date.
|
7
|
+
|
8
|
+
When a quickpick option like “This Year” is selected, it automatically populates the linked start and end inputs.
|
9
|
+
|
10
|
+
**For the Start/End DatePickers**:
|
11
|
+
`syncStartWith`: ID of the quickpick this start date is synced to.
|
12
|
+
`syncEndWith`: ID of the quickpick this end date is synced to.
|
13
|
+
|
14
|
+
When a user manually edits the start or end date, it clears the selected quickpick to prevent conflicting values.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<%= pb_rails("date_picker", props: {
|
2
|
+
mode: "range",
|
3
|
+
picker_id: "quick-pick-date-range",
|
4
|
+
placeholder: "Select a Date Range",
|
5
|
+
selection_type: "quickpick",
|
6
|
+
controls_end_id: "quick-pick-date-range-end",
|
7
|
+
controls_start_id: "quick-pick-date-range-start",
|
8
|
+
}) %>
|
9
|
+
|
10
|
+
<%= pb_rails("date_picker", props: {
|
11
|
+
picker_id: "quick-pick-date-range-start",
|
12
|
+
placeholder: "Select a Start Date",
|
13
|
+
sync_start_with:"quick-pick-date-range",
|
14
|
+
}) %>
|
15
|
+
|
16
|
+
<%= pb_rails("date_picker", props: {
|
17
|
+
picker_id: "quick-pick-date-range-end",
|
18
|
+
placeholder: "Select an End Date",
|
19
|
+
sync_end_with:"quick-pick-date-range",
|
20
|
+
}) %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
You can link a Quickpick DatePicker to standard DatePickers using the following props:
|
2
|
+
|
3
|
+
**For the Quickpick DatePicker**:
|
4
|
+
`controls_start_id`: ID of the DatePicker that should receive the start date.
|
5
|
+
|
6
|
+
`controls_end_id`: ID of the DatePicker that should receive the end date.
|
7
|
+
|
8
|
+
When a quickpick option like “This Year” is selected, it automatically populates the linked start and end inputs.
|
9
|
+
|
10
|
+
**For the Start/End DatePickers**:
|
11
|
+
`sync_start_with`: ID of the quickpick this start date is synced to.
|
12
|
+
`sync_end_with`: ID of the quickpick this end date is synced to.
|
13
|
+
|
14
|
+
When a user manually edits the start or end date, it clears the selected quickpick to prevent conflicting values.
|
@@ -15,6 +15,7 @@ examples:
|
|
15
15
|
- date_picker_quick_pick_custom: Custom Quick Pick Dates
|
16
16
|
- date_picker_quick_pick_custom_override: Custom Quick Pick Dates (append to defaults)
|
17
17
|
- date_picker_quick_pick_default_date: Range (Quick Pick w/ Default Date)
|
18
|
+
- date_picker_range_pattern_rails: Range with 2 Date Pickers and a Quick Pick
|
18
19
|
- date_picker_format: Format
|
19
20
|
- date_picker_disabled: Disabled Dates
|
20
21
|
- date_picker_min_max: Min Max
|
@@ -47,6 +48,7 @@ examples:
|
|
47
48
|
- date_picker_quick_pick_custom: Custom Quick Pick Dates
|
48
49
|
- date_picker_quick_pick_custom_override: Custom Quick Pick Dates (append to defaults)
|
49
50
|
- date_picker_quick_pick_default_date: Range (Quick Pick w/ Default Date)
|
51
|
+
- date_picker_range_pattern: Range with 2 Date Pickers and a Quick Pick
|
50
52
|
- date_picker_format: Format
|
51
53
|
- date_picker_disabled: Disabled Dates
|
52
54
|
- date_picker_min_max: Min Max
|
@@ -26,3 +26,4 @@ export { default as DatePickerOnClose } from './_date_picker_on_close.jsx'
|
|
26
26
|
export { default as DatePickerQuickPickCustom } from './_date_picker_quick_pick_custom'
|
27
27
|
export { default as DatePickerQuickPickCustomOverride } from './_date_picker_quick_pick_custom_override'
|
28
28
|
export { default as DatePickerQuickPickDefaultDate } from './_date_picker_quick_pick_default_date'
|
29
|
+
export { default as DatePickerRangePattern } from './_date_picker_range_pattern'
|
@@ -238,6 +238,16 @@ const quickPickPlugin = (thisRangesEndToday: boolean, customQuickPickDates: cust
|
|
238
238
|
},
|
239
239
|
|
240
240
|
onClose(selectedDates: Array<Date>) {
|
241
|
+
// Patch .clear() to also remove active state if cleared
|
242
|
+
const originalClear = fp.clear;
|
243
|
+
fp.clear = function (...args: any) {
|
244
|
+
const current = pluginData.rangesNav.querySelector('.active');
|
245
|
+
if (current) {
|
246
|
+
current.classList.remove('active');
|
247
|
+
}
|
248
|
+
activeLabel = "";
|
249
|
+
return originalClear.apply(this, args);
|
250
|
+
};
|
241
251
|
// remove the active class from the button if the selected dates don't match the label
|
242
252
|
if (!isLabelMatchingSelectedDates(selectedDates)) {
|
243
253
|
pluginData.rangesButtons[activeLabel]?.classList.remove('active');
|
@@ -1,9 +1,12 @@
|
|
1
1
|
import React, { useState } from 'react'
|
2
2
|
import Dropdown from '../../pb_dropdown/_dropdown'
|
3
|
+
import Icon from '../../pb_icon/_icon'
|
3
4
|
|
4
5
|
const DropdownError = (props) => {
|
5
6
|
const [selectedOption, setSelectedOption] = useState()
|
6
|
-
const error = selectedOption?.value ? null :
|
7
|
+
const error = selectedOption?.value ? null : (<>
|
8
|
+
<Icon icon="warning" /> Please make a valid selection
|
9
|
+
</>)
|
7
10
|
const options = [
|
8
11
|
{
|
9
12
|
label: "United States",
|
@@ -2,6 +2,7 @@ import colors from '../tokens/exports/_colors.module.scss'
|
|
2
2
|
import typography from '../tokens/exports/_typography.module.scss'
|
3
3
|
|
4
4
|
const gaugeTheme = {
|
5
|
+
title: { text: "" },
|
5
6
|
chart: {
|
6
7
|
type: "solidgauge",
|
7
8
|
events: {
|
@@ -77,7 +78,8 @@ const gaugeTheme = {
|
|
77
78
|
y: -26,
|
78
79
|
},
|
79
80
|
},
|
80
|
-
}
|
81
|
+
},
|
82
|
+
credits: { enabled: false }
|
81
83
|
}
|
82
84
|
|
83
85
|
export default gaugeTheme;
|