playbook_ui 14.13.0 → 14.14.0.pre.alpha.play1868dependencyremovallodash6286

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 (138) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +3 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +6 -5
  5. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +8 -1
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_custom_cell.jsx +75 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +3 -1
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +1 -1
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb +33 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +3 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
  14. data/app/pb_kits/playbook/pb_bar_graph/BarGraphStyles.scss +58 -0
  15. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.jsx +64 -0
  16. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.md +1 -0
  17. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -0
  18. data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +1 -0
  19. data/app/pb_kits/playbook/pb_card/_card.tsx +2 -1
  20. data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +17 -8
  21. data/app/pb_kits/playbook/pb_checkbox/checkbox.test.js +16 -0
  22. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.jsx +69 -0
  23. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.md +1 -0
  24. data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +2 -1
  25. data/app/pb_kits/playbook/pb_checkbox/docs/index.js +1 -0
  26. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +3 -1
  27. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.html.erb +2 -2
  28. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.md +4 -1
  29. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.jsx +90 -0
  30. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +5 -0
  31. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +2 -0
  32. data/app/pb_kits/playbook/pb_draggable/docs/index.js +2 -1
  33. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +7 -4
  34. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +6 -3
  35. data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.tsx +4 -4
  36. data/app/pb_kits/playbook/pb_filter/Filter/FilterSingle.tsx +2 -2
  37. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -0
  38. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -0
  39. data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +71 -0
  40. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +1 -2
  41. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.jsx +17 -0
  42. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.html.erb +27 -0
  43. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.jsx +61 -0
  44. data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +5 -3
  45. data/app/pb_kits/playbook/pb_icon_button/docs/index.js +2 -0
  46. data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +1 -1
  47. data/app/pb_kits/playbook/pb_icon_button/icon_button.rb +3 -0
  48. data/app/pb_kits/playbook/pb_icon_button/icon_button.test.jsx +39 -0
  49. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.html.erb +1 -6
  50. data/app/pb_kits/playbook/pb_nav/item.html.erb +7 -19
  51. data/app/pb_kits/playbook/pb_nav/nav.html.erb +3 -8
  52. data/app/pb_kits/playbook/pb_online_status/online_status.html.erb +1 -6
  53. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +4 -0
  54. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.jsx +37 -0
  55. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional_react.md +1 -0
  56. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +1 -0
  57. data/app/pb_kits/playbook/pb_overlay/docs/index.js +1 -0
  58. data/app/pb_kits/playbook/pb_overlay/subcomponents/_overlay_token.tsx +48 -10
  59. data/app/pb_kits/playbook/pb_popover/popover.html.erb +1 -6
  60. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.scss +6 -1
  61. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +7 -5
  62. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.html.erb +1 -0
  63. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +7 -0
  64. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.md +1 -0
  65. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.html.erb +1 -0
  66. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.jsx +18 -0
  67. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_rails.md +1 -0
  68. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_react.md +1 -0
  69. data/app/pb_kits/playbook/pb_progress_pills/docs/example.yml +2 -0
  70. data/app/pb_kits/playbook/pb_progress_pills/docs/index.js +1 -0
  71. data/app/pb_kits/playbook/pb_progress_pills/progress_pills.html.erb +2 -7
  72. data/app/pb_kits/playbook/pb_progress_pills/progress_pills.rb +6 -0
  73. data/app/pb_kits/playbook/pb_progress_pills/progress_pills.test.js +26 -1
  74. data/app/pb_kits/playbook/pb_progress_simple/progress_simple.html.erb +1 -5
  75. data/app/pb_kits/playbook/pb_progress_step/progress_step.html.erb +1 -5
  76. data/app/pb_kits/playbook/pb_progress_step/progress_step_item.html.erb +3 -7
  77. data/app/pb_kits/playbook/pb_radio/radio.html.erb +6 -11
  78. data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.html.erb +47 -0
  79. data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.jsx +88 -0
  80. data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.md +1 -0
  81. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +1 -1
  82. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.html.erb +51 -0
  83. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click_rails.md +2 -0
  84. data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +96 -0
  85. data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.jsx +101 -0
  86. data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.md +1 -0
  87. data/app/pb_kits/playbook/pb_table/docs/example.yml +5 -0
  88. data/app/pb_kits/playbook/pb_table/docs/index.js +3 -1
  89. data/app/pb_kits/playbook/pb_table/index.ts +41 -9
  90. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +4 -0
  91. data/app/pb_kits/playbook/pb_table/subcomponents/_table_body.tsx +29 -2
  92. data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +31 -3
  93. data/app/pb_kits/playbook/pb_table/table_body.html.erb +13 -7
  94. data/app/pb_kits/playbook/pb_table/table_body.rb +2 -0
  95. data/app/pb_kits/playbook/pb_table/table_row.html.erb +14 -7
  96. data/app/pb_kits/playbook/pb_table/table_row.rb +14 -1
  97. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +14 -0
  98. data/app/pb_kits/playbook/pb_text_input/index.js +9 -0
  99. data/app/pb_kits/playbook/pb_text_input/text_input.rb +5 -2
  100. data/app/pb_kits/playbook/pb_tooltip/index.js +1 -1
  101. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +5 -4
  102. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +2 -1
  103. data/app/pb_kits/playbook/utilities/object.ts +82 -1
  104. data/dist/chunks/_typeahead-CHxdYnAw.js +36 -0
  105. data/dist/chunks/_weekday_stacked-D2tZHCNS.js +45 -0
  106. data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
  107. data/dist/chunks/{lib-DjpLC8uO.js → lib-CrrD678a.js} +3 -3
  108. data/dist/chunks/{pb_form_validation-S56UaHZl.js → pb_form_validation-BbWhQeoO.js} +1 -1
  109. data/dist/chunks/vendor.js +1 -1
  110. data/dist/menu.yml +1 -8
  111. data/dist/playbook-doc.js +1 -1
  112. data/dist/playbook-rails-react-bindings.js +1 -1
  113. data/dist/playbook-rails.js +1 -1
  114. data/dist/playbook.css +1 -1
  115. data/lib/playbook/forms/builder/time_zone_select_field.rb +19 -0
  116. data/lib/playbook/forms/builder.rb +1 -0
  117. data/lib/playbook/version.rb +2 -2
  118. metadata +40 -24
  119. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +0 -66
  120. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +0 -98
  121. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +0 -28
  122. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.rb +0 -42
  123. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +0 -19
  124. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +0 -26
  125. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +0 -10
  126. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +0 -17
  127. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +0 -19
  128. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +0 -16
  129. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +0 -35
  130. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +0 -42
  131. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +0 -13
  132. data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +0 -15
  133. data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +0 -4
  134. data/app/pb_kits/playbook/pb_avatar_action_button/pb_avatar_action_button.test.js +0 -31
  135. data/dist/chunks/_typeahead-btjo1UN5.js +0 -36
  136. data/dist/chunks/_weekday_stacked-DeYS_l8v.js +0 -45
  137. data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
  138. /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible_with_custom_click.md → _table_with_collapsible_with_custom_click_react.md} +0 -0
