playbook_ui 13.10.0.pre.alpha.PLAY1046multilevelsingleselectphase21365 → 13.10.0.pre.alpha.dependabotnpmandyarntiptapextensionlink21121407

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_button/docs/_button_circle_swift.md +28 -0
  3. data/app/pb_kits/playbook/pb_button/docs/_button_default_swift.md +23 -0
  4. data/app/pb_kits/playbook/pb_button/docs/_button_full_width_swift.md +9 -0
  5. data/app/pb_kits/playbook/pb_button/docs/_button_icon_options_swift.md +18 -0
  6. data/app/pb_kits/playbook/pb_button/docs/_button_props_swift.md +11 -0
  7. data/app/pb_kits/playbook/pb_button/docs/_button_size_swift.md +20 -0
  8. data/app/pb_kits/playbook/pb_button/docs/example.yml +8 -0
  9. data/app/pb_kits/playbook/pb_card/docs/_card_background_swift.md +29 -0
  10. data/app/pb_kits/playbook/pb_card/docs/_card_border_none_swift.md +7 -0
  11. data/app/pb_kits/playbook/pb_card/docs/_card_border_radius_swift.md +33 -0
  12. data/app/pb_kits/playbook/pb_card/docs/_card_header_swift.md +33 -0
  13. data/app/pb_kits/playbook/pb_card/docs/_card_highlight_swift.md +17 -0
  14. data/app/pb_kits/playbook/pb_card/docs/_card_light_swift.md +7 -0
  15. data/app/pb_kits/playbook/pb_card/docs/_card_padding_swift.md +33 -0
  16. data/app/pb_kits/playbook/pb_card/docs/_card_props_swift.md +10 -0
  17. data/app/pb_kits/playbook/pb_card/docs/_card_selected_swift.md +0 -0
  18. data/app/pb_kits/playbook/pb_card/docs/_card_separator_swift.md +11 -0
  19. data/app/pb_kits/playbook/pb_card/docs/_card_shadow_swift.md +21 -0
  20. data/app/pb_kits/playbook/pb_card/docs/_card_styles_swift.md +17 -0
  21. data/app/pb_kits/playbook/pb_card/docs/_card_tag_swift.md +0 -0
  22. data/app/pb_kits/playbook/pb_card/docs/example.yml +12 -0
  23. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +19 -24
  24. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_selected_ids.html.erb +1 -0
  25. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single.html.erb +45 -104
  26. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single.jsx +43 -100
  27. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +0 -2
  28. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -1
  29. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +0 -3
  30. data/app/pb_kits/playbook/pb_table/docs/_table_header.html.erb +47 -31
  31. data/app/pb_kits/playbook/pb_table/docs/_table_header.md +5 -0
  32. data/app/pb_kits/playbook/pb_table/table_header.html.erb +1 -1
  33. data/dist/playbook-rails.js +5 -5
  34. data/lib/playbook/version.rb +1 -1
  35. metadata +21 -4
  36. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_children_only.html.erb +0 -139
  37. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_children_only.jsx +0 -151
@@ -3,126 +3,69 @@ import MultiLevelSelect from "../_multi_level_select";
3
3
 
