playbook_ui 16.8.0.pre.alpha.tablewidths16466 → 16.8.0.pre.rc.0

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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +0 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +0 -2
  4. data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +1 -5
  5. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +0 -24
  6. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +0 -144
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.jsx +0 -1
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.md +0 -6
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.json +5807 -148
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.overrides.json +30 -5
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_column_definitions_styling.json +1 -4
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -1
  14. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +19 -1
  15. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +8 -5
  16. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +12 -0
  17. data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +26 -0
  18. data/app/pb_kits/playbook/pb_date_range_stacked/docs/_playground.json +1 -1
  19. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +58 -0
  20. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +2 -0
  21. data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +7 -1
  22. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +1 -1
  23. data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +43 -262
  24. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +0 -2
  25. data/app/pb_kits/playbook/pb_rich_text_editor/kit.schema.json +9 -18
  26. data/app/pb_kits/playbook/pb_select/select.rb +9 -0
  27. data/app/pb_kits/playbook/pb_text_input/text_input.rb +9 -0
  28. data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +102 -133
  29. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +41 -54
  30. data/app/pb_kits/playbook/pb_tooltip/tooltip.test.jsx +2 -60
  31. data/dist/chunks/{_pb_line_graph-BgsTI0CL.js → _pb_line_graph-D7f-RfJJ.js} +1 -1
  32. data/dist/chunks/_typeahead-Cl5cZ7Hz.js +1 -0
  33. data/dist/chunks/{globalProps-DOB47YGB.js → globalProps-BwwZkfTI.js} +1 -1
  34. data/dist/chunks/{lib-BzglXly2.js → lib-Ch18RlJa.js} +2 -2
  35. data/dist/chunks/vendor.js +3 -3
  36. data/dist/menu.yml +2 -1
  37. data/dist/playbook-rails-react-bindings.js +1 -1
  38. data/dist/playbook-rails.js +1 -1
  39. data/dist/playbook.css +1 -1
  40. data/lib/playbook/version.rb +2 -2
  41. metadata +6 -16
  42. data/app/pb_kits/playbook/pb_advanced_table/Utilities/ColumnLayoutHelper.ts +0 -138
  43. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width.jsx +0 -57
  44. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_width.md +0 -66
  45. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_default.html.erb +0 -1
  46. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_default.md +0 -12
  47. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_simple.html.erb +0 -9
  48. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_simple.md +0 -8
  49. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.html.erb +0 -162
  50. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +0 -71
  51. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor_rails.js +0 -202
  52. data/dist/chunks/_typeahead-D2TWdJTn.js +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f46fd7de41487efa37647c36cc3d1d55e2260ccda34ff0f094dc4f3c21608c4
4
- data.tar.gz: 60e1b0388423c2a75088ba9210b0e9456c27fb7a7b5822b5753f1c46f1abfa53
3
+ metadata.gz: bf26b3a5bc84db3c0723985d97147839159d420ec7ea3041a24ce948eb307702
4
+ data.tar.gz: 6aabd8a4a3b3d75c8fd5bdf423caefbfbee870867a44efd283cd5e5300a13ad0
5
5
  SHA512:
6
- metadata.gz: 236bb6ec1f254c88d37bfa99aa2bb530aba234550a5635bfd19c9bb76fe0240bf818ccd4f2b859424662c2e15d1f31cae47d0831e172a9c2926e1eaa4cf3ade7
7
- data.tar.gz: 63776f5d3b77b41da7a95ad4d67e89d244a0981fb8cc2220c3fc8996f5506eb2b4f94cf30989d848afc83d2104dbe17092e00851e4b4cd46ebd5a63985ddb543
6
+ metadata.gz: 183ca9c2fc15ecde3a04ccb900578161d4a6941c096fb7ccac1fd122f4bb9873058d510a56be5fa775504b0da702b3a65ea7f9c8f3f84b37ab5e9d0242f2a563
7
+ data.tar.gz: 5d44fe619ba3ab8ac29b60e45d0d365a13314c4928bf9de29128179cf6fc18ed747b1e91864c27bcb6223fd9d21d87a6a35f31345a202d98de5ff579da747ff0
@@ -5,7 +5,6 @@ import { flexRender, Row, Cell } from "@tanstack/react-table"
5
5
  import { GenericObject } from "../../types"
6
6
  import { isChrome } from "../Utilities/BrowserCheck"
7
7
  import { findColumnDefByAccessor } from "../Utilities/ColumnStylingHelper"
8
- import { playbookColumnLayoutStylesFromMeta } from "../Utilities/ColumnLayoutHelper"
9
8
  import { getRowColorClass, shouldShowLoadingIndicator } from "../Utilities/RowUtils"
10
9
 
11
10
  import LoadingInline from "../../pb_loading_inline/_loading_inline"
@@ -95,7 +94,6 @@ const TableCellRenderer = ({
95
94
  )}
96
95
  key={`${cell.id}-data`}