@@ -3,7 +3,8 @@ import Select from 'react-select'
3
3
  import AsyncSelect from 'react-select/async'
4
4
  import CreateableSelect from 'react-select/creatable'
5
5
  import AsyncCreateableSelect from 'react-select/async-creatable'
6
- import { get, isString, uniqueId } from 'lodash'
6
+ import { get, isString, uniqueId } from '../utilities/object'
7
+
7
8
  import { globalProps, GlobalProps } from '../utilities/globalProps'
8
9
  import classnames from 'classnames'
9
10
 
@@ -1,3 +1,84 @@
1
1
  /* 🛠️ Any commonly used lodash functions can be added here. 🤙 */
2
2
 
3
- export const isEmpty = (obj: Record<string, unknown>): boolean => Object.keys(obj).length < 1
3
+ export const isEmpty = (obj: any) => [Object, Array].includes((obj || {}).constructor) && !Object.entries((obj || {})).length;
4
+
5
+ export const get = <T, R = any>(obj: T, path: string, defaultValue?: R): R | any => {
6
+ const travel = (regexp: RegExp): any =>
7
+ String.prototype.split
8
+ .call(path, regexp)
9
+ .filter(Boolean)
10
+ .reduce((res: any, key: string) => (res !== null && res !== undefined ? res[key] : res), obj)
11
+ const result = travel(/[,[\]]+?/) || travel(/[,[\].]+?/)
12
+ return result === undefined || result === obj ? defaultValue : result
13
+ }
14
+
15
+ export const map = <T, U>(
16
+ collection: T[] | Record<string, T> | null | undefined,
17
+ iteratee: (value: any, key: string, collection: T[] | Record<string, T>) => U
18
+ ): U[] => {
19
+ if (!collection) return []
20
+ const coerce = (val: any) => {
21
+ if (val === true) return val
22
+ if (
23
+ typeof val === "number" ||
24
+ typeof val === "string" ||
25
+ typeof val === "boolean" ||
26
+ val === null
27
+ )
28
+ return String(val)
29
+ return val
30
+ }
31
+ return Array.isArray(collection)
32
+ ? collection.map((v, i) => iteratee(coerce(v), String(i), collection))
33
+ : Object.keys(collection).map(key => iteratee(coerce(collection[key]), key, collection))
34
+ }
35
+
36
+ export const isString = (str: unknown): str is string =>
37
+ str != null && typeof (str as any).valueOf() === "string"
38
+
39
+ export const omitBy = <T extends Record<string, any>>(
40
+ obj: T,
41
+ predicate: (value: T[keyof T], key: string) => boolean
42
+ ): Partial<T> => {
43
+ if (obj === null || typeof obj !== 'object') return {} as Partial<T>
44
+ return Object.keys(obj).reduce((result, key) => {
45
+ const typedKey = key as keyof T
46
+ if (!predicate(obj[typedKey], key)) {
47
+ result[typedKey] = obj[typedKey]
48
+ }
49
+ return result
50
+ }, {} as Partial<T>)
51
+ }
52
+
53
+ export const uniqueId: (prefix?: string) => string = (() => {
54
+ let counter = 0
55
+ return (prefix = '') => `${prefix}${++counter}`
56
+ })()
57
+
58
+ type PlainObject = { [key: string]: any }
59
+
60
+ const isObject = (item: any): item is PlainObject =>
61
+ item !== null && typeof item === 'object'
62
+
63
+ export const merge = <T extends PlainObject>(
64
+ target: T,
65
+ ...sources: PlainObject[]
66
+ ): T => {
67
+ if (!sources.length) return target
68
+ const source = sources.shift()!
69
+ if (isObject(target) && isObject(source)) {
70
+ Object.keys(source).forEach((key: string) => {
71
+ const typedKey = key as keyof T
72
+ const srcValue = source[key]
73
+ if (isObject(srcValue)) {
74
+ if (!target[typedKey]) {
75
+ target[typedKey] = (Array.isArray(srcValue) ? [] : {}) as unknown as T[typeof typedKey]
76
+ }
77
+ merge(target[typedKey], srcValue)
78
+ } else {
79
+ target[typedKey] = srcValue
80
+ }
81
+ })
82
+ }
83
+ return merge(target, ...sources)
84
+ }