playbook_ui 14.16.0.pre.alpha.play1957inlinedatepickericonbugfix6872 → 14.16.0.pre.alpha.play1958formgrouperrorborder6922

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +86 -84
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +0 -1
  4. data/app/pb_kits/playbook/pb_button/_button.scss +5 -5
  5. data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.tsx +3 -4
  6. data/app/pb_kits/playbook/pb_filter/Filter/SortMenu.tsx +2 -3
  7. data/app/pb_kits/playbook/pb_form/pb_form_validation.js +1 -1
  8. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +5 -0
  9. data/app/pb_kits/playbook/pb_lightbox/hooks/useVisibility.js +1 -1
  10. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +2 -1
  11. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +29 -11
  12. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb +1 -1
  13. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.html.erb +4 -4
  14. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +2 -0
  15. data/app/pb_kits/playbook/pb_table/_table.tsx +4 -0
  16. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless.jsx +50 -0
  17. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless_react.md +1 -0
  18. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating.jsx +59 -0
  19. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_react.md +1 -0
  20. data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
  21. data/app/pb_kits/playbook/pb_table/docs/index.js +2 -0
  22. data/app/pb_kits/playbook/pb_table/styles/_headers.scss +76 -0
  23. data/app/pb_kits/playbook/pb_table/subcomponents/_table_head.tsx +11 -1
  24. data/app/pb_kits/playbook/pb_table/subcomponents/_table_header.tsx +11 -1
  25. data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +5 -0
  26. data/app/pb_kits/playbook/pb_table/table.test.js +17 -0
  27. data/app/pb_kits/playbook/pb_tooltip/index.js +183 -56
  28. data/app/pb_kits/playbook/pb_typeahead/index.ts +2 -2
  29. data/app/pb_kits/playbook/utilities/globalProps.ts +1 -1
  30. data/app/pb_kits/playbook/utilities/object.test.js +149 -1
  31. data/app/pb_kits/playbook/utilities/object.ts +124 -42
  32. data/dist/chunks/_typeahead-Djo6qCne.js +22 -0
  33. data/dist/chunks/_weekday_stacked-DIIHW0OV.js +45 -0
  34. data/dist/chunks/lib-BGzBzFZX.js +29 -0
  35. data/dist/chunks/{pb_form_validation-EUv1tqtI.js → pb_form_validation-BvNy9Bd6.js} +1 -1
  36. data/dist/chunks/vendor.js +1 -1
  37. data/dist/playbook-doc.js +1 -1
  38. data/dist/playbook-rails-react-bindings.js +1 -1
  39. data/dist/playbook-rails.js +1 -1
  40. data/dist/playbook.css +1 -1
  41. data/lib/playbook/version.rb +1 -1
  42. metadata +10 -7
  43. data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +0 -282
  44. data/dist/chunks/_typeahead-BniHPQq8.js +0 -22
  45. data/dist/chunks/_weekday_stacked-CuaFaMk8.js +0 -45
  46. data/dist/chunks/lib-UIelzz2O.js +0 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ac4260b02869cad3eaa3d0c49e523d9f4a4463cfccf98858f504172eaf1d601
4
- data.tar.gz: 1f91664b626b1362cf6b61ebf15ae1681830e96a3fb6d2bcd8601a2c50ea4a7a
3
+ metadata.gz: 4b47c802a9bb1f70a4794412e6b2fe30f91231e2da558d259747e21a219c5c87
4
+ data.tar.gz: 8e8fdf9336266e58cfb9690a8463047522bfc2d0d97e2dac03ab50f398abce60
5
5
  SHA512:
6
- metadata.gz: 1176546d1665cfe26fa78e48ad632470539f9b5bef9be47c28f60b238901c6237e236b413d09856ecde5d8f1166b3f9cc22e0c45e3e1d96c170b68d28dc2eeef
7
- data.tar.gz: 327c8ebe3c86777bffeb9af8b56ba1ab2ff2033b2245d728170ae3d86a164881abd90a0bbf691a01bce8c000a2bef515609e3c463313a4869ec36915e9e396c7
6
+ metadata.gz: 073ada67d971bf4666d2aaf56cc0a578fb34489efe0f6e7e42a6b542b6ce9f89c64fef64f0d488371f0a4e57b23dfcf2cbbbe608f24ec9264471c3508508167c
7
+ data.tar.gz: 4f37c81d357b9816ba68af52530c658be85a06f2fa84077297963311ff2045614baae55d66cb54587f4d55da3eb4ea5e5356d37ddca0b1f67db1057497399b18
@@ -167,93 +167,95 @@ const AdvancedTable = (props: AdvancedTableProps) => {
167
167
  const isActionBarVisible = selectableRows && showActionsBar && selectedRowsLength > 0;
168
168
 
169
169
  return (
170
- <div
171
- {...ariaProps}
172
- {...dataProps}
173
- {...htmlProps}
174
- className={classes}
175
- id={id}
176
- onScroll={virtualizedRows ? e => fetchMoreOnBottomReached(
177
- e.currentTarget,
178
- fetchNextPage,
179
- isFetching,
180
- totalFetched,
181
- fullData.length
182
- ) : undefined}
183
- ref={tableWrapperRef}
184
- style={tableWrapperStyle as React.CSSProperties}
185
- >
186
- <AdvancedTableProvider
187
- columnDefinitions={columnDefinitions}
188
- enableToggleExpansion={enableToggleExpansion}
189
- enableVirtualization={virtualizedRows}
190
- expanded={expanded}
191
- expandedControl={expandedControl}
192
- handleExpandOrCollapse={handleExpandOrCollapse}
193
- hasAnySubRows={hasAnySubRows}
194
- inlineRowLoading={inlineRowLoading}
195
- isActionBarVisible={isActionBarVisible}
196
- loading={loading}
197
- responsive={responsive}
198
- selectableRows={selectableRows}
199
- setExpanded={setExpanded}
200
- showActionsBar={showActionsBar}
201
- sortControl={sortControl}
202
- subRowHeaders={tableOptions?.subRowHeaders}
203
- table={table}
204
- tableContainerRef={tableWrapperRef}
205
- toggleExpansionIcon={toggleExpansionIcon}
206
- virtualizedRows={virtualizedRows}
170
+ <>
171
+ {/* Top Pagination */}
172
+ {pagination && (
173
+ <TablePagination
174
+ onChange={onPageChange}
175
+ position="top"
176
+ range={paginationProps?.range}
177
+ table={table}
178
+ />
179
+ )}
180
+
181
+ <div
182
+ {...ariaProps}
183
+ {...dataProps}
184
+ {...htmlProps}
185
+ className={classes}
186
+ id={id}
187
+ onScroll={virtualizedRows ? e => fetchMoreOnBottomReached(
188
+ e.currentTarget,
189
+ fetchNextPage,
190
+ isFetching,
191
+ totalFetched,
192
+ fullData.length
193
+ ) : undefined}
194
+ ref={tableWrapperRef}
195
+ style={tableWrapperStyle as React.CSSProperties}
207
196
  >
208
- <React.Fragment>
209
- {/* Top Pagination */}
210
- {pagination && (
211
- <TablePagination
212
- onChange={onPageChange}
213
- position="top"
214
- range={paginationProps?.range}
215
- table={table}
197
+ <AdvancedTableProvider
198
+ columnDefinitions={columnDefinitions}
199
+ enableToggleExpansion={enableToggleExpansion}
200
+ enableVirtualization={virtualizedRows}
201
+ expanded={expanded}
202
+ expandedControl={expandedControl}
203
+ handleExpandOrCollapse={handleExpandOrCollapse}
204
+ hasAnySubRows={hasAnySubRows}
205
+ inlineRowLoading={inlineRowLoading}
206
+ isActionBarVisible={isActionBarVisible}
207
+ loading={loading}
208
+ responsive={responsive}
209
+ selectableRows={selectableRows}
210
+ setExpanded={setExpanded}
211
+ showActionsBar={showActionsBar}
212
+ sortControl={sortControl}
213
+ subRowHeaders={tableOptions?.subRowHeaders}
214
+ table={table}
215
+ tableContainerRef={tableWrapperRef}
216
+ toggleExpansionIcon={toggleExpansionIcon}
217
+ virtualizedRows={virtualizedRows}
218
+ >
219
+ <React.Fragment>
220
+ {/* Selection Action Bar */}
221
+ <TableActionBar
222
+ actions={actions}
223
+ isVisible={isActionBarVisible}
224
+ selectedCount={selectedRowsLength}
216
225
  />
217
- )}
218
-
219
- {/* Selection Action Bar */}
220
- <TableActionBar
221
- actions={actions}
222
- isVisible={isActionBarVisible}
223
- selectedCount={selectedRowsLength}
224
- />
225
226
 
226
- {/* Main Table */}
227
- <Table
228
- className={`${loading ? "content-loading" : ""}`}
229
- dark={dark}
230
- dataTable
231
- numberSpacing="tabular"
232
- responsive="none"
233
- {...tableProps}
234
- >
235
- {children ? (
236
- children
237
- ) : (
238
- <>
239
- <TableHeader />
240
- <TableBody />
241
- </>
242
- )}
243
- </Table>
244
-
245
- {/* Bottom Pagination */}
246
- {pagination && (
247
- <TablePagination
248
- onChange={onPageChange}
249
- position="bottom"
250
- range={paginationProps?.range}
251
- table={table}
252
- />
253
- )}
254
- </React.Fragment>
255
- </AdvancedTableProvider>
256
- </div>
227
+ {/* Main Table */}
228
+ <Table
229
+ className={`${loading ? "content-loading" : ""}`}
230
+ dark={dark}
231
+ dataTable
232
+ numberSpacing="tabular"
233
+ responsive="none"
234
+ {...tableProps}
235
+ >
236
+ {children ? (
237
+ children
238
+ ) : (
239
+ <>
240
+ <TableHeader />
241
+ <TableBody />
242
+ </>
243
+ )}
244
+ </Table>
245
+ </React.Fragment>
246
+ </AdvancedTableProvider>
247
+
248
+ </div>
249
+ {/* Bottom Pagination */}
250
+ {pagination && (
251
+ <TablePagination
252
+ onChange={onPageChange}
253
+ position="bottom"
254
+ range={paginationProps?.range}
255
+ table={table}
256
+ />
257
+ )}
258
+ </>
257
259
  );
258
260
  };
