playbook_ui 14.11.1.pre.alpha.responsivetablerails5364 → 14.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +0 -2
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
  5. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +5 -5
  6. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +2 -3
  7. data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +4 -12
  8. data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +1 -5
  9. data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.tsx +3 -8
  10. data/app/pb_kits/playbook/pb_typeahead/components/MenuList.tsx +1 -6
  11. data/app/pb_kits/playbook/pb_typeahead/components/Option.tsx +6 -21
  12. data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.tsx +6 -13
  13. data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +3 -7
  14. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx +0 -2
  15. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +2 -4
  16. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_custom_options.jsx +5 -5
  17. data/dist/chunks/{_typeahead-BNULwihE.js → _typeahead-C2iCBqxQ.js} +1 -1
  18. data/dist/chunks/{_weekday_stacked-BKWemDAe.js → _weekday_stacked-E-5KcEkc.js} +1 -1
  19. data/dist/chunks/lazysizes-DHz07jlL.js +1 -0
  20. data/dist/chunks/vendor.js +1 -1
  21. data/dist/playbook-doc.js +1 -1
  22. data/dist/playbook-rails-react-bindings.js +1 -1
  23. data/dist/playbook-rails.js +1 -1
  24. data/dist/playbook.css +1 -1
  25. data/lib/playbook/version.rb +2 -2
  26. metadata +6 -8
  27. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +0 -33
  28. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +0 -1
  29. data/dist/chunks/lazysizes-B7xYodB-.js +0 -1
  30. /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_table_props_react.md → _advanced_table_table_props.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46277960523f04136c4eb174e2809aa1d0dc8eddc1fe762877ae0c2f3dbb3b7d
4
- data.tar.gz: 76a396f4ef362cf68635b0e94691ef6d45d454d6dd56bbb751ecdb18ccad715c
3
+ metadata.gz: 684dfcc3e0b2d271c0ef3992c66895d5bf59f7814908e97b4ba0a6a2fd3a35c6
4
+ data.tar.gz: 8cff029a4d16a46c0d11292767c7faed0fed272b1102316c5c6988289b145f9b
5
5
  SHA512:
6
- metadata.gz: 0713edb158ee3e0806bab681982fd72cf5db7439518159f212de49889aff28bd9ca14fd6d43cac959d37b529f01f6b3ff91fdbc2f7a3dda0fe8c8aed4e035af1
7
- data.tar.gz: 18a44c121ed5011d7a8179b8d887b04638051f99d113861fdf3ee382d293dfae535a62d1c1a64f16c458013b3024f1c6ccfb3f8804226d96b7c1138e32251f7d
6
+ metadata.gz: cf605e9ea95eca375c9efc8a112416d373958b9c5b0cd2bb4ea63495a6e6a97e22776d372d96894d2060c0c2c02ee671943390b06dbf0b35dded14de3b531a09
7
+ data.tar.gz: 8c2b6329d1a8ed96313eb9cacae23f86c2801ebdf4fe24de3070b969b79758753ca5f7e2507956482e4560fac781f6dc443f55cf0844ea749f2e7dcd26b1c92e
@@ -1,5 +1,5 @@
1
1
  <%= pb_content_tag do %>
2
- <%= pb_rails("table", props: { size: "sm", data_table: true, number_spacing:"tabular", responsive:"none", dark: dark }.merge(object.table_props)) do %>
2
+ <%= pb_rails("table", props: { size: "sm", data_table: true, number_spacing:"tabular", responsive:"none", dark: dark }) do %>
3
3
  <% if content.present? %>
4
4
  <% content.presence %>
5
5
  <% else %>
@@ -13,8 +13,6 @@ module Playbook
13
13
  prop :responsive, type: Playbook::Props::Enum,
14
14
  values: %w[none scroll],
15
15
  default: "none"
16
- prop :table_props, type: Playbook::Props::HashProp,
17
- default: {}
18
16
 
19
17
  def classname
20
18
  generate_classname("pb_advanced_table", responsive_classname, separator: " ")
@@ -3,7 +3,6 @@ examples:
3
3
  - advanced_table_beta: Default (Required Props)
4
4
  - advanced_table_beta_subrow_headers: SubRow Headers
5
5
  - advanced_table_collapsible_trail_rails: Collapsible Trail
6
- - advanced_table_table_props: Table Props
7
6
  - advanced_table_beta_sort: Enable Sorting
8
7
  - advanced_table_custom_cell_rails: Custom Components for Cells
9
8
  - advanced_table_column_headers: Multi-Header Columns
@@ -1,6 +1,7 @@
1
1
  @import "../../tokens/screen_sizes";
2
2
 
