Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Separated out Borders to its own page & [EuiTableRowCell] fixes #5283

Merged
merged 26 commits into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
963e589
Added a ThemeSelector for optionally showing/changing content based o…
Sep 29, 2021
f3eccfb
Added the more options to the GuideSectionTypes
Sep 29, 2021
4e66fbc
Added some theme helper components like alert banners, values table, …
Sep 29, 2021
082a756
[Manual] Copied the outputs json version of Sass for easier consumpti…
Sep 29, 2021
2db22a4
Changed color utilites to output hex instead of `.css()` or `rgb`
Sep 29, 2021
fcb1b1c
Rearranging sidenav to promote Theme section and adding “Breakpoints”
Sep 29, 2021
b6e52f6
Fixes
Sep 29, 2021
11cb672
Revert "Added the more options to the GuideSectionTypes"
Sep 29, 2021
c386f09
Fixed some routing and notices
Sep 29, 2021
db817b5
Revert "Changed color utilites to output hex instead of `.css()` or `…
Sep 29, 2021
f4dd077
Cleanup
Sep 29, 2021
fcb840c
Moved Border tokens to its own page
Sep 30, 2021
d827108
Figured out a way to get subsections in the sidenav working
Sep 30, 2021
18efc56
Added the new `_values` under `customizing/`
Sep 30, 2021
57f4d4e
Merge remote-tracking branch 'upstream/master' into theme_languages/1…
Sep 30, 2021
884cb28
Remove now unnecessary ts-ignore for EuiTour
Sep 30, 2021
a4fc3c1
Merge branch 'theme_languages/1_setup_and_breakpoints' into theme_lan…
Sep 30, 2021
3781d61
Merge remote-tracking branch 'upstream/master' into theme_languages/2…
Oct 18, 2021
a1fa599
[EuiTableRowCell] Actually support `valign` property manually
Oct 18, 2021
3320525
[EuiTable*] Fixing some props and mobile options
Oct 19, 2021
8f7b9cf
cl
Oct 19, 2021
edbfd08
Merge branch 'master' into theme_languages/2_border
cchaos Oct 19, 2021
71bcc93
Slightly better responsive table styles
Oct 19, 2021
14d4fe5
resolve border types
thompsongl Oct 20, 2021
5c460be
Comment
Oct 20, 2021
f94496a
Get `valign` to show up in props table
Oct 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
## [`master`](https://github.com/elastic/eui/tree/master)

