@axinom/mosaic-ui 0.66.0-rc.9 → 0.66.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.
- package/dist/components/DynamicDataList/DynamicListHeader/DynamicListHeader.d.ts.map +1 -1
- package/dist/components/FieldSelection/FieldSelection.d.ts.map +1 -1
- package/dist/components/Filters/Filter/Filter.d.ts.map +1 -1
- package/dist/components/Filters/Filters.model.d.ts +5 -0
- package/dist/components/Filters/Filters.model.d.ts.map +1 -1
- package/dist/components/Filters/SelectionTypes/DateTimeFilter/DateTimeFilter.d.ts +2 -0
- package/dist/components/Filters/SelectionTypes/DateTimeFilter/DateTimeFilter.d.ts.map +1 -1
- package/dist/components/Filters/SelectionTypes/FreeTextFilter/FreeTextFilter.d.ts +2 -0
- package/dist/components/Filters/SelectionTypes/FreeTextFilter/FreeTextFilter.d.ts.map +1 -1
- package/dist/components/Filters/SelectionTypes/MultiOptionFilter/MultiOptionFilter.d.ts +2 -0
- package/dist/components/Filters/SelectionTypes/MultiOptionFilter/MultiOptionFilter.d.ts.map +1 -1
- package/dist/components/Filters/SelectionTypes/NumericTextFilter/NumericTextFilter.d.ts +2 -0
- package/dist/components/Filters/SelectionTypes/NumericTextFilter/NumericTextFilter.d.ts.map +1 -1
- package/dist/components/Filters/SelectionTypes/OptionsFilter/OptionsFilter.d.ts +2 -0
- package/dist/components/Filters/SelectionTypes/OptionsFilter/OptionsFilter.d.ts.map +1 -1
- package/dist/components/Filters/SelectionTypes/SearcheableOptionsFilter/SearcheableOptionsFilter.d.ts +2 -0
- package/dist/components/Filters/SelectionTypes/SearcheableOptionsFilter/SearcheableOptionsFilter.d.ts.map +1 -1
- package/dist/components/FormElements/Radio/Radio.d.ts.map +1 -1
- package/dist/components/FormElements/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/components/Hub/Tile/Tile.d.ts.map +1 -1
- package/dist/components/Icons/Icons.d.ts +4 -9
- package/dist/components/Icons/Icons.d.ts.map +1 -1
- package/dist/components/LandingPageTiles/TileLarge/TileLarge.d.ts.map +1 -1
- package/dist/components/LandingPageTiles/TileSmall/TileSmall.d.ts.map +1 -1
- package/dist/components/List/ListCheckBox/ListCheckBox.d.ts.map +1 -1
- package/dist/components/List/ListHeader/ColumnLabel/ColumnLabel.d.ts.map +1 -1
- package/dist/components/List/ListHeader/ListHeader.d.ts.map +1 -1
- package/dist/components/List/ListRow/ListRow.d.ts.map +1 -1
- package/dist/components/List/ListRow/ListRowCell/ListRowCell.d.ts +15 -0
- package/dist/components/List/ListRow/ListRowCell/ListRowCell.d.ts.map +1 -0
- package/dist/components/List/ListRow/ListRowCell/renderData.d.ts +9 -0
- package/dist/components/List/ListRow/ListRowCell/renderData.d.ts.map +1 -0
- package/dist/components/List/ListRow/Renderers/TagsRenderer/TagsRenderer.d.ts.map +1 -1
- package/dist/components/Loaders/ImageLoader/ImageLoader.d.ts.map +1 -1
- package/dist/components/PageHeader/PageHeaderAction/PageHeaderAction.d.ts.map +1 -1
- package/dist/components/Utils/Postgraphile/CreateConnectionRenderer.d.ts +1 -1
- package/dist/components/Utils/Postgraphile/CreateConnectionRenderer.d.ts.map +1 -1
- package/dist/components/VisualElements/ImgElement.d.ts +50 -0
- package/dist/components/VisualElements/ImgElement.d.ts.map +1 -0
- package/dist/components/VisualElements/SvgElement.d.ts +14 -0
- package/dist/components/VisualElements/SvgElement.d.ts.map +1 -0
- package/dist/components/VisualElements/index.d.ts +3 -0
- package/dist/components/VisualElements/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/helpers/idleCallbackHelpers.d.ts +42 -0
- package/dist/helpers/idleCallbackHelpers.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/hooks/useResize/ResizeIndicator.d.ts +8 -0
- package/dist/hooks/useResize/ResizeIndicator.d.ts.map +1 -0
- package/dist/hooks/useResize/useResize.d.ts +5 -2
- package/dist/hooks/useResize/useResize.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +4 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Accordion/Accordion.scss +1 -1
- package/src/components/Accordion/AccordionItem/AccordionItem.scss +2 -2
- package/src/components/Buttons/Button/Button.scss +5 -5
- package/src/components/Buttons/CompositeButton/CompositeButton.scss +7 -7
- package/src/components/Buttons/TextButton/TextButton.scss +6 -6
- package/src/components/ConfirmDialog/ConfirmDialog.scss +1 -1
- package/src/components/DateTime/DatePicker/DatePicker.scss +12 -12
- package/src/components/DateTime/TimePicker/ScrollColumn/ScrollColumn.scss +7 -7
- package/src/components/DateTime/TimePicker/TimePicker.scss +1 -1
- package/src/components/DynamicDataList/DynamicListHeader/DynamicListHeader.scss +2 -2
- package/src/components/DynamicDataList/DynamicListHeader/DynamicListHeader.spec.tsx +2 -0
- package/src/components/DynamicDataList/DynamicListHeader/DynamicListHeader.tsx +62 -50
- package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.scss +2 -2
- package/src/components/FieldSelection/FieldSelection.scss +4 -0
- package/src/components/FieldSelection/FieldSelection.tsx +1 -0
- package/src/components/Filters/Filter/Filter.scss +34 -15
- package/src/components/Filters/Filter/Filter.spec.tsx +1 -1
- package/src/components/Filters/Filter/Filter.tsx +46 -34
- package/src/components/Filters/Filters.model.ts +6 -0
- package/src/components/Filters/SelectionTypes/DateTimeFilter/DateTimeFilter.tsx +5 -0
- package/src/components/Filters/SelectionTypes/FreeTextFilter/FreeTextFilter.tsx +4 -0
- package/src/components/Filters/SelectionTypes/MultiOptionFilter/MultiOptionFilter.scss +1 -1
- package/src/components/Filters/SelectionTypes/MultiOptionFilter/MultiOptionFilter.tsx +9 -1
- package/src/components/Filters/SelectionTypes/NumericTextFilter/NumericTextFilter.tsx +5 -0
- package/src/components/Filters/SelectionTypes/OptionsFilter/OptionsFilter.scss +6 -10
- package/src/components/Filters/SelectionTypes/OptionsFilter/OptionsFilter.tsx +8 -0
- package/src/components/Filters/SelectionTypes/SearcheableOptionsFilter/SearcheableOptionsFilter.tsx +6 -1
- package/src/components/FormElements/Checkbox/Checkbox.scss +4 -4
- package/src/components/FormElements/CustomTags/CustomTags.scss +1 -1
- package/src/components/FormElements/FileUploadControl/FileUploadControl.scss +4 -4
- package/src/components/FormElements/Radio/Radio.scss +5 -5
- package/src/components/FormElements/Radio/Radio.tsx +3 -2
- package/src/components/FormElements/Select/Select.scss +11 -6
- package/src/components/FormElements/ToggleButton/ToggleButton.scss +7 -7
- package/src/components/FormElements/ToggleButton/ToggleButton.tsx +32 -27
- package/src/components/Hub/Hub.stories.tsx +3 -2
- package/src/components/Hub/Tile/Tile.spec.tsx +7 -2
- package/src/components/Hub/Tile/Tile.tsx +2 -1
- package/src/components/Icons/Icons.scss +1 -0
- package/src/components/Icons/Icons.spec.tsx +90 -41
- package/src/components/Icons/Icons.tsx +357 -765
- package/src/components/InfoTooltip/InfoTooltip.scss +1 -1
- package/src/components/InlineMenu/InlineMenu.scss +2 -2
- package/src/components/LandingPageTiles/LandingPageTiles.stories.tsx +3 -2
- package/src/components/LandingPageTiles/TileLarge/TileLarge.spec.tsx +5 -1
- package/src/components/LandingPageTiles/TileLarge/TileLarge.tsx +2 -1
- package/src/components/LandingPageTiles/TileSmall/TileSmall.spec.tsx +7 -2
- package/src/components/LandingPageTiles/TileSmall/TileSmall.tsx +2 -1
- package/src/components/List/List.scss +4 -4
- package/src/components/List/ListCheckBox/ListCheckBox.tsx +1 -0
- package/src/components/List/ListHeader/ColumnLabel/ColumnLabel.spec.tsx +6 -6
- package/src/components/List/ListHeader/ColumnLabel/ColumnLabel.tsx +10 -13
- package/src/components/List/ListHeader/ListHeader.scss +2 -3
- package/src/components/List/ListHeader/ListHeader.spec.tsx +2 -0
- package/src/components/List/ListHeader/ListHeader.tsx +57 -51
- package/src/components/List/ListRow/ListRow.scss +1 -28
- package/src/components/List/ListRow/ListRow.spec.tsx +10 -8
- package/src/components/List/ListRow/ListRow.tsx +20 -152
- package/src/components/List/ListRow/ListRowCell/ListRowCell.scss +26 -0
- package/src/components/List/ListRow/ListRowCell/ListRowCell.spec.tsx +491 -0
- package/src/components/List/ListRow/ListRowCell/ListRowCell.tsx +57 -0
- package/src/components/List/ListRow/ListRowCell/renderData.tsx +124 -0
- package/src/components/List/ListRow/Renderers/TagsRenderer/TagsRenderer.spec.tsx +191 -80
- package/src/components/List/ListRow/Renderers/TagsRenderer/TagsRenderer.tsx +63 -34
- package/src/components/Loaders/ImageLoader/ImageLoader.spec.tsx +13 -14
- package/src/components/Loaders/ImageLoader/ImageLoader.tsx +5 -3
- package/src/components/PageHeader/PageHeader.scss +1 -1
- package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.tsx +13 -2
- package/src/components/Tabs/Tab/CustomTab.scss +4 -4
- package/src/components/Tabs/TabList/CustomTabList.scss +2 -2
- package/src/components/Utils/Postgraphile/CreateConnectionRenderer.spec.ts +48 -12
- package/src/components/Utils/Postgraphile/CreateConnectionRenderer.tsx +5 -4
- package/src/components/VisualElements/ImgElement.spec.tsx +92 -0
- package/src/components/VisualElements/ImgElement.tsx +72 -0
- package/src/components/VisualElements/SvgElement.spec.tsx +160 -0
- package/src/components/VisualElements/SvgElement.tsx +40 -0
- package/src/components/VisualElements/index.ts +7 -0
- package/src/components/index.ts +1 -0
- package/src/helpers/idleCallbackHelpers.ts +66 -0
- package/src/helpers/index.ts +5 -0
- package/src/hooks/useResize/ResizeIndicator.scss +7 -0
- package/src/hooks/useResize/ResizeIndicator.tsx +39 -0
- package/src/hooks/useResize/{useResize.ts → useResize.tsx} +38 -6
- package/src/index.ts +2 -0
- package/src/styles/branding.scss +89 -0
- package/src/styles/variables.scss +245 -187
|
@@ -13,7 +13,7 @@ $pop-up-arrow-extrusion: -7px;
|
|
|
13
13
|
|
|
14
14
|
box-shadow: 0px 1px 8px 3px rgba(92, 92, 92, 0.27);
|
|
15
15
|
|
|
16
|
-
z-index:
|
|
16
|
+
z-index: 9999;
|
|
17
17
|
|
|
18
18
|
.arrow,
|
|
19
19
|
.arrow::before {
|
|
@@ -102,7 +102,7 @@ $pop-up-arrow-extrusion: -7px;
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
.buttonDefaultOpacity {
|
|
105
|
-
background-color:
|
|
105
|
+
background-color: color-mix(in srgb, white 70%, transparent) !important;
|
|
106
106
|
svg * {
|
|
107
107
|
stroke: var(
|
|
108
108
|
--inline-menu-button-stroke-color,
|
|
@@ -2,6 +2,7 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { MemoryRouter } from 'react-router-dom';
|
|
4
4
|
import { createGroups, getRandomInt } from '../../helpers/storybook';
|
|
5
|
+
import { SvgElement } from '../VisualElements/SvgElement';
|
|
5
6
|
import { LandingPageTiles } from './LandingPageTiles';
|
|
6
7
|
import { LandingPageItem } from './LandingPageTiles.model';
|
|
7
8
|
|
|
@@ -15,7 +16,7 @@ const defaultContainer = {
|
|
|
15
16
|
|
|
16
17
|
const DefaultIcon: React.FC = () => {
|
|
17
18
|
return (
|
|
18
|
-
<
|
|
19
|
+
<SvgElement viewBox="0 0 40 40">
|
|
19
20
|
<path
|
|
20
21
|
vectorEffect="non-scaling-stroke"
|
|
21
22
|
fill="none"
|
|
@@ -23,7 +24,7 @@ const DefaultIcon: React.FC = () => {
|
|
|
23
24
|
d="M39,39H1V1h38V39z M39.1,26l-8.4-8.7l-9.1,11.5
|
|
24
25
|
l-6.4-5.4L3.6,39.1 M12.8,7.8c-2.4,0-4.4,2-4.4,4.4s2,4.4,4.4,4.4s4.4-2,4.4-4.4S15.3,7.8,12.8,7.8z"
|
|
25
26
|
/>
|
|
26
|
-
</
|
|
27
|
+
</SvgElement>
|
|
27
28
|
);
|
|
28
29
|
};
|
|
29
30
|
|
|
@@ -84,7 +84,11 @@ describe('TileLarge', () => {
|
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
it('renders an icon when passed as a string URL', () => {
|
|
87
|
-
const wrapper =
|
|
87
|
+
const wrapper = mount(
|
|
88
|
+
<MemoryRouter>
|
|
89
|
+
<TileLarge {...mockProps} />
|
|
90
|
+
</MemoryRouter>,
|
|
91
|
+
);
|
|
88
92
|
const iconUrl = wrapper.find('img').prop('src');
|
|
89
93
|
|
|
90
94
|
expect(iconUrl).toBe(`${mockProps.icon}`);
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
4
|
import { useValueOrOnDemand } from '../../../hooks/useValueOrOnDemand/useValueOrOnDemand';
|
|
5
5
|
import { Loader } from '../../Loaders/Loader/Loader';
|
|
6
|
+
import { ImgElement } from '../../VisualElements';
|
|
6
7
|
import { LandingPageItem } from '../LandingPageTiles.model';
|
|
7
8
|
import classes from './TileLarge.scss';
|
|
8
9
|
|
|
@@ -56,7 +57,7 @@ export const TileLarge: React.FC<TileLargeProps> = ({
|
|
|
56
57
|
{React.isValidElement(icon)
|
|
57
58
|
? icon
|
|
58
59
|
: typeof icon === 'string' && (
|
|
59
|
-
<
|
|
60
|
+
<ImgElement src={icon} decorative={true} />
|
|
60
61
|
)}
|
|
61
62
|
</div>
|
|
62
63
|
<div className={classes.titlesSection}>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { shallow } from 'enzyme';
|
|
1
|
+
import { mount, shallow } from 'enzyme';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { MemoryRouter } from 'react-router';
|
|
3
4
|
import { TileSmall, TileSmallProps } from './TileSmall';
|
|
4
5
|
|
|
5
6
|
const mockProps: TileSmallProps = {
|
|
@@ -31,7 +32,11 @@ describe('TileSmall', () => {
|
|
|
31
32
|
});
|
|
32
33
|
|
|
33
34
|
it('renders an icon when passed a string URL', () => {
|
|
34
|
-
const wrapper =
|
|
35
|
+
const wrapper = mount(
|
|
36
|
+
<MemoryRouter>
|
|
37
|
+
<TileSmall {...mockProps} />
|
|
38
|
+
</MemoryRouter>,
|
|
39
|
+
);
|
|
35
40
|
const iconUrl = wrapper.find('img').prop('src');
|
|
36
41
|
|
|
37
42
|
expect(iconUrl).toBe(`${mockProps.icon}`);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
|
+
import { ImgElement } from '../../VisualElements';
|
|
4
5
|
import { LandingPageItem } from '../LandingPageTiles.model';
|
|
5
6
|
import classes from './TileSmall.scss';
|
|
6
7
|
|
|
@@ -50,7 +51,7 @@ export const TileSmall: React.FC<TileSmallProps> = ({
|
|
|
50
51
|
{React.isValidElement(icon)
|
|
51
52
|
? icon
|
|
52
53
|
: typeof icon === 'string' && (
|
|
53
|
-
<
|
|
54
|
+
<ImgElement src={icon} decorative={true} />
|
|
54
55
|
)}
|
|
55
56
|
</div>
|
|
56
57
|
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
p {
|
|
43
43
|
margin-left: 10px;
|
|
44
44
|
|
|
45
|
-
color:
|
|
45
|
+
color: var(--ax-neutral-dark);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
background-color:
|
|
48
|
+
background-color: var(--ax-neutral-light) !important;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.error {
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
p {
|
|
57
57
|
margin: 10px 0px 10px 10px;
|
|
58
58
|
|
|
59
|
-
color:
|
|
59
|
+
color: var(--ax-error);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
background-color:
|
|
62
|
+
background-color: color-mix(in srgb, var(--ax-error) 15%, transparent) !important;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallow } from 'enzyme';
|
|
1
|
+
import { mount, shallow } from 'enzyme';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { SortData } from '../../List.model';
|
|
4
4
|
import { ColumnLabel } from './ColumnLabel';
|
|
@@ -37,7 +37,7 @@ describe('ColumnLabel', () => {
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
it('renders the directional arrows by default', () => {
|
|
40
|
-
const wrapper =
|
|
40
|
+
const wrapper = mount(<ColumnLabel propertyName="test-prop" />);
|
|
41
41
|
|
|
42
42
|
const dirArrows = wrapper.find('svg');
|
|
43
43
|
const clickWrapper = wrapper.find('.clickWrapper');
|
|
@@ -77,7 +77,7 @@ describe('ColumnLabel', () => {
|
|
|
77
77
|
);
|
|
78
78
|
|
|
79
79
|
const columnTitle = wrapper.find('.clickWrapper');
|
|
80
|
-
columnTitle.simulate('click');
|
|
80
|
+
columnTitle.simulate('click', { stopPropagation: jest.fn() });
|
|
81
81
|
|
|
82
82
|
expect(spy).toHaveBeenCalledTimes(1);
|
|
83
83
|
expect(spy).toHaveBeenCalledWith({
|
|
@@ -102,7 +102,7 @@ describe('ColumnLabel', () => {
|
|
|
102
102
|
);
|
|
103
103
|
|
|
104
104
|
const columnTitle = wrapper.find('.clickWrapper');
|
|
105
|
-
columnTitle.simulate('click');
|
|
105
|
+
columnTitle.simulate('click', { stopPropagation: jest.fn() });
|
|
106
106
|
|
|
107
107
|
expect(spy).toHaveBeenCalledTimes(1);
|
|
108
108
|
expect(spy).toHaveBeenCalledWith({
|
|
@@ -126,7 +126,7 @@ describe('ColumnLabel', () => {
|
|
|
126
126
|
);
|
|
127
127
|
|
|
128
128
|
const columnTitle = wrapper.find('.clickWrapper');
|
|
129
|
-
columnTitle.simulate('click');
|
|
129
|
+
columnTitle.simulate('click', { stopPropagation: jest.fn() });
|
|
130
130
|
|
|
131
131
|
expect(spy).toHaveBeenCalledTimes(1);
|
|
132
132
|
expect(spy).toHaveBeenCalledWith({
|
|
@@ -150,7 +150,7 @@ describe('ColumnLabel', () => {
|
|
|
150
150
|
);
|
|
151
151
|
|
|
152
152
|
const columnTitle = wrapper.find('.clickWrapper');
|
|
153
|
-
columnTitle.simulate('click');
|
|
153
|
+
columnTitle.simulate('click', { stopPropagation: jest.fn() });
|
|
154
154
|
|
|
155
155
|
expect(spy).toHaveBeenCalledTimes(1);
|
|
156
156
|
expect(spy).toHaveBeenCalledWith({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import React, { PropsWithChildren } from 'react';
|
|
3
3
|
import { noop } from '../../../../helpers/utils';
|
|
4
|
+
import { SvgElement } from '../../../VisualElements/SvgElement';
|
|
4
5
|
import { ColumnSortKeys, SortData } from '../../List.model';
|
|
5
6
|
import classes from './ColumnLabel.scss';
|
|
6
7
|
|
|
@@ -64,7 +65,11 @@ export const ColumnLabel = <T,>({
|
|
|
64
65
|
<div
|
|
65
66
|
className={clsx(classes.clickWrapper, classes.sortable)}
|
|
66
67
|
onClick={
|
|
67
|
-
propertyName &&
|
|
68
|
+
propertyName &&
|
|
69
|
+
((e) => {
|
|
70
|
+
onSortChanged(getSortDir(propertyName));
|
|
71
|
+
e.stopPropagation();
|
|
72
|
+
})
|
|
68
73
|
}
|
|
69
74
|
data-test-id={`list-label:${String(propertyName)}`}
|
|
70
75
|
data-test-sort-dir={direction ?? 'none'}
|
|
@@ -73,26 +78,18 @@ export const ColumnLabel = <T,>({
|
|
|
73
78
|
{label ?? propertyName}
|
|
74
79
|
</span>
|
|
75
80
|
<div className={classes.arrows}>
|
|
76
|
-
<
|
|
77
|
-
version="1.1"
|
|
78
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
79
|
-
viewBox="0 0 13 10"
|
|
80
|
-
>
|
|
81
|
+
<SvgElement viewBox="0 0 13 10">
|
|
81
82
|
<path
|
|
82
83
|
className={clsx({ [classes.sorted]: direction === 'asc' })}
|
|
83
84
|
d="M1.5,7.3l4.8-5.7l5.2,5.7"
|
|
84
85
|
></path>
|
|
85
|
-
</
|
|
86
|
-
<
|
|
87
|
-
version="1.1"
|
|
88
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
89
|
-
viewBox="0 0 13 10"
|
|
90
|
-
>
|
|
86
|
+
</SvgElement>
|
|
87
|
+
<SvgElement viewBox="0 0 13 10">
|
|
91
88
|
<path
|
|
92
89
|
className={clsx({ [classes.sorted]: direction === 'desc' })}
|
|
93
90
|
d="M11.5,2.8L6.7,8.5L1.5,2.8"
|
|
94
91
|
></path>
|
|
95
|
-
</
|
|
92
|
+
</SvgElement>
|
|
96
93
|
</div>
|
|
97
94
|
</div>
|
|
98
95
|
</div>
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
display: grid;
|
|
6
6
|
position: sticky;
|
|
7
7
|
top: 0;
|
|
8
|
-
//z-index: 1;
|
|
9
8
|
|
|
10
9
|
background-color: var(
|
|
11
10
|
--explorer-header-background-color,
|
|
@@ -13,7 +12,7 @@
|
|
|
13
12
|
);
|
|
14
13
|
|
|
15
14
|
box-sizing: border-box;
|
|
16
|
-
border-bottom: solid 1px
|
|
15
|
+
border-bottom: solid 1px var(--ax-neutral-light);
|
|
17
16
|
|
|
18
17
|
.columnLabel {
|
|
19
18
|
box-sizing: border-box;
|
|
@@ -29,7 +28,7 @@
|
|
|
29
28
|
height: 100%;
|
|
30
29
|
|
|
31
30
|
z-index: 1;
|
|
32
|
-
border-right: var(--explorer-list-row-border, 1px solid
|
|
31
|
+
border-right: var(--explorer-list-row-border, 1px solid var(--ax-neutral-light));
|
|
33
32
|
position: absolute;
|
|
34
33
|
right: 0;
|
|
35
34
|
|
|
@@ -85,60 +85,66 @@ export const ListHeader = <T extends Data>({
|
|
|
85
85
|
alignItems: verticalTextAlign,
|
|
86
86
|
} as React.CSSProperties;
|
|
87
87
|
|
|
88
|
-
const { cols, mouseDown } = useResize(
|
|
88
|
+
const { cols, mouseDown, ResizeIndicator } = useResize(
|
|
89
|
+
columns,
|
|
90
|
+
onColumnSizesChanged,
|
|
91
|
+
);
|
|
89
92
|
|
|
90
93
|
return (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
ref={cols[i].ref}
|
|
100
|
-
className={clsx(classes.columnLabel)}
|
|
101
|
-
>
|
|
102
|
-
<ColumnLabel<T>
|
|
103
|
-
propertyName={column.propertyName}
|
|
104
|
-
label={column.label ?? (column.propertyName as string)}
|
|
105
|
-
sortable={column.sortable}
|
|
106
|
-
columnSortKeys={column?.columnSortKeys}
|
|
107
|
-
sortData={sortData}
|
|
108
|
-
onSortChanged={onSortChanged}
|
|
109
|
-
/>
|
|
94
|
+
<>
|
|
95
|
+
{ResizeIndicator}
|
|
96
|
+
<div
|
|
97
|
+
className={clsx(classes.container, 'list-header-container', className)}
|
|
98
|
+
style={customStyles}
|
|
99
|
+
data-test-id="list-header"
|
|
100
|
+
>
|
|
101
|
+
{columns.map((column, i) => (
|
|
110
102
|
<div
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
isDisabled={isCheckboxDisabled}
|
|
137
|
-
onCheckBoxToggled={onCheckboxToggled}
|
|
103
|
+
key={column.key ?? (column.propertyName as string)}
|
|
104
|
+
ref={cols[i].ref}
|
|
105
|
+
className={clsx(classes.columnLabel)}
|
|
106
|
+
>
|
|
107
|
+
<ColumnLabel<T>
|
|
108
|
+
propertyName={column.propertyName}
|
|
109
|
+
label={column.label ?? (column.propertyName as string)}
|
|
110
|
+
sortable={column.sortable}
|
|
111
|
+
columnSortKeys={column?.columnSortKeys}
|
|
112
|
+
sortData={sortData}
|
|
113
|
+
onSortChanged={onSortChanged}
|
|
114
|
+
/>
|
|
115
|
+
<div
|
|
116
|
+
onMouseDown={
|
|
117
|
+
!column.disableResizing
|
|
118
|
+
? (e) => {
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
mouseDown(i);
|
|
121
|
+
}
|
|
122
|
+
: undefined
|
|
123
|
+
}
|
|
124
|
+
onDoubleClick={() => onResetColumnSizes()}
|
|
125
|
+
className={clsx(classes.resizeHandle, {
|
|
126
|
+
[classes.resizeHandleDisabled]: column.disableResizing,
|
|
127
|
+
})}
|
|
138
128
|
/>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
129
|
+
</div>
|
|
130
|
+
))}
|
|
131
|
+
{hasActionColumn && (
|
|
132
|
+
<div
|
|
133
|
+
ref={cols[cols.length - 1].ref}
|
|
134
|
+
className={clsx(classes.columnLabel)}
|
|
135
|
+
>
|
|
136
|
+
{showItemCheckbox && (
|
|
137
|
+
<ListCheckBox
|
|
138
|
+
height={actionSize}
|
|
139
|
+
width={actionSize}
|
|
140
|
+
isChecked={itemSelected}
|
|
141
|
+
isDisabled={isCheckboxDisabled}
|
|
142
|
+
onCheckBoxToggled={onCheckboxToggled}
|
|
143
|
+
/>
|
|
144
|
+
)}
|
|
145
|
+
</div>
|
|
146
|
+
)}
|
|
147
|
+
</div>
|
|
148
|
+
</>
|
|
143
149
|
);
|
|
144
150
|
};
|
|
@@ -29,34 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
&.disabled {
|
|
31
31
|
cursor: not-allowed;
|
|
32
|
-
color: var(--disabled-text-color,
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.cellWrapper {
|
|
36
|
-
display: grid;
|
|
37
|
-
width: 100%;
|
|
38
|
-
height: 100%;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.cell {
|
|
42
|
-
max-width: 100%;
|
|
43
|
-
max-height: 100%;
|
|
44
|
-
|
|
45
|
-
span {
|
|
46
|
-
padding: 5px 0;
|
|
47
|
-
display: block;
|
|
48
|
-
width: 100%;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&.nowrap {
|
|
52
|
-
overflow: hidden;
|
|
53
|
-
|
|
54
|
-
span {
|
|
55
|
-
white-space: nowrap;
|
|
56
|
-
text-overflow: ellipsis;
|
|
57
|
-
overflow: hidden;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
32
|
+
color: var(--disabled-text-color, var(--ax-neutral));
|
|
60
33
|
}
|
|
61
34
|
|
|
62
35
|
.actions {
|
|
@@ -47,7 +47,7 @@ describe('ListRow', () => {
|
|
|
47
47
|
`(
|
|
48
48
|
'renders the defined columns in the defined order -> $name',
|
|
49
49
|
({ expectedColumns }: { expectedColumns: Column<TestExplorerData>[] }) => {
|
|
50
|
-
const wrapper =
|
|
50
|
+
const wrapper = mount(
|
|
51
51
|
<ListRow {...mockProps} columns={expectedColumns} />,
|
|
52
52
|
);
|
|
53
53
|
|
|
@@ -74,7 +74,7 @@ describe('ListRow', () => {
|
|
|
74
74
|
|
|
75
75
|
setLocale('en-US');
|
|
76
76
|
|
|
77
|
-
const wrapper =
|
|
77
|
+
const wrapper = mount(
|
|
78
78
|
<ListRow
|
|
79
79
|
data={rowData}
|
|
80
80
|
columns={expectedColumns}
|
|
@@ -115,7 +115,7 @@ describe('ListRow', () => {
|
|
|
115
115
|
];
|
|
116
116
|
const rowData = { value: 'something' };
|
|
117
117
|
|
|
118
|
-
const wrapper =
|
|
118
|
+
const wrapper = mount(
|
|
119
119
|
// @ts-expect-error Typings to not match up
|
|
120
120
|
<ListRow {...mockProps} data={rowData} columns={expectedColumns} />,
|
|
121
121
|
);
|
|
@@ -129,9 +129,7 @@ describe('ListRow', () => {
|
|
|
129
129
|
{ propertyName: "doesn't exist", size: '1fr', label: 'desc' },
|
|
130
130
|
];
|
|
131
131
|
|
|
132
|
-
const wrapper =
|
|
133
|
-
<ListRow {...mockProps} columns={expectedColumns} />,
|
|
134
|
-
);
|
|
132
|
+
const wrapper = mount(<ListRow {...mockProps} columns={expectedColumns} />);
|
|
135
133
|
|
|
136
134
|
const actualColumns = wrapper.find('.cellWrapper');
|
|
137
135
|
|
|
@@ -488,12 +486,16 @@ describe('ListRow', () => {
|
|
|
488
486
|
];
|
|
489
487
|
const rowData = { value: mockValue };
|
|
490
488
|
|
|
491
|
-
const wrapper =
|
|
489
|
+
const wrapper = mount(
|
|
492
490
|
// @ts-expect-error Typings to not match up
|
|
493
491
|
<ListRow {...mockProps} data={rowData} columns={expectedColumns} />,
|
|
494
492
|
);
|
|
495
493
|
|
|
496
|
-
|
|
494
|
+
// When a custom renderer returns a string, it's wrapped in a span with data-test-id
|
|
495
|
+
const span = wrapper
|
|
496
|
+
.find('span[data-test-id="list-entry-property:value"]')
|
|
497
|
+
.first();
|
|
498
|
+
const cell = span.closest('.cell');
|
|
497
499
|
|
|
498
500
|
expect(cell.prop('title')).toBe(mockValue);
|
|
499
501
|
});
|