4
4
  const treeData = [
5
5
  {
6
- label: "HQ",
7
- value: "HQ",
8
- id: "hq",
9
- },
10
- {
11
- label: "Philadelphia",
12
- value: "Philadelphia",
13
- id: "phl",
6
+ label: "Power Home Remodeling",
7
+ value: "Power Home Remodeling",
8
+ id: "powerhome2",
9
+ expanded: true,
14
10
  children: [
15
11
  {
16
- label: "Marketing & Sales PHL",
17
- value: "Marketing & Sales PHL",
18
- id: "marketingPHL",
19
- },
20
- {
21
- label: "Installation Office PHL",
22
- value: "Installation Office PHL",
23
- id: "installationPHL",
24
- },
25
- {
26
- label: "Warehouse PHL",
27
- value: "Warehouse PHL",
28
- id: "warehousePHL",
29
- },
30
- ]
31
- },
32
- {
33
- label: "New Jersey",
34
- value: "New Jersey",
35
- id: "nj",
36
- children: [
37
- {
38
- label: "New Jersey",
39
- value: "New Jersey",
40
- id: "nj1",
12
+ label: "People",
13
+ value: "People",
14
+ id: "people2",
15
+ expanded: true,
41
16
  children: [
42
17
  {
43
- label: "Marketing & Sales NJ",
44
- value: "Marketing & Sales NJ",
45
- id: "marketingNJ",
18
+ label: "Talent Acquisition",
19
+ value: "Talent Acquisition",
20
+ id: "talent2",
46
21
  },
47
22
  {
48
- label: "Installation Office NJ",
49
- value: "Installation Office NJ",
50
- id: "installationNJ",
23
+ label: "Business Affairs",
24
+ value: "Business Affairs",
25
+ id: "business2",
26
+ children: [
27
+ {
28
+ label: "Initiatives",
29
+ value: "Initiatives",
30
+ id: "initiative2",
31
+ },
32
+ {
33
+ label: "Learning & Development",
34
+ value: "Learning & Development",
35
+ id: "development2",
36
+ },
37
+ ],
51
38
  },
52
39
  {
53
- label: "Warehouse NJ",
54
- value: "Warehouse NJ",
55
- id: "warehouseNJ",
40
+ label: "People Experience",
41
+ value: "People Experience",
42
+ id: "experience2",
56
43
  },
57
44
  ],
58
45
  },
59
46
  {
60
- label: "Princeton",
61
- value: "Princeton",
62
- id: "princeton",
47
+ label: "Contact Center",
48
+ value: "Contact Center",
49
+ id: "contact2",
63
50
  children: [
64
51
  {
65
- label: "Marketing & Sales Princeton",
66
- value: "Marketing & Sales Princeton",
67
- id: "marketingPR",
52
+ label: "Appointment Management",
53
+ value: "Appointment Management",
54
+ id: "appointment2",
68
55
  },
69
56
  {
70
- label: "Installation Office Princeton",
71
- value: "Installation Office Princeton",
72
- id: "installationPR",
57
+ label: "Customer Service",
58
+ value: "Customer Service",
59
+ id: "customer2",
73
60
  },
74
61
  {
75
- label: "Warehouse Princeton",
76
- value: "Warehouse Princeton",
77
- id: "warehousePR",
62
+ label: "Energy",
63
+ value: "Energy",
64
+ id: "energy2",
78
65
  },
79
- ]
80
- },
81
- ]
82
- },
83
- {
84
- label: "Maryland",
85
- value: "Maryland",
86
- id: "MD",
87
- children: [
88
- {
89
- label: "Marketing & Sales MD",
90
- value: "Marketing & Sales MD",
91
- id: "marketingMD",
92
- },
93
- {
94
- label: "Installation Office MD",
95
- value: "Installation Office MD",
96
- id: "installationMD",
97
- },
98
- {
99
- label: "Warehouse MD",
100
- value: "Warehouse MD",
101
- id: "warehouseMD",
102
- },
103
- ]
104
- },
105
- {
106
- label: "Connecticut",
107
- value: "Connecticut",
108
- id: "CT",
109
- children: [
110
- {
111
- label: "Marketing & Sales CT",
112
- value: "Marketing & Sales CT",
113
- id: "marketingCT",
114
- },
115
- {
116
- label: "Installation Office CT",
117
- value: "Installation Office CT",
118
- id: "installationCT",
119
- },
120
- {
121
- label: "Warehouse CT",
122
- value: "Warehouse CT",
123
- id: "warehouseCT",
66
+ ],
124
67
  },
125
- ]
68
+ ],
126
69
  },
127
70
  ];
128
71
 
@@ -2,7 +2,6 @@ examples:
2
2
  rails:
3
3
  - multi_level_select_default: Default
4
4
  - multi_level_select_single: Single Select
5
- - multi_level_select_single_children_only: Single Select Ultimate Children Only
6
5
  - multi_level_select_return_all_selected: Return All Selected
7
6
  - multi_level_select_selected_ids: Selected Ids
8
7
  - multi_level_select_with_form: With Form
@@ -10,6 +9,5 @@ examples:
10
9
  react:
11
10
  - multi_level_select_default: Default
12
11
  - multi_level_select_single: Single Select
13
- - multi_level_select_single_children_only: Single Select Ultimate Children Only
14
12
  - multi_level_select_return_all_selected: Return All Selected
15
13
  - multi_level_select_selected_ids: Selected Ids
@@ -1,5 +1,4 @@
1
1
  export { default as MultiLevelSelectDefault } from './_multi_level_select_default.jsx'
2
2
  export { default as MultiLevelSelectSingle } from './_multi_level_select_single.jsx'