259
261
 
@@ -40,7 +40,6 @@ const AdvancedTablePagination = (props) => {
40
40
  <AdvancedTable
41
41
  columnDefinitions={columnDefinitions}
42
42
  pagination
43
- responsive="none"
44
43
  tableData={PAGINATION_MOCK_DATA}
45
44
  {...props}
46
45
  />
@@ -63,11 +63,6 @@ $pb_button_sizes: (
63
63
  color: $text_lt_lighter;
64
64
  }
65
65
 
66
- // Disabled =================
67
- &[class*=_disabled] {
68
- @include pb_button_disabled;
69
- }
70
-
71
66
  // Block ====================
72
67
  &[class*=_block] {
73
68
  @include pb_button_block;
@@ -83,6 +78,11 @@ $pb_button_sizes: (
83
78
  @include pb_button_danger;
84
79
  }
85
80
 
81
+ // Disabled =================
82
+ &[class*=_disabled] {
83
+ @include pb_button_disabled;
84
+ }
85
+
86
86
  // Dark Variants =============
87
87
  &.dark {
88
88
  &[class*=_primary] {
@@ -1,6 +1,5 @@
1
1
  import React from 'react'
2
- import { map } from 'lodash'
3
- import { isEmpty, omitBy } from '../../utilities/object'
2
+ import { isEmpty, omitBy, map } from '../../utilities/object'
4
3
 
5
4
  import Body from '../../pb_body/_body'
6
5
  import Caption from '../../pb_caption/_caption'
@@ -46,12 +45,12 @@ const CurrentFilters = ({ dark, filters }: CurrentFiltersProps): React.ReactElem
46
45
  dark={dark}
47
46
  size={4}
48
47
  tag="h4"
49
- text={name}
48
+ text={`${name}`}
50
49
  /> :
51
50
  <div>
52
51
  <Caption
53
52
  dark={dark}
54
- text={name}
53
+ text={`${name}`}
55
54
  />
56
55
  <Title
57
56
  dark={dark}
@@ -1,6 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { map } from 'lodash'
3
- import { find, partial } from '../../utilities/object'
2
+ import { find, partial, map } from '../../utilities/object'
4
3
 
5
4
  import Button from '../../pb_button/_button'
6
5
  import Icon from '../../pb_icon/_icon'
@@ -27,7 +26,7 @@ const directionIcon = (dir: Direction) => (
27
26
 
28
27
  const renderOptions = (options: SortOptions, value: SortValue[], handleChange: (arg0: SortValue) => void) => (
29
28
  map(options, (label, name) => {
30
- const next = nextValue(value, name)
29
+ const next = nextValue(value, String(name))
31
30
  return (
32
31
  <ListItem key={`option-${next.name}-${next.dir}`}>
33
32
  <Button
@@ -1,5 +1,5 @@
1
1
  import PbEnhancedElement from '../pb_enhanced_element'
2
- import { debounce } from 'lodash'
2
+ import { debounce } from '../utilities/object'
3
3
 
4
4
  // Kit selectors
5
5
  const KIT_SELECTOR = '[class^="pb_"][class*="_kit"]'
@@ -205,4 +205,9 @@
205
205
  border-top-left-radius: 0;
206
206
  }
207
207
  }
208
+
209
+ .pb_text_input_kit.error + * input,
210
+ .pb_text_input_kit.error + * select {
211
+ border-left-color: $red;
212
+ }
208
213
  }
@@ -1,4 +1,4 @@
1
- import { debounce } from 'lodash'
1
+ import { debounce } from "../../utilities/object"
2
2
  import { useCallback, useMemo, useState } from 'react'
3
3
 
4
4
  export default function useVisibility(initialState = false) {
@@ -7,11 +7,12 @@ import {
7
7
  buildDataProps,
8
8
  buildHtmlProps,
9
9
  } from "../utilities/props";
10
+ import { cloneDeep } from "../utilities/object";
11
+
10
12
  import Icon from "../pb_icon/_icon";
11
13
  import FormPill from "../pb_form_pill/_form_pill";
12
14
  import Body from "../pb_body/_body";
13
15
  import Caption from "../pb_caption/_caption";
14
- import { cloneDeep } from "lodash";
15
16
  import MultiLevelSelectOptions from "./multi_level_select_options";
16
17
  import MultiLevelSelectContext from "./context";
17
18
 
@@ -32,11 +32,12 @@ type RichTextEditorProps = {
32
32
  advancedEditor?: any,
33
33
  advancedEditorToolbar?: boolean,
34
34
  toolbarBottom?: boolean,
35
- children?: React.ReactNode | React.ReactNode[]
35
+ children?: React.ReactNode | React.ReactNode[],
36
36
  className?: string,
37
37
  data?: { [key: string]: string },
38
38
  focus?: boolean,
39
- htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
39
+ htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
40
+ inputOptions?: { [key: string]: string | number | boolean | (() => void) },
40
41
  id?: string,
41
42
  inline?: boolean,
42
43
  extensions?: { [key: string]: string }[],
@@ -61,6 +62,7 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
61
62
  data = {},
62
63
  focus = false,
63
64
  htmlOptions = {},
65
+ inputOptions = {},
64
66
  inline = false,
65
67
  extensions,
66
68
  name,
@@ -70,7 +72,7 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
70
72
  sticky = false,
71
73
  template = '',
72
74
  value = '',
73
- maxWidth="md"
75
+ maxWidth = "md"
74
76
  } = props
75
77
 
76
78
  const ariaProps = buildAriaProps(aria),
@@ -79,12 +81,28 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
79
81
 
80
82
  const htmlProps = buildHtmlProps(htmlOptions)
81
83
 
82
- const handleOnEditorReady = (editorInstance: Editor) => setEditor(editorInstance),
83
- element = editor?.element
84
+ const handleOnEditorReady = (editorInstance: Editor) => {
85
+ setEditor(editorInstance)
86
+ setTimeout(() => {
87
+ const oldId = editorInstance.element.getAttribute('input')
88
+ if (oldId) {
89
+ const hiddenInput = document.getElementById(oldId)
90
+ if (hiddenInput) {
91
+ const newId = (inputOptions.id as string) || oldId
92
+ hiddenInput.id = newId
93
+ editorInstance.element.setAttribute('input', newId)
94
+
95
+ if (inputOptions.name) {
96
+ hiddenInput.setAttribute('name', inputOptions.name as string)
97
+ }
98
+ }
99
+ }
100
+ })
101
+ }
84
102
 
85
103
  // DOM manipulation must wait for editor to be ready
86
- if (editor) {
87
- const toolbarElement = element.parentElement.querySelector('trix-toolbar') as HTMLElement,
104
+ if (editor && editor.element) {
105
+ const toolbarElement = editor.element.parentElement.querySelector('trix-toolbar') as HTMLElement,
88
106
  blockCodeButton = toolbarElement.querySelector('[data-trix-attribute=code]') as HTMLElement
89
107
 
90
108
  // replace default trix "block code" button with "inline code" button
@@ -118,8 +136,8 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
118
136
  }, [editor, template])
119
137
 
120
138
  useEffect(() => {
121
- if (!element) return
122
- element.addEventListener('click', ({ target }: Event) => {
139
+ if (!editor?.element) return
140
+ editor.element.addEventListener('click', ({ target }: Event) => {
123
141
  const trixEditorContainer = (target as Element).closest('.pb_rich_text_editor_kit')
124
142
  if (!trixEditorContainer) return
125
143
 
@@ -128,7 +146,7 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
128
146
 
129
147
  if (anchorElement.hasAttribute('href')) window.open(anchorElement.href)
130
148
  })
131
- }, [element])
149
+ }, [editor])
132
150
 
133
151
  const richTextEditorClass = 'pb_rich_text_editor_kit',
134
152
  simpleClass = simple ? 'simple' : '',
@@ -137,7 +155,7 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
137
155
  inlineClass = inline ? 'inline' : '',
138
156
  toolbarBottomClass = toolbarBottom ? 'toolbar-bottom' : ''
139
157
 
140
- let css = classnames(globalProps(props, {maxWidth}), className)
158
+ let css = classnames(globalProps(props, { maxWidth }), className)
141
159
  css = classnames(
142
160
  richTextEditorClass,
143
161
  simpleClass,
@@ -1 +1 @@
1
- <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here. You can format your text, add links, quotes, and bullets."}) %>
1
+ <%= pb_rails("rich_text_editor", props: {input_options: { id: 'hidden_input_id', name: "hidden_input_name" }, value: "Add your text here. You can format your text, add links, quotes, and bullets."}) %>
@@ -1,5 +1,5 @@
1
1
  <%= react_component('RichTextEditor',
2
- object.rich_text_options,
3
- aria: object.aria,
4
- data: object.data
5
- ) %>
2
+ object.rich_text_options,
3
+ aria: object.aria,
4
+ data: object.data
5
+ ) %>
@@ -20,6 +20,7 @@ module Playbook
20
20
  prop :value
21
21
  prop :template
22
22
  prop :placeholder
23
+ prop :input_options
23
24
 
24
25
  def classname
25
26
  generate_classname("pb_rich_text_editor_kit", simple_class, focus_class, sticky_class, separator: " ")
@@ -49,6 +50,7 @@ module Playbook
49
50
  value: value,
50
51
  template: template,
51
52
  placeholder: placeholder,
53
+ inputOptions: input_options,
52
54
  }
53
55
  end
54
56
  end
@@ -21,6 +21,7 @@ type TableProps = {
21
21
  data?: { [key: string]: string },
22
22
  dataTable: boolean,
23
23
  disableHover?: boolean,
24
+ headerStyle?: "default" | "borderless" | "floating"
24
25
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
25
26
  id?: string,
26
27
  outerPadding?: "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
@@ -46,6 +47,7 @@ const Table = (props: TableProps): React.ReactElement => {
46
47
  data = {},
47
48
  dataTable = false,
48
49
  disableHover = false,
50
+ headerStyle = "default",
49
51
  htmlOptions = {},
50
52
  id,
51
53
  outerPadding = '',
@@ -85,6 +87,8 @@ const Table = (props: TableProps): React.ReactElement => {
85
87
  'sticky-left-column': stickyLeftColumn,
86
88
  'sticky-right-column': stickyRightColumn,
87
89
  'striped': striped,
90
+ 'header-borderless': headerStyle === 'borderless',
91
+ 'header-floating': headerStyle === 'floating',
88
92
  [outerPaddingCss]: outerPadding !== '',
89
93
  },
90
94
  globalProps(props),
@@ -0,0 +1,50 @@
1
+ import React from 'react'
2
+
3
+ import Table from '../../pb_table/_table'
4
+
5
+ const TableWithHeaderStyleBorderless = (props) => {
6
+ return (
7
+ <>
8
+ <Table
9
+ headerStyle="borderless"
10
+ size="sm"
11
+ {...props}
12
+ >
13
+ <thead>
14
+ <tr>
15
+ <th>{'Column 1'}</th>
16
+ <th>{'Column 2'}</th>
17
+ <th>{'Column 3'}</th>
18
+ <th>{'Column 4'}</th>
19
+ <th>{'Column 5'}</th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <tr>
24
+ <td>{'Value 1'}</td>
25
+ <td>{'Value 2'}</td>
26
+ <td>{'Value 3'}</td>
27
+ <td>{'Value 4'}</td>
28
+ <td>{'Value 5'}</td>
29
+ </tr>
30
+ <tr>
31
+ <td>{'Value 1'}</td>
32
+ <td>{'Value 2'}</td>
33
+ <td>{'Value 3'}</td>
34
+ <td>{'Value 4'}</td>
35
+ <td>{'Value 5'}</td>
36
+ </tr>
37
+ <tr>
38
+ <td>{'Value 1'}</td>
39
+ <td>{'Value 2'}</td>
40
+ <td>{'Value 3'}</td>
41
+ <td>{'Value 4'}</td>
42
+ <td>{'Value 5'}</td>
43
+ </tr>
44
+ </tbody>
45
+ </Table>
46
+ </>
47
+ )
48
+ }
49
+
50
+ export default TableWithHeaderStyleBorderless
@@ -0,0 +1 @@
1
+ Customize your header by removing the header borders with the `headerStyle="borderless"` prop.
@@ -0,0 +1,59 @@
1
+ import React from 'react'
2
+
3
+ import Background from '../../pb_background/_background'
4
+ import Card from '../../pb_card/_card'
5
+ import Table from '../../pb_table/_table'
6
+
7
+ const TableWithHeaderStyleFloating = (props) => {
8
+ return (
9
+ <>
10
+ <Card background="light"
11
+ {...props}
12
+ >
13
+ <Table
14
+ headerStyle="floating"
15
+ size="sm"
16
+ {...props}
17
+ >
18
+ <Table.Head>
19
+ <Background backgroundColor="light"
20
+ tag="tr"
21
+ {...props}
22
+ >
23
+ <Table.Header>{'Column 1'}</Table.Header>
24
+ <Table.Header>{'Column 2'}</Table.Header>
25
+ <Table.Header>{'Column 3'}</Table.Header>
26
+ <Table.Header>{'Column 4'}</Table.Header>
27
+ <Table.Header>{'Column 5'}</Table.Header>
28
+ </Background>
29
+ </Table.Head>
30
+ <Table.Body>
31
+ <Table.Row>
32
+ <Table.Cell>{'Value 1'}</Table.Cell>
33
+ <Table.Cell>{'Value 2'}</Table.Cell>
34
+ <Table.Cell>{'Value 3'}</Table.Cell>
35
+ <Table.Cell>{'Value 4'}</Table.Cell>
36
+ <Table.Cell>{'Value 5'}</Table.Cell>
37
+ </Table.Row>
38
+ <Table.Row>
39
+ <Table.Cell>{'Value 1'}</Table.Cell>
40
+ <Table.Cell>{'Value 2'}</Table.Cell>
41
+ <Table.Cell>{'Value 3'}</Table.Cell>
42
+ <Table.Cell>{'Value 4'}</Table.Cell>
43
+ <Table.Cell>{'Value 5'}</Table.Cell>
44
+ </Table.Row>
45
+ <Table.Row>
46
+ <Table.Cell>{'Value 1'}</Table.Cell>
47
+ <Table.Cell>{'Value 2'}</Table.Cell>
48
+ <Table.Cell>{'Value 3'}</Table.Cell>
49
+ <Table.Cell>{'Value 4'}</Table.Cell>
50
+ <Table.Cell>{'Value 5'}</Table.Cell>
51
+ </Table.Row>
52
+ </Table.Body>
53
+ </Table>
54
+ </Card>
55
+ </>
56
+ )
57
+ }
58
+
59
+ export default TableWithHeaderStyleFloating
@@ -0,0 +1 @@
1
+ Further customize your header by using the [table with background kit](https://playbook.powerapp.cloud/kits/table/react#table-with-background-kit) logic to give your table header a custom background color. Use the `headerStyle="floating"` prop to visually nest the borderless table within a card or collapsible with a matching background color (the `backgroundColor` passed to Background kit should match the `backgroundColor` for the element in which it is nested).
@@ -75,3 +75,5 @@ examples:
75
75
  - table_with_collapsible_with_nested_table: Table with Collapsible with Nested Table
76
76
  - table_with_clickable_rows: Table with Clickable Rows
77
77
  - table_with_selectable_rows: Table with Selectable Rows
78
+ - table_with_header_style_borderless: Header Style Borderless
79
+ - table_with_header_style_floating: Header Style Floating
@@ -35,3 +35,5 @@ export { default as TableWithCollapsibleWithNestedRows } from './_table_with_col
35
35
  export { default as TableWithCollapsibleWithCustomClick } from './_table_with_collapsible_with_custom_click.jsx'
36
36
  export { default as TableWithSelectableRows } from './_table_with_selectable_rows.jsx'
37
37
  export { default as TableWithClickableRows } from './_table_with_clickable_rows.jsx'
38
+ export { default as TableWithHeaderStyleBorderless } from './_table_with_header_style_borderless.jsx'
39
+ export { default as TableWithHeaderStyleFloating } from './_table_with_header_style_floating.jsx'