playbook_ui 15.5.0.pre.rc.0 → 15.5.0.pre.rc.2
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_currency/docs/_currency_abbreviated.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals_rails.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals_react.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.html.erb +10 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.jsx +10 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol_rails.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol_react.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +7 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.jsx +7 -0
- data/app/pb_kits/playbook/pb_currency/docs/_description.md +2 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +44 -3
- data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +3 -0
- data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +1 -0
- data/app/pb_kits/playbook/pb_date_time/date_time.rb +1 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.html.erb +4 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.jsx +14 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_rails.md +1 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_react.md +1 -0
- data/app/pb_kits/playbook/pb_date_time/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_date_time/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +3 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +2 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.rb +2 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +33 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.html.erb +4 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.jsx +22 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.md +1 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +2 -2
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.md +1 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.md +11 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +2 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.md +1 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.md +2 -2
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.md +1 -0
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_default.md +1 -0
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend_position.html.erb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +8 -61
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.html.erb +2 -10
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +11 -19
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.html.erb +1 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.html.erb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +7 -16
- data/app/pb_kits/playbook/pb_table/_table.tsx +28 -26
- data/app/pb_kits/playbook/utilities/globalProps.ts +26 -8
- data/app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/alignItems.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/alignSelf.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/display.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/flex.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/flexDirection.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/flexGrow.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/flexShrink.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/flexWrap.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/justifyContent.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +18 -0
- data/dist/chunks/{_line_graph-eQNOB_GQ.js → _line_graph-BuucBJlH.js} +1 -1
- data/dist/chunks/_typeahead-VFd5WMRg.js +6 -0
- data/dist/chunks/{_weekday_stacked-CvJHyUq6.js → _weekday_stacked-B4_b9xef.js} +2 -2
- data/dist/chunks/{lib-BCrK6CFU.js → lib-COXg9aPA.js} +1 -1
- data/dist/chunks/{pb_form_validation-Cj4vdjWI.js → pb_form_validation-DR765aoq.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +19 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +25 -10
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default_rails.md +0 -7
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline_rails.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky_rails.md +0 -1
- data/dist/chunks/_typeahead-vbfetkuE.js +0 -24
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 33c3f871448ed381e3a35223c4d72ce6f15794928468beab586e281c46b5d5e7
|
|
4
|
+
data.tar.gz: 46015ad2243722f29271c481b22163c3138cb1834ce33999c1b9459a88bc9908
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e965c14c7e23528961b070c24dcab12edf09e659d80af74690c644c384ad095b57789f779fef1af0eb3f778a6d49568bc059dc088fd7802173334277f93692bf
|
|
7
|
+
data.tar.gz: ea57133c7daf69d350755427d7a8cc84d56bb0f09db0ed131ef33424c14ce7d3bc6067d386a84633df1c6c4e651ddc336f7a456a2cfdc703fd722a300d848212
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Abbreviate larger amounts into thousands (K), millions (M), billions (B), and even trillions (T).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Use `decimals: "matching"` when you want the full decimal amount displayed as a single number rather than split visually.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Use `decimals="matching"` when you want the full decimal amount displayed as a single number rather than split visually.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Small `Currency` kits have the negative sign on the lefthand side of the "$" symbol.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Remove the "$" symbol by setting an empty string: `symbol: ""`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Remove the "$" symbol by setting an empty string: `symbol=""`.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Use to display monetary amounts, typically on dashboards or other layouts to show an overview or summary.
|
|
2
|
-
Cents
|
|
1
|
+
Use this kit to display monetary amounts, typically on dashboards or other layouts to show an overview or summary. Pairing it with labels improves user understanding.
|
|
2
|
+
Cents are automatically ".00" unless otherwise overwritten (i.e. `unit` prop).
|
|
@@ -182,6 +182,33 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
+
const positionCalendarIfNeeded = (fp: Instance) => {
|
|
186
|
+
const cal = document.querySelector(`#cal-${pickerId}`) as HTMLElement
|
|
187
|
+
if (!cal) return
|
|
188
|
+
|
|
189
|
+
const inputRect = fp.input.getBoundingClientRect()
|
|
190
|
+
const h = cal.getBoundingClientRect().height || 300
|
|
191
|
+
const spaceBelow = window.innerHeight - inputRect.bottom
|
|
192
|
+
const spaceAbove = inputRect.top
|
|
193
|
+
|
|
194
|
+
if (spaceBelow < h + 10 && spaceAbove >= h + 10) {
|
|
195
|
+
if (staticPosition) {
|
|
196
|
+
cal.style.top = 'auto'
|
|
197
|
+
cal.style.bottom = 'calc(100% + 5px)'
|
|
198
|
+
} else {
|
|
199
|
+
cal.style.position = 'fixed'
|
|
200
|
+
cal.style.top = `${Math.max(10, inputRect.top - h - 5)}px`
|
|
201
|
+
cal.style.left = `${inputRect.left}px`
|
|
202
|
+
}
|
|
203
|
+
} else if (staticPosition) {
|
|
204
|
+
cal.style.top = ''
|
|
205
|
+
cal.style.bottom = ''
|
|
206
|
+
} else {
|
|
207
|
+
Object.assign(cal.style, { position: '', top: '', left: '', bottom: '', right: '', transform: '' })
|
|
208
|
+
fp._positionCalendar()
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
185
212
|
const setPlugins = (thisRangesEndToday: boolean, customQuickPickDates: any) => {
|
|
186
213
|
const pluginList = []
|
|
187
214
|
|
|
@@ -239,6 +266,9 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
|
239
266
|
}
|
|
240
267
|
}
|
|
241
268
|
|
|
269
|
+
// Store resize / position handler reference for cleanup
|
|
270
|
+
let resizeRepositionHandlerRef: (() => void) | null = null
|
|
271
|
+
|
|
242
272
|
// ===========================================================
|
|
243
273
|
// | Flatpickr initializer w/ config |
|
|
244
274
|
// ===========================================================
|
|
@@ -260,13 +290,24 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
|
260
290
|
minDate: setMinDate,
|
|
261
291
|
mode,
|
|
262
292
|
nextArrow: '<i class="far fa-angle-right"></i>',
|
|
263
|
-
onOpen: [() => {
|
|
293
|
+
onOpen: [(_selectedDates, _dateStr, fp) => {
|
|
264
294
|
calendarResizer()
|
|
265
|
-
|
|
295
|
+
if (resizeRepositionHandlerRef) {
|
|
296
|
+
window.removeEventListener('resize', resizeRepositionHandlerRef)
|
|
297
|
+
}
|
|
298
|
+
resizeRepositionHandlerRef = () => {
|
|
299
|
+
calendarResizer()
|
|
300
|
+
positionCalendarIfNeeded(fp)
|
|
301
|
+
}
|
|
302
|
+
window.addEventListener('resize', resizeRepositionHandlerRef)
|
|
266
303
|
if (!staticPosition && scrollContainer) attachToScroll(scrollContainer)
|
|
304
|
+
positionCalendarIfNeeded(fp)
|
|
267
305
|
}],
|
|
268
306
|
onClose: [(selectedDates, dateStr) => {
|
|
269
|
-
|
|
307
|
+
if (resizeRepositionHandlerRef) {
|
|
308
|
+
window.removeEventListener('resize', resizeRepositionHandlerRef)
|
|
309
|
+
resizeRepositionHandlerRef = null
|
|
310
|
+
}
|
|
270
311
|
if (!staticPosition && scrollContainer) detachFromScroll(scrollContainer as HTMLElement)
|
|
271
312
|
onClose(selectedDates, dateStr)
|
|
272
313
|
}],
|
|
@@ -17,6 +17,7 @@ type DateTimeProps = {
|
|
|
17
17
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
|
18
18
|
id?: string,
|
|
19
19
|
size?: "sm" | "md",
|
|
20
|
+
showCurrentYear?: boolean,
|
|
20
21
|
showDayOfWeek: boolean,
|
|
21
22
|
showIcon?: boolean,
|
|
22
23
|
timeZone?: string
|
|
@@ -32,6 +33,7 @@ const DateTime = (props: DateTimeProps): React.ReactElement => {
|
|
|
32
33
|
showDayOfWeek = false,
|
|
33
34
|
datetime,
|
|
34
35
|
id,
|
|
36
|
+
showCurrentYear = false,
|
|
35
37
|
showIcon = false,
|
|
36
38
|
size = 'md',
|
|
37
39
|
timeZone = 'America/New_York',
|
|
@@ -59,6 +61,7 @@ const DateTime = (props: DateTimeProps): React.ReactElement => {
|
|
|
59
61
|
vertical="baseline"
|
|
60
62
|
>
|
|
61
63
|
<FormattedDate
|
|
64
|
+
showCurrentYear={showCurrentYear}
|
|
62
65
|
showDayOfWeek={showDayOfWeek}
|
|
63
66
|
size={size}
|
|
64
67
|
value={datetime}
|
|
@@ -16,6 +16,7 @@ module Playbook
|
|
|
16
16
|
prop :dark, type: Playbook::Props::Boolean, default: false
|
|
17
17
|
prop :show_icon, type: Playbook::Props::Boolean, default: false
|
|
18
18
|
prop :show_day_of_week, type: Playbook::Props::Boolean, default: false
|
|
19
|
+
prop :show_current_year, type: Playbook::Props::Boolean, default: false
|
|
19
20
|
|
|
20
21
|
def classname
|
|
21
22
|
generate_classname("pb_date_time_kit", align)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import DateTime from '../_date_time'
|
|
3
|
+
|
|
4
|
+
const DateTimeShowCurrentYear = (props) => (
|
|
5
|
+
<div>
|
|
6
|
+
<DateTime
|
|
7
|
+
datetime={new Date()}
|
|
8
|
+
showCurrentYear
|
|
9
|
+
{...props}
|
|
10
|
+
/>
|
|
11
|
+
</div>
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
export default DateTimeShowCurrentYear
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Pass in `show_current_year` to show this date's current year.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Pass in `showCurrentYear` to show this date's current year.
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
examples:
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
rails:
|
|
4
4
|
- date_time_default: Default
|
|
5
5
|
- date_time_align: Alignment
|
|
6
6
|
- date_time_size: Size
|
|
7
|
+
- date_time_show_current_year: Show Current Year
|
|
7
8
|
|
|
8
9
|
react:
|
|
9
10
|
- date_time_default: Default
|
|
10
11
|
- date_time_align: Alignment
|
|
11
12
|
- date_time_size: Size
|
|
13
|
+
- date_time_show_current_year: Show Current Year
|
|
12
14
|
|
|
13
15
|
swift:
|
|
14
16
|
- date_time_default_swift: Default
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default as DateTimeDefault } from './_date_time_default.jsx'
|
|
2
2
|
export { default as DateTimeAlign } from './_date_time_align.jsx'
|
|
3
3
|
export { default as DateTimeSize } from './_date_time_size.jsx'
|
|
4
|
+
export { default as DateTimeShowCurrentYear } from './_date_time_show_current_year.jsx'
|
|
@@ -17,6 +17,7 @@ type DateTimeStackedProps = {
|
|
|
17
17
|
datetime: Date,
|
|
18
18
|
dark: boolean,
|
|
19
19
|
timeZone?: string,
|
|
20
|
+
showCurrentYear?: boolean,
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
|
|
@@ -28,6 +29,7 @@ const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
|
|
|
28
29
|
dark,
|
|
29
30
|
htmlOptions = {},
|
|
30
31
|
timeZone = 'America/New_York',
|
|
32
|
+
showCurrentYear = false,
|
|
31
33
|
} = props
|
|
32
34
|
|
|
33
35
|
const classes = buildCss('pb_date_time_stacked_kit', globalProps(props))
|
|
@@ -46,6 +48,7 @@ const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
|
|
|
46
48
|
bold
|
|
47
49
|
dark={dark}
|
|
48
50
|
date={date || datetime}
|
|
51
|
+
showCurrentYear={showCurrentYear}
|
|
49
52
|
/>
|
|
50
53
|
</FlexItem>
|
|
51
54
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<%= pb_content_tag do %>
|
|
1
|
+
<%= pb_content_tag do %>
|
|
2
2
|
|
|
3
3
|
<%= pb_rails("flex", props: {classname: "flex-container", vertical: "stretch"}) do %>
|
|
4
4
|
<%= pb_rails("body", props: {classname: "flex-item"}) do %>
|
|
5
|
-
<%= pb_rails("date_stacked", props: { date: object.date_time_value, size: "sm", align: "right", bold: true, dark: object.dark }) %>
|
|
5
|
+
<%= pb_rails("date_stacked", props: { date: object.date_time_value, size: "sm", align: "right", bold: true, dark: object.dark, show_current_year: object.show_current_year }) %>
|
|
6
6
|
<% end %>
|
|
7
7
|
<%= pb_rails("section_separator", props: { orientation: "vertical", classname: "date-time-padding" }) %>
|
|
8
8
|
<%= pb_rails("body", props: {classname: "flex-item"}) do %>
|
|
@@ -41,3 +41,36 @@ test('renders time in timezone', () => {
|
|
|
41
41
|
const kit = renderKit(DateTimeStacked, props)
|
|
42
42
|
expect(kit).toHaveTextContent(`${monthDayYear}11:00aMDT`)
|
|
43
43
|
})
|
|
44
|
+
|
|
45
|
+
test('renders current year when showCurrentYear is true', () => {
|
|
46
|
+
const currentYearDate = new Date()
|
|
47
|
+
const currentYear = currentYearDate.getFullYear()
|
|
48
|
+
|
|
49
|
+
const kit = renderKit(DateTimeStacked, {
|
|
50
|
+
data: { testid: 'datetimestacked-current-year' },
|
|
51
|
+
datetime: currentYearDate,
|
|
52
|
+
dark: false,
|
|
53
|
+
showCurrentYear: true,
|
|
54
|
+
})
|
|
55
|
+
expect(kit).toHaveTextContent(currentYear.toString())
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
test('hides current year by default', () => {
|
|
59
|
+
const currentYearDate = new Date()
|
|
60
|
+
const currentYear = currentYearDate.getFullYear()
|
|
61
|
+
|
|
62
|
+
const kit = renderKit(DateTimeStacked, {
|
|
63
|
+
data: { testid: 'datetimestacked-hide-year' },
|
|
64
|
+
datetime: currentYearDate,
|
|
65
|
+
dark: false,
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
const yearElement = kit.querySelector('.pb_caption_kit_xs')
|
|
69
|
+
|
|
70
|
+
if (yearElement) {
|
|
71
|
+
expect(yearElement.textContent).not.toBe(currentYear.toString())
|
|
72
|
+
} else {
|
|
73
|
+
|
|
74
|
+
expect(yearElement).toBeNull()
|
|
75
|
+
}
|
|
76
|
+
})
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import DateTimeStacked from '../_date_time_stacked'
|
|
4
|
+
|
|
5
|
+
const DateTimeStackedShowCurrentYear = (props) => (
|
|
6
|
+
<div>
|
|
7
|
+
<DateTimeStacked
|
|
8
|
+
datetime={new Date()}
|
|
9
|
+
showCurrentYear
|
|
10
|
+
{...props}
|
|
11
|
+
/>
|
|
12
|
+
<br />
|
|
13
|
+
<DateTimeStacked
|
|
14
|
+
datetime={new Date()}
|
|
15
|
+
showCurrentYear
|
|
16
|
+
timeZone="America/Denver"
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export default DateTimeStackedShowCurrentYear;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
By default, the Date Time Stacked kit does NOT display the year if it is the current year. If you want to display the current year you can do so by setting `showCurrentYear`/`show_current_year` to true as shown here.
|
|
@@ -2,9 +2,11 @@ examples:
|
|
|
2
2
|
|
|
3
3
|
rails:
|
|
4
4
|
- date_time_stacked_default: Default
|
|
5
|
-
|
|
5
|
+
- date_time_stacked_show_current_year: Show Current Year
|
|
6
|
+
|
|
6
7
|
react:
|
|
7
8
|
- date_time_stacked_default: Default
|
|
9
|
+
- date_time_stacked_show_current_year: Show Current Year
|
|
8
10
|
|
|
9
11
|
swift:
|
|
10
12
|
- date_time_stacked_default_swift: Default
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%= pb_rails("button", props: { text: "Open Complex Dialog", data:{"open-dialog": "dialog-complex"} }) %>
|
|
2
2
|
|
|
3
3
|
<%= pb_rails("dialog", props: { id:"dialog-complex", size: "lg", full_height: true }) do %>
|
|
4
|
-
|
|
4
|
+
<%= pb_form_with(scope: :example, method: :get, url: "", options: { remote: true }) do |form| %>
|
|
5
5
|
<%= pb_rails("dialog/dialog_header", props: { id: "dialog-complex" } ) do %>
|
|
6
6
|
<%= pb_rails("body", props: { text: "What do you need us to take care of?" }) %>
|
|
7
7
|
<% end %>
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
|
|
14
14
|
<% end %>
|
|
15
15
|
<%= pb_rails("dialog/dialog_footer", props: {cancel_button: "Back", confirm_button: "Send my Issue", confirm_button_id:"confirm-complex", id: "dialog-complex"}) %>
|
|
16
|
-
|
|
16
|
+
<% end %>
|
|
17
17
|
<% end %>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
**In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo.**
|
|
2
|
+
|
|
3
|
+
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. Once 'highcharts' and 'highcharts-react-official are installed into your repo, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
2
4
|
|
|
3
5
|
See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo.
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
}
|
|
37
37
|
%>
|
|
38
38
|
|
|
39
|
-
<%= pb_rails("title", props: {size: 4, text: "align |
|
|
39
|
+
<%= pb_rails("title", props: {size: 4, text: "align | verticalAlign", padding_top: "sm", padding_bottom: "sm"})%>
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
<%= pb_rails("pb_bar_graph", props: {options: chart_options_right}) %>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Highcharts provides many options for customizing the legend display. This example showcases the following:
|
|
2
|
+
|
|
3
|
+
`align` can be used to align the legend left, right or center (defaults to center)
|
|
4
|
+
|
|
5
|
+
`verticalAlign` can be used to place the legend above the graph. Options are top, middle, bottom with default set to bottom
|
|
6
|
+
|
|
7
|
+
`layout` determines the position of the legend items. Options are horizontal, vertical or proximate with default set to horizontal `layout: proximate` will place the legend items as close as possible to the graphs they're representing. It will also determine whether to place the legend above/below or on the side of the plot area, if the legend is in a corner.
|
|
8
|
+
|
|
9
|
+
`x` offsets the legend relative to its horizontal alignment. Negative x moves it to the left, positive x moves it to the right (defaults to 0)
|
|
10
|
+
|
|
11
|
+
`y` offsets the legend relative to its vertical alignment. Negative y moves it up, positive y moves it down (defaults to 0)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
**In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo.**
|
|
2
|
+
|
|
3
|
+
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. Once 'highcharts' and 'highcharts-react-official are installed into your repo, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
2
4
|
|
|
3
5
|
See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
Tooltip options from Highcharts:
|
|
2
|
+
|
|
2
3
|
`headerFormat` **Type**: String | when set to null will disable the header.
|
|
3
4
|
`pointFormat` **Type**: String | defines the HTML template for each data point and supports custom HTML when `useHTML` is enabled.
|
|
4
5
|
`useHTML` **Type**: boolean (default false) | enables HTML rendering in tooltips.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
**In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo.**
|
|
2
|
+
|
|
3
|
+
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. Once 'highcharts' and 'highcharts-react-official are installed into your repo, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
2
4
|
|
|
3
5
|
See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Highcharts allows for any custom colors to be used. Custom data colors allow for color customization to match the needs of business requirements.
|
|
2
2
|
|
|
3
|
-
For React, pass the
|
|
3
|
+
For React, pass the option `plotOptions.solidgauge.borderColor` with a Playbook token like `colors.` + `data_1 | data_2 | data_3 | data_4 | data_5 | data_6 | data_7 | data_8`. HEX colors are also available `eg: #CA0095`
|
|
4
4
|
|
|
5
|
-
For Rails, the
|
|
5
|
+
For Rails, the option `plotOptions.solidgauge.borderColor` can only be used with HEX values as shown.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
**In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo.**
|
|
2
|
+
|
|
3
|
+
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. Once 'highcharts' and 'highcharts-react-official are installed into your repo, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
2
4
|
|
|
3
5
|
See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo.
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
} %>
|
|
39
39
|
|
|
40
|
-
<%= pb_rails("title", props: {size: 4, text: "align |
|
|
40
|
+
<%= pb_rails("title", props: {size: 4, text: "align | verticalAlign", padding_top: "sm", padding_bottom: "sm"})%>
|
|
41
41
|
<%= pb_rails("pb_line_graph", props: {options: chartOptionsFirst}) %>
|
|
42
42
|
|
|
43
43
|
<% chartOptionsSecond = {
|
|
@@ -96,7 +96,7 @@ const EditorToolbar = ({ editor, extensions, simple, sticky }: any): React.React
|
|
|
96
96
|
<SectionSeparator orientation="vertical" />
|
|
97
97
|
<ToolbarNodes editor={editor} />
|
|
98
98
|
{
|
|
99
|
-
extensions &&
|
|
99
|
+
extensions && (
|
|
100
100
|
<>
|
|
101
101
|
<MoreExtensionsDropdown extensions={extensions}/>
|
|
102
102
|
</>
|