3
- export { default as MultiLevelSelectSingleChildrenOnly } from './_multi_level_select_single_children_only.jsx'
4
3
  export { default as MultiLevelSelectReturnAllSelected } from './_multi_level_select_return_all_selected.jsx'
5
4
  export { default as MultiLevelSelectSelectedIds } from "./_multi_level_select_selected_ids.jsx"
@@ -16,8 +16,6 @@ module Playbook
16
16
  default: "pills"
17
17
  prop :input_name, type: Playbook::Props::String,
18
18
  default: ""
19
- prop :ultimate_children_only, type: Playbook::Props::Boolean,
20
- default: false
21
19
  prop :variant, type: Playbook::Props::Enum,
22
20
  values: %w[multi single],
23
21
  default: "multi"
@@ -35,7 +33,6 @@ module Playbook
35
33
  returnAllSelected: return_all_selected,
36
34
  selectedIds: selected_ids,
37
35
  input_name: input_name,
38
- ultimateChildrenOnly: ultimate_children_only,
39
36
  variant: variant,
40
37
  }
41
38
  end
@@ -1,12 +1,37 @@
1
- <%= pb_rails("table", props: { size: "lg"} ) do %>
1
+ <%# Example data for demonstration purposes %>
2
+ <% data_rows = [
3
+ { 'territory' => 'North', 'firstname' => 'John', 'lastname' => 'Doe', 'age' => 30, 'job' => 'Engineer' },
4
+ { 'territory' => 'South', 'firstname' => 'Alice', 'lastname' => 'Smith', 'age' => 28, 'job' => 'Designer' },
5
+ { 'territory' => 'East', 'firstname' => 'Mike', 'lastname' => 'Johnson', 'age' => 35, 'job' => 'Manager' },
6
+ { 'territory' => 'West', 'firstname' => 'Sarah', 'lastname' => 'Brown', 'age' => 29, 'job' => 'Developer' },
7
+ { 'territory' => 'Central', 'firstname' => 'David', 'lastname' => 'Wilson', 'age' => 32, 'job' => 'Analyst' }
8
+ ]
9
+ %>
10
+
11
+ <%# Example sort method for demonstration purposes %>
12
+ <% if params["sort"] %>
13
+ <% sort_param = params["sort"].gsub(/_(asc|desc)\z/, "") %>
14
+ <% sort_direction = params["sort"].end_with?("_asc") ? 1 : -1 %>
15
+ <% data_rows.sort! do |a, b|
16
+ value_a = a[sort_param]
17
+ value_b = b[sort_param]
18
+
19
+ value_a = value_a.to_i if value_a.is_a?(String) && value_a.match?(/^\d+$/)
20
+ value_b = value_b.to_i if value_b.is_a?(String) && value_b.match?(/^\d+$/)
21
+
22
+ sort_direction * (value_a <=> value_b)
23
+ end %>
24
+ <% end %>
25
+
26
+ <%= pb_rails("table", props: { data_table: true, vertical_border: true, id: "table-header" } ) do %>
2
27
  <thead>
3
28
  <tr>
4
29
  <%= pb_rails("table/table_header", props: {
5
30
  text: "Territory",
6
31
  id: "territory",
7
32
  sort_menu: [
8
- { item: "Territory", link: "?sort=territory_desc", active: params["sort"] == "territory_desc", direction: "desc" },
9
- { item: "Territory", link: "?sort=territory_asc", active: params["sort"] == "territory_asc", direction: "asc" }
33
+ { item: "Territory", link: "?sort=territory_asc#table-header", active: params["sort"] == "territory_asc", direction: "asc" },
34
+ { item: "Territory", link: "?sort=territory_desc#table-header", active: params["sort"] == "territory_desc", direction: "desc" }
10
35
  ],
11
36
  }) %>
