playbook_ui_docs 14.12.0.pre.rc.2 → 14.12.0.pre.rc.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a47e2f352693ab2e2cdf8118003f420e1128c93668d7527970c2960856cb8cb6
4
- data.tar.gz: e90be0260c74536098e3ae8b7bdda97cc5f5e38c2baeb986c52099240e54d148
3
+ metadata.gz: 03ab0360c79c6a5fa58886b17de9636de65a1d672da2e6a782003b800957f460
4
+ data.tar.gz: bf16202865758e19e90dcf44751c0e9075eb87e8543bd23a510b214b9af82eb4
5
5
  SHA512:
6
- metadata.gz: 31b2f748a4d34571f95891614fc5ea77e469370fdd724e8a2de5522df5f6595b0a03f6266acbf53dfeae040caf1e9d1e158de2a7e5fed07a3d6a74f7845901dc
7
- data.tar.gz: cd13ca6eea025bb65cf70bce8b030948ff49cff008672193cc9e8213e3e789c4c052a4007267e5b56f1183ab76235795caaabeee777f35bb55f009fe4f93ab9e
6
+ metadata.gz: 6c6830d31f04415d09786bc3ab000df8ee2dee6f9bec26e413fa91f7a6bdb705424968cf5443ffb747a9431f4cc4ec371265dcd2cafc976f95e8fe2e06df094b
7
+ data.tar.gz: 2087b394fcb2b7e4d2fc47643096ea821ad5cfef493a1e2a8ee44dec6f270ae28d44b8d3609bf150132011257c7c18bc0ab160281b3f6784b9cb63fc3488e970
@@ -0,0 +1,33 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ accessor: "newEnrollments",
9
+ label: "New Enrollments",
10
+ },
11
+ {
12
+ accessor: "scheduledMeetings",
13
+ label: "Scheduled Meetings",
14
+ },
15
+ {
16
+ accessor: "attendanceRate",
17
+ label: "Attendance Rate",
18
+ },
19
+ {
20
+ accessor: "completedClasses",
21
+ label: "Completed Classes",
22
+ },
23
+ {
24
+ accessor: "classCompletionRate",
25
+ label: "Class Completion Rate",
26
+ },
27
+ {
28
+ accessor: "graduatedStudents",
29
+ label: "Graduated Students",
30
+ }
31
+ ] %>
32
+
33
+ <%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, column_definitions: column_definitions, table_props: { container: false, sticky: true }}) %>
@@ -0,0 +1 @@
1
+ This kit uses the [Table kit](https://playbook.powerapp.cloud/kits/table) under the hood which comes with it's own set of props. If you want to apply certain Table props to that underlying kit, you can do so by using the optional `table_props` prop. This prop must be an object that contains valid Table props. For a full list of Table props, see [here](https://playbook.powerapp.cloud/kits/table).
@@ -3,6 +3,7 @@ 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
6
7
  - advanced_table_beta_sort: Enable Sorting
7
8
  - advanced_table_custom_cell_rails: Custom Components for Cells
8
9
  - advanced_table_column_headers: Multi-Header Columns
@@ -1,3 +1,5 @@
1
+ /* eslint-disable react/no-multi-comp */
2
+
1
3
  import React, { useState } from 'react'
2
4
 
3
5
  import {
@@ -45,8 +45,7 @@ const promiseOptions = (inputValue) =>
45
45
 
46
46
  const TypeaheadWithPillsAsync = (props) => {
47
47
  const [users, setUsers] = useState([])
48
- const handleOnChange = (value) => setUsers(formatUsers(value))
49
- const formatValue = (users) => formatUsers(users)
48
+
50
49
  const formatUsers = (users) => {
51
50
  const results = () => (users.map((user) => {
52
51
  if (Object.keys(user)[0] === 'name' || Object.keys(user)[1] === 'id'){
@@ -58,6 +57,9 @@ const TypeaheadWithPillsAsync = (props) => {
58
57
  return results()
59
58
  }
60
59
 
60
+ const handleOnChange = (value) => setUsers(formatUsers(value))
61
+ const formatValue = (users) => formatUsers(users)
62
+
61
63
  return (
62
64
  <>
63
65
  {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={(props) => (
86
+ valueComponent={({imageUrl, label, territory, type}) => (
87
87
  <User
88
88
  avatar
89
- avatarUrl={props.imageUrl}
90
- name={props.label}
91
- territory={props.territory}
92
- title={props.type}
89
+ avatarUrl={imageUrl}
90
+ name={label}
91
+ territory={territory}
92
+ title={type}
93
93
  />
94
94
  )}
95
95
  {...props}