3
3
  .table-responsive-scroll {
4
+ display: block;
4
5
  overflow-x: scroll;
5
6
 
6
7
  // hides duplicate scroll bar for those that see two (byproduct of repeated table-responsive-scroll class
@@ -26,12 +27,11 @@
26
27
  // Responsive Styles
27
28
  @media (max-width: 1600px) {
28
29
  &[class*="table-responsive-scroll"] {
29
- &:has(> table.table-card) {
30
- border-radius: 4px;
31
- box-shadow: 1px 0 0 0px $border_light,
30
+ border-radius: 4px;
31
+ box-shadow: 1px 0 0 0px $border_light,
32
32
  -1px 0 0 0px $border_light
33
- }
34
- }
33
+ }
34
+
35
35
  &[class^=pb_table].table-sm.table-card thead tr th:first-child,
36
36
  &[class^=pb_table].table-sm:not(.no-hover).table-card tbody tr td:first-child {
37
37
  border-left-width: 0px;
@@ -42,8 +42,8 @@ type TypeaheadProps = {
42
42
  id?: string,
43
43
  label?: string,
44
44
  loadOptions?: string | Noop,
45
- getOptionLabel?: string | (() => string),
46
- getOptionValue?: string | (() => string),
45
+ getOptionLabel?: string | (() => any),
46
+ getOptionValue?: string | (() => any),
47
47
  name?: string,
48
48
  marginBottom?: "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
49
49
  pillColor?: "primary" | "neutral" | "success" | "warning" | "error" | "info" | "data_1" | "data_2" | "data_3" | "data_4" | "data_5" | "data_6" | "data_7" | "data_8" | "windows" | "siding" | "roofing" | "doors" | "gutters" | "solar" | "insulation" | "accessories",
@@ -109,7 +109,6 @@ const Typeahead = ({
109
109
  multiKit: '',
110
110
  onCreateOption: null as null,
111
111
  plusIcon: false,
112
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
113
112
  onMultiValueClick: (_option: SelectValueType): any => undefined,
114
113
  pillColor: pillColor,
115
114
  ...props,
@@ -1,24 +1,16 @@
1
1
  import React, { useEffect } from 'react'
2
2
  import { components } from 'react-select'
3
3
 
4
- type ClearContainerProps = {
5
- children: React.ReactNode,
6
- selectProps?: {
7
- id: string,
8
- },
9
- clearValue: () => void,
10
- }
11
-
12
- const ClearContainer = (props: ClearContainerProps): React.ReactElement => {
4
+ const ClearContainer = (props: any) => {
13
5
  const { selectProps, clearValue } = props
14
6
  useEffect(() => {
15
7
  document.addEventListener(`pb-typeahead-kit-${selectProps.id}:clear`, clearValue)
16
- }, [clearValue, selectProps.id])
8
+ }, [true])
17
9
 
18
10
  return (
19
11
  <components.ClearIndicator
20
- className="clear_indicator"
21
- {...props}
12
+ className="clear_indicator"
13
+ {...props}
22
14
  />
23
15
  )
24
16
  }
@@ -5,11 +5,7 @@ import Flex from '../../pb_flex/_flex'
5
5
  import TextInput from '../../pb_text_input/_text_input'
6
6
 
7
7
  type Props = {
8
- selectProps: {
9
- dark?: boolean,
10
- label: string,
11
- error?: string,
12
- },
8
+ selectProps: any,
13
9
  }
14
10
 
15
11
  const TypeaheadControl = (props: Props) => (
@@ -1,15 +1,10 @@
1
1
  import React from 'react'
2
2
  import { components } from 'react-select'
3
3
 
4
- type IndicatorsContainerProps = {
5
- children: React.ReactNode,
6
- }
7
-
8
-
9
- const IndicatorsContainer = (props: IndicatorsContainerProps): React.ReactElement => (
4
+ const IndicatorsContainer = (props: any) => (
10
5
  <components.IndicatorsContainer
11
- className="text_input_indicators"
12
- {...props}
6
+ className="text_input_indicators"
7
+ {...props}
13
8
  />
14
9
  )
15
10
 
@@ -1,12 +1,7 @@
1
1
  import React from 'react'
2
2
  import { components } from 'react-select'
3
3
 
4
- type MenuListProps = {
5
- children: React.ReactNode,
6
- footer: React.ReactNode,
7
- }
8
-
9
- const MenuList = (props: MenuListProps): React.ReactElement => {
4
+ const MenuList = (props: any) => {
10
5
  return (
11
6
  <components.MenuList {...props}>
12
7
  {props.children}
@@ -3,22 +3,7 @@ import { components } from 'react-select'
3
3
 
4
4
  import User from '../../pb_user/_user'
5
5
 
6
- type OptionProps = {
7
- children: React.ReactNode,
8
- label?: string,
9
- data: {
10
- imageUrl?: string,
11
- },
12
- selectProps: {
13
- dark?: boolean,
14
- valueComponent?: (data: {
15
- imageUrl?: string,
16
- }) => React.ReactNode,
17
- },
18
- }
19
-
20
-
21
- const Option = (props: OptionProps): React.ReactElement => {
6
+ const Option = (props: any) => {
22
7
  const {
23
8
  imageUrl,
24
9
  } = props.data
@@ -29,11 +14,11 @@ const Option = (props: OptionProps): React.ReactElement => {
29
14
  <>
30
15
  {!valueComponent && imageUrl &&
31
16
  <User
32
- align="left"
33
- avatarUrl={imageUrl}
34
- dark={props.selectProps.dark}
35
- name={props.label}
36
- orientation="horizontal"
17
+ align="left"
18
+ avatarUrl={imageUrl}
19
+ dark={props.selectProps.dark}
20
+ name={props.label}
21
+ orientation="horizontal"
37
22
  />
38
23
  }
39
24
 
@@ -4,26 +4,19 @@ import { components } from 'react-select'
4
4
  import Flex from '../../pb_flex/_flex'
5
5
  import Icon from '../../pb_icon/_icon'
6
6
 
7
- type PlaceholderProps = {
8
- children: React.ReactNode,
9
- selectProps: {
10
- plusIcon?: boolean,
11
- },
12
- }
13
-
14
- const Placeholder = (props: PlaceholderProps): React.ReactElement => (
7
+ const Placeholder = (props: any) => (
15
8
  <>
16
9
  <Flex
17
- align="center"
18
- className="placeholder"
10
+ align="center"
11
+ className="placeholder"
19
12
  >
20
13
  <components.IndicatorsContainer
21
- {...props}
14
+ {...props}
22
15
  />
23
16
  {props.selectProps.plusIcon &&
24
17
  <Icon
25
- className="typeahead-plus-icon"
26
- icon="plus"
18
+ className="typeahead-plus-icon"
19
+ icon="plus"
27
20
  />
28
21
  }
29
22
  </Flex>
@@ -1,14 +1,10 @@
1
1
  import React from 'react'
2
2
  import { components } from 'react-select'
3
3
 
4
- type ValueContainerProps = {
5
- children: React.ReactNode,
6
- }
7
-
8
- const ValueContainer = (props: ValueContainerProps): React.ReactElement => (
4
+ const ValueContainer = (props: any) => (
9
5
  <components.ValueContainer
10
- className="text_input_value_container"
11
- {...props}
6
+ className="text_input_value_container"
7
+ {...props}
12
8
  />
13
9
  )
14
10
 
@@ -1,5 +1,3 @@
1
- /* eslint-disable react/no-multi-comp */
2
-
3
1
  import React, { useState } from 'react'
4
2
 
5
3
  import {
@@ -45,7 +45,8 @@ const promiseOptions = (inputValue) =>
45
45
 
46
46
  const TypeaheadWithPillsAsync = (props) => {
47
47
  const [users, setUsers] = useState([])
48
-
48
+ const handleOnChange = (value) => setUsers(formatUsers(value))
49
+ const formatValue = (users) => formatUsers(users)
49
50
  const formatUsers = (users) => {
50
51
  const results = () => (users.map((user) => {
51
52
  if (Object.keys(user)[0] === 'name' || Object.keys(user)[1] === 'id'){
@@ -57,9 +58,6 @@ const TypeaheadWithPillsAsync = (props) => {
57
58
  return results()
58
59
  }
59
60
 
60
- const handleOnChange = (value) => setUsers(formatUsers(value))
61
- const formatValue = (users) => formatUsers(users)
62
-
63
61
  return (
64
62
  <>
65
63
  {users && users.length > 0 && (
@@ -83,13 +83,13 @@ const TypeaheadWithPillsAsyncCustomOptions = (props) => {
83
83
  onChange={handleOnChange}
84
84
  onMultiValueClick={handleOnMultiValueClick}
85
85
  placeholder="type the name of a Github user"
86
- valueComponent={({imageUrl, label, territory, type}) => (
86
+ valueComponent={(props) => (
87
87
  <User
88
88
  avatar
89
- avatarUrl={imageUrl}
90
- name={label}
91
- territory={territory}
92
- title={type}
89
+ avatarUrl={props.imageUrl}
90
+ name={props.label}
91
+ territory={props.territory}
92
+ title={props.type}
93
93
  />
94
94
  )}
95
95
  {...props}