97
96
  style={{
98
- ...playbookColumnLayoutStylesFromMeta(column.columnDef),
99
97
  left: isPinnedLeft
100
98
  ? i === 1 // Accounting for set min-width for first column
101
99
  ? '180px'
@@ -16,7 +16,6 @@ import { SortIconButton } from "./SortIconButton"
16
16
  import { ToggleIconButton } from "./ToggleIconButton"
17
17
  import { displayIcon } from "../Utilities/IconHelpers"
18
18
  import { findColumnDefByAccessor } from "../Utilities/ColumnStylingHelper"
19
- import { playbookColumnLayoutStylesFromMeta } from "../Utilities/ColumnLayoutHelper"
20
19
  import { updateExpandAndCollapseState } from "../Utilities/ExpansionControlHelpers"
21
20
 
22
21
  import { isChrome } from "../Utilities/BrowserCheck"
@@ -199,7 +198,6 @@ const isToggleExpansionEnabled =
199
198
  id={cellId}
200
199
  key={`${header?.id}-header`}
201
200
  style={{
202
- ...playbookColumnLayoutStylesFromMeta(header?.column?.columnDef),
203
201
  backgroundColor: headerBackgroundColor,
204
202
  color: headerFontColor,
205
203
  left: isPinnedLeft
@@ -19,7 +19,6 @@ import { LoadingCell } from "../Components/LoadingCell"
19
19
  import { renderCollapsibleTrail } from "../Components/CollapsibleTrail"
20
20
 
21
21
  import AdvancedTableContext from "../Context/AdvancedTableContext"
22
- import { playbookColumnLayoutStylesFromMeta } from "../Utilities/ColumnLayoutHelper"
23
22
 
24
23
  type VirtualizedTableViewProps = {
25
24
  collapsibleTrail?: boolean
@@ -225,10 +224,7 @@ export const VirtualizedTableView = ({
225
224
  isLastCell && 'last-cell',
226
225
  )}
227
226
  key={`${cell.id}-data`}
228
- style={{
229
- ...playbookColumnLayoutStylesFromMeta(cell.column.columnDef),
230
- width: cellWidth,
231
- }}
227
+ style={{ width: cellWidth }}
232
228
  >
233
229
  {collapsibleTrail && i === 0 && row.depth > 0 && renderCollapsibleTrail(row.depth)}
234
230
  <span id={`${cell.id}-span`}>
@@ -12,10 +12,6 @@ import {
12
12
  import { GenericObject } from "../../types";
13
13
  import { createColumnHelper } from "@tanstack/react-table";
14
14
  import { createCellFunction } from "../Utilities/CellRendererUtils";
15
- import {
16
- buildPlaybookColumnLayoutStyles,
17
- buildTanStackSizingFromColumn,
18
- } from "../Utilities/ColumnLayoutHelper";
19
15
  import { getParentOnlySortedRowModel } from "../Utilities/RowModelUtils";
20
16
 
21
17
  interface UseTableStateProps {
@@ -109,31 +105,11 @@ export function useTableState({
109
105
  columns: buildColumns(column.columns, false),
110
106
  };
111
107
  }
112
- const tanStackSizing = buildTanStackSizingFromColumn(column);
113
- const layoutStyles = buildPlaybookColumnLayoutStyles(column, tanStackSizing);
114
- const userMeta =
115
- column.meta &&
116
- typeof column.meta === "object" &&
117
- !Array.isArray(column.meta)
118
- ? column.meta
119
- : {};
120
- const hasLayoutStyles =
121
- layoutStyles.width !== undefined ||
122
- layoutStyles.minWidth !== undefined ||
123
- layoutStyles.maxWidth !== undefined;
124
-
125
108
  // Define the base column structure
126
109
  const columnStructure = {
127
110
  ...columnHelper.accessor(column.accessor, {
128
111
  header: column.header ?? column.label ?? "",
129
112
  enableSorting: isFirstColumn || column.enableSort === true,
130
- ...tanStackSizing,
131
- meta: {
132
- ...userMeta,
133
- ...(hasLayoutStyles
134
- ? { playbookColumnLayoutStyles: layoutStyles }
135
- : {}),
136
- },
137
113
  }),
138
114
  };
139
115
 
@@ -774,150 +774,6 @@ test("columnStyling.cellPadding sets cell padding", () => {
774
774
  expect(firstEnrollmentCell).toHaveClass('p_none')
775
775
  });
776
776
 
777
- test("columnStyling minWidth, width, and maxWidth apply to header and body cells", () => {
778
- const styledColumnDefs = [
779
- {
780
- accessor: "year",
781
- label: "Year",
782
- cellAccessors: ["quarter", "month", "day"],
783
- columnStyling: { minWidth: 240, width: 260, maxWidth: 400 },
784
- },
785
- {
786
- accessor: "newEnrollments",
787
- label: "New Enrollments",
788
- },
789
- {
790
- accessor: "scheduledMeetings",
791
- label: "Scheduled Meetings",
792
- },
793
- ];
794
-
795
- render(
796
- <AdvancedTable
797
- columnDefinitions={styledColumnDefs}
798
- data={{ testid: testId }}
799
- tableData={MOCK_DATA}
800
- />
801
- );
802
-
803
- const yearHeader = screen.getByText("Year").closest("th");
804
- expect(yearHeader).toHaveStyle({ minWidth: "240px", width: "260px", maxWidth: "400px" });
805
-
806
- const yearCell = screen.getAllByText("2021")[0].closest("td");
807
- expect(yearCell).toHaveStyle({ minWidth: "240px", width: "260px", maxWidth: "400px" });
808
- });
809
-
810
- test("columnStyling width only locks minWidth and maxWidth to the same value", () => {
811
- const styledColumnDefs = [
812
- {
813
- accessor: "year",
814
- label: "Year",
815
- cellAccessors: ["quarter", "month", "day"],
816
- columnStyling: { width: 128 },
817
- },
818
- {
819
- accessor: "newEnrollments",
820
- label: "New Enrollments",
821
- },
822
- {
823
- accessor: "scheduledMeetings",
824
- label: "Scheduled Meetings",
825
- },
826
- ];
827
-
828
- render(
829
- <AdvancedTable
830
- columnDefinitions={styledColumnDefs}
831
- data={{ testid: testId }}
832
- tableData={MOCK_DATA}
833
- />
834
- );
835
-
836
- const yearHeader = screen.getByText("Year").closest("th");
837
- expect(yearHeader).toHaveStyle({
838
- width: "128px",
839
- minWidth: "128px",
840
- maxWidth: "128px",
841
- });
842
- });
843
-
844
- test("columnDefinitions size only locks minSize and maxSize to the same value", () => {
845
- const styledColumnDefs = [
846
- {
847
- accessor: "year",
848
- label: "Year",
849
- cellAccessors: ["quarter", "month", "day"],
850
- },
851
- {
852
- accessor: "newEnrollments",
853
- label: "New Enrollments",
854
- size: 200,
855
- },
856
- {
857
- accessor: "scheduledMeetings",
858
- label: "Scheduled Meetings",
859
- },
860
- ];
861
-
862
- render(
863
- <AdvancedTable
864
- columnDefinitions={styledColumnDefs}
865
- data={{ testid: testId }}
866
- tableData={MOCK_DATA}
867
- />
868
- );
869
-
870
- const enrollmentsHeader = screen.getByText("New Enrollments").closest("th");
871
- expect(enrollmentsHeader).toHaveStyle({
872
- width: "200px",
873
- minWidth: "200px",
874
- maxWidth: "200px",
875
- });
876
- });
877
-
878
- test("columnDefinitions size, minSize, and maxSize apply layout styles", () => {
879
- const styledColumnDefs = [
880
- {
881
- accessor: "year",
882
- label: "Year",
883
- cellAccessors: ["quarter", "month", "day"],
884
- },
885
- {
886
- accessor: "newEnrollments",
887
- label: "New Enrollments",
888
- size: 180,
889
- minSize: 160,
890
- maxSize: 320,
891
- },
892
- {
893
- accessor: "scheduledMeetings",
894
- label: "Scheduled Meetings",
895
- },
896
- ];
897
-
898
- render(
899
- <AdvancedTable
900
- columnDefinitions={styledColumnDefs}
901
- data={{ testid: testId }}
902
- tableData={MOCK_DATA}
903
- />
904
- );
905
-
906
- const enrollmentsHeader = screen.getByText("New Enrollments").closest("th");
907
- expect(enrollmentsHeader).toHaveStyle({
908
- width: "180px",
909
- minWidth: "160px",
910
- maxWidth: "320px",
911
- });
912
-
913
- const enrollmentsCell = screen.getAllByText("20")[0].closest("td");
914
- expect(enrollmentsCell).toHaveStyle({
915
- width: "180px",
916
- minWidth: "160px",
917
- maxWidth: "320px",
918
- });
919
- });
920
-
921
777
  test("columnStyling.fontColor sets cell font color", () => {
922
778
  const styledColumnDefs = [
923
779
  {
@@ -10,7 +10,6 @@ const AdvancedTableColumnStyling = (props) => {
10
10
  accessor: "year",
11
11
  label: "Year",
12
12
  cellAccessors: ["quarter", "month", "day"],
13
- columnStyling: { width: 124 },
14
13
  },
15
14
  {
16
15
  accessor: "newEnrollments",
@@ -6,10 +6,4 @@ The `columnStyling` prop is an optional item that can be used within `columnDefi
6
6
 
7
7
  3) `fontColor`: This will allow you to control the font color for a given column.
8
8
 
9
- 4) Column width: optional keys on `columnStyling` are `minWidth`, `width`, and `maxWidth` (numbers = pixels; CSS strings allowed). This example sets `width` on Year for a fixed hierarchy column (see the width doc for `minWidth` and bands).
10
-
11
- Fixed width: pass `width` only (or TanStack `size` only) and Playbook sets min and max to the same value automatically — you do not need all three for an exact width.
12
-
13
- See [Column Styling: Width](https://playbook.powerapp.cloud/kits/advanced_table/react#column-styling-width) for the full guide (Playbook ↔ TanStack mapping, floor-only vs bands, and when to use one vs three values).
14
-
15
9
  `columnStyling` can be used within the columnDefinition of all the columns or some of them, as shown. Each column has its own individual control in this way.