12
37
  <%= pb_rails("table/table_header", props: {
@@ -14,45 +39,36 @@
14
39
  text: "Full Name",
15
40
  colspan: 2,
16
41
  sort_menu: [
17
- { item: "First Name Descending", link: "?sort=firstname_desc", active: params["sort"] == "firstname_desc", direction: "desc" },
18
- { item: "First Name Ascending", link: "?sort=firstname_asc", active: params["sort"] == "firstname_asc", direction: "asc" },
19
- { item: "Last Name Descending", link: "?sort=lastname_desc", active: params["sort"] == "lastname_desc", direction: "desc" },
20
- { item: "Last Name Ascending", link: "?sort=lastname_asc", active: params["sort"] == "lastname_asc", direction: "asc" }
42
+ { item: "First Name Descending", link: "?sort=firstname_desc#table-header", active: params["sort"] == "firstname_desc", direction: "desc" },
43
+ { item: "First Name Ascending", link: "?sort=firstname_asc#table-header", active: params["sort"] == "firstname_asc", direction: "asc" },
44
+ { item: "Last Name Descending", link: "?sort=lastname_desc#table-header", active: params["sort"] == "lastname_desc", direction: "desc" },
45
+ { item: "Last Name Ascending", link: "?sort=lastname_asc#table-header", active: params["sort"] == "lastname_asc", direction: "asc" }
21
46
  ],
22
47
  }) %>
23
48
  <%= pb_rails("table/table_header", props: {
24
49
  text: "Age",
25
50
  id: "age",
26
- sort_dropdown: true,
27
51
  sort_menu: [
28
- { item: "Age Descending", link: "?sort=age_desc", active: params["sort"] == "age_desc", direction: "desc" },
29
- { item: "Age Ascending", link: "?sort=age_asc", active: params["sort"] == "age_asc", direction: "asc" }
52
+ { item: "Age Descending", link: "?sort=age_desc#table-header", active: params["sort"] == "age_desc", direction: "desc" },
53
+ { item: "Age Ascending", link: "?sort=age_asc#table-header", active: params["sort"] == "age_asc", direction: "asc" }
30
54
  ],
31
55
  }) %>
32
56
  <%= pb_rails("table/table_header", props: { text: "Job Title" }) %>
33
57
  </tr>
34
58
  </thead>
35
59
  <tbody>
36
- <tr>
37
- <td>Ter 1</td>
38
- <td>First Name 1</td>
39
- <td>Last Name 1</td>
40
- <td>Age 1</td>
41
- <td>Job 1</td>
42
- </tr>
43
- <tr>
44
- <td>Ter 2</td>
45
- <td>First Name 2</td>
46
- <td>Last Name 2</td>
47
- <td>Age 2</td>
48
- <td>Job 2</td>
49
- </tr>
50
- <tr>
51
- <td>Ter 3</td>
52
- <td>First Name 3</td>
53
- <td>Last Name 3</td>
54
- <td>Age 3</td>
55
- <td>Job 3</td>
56
- </tr>
60
+ <% data_rows.each do |row| %>
61
+ <tr>
62
+ <% row.each do |key, value| %>
63
+ <%= pb_rails("background", props: {
64
+ background_color: (params["sort"] && params["sort"].start_with?(key) ? "info_subtle" : "card_light"),
65
+ text_align: (value.is_a?(Integer) ? "right" : ""),
66
+ tag: "td"
67
+ }) do %>
68
+ <%= value %>
69
+ <% end %>
70
+ <% end %>
71
+ </tr>
72
+ <% end %>
57
73
  </tbody>
58
74
  <% end %>
@@ -6,3 +6,8 @@ presence of `sort_menu` enables the sort link within the header
6
6
  * `sort_dropdown` (boolean) optionally declares that (true) clicking a header's sort link opens a dropdown of sort options, or (false) each sort link click cycles through available sort_menu items in the order they are passed
7
7
  * passing a valid `colspan` will render sort options within a dropdown by default, without requiring `sort_dropdown` explicitly. Alternatively, the default sort dropdown can be prevented on headers with `colspan` by setting `sort_dropdown: false`, which reverts the column to sorting to multi-click default (each click of the sort link cycles through the available sort_menu items in the order they are passed)
8
8
  * `id` (string) is required for headers that have a dropdown (for popover reference); otherwise they are optional
9
+
10
+ </br>
11
+ <div class="pb_pill_kit_warning"><div class="pb_title_kit_size_4 pb_pill_text">Disclaimer</div></div>
12
+
13
+ This example uses a custom sort method that may need to be modified or replaced within your project.
@@ -3,7 +3,7 @@
3
3
  aria: object.aria,
4
4
  class: object.classname,
5
5
  data: object.data,
6
- id: "pb-th#{object.id}") do %>
6
+ id: "pb-th#{object.id}" ) do %>
7
7
  <% unless sorting_style? %>
8
8
  <%= pb_rails("flex", props:{ align: object.align_content, justify: object.justify_sort_icon, classname: "pb_th_nolink" }) do %>
9
9
  <%= content.presence || object.text %>