playbook_ui 15.4.0.pre.alpha.PLAY2465improvetruncation12292 → 15.4.0.pre.alpha.play254712379

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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +44 -3
  3. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +2 -2
  4. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +3 -1
  5. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.md +1 -0
  6. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +1 -1
  7. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.md +11 -0
  8. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +3 -1
  9. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +2 -1
  10. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.md +1 -0
  11. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +3 -1
  12. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.md +2 -2
  13. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.md +1 -0
  14. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +3 -1
  15. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_default.md +1 -0
  16. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend_position.html.erb +1 -1
  17. data/app/pb_kits/playbook/pb_progress_step/_progress_step.scss +384 -262
  18. data/app/pb_kits/playbook/pb_progress_step/docs/_description.md +1 -5
  19. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.html.erb +14 -0
  20. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.jsx +29 -0
  21. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.md +3 -0
  22. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.jsx +31 -0
  23. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.md +1 -0
  24. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.html.erb +4 -1
  25. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.jsx +14 -3
  26. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.md +3 -0
  27. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tracker.md +3 -0
  28. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.html.erb +1 -7
  29. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.md +1 -0
  30. data/app/pb_kits/playbook/pb_progress_step/docs/example.yml +3 -0
  31. data/app/pb_kits/playbook/pb_progress_step/docs/index.js +2 -0
  32. data/app/pb_kits/playbook/pb_progress_step/progress_step.test.js +41 -0
  33. data/app/pb_kits/playbook/utilities/_truncate.scss +0 -2
  34. data/dist/chunks/{_line_graph-eQNOB_GQ.js → _line_graph-8BUASxIP.js} +1 -1
  35. data/dist/chunks/{_typeahead-vbfetkuE.js → _typeahead-DESMSfUO.js} +1 -1
  36. data/dist/chunks/{_weekday_stacked-CvJHyUq6.js → _weekday_stacked-EQMaMJvC.js} +1 -1
  37. data/dist/chunks/{lib-BCrK6CFU.js → lib-CzQFzKzw.js} +1 -1
  38. data/dist/chunks/{pb_form_validation-Cj4vdjWI.js → pb_form_validation-Bf9TK15t.js} +1 -1
  39. data/dist/chunks/vendor.js +1 -1
  40. data/dist/playbook-doc.js +1 -1
  41. data/dist/playbook-rails-react-bindings.js +1 -1
  42. data/dist/playbook-rails.js +1 -1
  43. data/dist/playbook.css +1 -1
  44. data/lib/playbook/version.rb +1 -1
  45. metadata +20 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c94a476c487c962bfc494f14bc2ce270d0a40ae0d67397ab2cd427c46e737daa
4
- data.tar.gz: bc7fb17ca8d6f5828604f195e1cdfaf26a425b120c57bf98d2f866755a9f1094
3
+ metadata.gz: 1e3a2f13c99348c91029efd118b7491a3d70554286780980620dbc4bf2746121
4
+ data.tar.gz: 10b6b15d921600eee4fd1b9b631bdd0571e49680b00af25358a1d32cbaa30fb2
5
5
  SHA512:
6
- metadata.gz: d1fefeb691bfb6fe4bfad24fca4c85eadd0b515b6722d66e3dc85f83dd3245849d21fdd9fb9011cbd8c6c9ff0f104243239bc5bb7019a142d657520019ce3ad7
7
- data.tar.gz: 2590d80114e311bb9526ea81f46a902b99deaf77a444ad19c1adab62f9f828c8f84d59e57c25cb3ff5a4cb1b30151e94c24ecf53b2e523deac934d8505452362
6
+ metadata.gz: f9df2ad880a4df9bf2cbccc107ff3a15493728dc179b39f23ebc023cde0a17d47bad0f132624de43dd8667d45177ea2f4ca9db887cdb33235eefb5ee9c1c5f0a
7
+ data.tar.gz: 9827d30f93a07f258b162845c427cddf43960bc780e29ceb6d656be669a66e9e5b2a1d13478dbacb1392ce25fb6147772f8d711ff647c62aa5964ac620042098
@@ -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
- window.addEventListener('resize', calendarResizer)
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
- window.removeEventListener('resize', calendarResizer)
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
  }],
@@ -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
- <form>
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
- </form>
16
+ <% end %>
17
17
  <% end %>
@@ -1,3 +1,5 @@
1
- This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo. Once done, 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.
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 | vertical_align", padding_top: "sm", padding_bottom: "sm"})%>
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
- This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo. Once done, 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.
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
- Custom tooltip formatting is configured through the tooltip object in the options passed to the kit:
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
- This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo. Once done, 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.
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 prop `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`
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 prop `plotOptions.solidgauge.borderColor` can only be used with HEX values as shown.
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
- This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo. Once done, 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.
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 | vertical_align", padding_top: "sm", padding_bottom: "sm"})%>
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 = {