No public interface changes since `40.0.0`.
- Added styling support for `valign` prop on `EuiTableRowCell` ([#5283](https://github.com/elastic/eui/pull/5283))

**Bug fixes**

- Fixed default text alignment in `EuiTableRowCell` on Safari ([#5283](https://github.com/elastic/eui/pull/5283))
- Fixed `mobileOptions.truncateText` from getting overridden by `truncateText` in `EuiTableRowCell` ([#5283](https://github.com/elastic/eui/pull/5283))

**Theme: Amsterdam**

- Fixed `mobileOptions.enlarge` styling in `EuiTableRowCell` ([#5283](https://github.com/elastic/eui/pull/5283))

## [`40.0.0`](https://github.com/elastic/eui/tree/v40.0.0)

- Updated `tokenKeyword` to match the definition of keyword field type ([#5251](https://github.com/elastic/eui/pull/5251))
- Added `element`, `buttonElement`, and `arrowProps` props to further customize `EuiAccordion` ([#5258](https://github.com/elastic/eui/pull/5258))

**Bug fixes**

- Fixed missing `id` for `EuiCombobox` by generating one if `prepend` or `append` exists ([#5229](https://github.com/elastic/eui/pull/5229))

**Breaking changes**
Expand Down
12 changes: 0 additions & 12 deletions src-docs/src/components/guide_page/guide_page_chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,6 @@ export class GuidePageChrome extends Component {
}, 250);
};

onButtonClick() {
this.setState({
isPopoverOpen: !this.state.isPopoverOpen,
});
}

closePopover() {
this.setState({
isPopoverOpen: false,
});
}

renderSubSections = (href, subSections = [], searchTerm = '') => {
const subSectionsWithTitles = subSections.filter((item) => {
if (!item.title) {
Expand Down
6 changes: 6 additions & 0 deletions src-docs/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ import { SuperSelectExample } from './views/super_select/super_select_example';
import { ThemeExample } from './views/theme/theme_example';
import ThemeValues from './views/theme/values';
import Breakpoints from './views/theme/breakpoints/breakpoints';
import Borders, { bordersSections } from './views/theme/borders/borders';

/** Elastic Charts */

Expand Down Expand Up @@ -350,6 +351,11 @@ const navigation = [
name: 'Breakpoints',
component: Breakpoints,
},
{
name: 'Borders',
component: Borders,
sections: bordersSections,
},
createExample(SassGuidelines, 'Sass'),
],
},
Expand Down
10 changes: 8 additions & 2 deletions src-docs/src/views/guidelines/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,22 @@
padding: $euiSize;
}

.guideSass__border--radius {
.guideSass__border--euiBorderRadius {
border: $euiBorderThin;
border-radius: $euiBorderRadius;
}

.guideSass__border--radiusSmall {
.guideSass__border--euiBorderRadiusSmall {
border: $euiBorderThin;
border-radius: $euiBorderRadiusSmall;
}

.guideSass__border--euiBorderWidthThin,
.guideSass__border--euiBorderThin {
border: $euiBorderThin;
}

.guideSass__border--euiBorderWidthThick,
.guideSass__border--euiBorderThick {
border: $euiBorderThick;
}
Expand All @@ -215,6 +217,10 @@
border: $euiBorderEditable;
}

.guideSass__border--thickDashed {
border: $euiBorderWidthThick dashed $euiBorderColor;
}

.guideSass__fontFamily {
font-size: $euiSizeL;
background: $euiColorDarkestShade;
Expand Down
6 changes: 0 additions & 6 deletions src-docs/src/views/guidelines/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ThemeContext } from '../../components';
import { Typography } from './sass/typography';
import { Animation } from './sass/animation';
import { Shadow } from './sass/shadow';
import { Border } from './sass/border';
import { Color } from './sass/color';
import { Core } from './sass/core';

Expand Down Expand Up @@ -192,11 +191,6 @@ export const SassGuidelines = {
wrapText: false,
text: <Typography />,
},
{
title: 'Borders',
wrapText: false,
text: <Border />,
},
{
title: 'Shadow and Depth',
wrapText: false,
Expand Down
78 changes: 0 additions & 78 deletions src-docs/src/views/guidelines/sass/border.tsx

This file was deleted.

109 changes: 43 additions & 66 deletions src-docs/src/views/tables/auto/auto.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,48 +55,7 @@ const columns = [
header: false,
truncateText: false,
enlarge: true,
fullWidth: true,
},
},
{
field: 'lastName',
name: 'Last Name',
render: (name) => (
<EuiLink href="#" target="_blank">
{name}
</EuiLink>
),
mobileOptions: {
show: false,
},
},
{
field: 'github',
name: 'Github',
},
];

const customColumns = [
{
field: 'firstName',
name: 'First Name',
sortable: true,
truncateText: true,
'data-test-subj': 'firstNameCell',
width: '20%',
mobileOptions: {
render: (item) => (
<span>
{item.firstName}{' '}
<EuiLink href="#" target="_blank">
{item.lastName}
</EuiLink>
</span>
),
header: false,
truncateText: false,
enlarge: true,
fullWidth: true,
width: '100%',
},
},
{
Expand All @@ -119,25 +78,6 @@ const customColumns = [

const items = store.users.filter((user, index) => index < 10);

const getRowProps = (item) => {
const { id } = item;
return {
'data-test-subj': `row-${id}`,
className: 'customRowClass',
onClick: () => {},
};
};

const getCellProps = (item, column) => {
const { id } = item;
const { field } = column;
return {
className: 'customCellClass',
'data-test-subj': `cell-${id}-${field}`,
textOnly: true,
};
};

const idPrefix = htmlIdGenerator()();

const toggleButtons = [
Expand All @@ -158,13 +98,44 @@ const toggleButtons = [
},
];

const vAlignButtons = [
{
id: `${idPrefix}4`,
label: 'Top',
value: 'top',
},
{
id: `${idPrefix}3`,
label: 'Middle',
value: 'middle',
},
{
id: `${idPrefix}5`,
label: 'Bottom',
value: 'bottom',
},
];

export const Table = () => {
const [layout, setLayout] = useState('fixed');
const [toggleIdSelected, setToggleIdSelected] = useState(`${idPrefix}0`);
const [vAlignButtonsIdSelected, setVAlignButtonsIdSelected] = useState(
`${idPrefix}3`
);

const onChange = (optionId) => {
const alignment = toggleButtons.find((x) => x.id === optionId).value;
columns[0].width = alignment === 'custom' ? '20%' : undefined;

setToggleIdSelected(optionId);
setLayout(toggleButtons.find((x) => x.id === optionId).value);
setLayout(alignment);
};

const onVAlignChange = (optionId) => {
setVAlignButtonsIdSelected(optionId);
const alignment = vAlignButtons.find((x) => x.id === optionId).value;

columns.forEach((column) => (column.valign = alignment));
};

let callOutText;
Expand All @@ -186,11 +157,19 @@ export const Table = () => {
return (
<div>
<EuiButtonGroup
legend="Table layout group"
legend="Table layout options"
options={toggleButtons}
idSelected={toggleIdSelected}
onChange={onChange}
/>
&emsp;
<EuiButtonGroup
legend="Vertical align options"
options={vAlignButtons}
idSelected={vAlignButtonsIdSelected}
onChange={onVAlignChange}
/>
&emsp;
<EuiSpacer size="m" />
<EuiCallOut
size="s"
Expand All @@ -201,10 +180,8 @@ export const Table = () => {
<EuiBasicTable
tableCaption="Demo of EuiBasicTable's table layout options"
items={items}
columns={layout === 'custom' ? customColumns : columns}
columns={columns}
tableLayout={layout === 'auto' ? 'auto' : 'fixed'}
rowProps={getRowProps}
cellProps={getCellProps}
/>
</div>
);
Expand Down
16 changes: 13 additions & 3 deletions src-docs/src/views/tables/auto/auto_section.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ const layoutSnippet = [
{ field: 'column1', name: 'Column 1', truncateText: true, width: '20%' },
{ field: 'column2', name: 'Column 2' }
]}
tableLayout="fixed"
/>`,
`<EuiBasicTable
columns={[
{ field: 'column1', name: 'Column 1', valign: 'top' },
{ field: 'column2', name: 'Column 2' }
]}
/>`,
];

Expand All @@ -38,7 +43,7 @@ export const section = {
},
],
text: (
<div>
<>
<p>
<strong>EuiBasicTable</strong> has a fixed layout by default. You can
change it to <EuiCode>auto</EuiCode> using the{' '}
Expand All @@ -49,7 +54,12 @@ export const section = {
<EuiCode>truncateText</EuiCode>, set the width of each column using the{' '}
<EuiCode>width</EuiCode> prop.
</p>
</div>
<p>
You can also set the vertical alignment (<EuiCode>valign</EuiCode>) at
the column level which will affect the cell contents for that entire
column excluding the header and footer.
</p>
</>
),
snippet: layoutSnippet,
demo: <Table />,
Expand Down
Loading