playbook_ui 13.16.0.pre.alpha.PBNTR177NewAdvancedTableKit2023 → 13.16.0.pre.alpha.PBNTR177NewAdvancedTableKit2035

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: 7de4a52108e01951e999ec72a392167e7ca613eedc6b2460454cea0fb265fcf8
4
- data.tar.gz: 33e05379b7d7004b6943995d1710a1b91a844942710e2c8ca62dbc6e6bbbda0c
3
+ metadata.gz: 175ddacedbfec513a95b37bf13a61333a099bd30e8421e4860f71c0388f11f1a
4
+ data.tar.gz: 72d03981d777dc247c76e68999859037ade97c566e696afc8b55b237ef5ac9dd
5
5
  SHA512:
6
- metadata.gz: 4e8d2d44b46b465a9d3cf4e954d0621abfc2da9cef8b9004f1d5e7e535f37bc57b8f4d54c46e26a2a4a79721c7e36e991ba9902170740b6ffe76f27a6becf207
7
- data.tar.gz: 9e2878d9346444289f740ae5f3804c871e02d7c49f6283351768e68ffbfd0f19d6215eba7ee897cdb947ca332a2d802cd40ce8d5f118ff07b176707c0a1c9add
6
+ metadata.gz: 802f5962c3902b281230c7679161ebd2299befb957ebc27595e423be42bbe2a28791524dbc038fbb3ff345d4899daaa47ea72da30390f616bd7e5781cc0ad8e3
7
+ data.tar.gz: 949b717b13f2ac5f2c1e5627e79df7c99e0a3568c8c19b804a65056abf7a7d18d756cefd5149a9bf10bbf27d9c09f4764242aa98f870b814fe994a4e382c790c
@@ -4,7 +4,7 @@ import React from "react"
4
4
  const CollapsibleTrail = ({ leftOffset }: { leftOffset: number }) => {
5
5
  const style: { [key: string]: string | number } = {
6
6
  position: "absolute",
7
- left: `${leftOffset}rem`,
7
+ left: `${leftOffset}em`,
8
8
  top: 0,
9
9
  bottom: 0,
10
10
  width: "2px",
@@ -19,8 +19,8 @@ export const renderCollapsibleTrail = (currentDepth: number) => {
19
19
  const lines = []
20
20
  for (let i = 1; i <= currentDepth; i++) {
21
21
  // Calculate leftOffset with additional 0.4rem for each depth level above 1
22
- const additionalOffset = i > 1 ? (i - 1) * 0.4 : 0
23
- const leftOffset = i * 1.6 + additionalOffset
22
+ const additionalOffset = i > 1 ? (i - 1) * 0.25 : 0
23
+ const leftOffset = i * 1.0 + additionalOffset
24
24
  lines.push(<CollapsibleTrail key={i}
25
25
  leftOffset={leftOffset}
26
26
  />
@@ -31,7 +31,7 @@ export const CustomCell = ({
31
31
  };
32
32
 
33
33
  return (
34
- <div style={{ paddingLeft: `${row.depth * 2}rem` }}>
34
+ <div style={{ paddingLeft: `${row.depth * 1.25}em` }}>
35
35
  <Flex alignItems="center"
36
36
  columnGap="xs"
37
37
  orientation="row"
@@ -42,11 +42,14 @@ export const CustomCell = ({
42
42
  onClick={() => handleOnExpand(row)}
43
43
  >
44
44
  {row.getIsExpanded() ? (
45
- <Icon icon="circle-play"
45
+ <Icon cursor="pointer"
46
+ icon="circle-play"
46
47
  rotation={90}
47
48
  />
48
49
  ) : (
49
- <Icon icon="circle-play" />
50
+ <Icon cursor="pointer"
51
+ icon="circle-play"
52
+ />
50
53
  )}
51
54
  </button>
52
55
  ) : null}
@@ -13,13 +13,13 @@ export const SortIconButton = ({ header, sortIcon }: SortIconButtonProps) => {
13
13
  return (
14
14
  <>
15
15
  {header.column.getIsSorted() === "desc" ? (
16
- <div className="year-sort-icon"
16
+ <div className="sort-button-icon"
17
17
  key={displayIcon(sortIcon)[0]}
18
18
  >
19
19
  <Icon icon={displayIcon(sortIcon)[0]} />
20
20
  </div>
21
21
  ) : (
22
- <div className="year-sort-icon"
22
+ <div className="sort-button-icon"
23
23
  key={displayIcon(sortIcon)[1]}
24
24
  >
25
25
  <Icon icon={displayIcon(sortIcon)[1]} />
@@ -38,7 +38,7 @@ export const SubRowHeaderRow = ({
38
38
  colSpan={1}
39
39
  >
40
40
  {collapsibleTrail && row.depth > 0 && renderCollapsibleTrail(row.depth)}
41
- <div style={{ paddingLeft: `${row.depth * 2}rem` }}>
41
+ <div style={{ paddingLeft: `${row.depth * 1.25}em` }}>
42
42
  <Flex align="center"
43
43
  columnGap="xs"
44
44
  >
@@ -14,7 +14,7 @@ export const ToggleIconButton = ({ row, onClick }: ToggleIconButtonProps) => {
14
14
  const { toggleExpansionIcon } = useContext(AdvancedTableContext)
15
15
  return (
16
16
  <button
17
- className="gray-icon time-period-toggle-icon"
17
+ className="gray-icon toggle-all-icon"
18
18
  key={displayIcon(toggleExpansionIcon)[0]}
19
19
  onClick={() => onClick(row)}
20
20
  >
@@ -46,12 +46,12 @@
46
46
  @extend %primary-color-pseudo;
47
47
  }
48
48
 
49
- .year-sort-icon {
49
+ .sort-button-icon {
50
50
  @extend .button-icon;
51
51
  padding: 2px;
52
52
  }
53
53
 
54
- .time-period-toggle-icon {
54
+ .toggle-all-icon {
55
55
  @extend .button-icon;
56
56
  @extend %primary-color-pseudo;
57
57
  padding: 2px 0;
@@ -0,0 +1,57 @@
1
+ import React from "react";
2
+ import { AdvancedTable } from "../..";
3
+ import { MOCK_DATA } from "./_mock_data";
4
+
5
+ const AdvancedTableSort = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ];
37
+
38
+ //Render the subRow header rows
39
+ const subRowHeaders = ["Quarter", "Month", "Day"]
40
+
41
+
42
+ return (
43
+ <div>
44
+ <AdvancedTable
45
+ columnDefinitions={columnDefinitions}
46
+ enableToggleExpansion="all"
47
+ tableData={MOCK_DATA}
48
+ {...props}
49
+ >
50
+ <AdvancedTable.Header enableSorting />
51
+ <AdvancedTable.Body subRowHeaders={subRowHeaders} />
52
+ </AdvancedTable>
53
+ </div>
54
+ );
55
+ };
56
+
57
+ export default AdvancedTableSort;
@@ -1,5 +1,6 @@
1
1
  examples:
2
2
  react:
3
3
  - advanced_table_default: Default
4
+ - advanced_table_sort: All in One
4
5
 
5
6
 
@@ -1 +1,2 @@
1
1
  export { default as AdvancedTableDefault } from './_advanced_table_default.jsx'
2
+ export { default as AdvancedTableSort } from './_advanced_table_sort.jsx'
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "13.16.0"
5
- VERSION = "13.16.0.pre.alpha.PBNTR177NewAdvancedTableKit2023"
5
+ VERSION = "13.16.0.pre.alpha.PBNTR177NewAdvancedTableKit2035"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.16.0.pre.alpha.PBNTR177NewAdvancedTableKit2023
4
+ version: 13.16.0.pre.alpha.PBNTR177NewAdvancedTableKit2035
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-01-29 00:00:00.000000000 Z
12
+ date: 2024-01-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -289,6 +289,7 @@ files:
289
289
  - app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx
290
290
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.jsx
291
291
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.md
292
+ - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.jsx
292
293
  - app/pb_kits/playbook/pb_advanced_table/docs/_description.md
293
294
  - app/pb_kits/playbook/pb_advanced_table/docs/_mock_data.js
294
295
  - app/pb_kits/playbook/pb_advanced_table/docs/example.yml