@ssa-ui-kit/widgets 0.0.6-alpha → 0.0.8-alpha
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/custom-shots/widgets-bots-table--no-control-orders--menu-opened_[w1920px].png +0 -0
- package/custom-shots/widgets-bots-table--no-control-orders--run-reason-modal_[w1920px].png +0 -0
- package/custom-shots/widgets-collapsiblenavbar-opened__[w1920px].png +0 -0
- package/custom-shots/widgets-collapsiblenavbar-opened__[w1920px]_side_menu_expanded.png +0 -0
- package/custom-shots/widgets-collapsiblenavbar-opened__[w899px]_menu_opened.png +0 -0
- package/custom-shots/widgets-collapsiblenavbar-opened__[w899px]_statistics_submenu.png +0 -0
- package/custom-shots/widgets-filters--default__[w1920px].png +0 -0
- package/custom-shots/widgets-filters--filter-button__[w900px].png +0 -0
- package/custom-shots/widgets-filters--more-button__[w900px].png +0 -0
- package/custom-shots/widgets-linkstabbar--current-focus__[w1920px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__[w1440px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__[w1920px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__[w390px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__[w900px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__dropdown__[w900px].png +0 -0
- package/custom-shots/widgets-navbar-opened__[w1920px].png +0 -0
- package/custom-shots/widgets-notification-menu--is-opened__[w1440px].png +0 -0
- package/custom-shots/widgets-notification-menu--is-opened__[w390px].png +0 -0
- package/custom-shots/widgets-notification-menu--is-opened__[w900px].png +0 -0
- package/custom-shots/widgets-pagination-disabled--next-hover__[w1920px].png +0 -0
- package/custom-shots/widgets-pagination-disabled--not-selected-hover__[w1920px].png +0 -0
- package/custom-shots/widgets-pagination-disabled--previous-hover__[w1920px].png +0 -0
- package/custom-shots/widgets-pagination-disabled--selected-hover__[w1920px].png +0 -0
- package/custom-shots/widgets-progressInfo__[w1440px].png +0 -0
- package/custom-shots/widgets-progressInfo__[w1920px].png +0 -0
- package/custom-shots/widgets-progressInfo__[w390px].png +0 -0
- package/custom-shots/widgets-progressInfo__[w900px].png +0 -0
- package/custom-shots/widgets-progressInfo__dropdown__[w390px].png +0 -0
- package/custom-shots/widgets-progressInfo__dropdown__[w900px].png +0 -0
- package/custom-shots/widgets-table-filters--opened__[w1920px].png +0 -0
- package/dist/components/TableFilters/TableFilterTrigger.d.ts +1 -1
- package/dist/components/TableFilters/TableFilterTriggerWithNotification.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/ExchangeAccount/styles.ts +0 -1
- package/src/components/Filters/Filters.e2e.ts +38 -3
- package/src/components/TableFilters/TableFilterTrigger.tsx +13 -1
- package/src/components/TableFilters/TableFilterTriggerWithNotification.tsx +2 -2
- package/src/components/TableFilters/TableFilters.e2e.ts +6 -2
- package/src/components/TableFilters/TableFilters.tsx +2 -3
- package/src/components/TableFilters/hooks/useTableData.ts +1 -1
- package/test-results/{src-components-UserProfile-UserProfile.e2e.ts--914db-r-info-and-logout-button-when-avatar-is-hovered-chromium → src-components-TableFilters-TableFilters.e2e.ts-Widgets-TableFilters-Opens-popover-chromium}/trace.zip +0 -0
- package/tsbuildcache +1 -1
- package/test-results/src-components-UserProfile-UserProfile.e2e.ts--1569e-r-info-and-logout-button-when-avatar-is-clicked-chromium/trace.zip +0 -0
- package/test-results/src-components-UserProfile-UserProfile.e2e.ts-Widgets-UserProfile-is-opened-chromium/trace.zip +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssa-ui-kit/widgets",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8-alpha",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"private": false,
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"js-tokens": "^4.0.0",
|
|
30
30
|
"loose-envify": "^1.4.0",
|
|
31
31
|
"scheduler": "^0.23.0",
|
|
32
|
-
"@ssa-ui-kit/core": "^0.0.
|
|
33
|
-
"@ssa-ui-kit/
|
|
34
|
-
"@ssa-ui-kit/
|
|
32
|
+
"@ssa-ui-kit/core": "^0.0.6-alpha",
|
|
33
|
+
"@ssa-ui-kit/utils": "^0.0.1-alpha",
|
|
34
|
+
"@ssa-ui-kit/hooks": "^0.0.1-alpha"
|
|
35
35
|
},
|
|
36
36
|
"browserslist": [
|
|
37
37
|
">0.1%",
|
|
@@ -23,19 +23,47 @@ test('Widgets: Filters should be opened correctly', async ({ page }) => {
|
|
|
23
23
|
test('Widgets: Filters - More button should be shown', async ({ page }) => {
|
|
24
24
|
await gotoPage(page);
|
|
25
25
|
await page.setViewportSize(SCREEN_SIZES[900]);
|
|
26
|
-
|
|
26
|
+
const triggerButton = page.getByTestId('trigger-button');
|
|
27
|
+
const beforeContent = await triggerButton.evaluate((el) => {
|
|
28
|
+
return window.getComputedStyle(el, ':before').content;
|
|
29
|
+
});
|
|
30
|
+
await expect(beforeContent).toEqual('"More"');
|
|
31
|
+
const buttonText = await triggerButton.innerText();
|
|
32
|
+
await expect(buttonText).toEqual('2');
|
|
27
33
|
const SCREENSHOT_PREFIX = `${WIDGETS_CUSTOM_SHOTS_PATH}widgets-filters--more-button__`;
|
|
28
34
|
await page.screenshot({
|
|
29
35
|
path: `${SCREENSHOT_PREFIX}[w900px].png`,
|
|
30
36
|
});
|
|
31
37
|
});
|
|
32
38
|
|
|
39
|
+
test('Widgets: Filters - Filter button should be shown', async ({ page }) => {
|
|
40
|
+
await gotoPage(page);
|
|
41
|
+
await page.setViewportSize(SCREEN_SIZES[390]);
|
|
42
|
+
const triggerButton = page.getByTestId('trigger-button');
|
|
43
|
+
const beforeContent = await triggerButton.evaluate((el) => {
|
|
44
|
+
return window.getComputedStyle(el, ':before').content;
|
|
45
|
+
});
|
|
46
|
+
expect(beforeContent).toEqual('"Filter"');
|
|
47
|
+
const buttonText = await triggerButton.innerText();
|
|
48
|
+
expect(buttonText).toEqual('4');
|
|
49
|
+
const SCREENSHOT_PREFIX = `${WIDGETS_CUSTOM_SHOTS_PATH}widgets-filters--filter-button__`;
|
|
50
|
+
await page.screenshot({
|
|
51
|
+
path: `${SCREENSHOT_PREFIX}[w390px].png`,
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
33
55
|
test('Widgets: Filters - More button count notification should be changed', async ({
|
|
34
56
|
page,
|
|
35
57
|
}) => {
|
|
36
58
|
await gotoPage(page);
|
|
37
59
|
await page.setViewportSize(SCREEN_SIZES[900]);
|
|
38
|
-
|
|
60
|
+
let triggerButton = page.getByTestId('trigger-button');
|
|
61
|
+
let beforeContent = await triggerButton.evaluate((el) => {
|
|
62
|
+
return window.getComputedStyle(el, ':before').content;
|
|
63
|
+
});
|
|
64
|
+
expect(beforeContent).toEqual('"More"');
|
|
65
|
+
let buttonText = await triggerButton.innerText();
|
|
66
|
+
expect(buttonText).toEqual('2');
|
|
39
67
|
|
|
40
68
|
await page.getByText('Status: Running').click();
|
|
41
69
|
await page.getByRole('button', { name: 'Stopped' }).click();
|
|
@@ -43,5 +71,12 @@ test('Widgets: Filters - More button count notification should be changed', asyn
|
|
|
43
71
|
|
|
44
72
|
await page.getByText('strategy #3Carrot down').click();
|
|
45
73
|
await page.getByRole('button', { name: 'strategy #3 checkbox1' }).click();
|
|
46
|
-
|
|
74
|
+
|
|
75
|
+
triggerButton = page.getByTestId('trigger-button');
|
|
76
|
+
beforeContent = await triggerButton.evaluate((el) => {
|
|
77
|
+
return window.getComputedStyle(el, ':before').content;
|
|
78
|
+
});
|
|
79
|
+
expect(beforeContent).toEqual('"More"');
|
|
80
|
+
buttonText = await triggerButton.innerText();
|
|
81
|
+
expect(buttonText).toEqual('3');
|
|
47
82
|
});
|
|
@@ -14,6 +14,17 @@ export const filterButtonStyles = (theme: Theme) => css`
|
|
|
14
14
|
gap: 5px;
|
|
15
15
|
user-select: none;
|
|
16
16
|
|
|
17
|
+
&::before {
|
|
18
|
+
display: block;
|
|
19
|
+
content: 'Filter';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@media screen and (min-width: 900px) {
|
|
23
|
+
&::before {
|
|
24
|
+
content: 'More';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
17
28
|
&:hover {
|
|
18
29
|
border-color: ${theme.colors.greyDropdownFocused};
|
|
19
30
|
}
|
|
@@ -28,10 +39,11 @@ export const filterButtonStyles = (theme: Theme) => css`
|
|
|
28
39
|
`;
|
|
29
40
|
|
|
30
41
|
export const TableFilterTrigger = ({
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
31
43
|
children,
|
|
32
44
|
...rest
|
|
33
45
|
}: {
|
|
34
|
-
children
|
|
46
|
+
children?: React.ReactNode;
|
|
35
47
|
as?: string;
|
|
36
48
|
className?: string;
|
|
37
49
|
}) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { Interpolation, Theme, useTheme } from '@emotion/react';
|
|
1
2
|
import { MultipleDropdownNotification } from '@ssa-ui-kit/core';
|
|
2
3
|
import { TableFilterTrigger } from './TableFilterTrigger';
|
|
3
|
-
import { Interpolation, Theme, useTheme } from '@emotion/react';
|
|
4
4
|
|
|
5
5
|
export const TableFilterTriggerWithNotification = ({
|
|
6
6
|
children,
|
|
7
7
|
count,
|
|
8
8
|
visible = true,
|
|
9
9
|
}: {
|
|
10
|
-
children
|
|
10
|
+
children?: React.ReactNode;
|
|
11
11
|
count?: number;
|
|
12
12
|
visible?: boolean;
|
|
13
13
|
}) => {
|
|
@@ -13,13 +13,17 @@ const gotoPage = (page: Page) => {
|
|
|
13
13
|
test.describe('Widgets: TableFilters', () => {
|
|
14
14
|
test('Renders correctly', async ({ page }) => {
|
|
15
15
|
await gotoPage(page);
|
|
16
|
-
|
|
16
|
+
const triggerButton = page.getByTestId('trigger-button');
|
|
17
|
+
const beforeContent = await triggerButton.evaluate((el) => {
|
|
18
|
+
return window.getComputedStyle(el, ':before').content;
|
|
19
|
+
});
|
|
20
|
+
expect(beforeContent).toEqual('"More"');
|
|
17
21
|
});
|
|
18
22
|
|
|
19
23
|
test('Opens popover', async ({ page }) => {
|
|
20
24
|
await page.setViewportSize(SCREEN_SIZES[1920]);
|
|
21
25
|
await gotoPage(page);
|
|
22
|
-
await page.
|
|
26
|
+
await page.getByTestId('trigger-button').click();
|
|
23
27
|
|
|
24
28
|
await page.screenshot({
|
|
25
29
|
path: `${SCREENSHOT_PREFIX}[w1920px].png`,
|
|
@@ -118,9 +118,8 @@ export const TableFilters = ({
|
|
|
118
118
|
}}>
|
|
119
119
|
<TableFilterTriggerWithNotification
|
|
120
120
|
count={selectedGroupsCount}
|
|
121
|
-
visible={isMoreButtonVisible}
|
|
122
|
-
|
|
123
|
-
</TableFilterTriggerWithNotification>
|
|
121
|
+
visible={isMoreButtonVisible}
|
|
122
|
+
/>
|
|
124
123
|
<PopoverContent className="popover" css={tableFilterPopoverContentStyles}>
|
|
125
124
|
<form
|
|
126
125
|
onSubmit={handleSubmit}
|
|
@@ -68,7 +68,7 @@ export const useTableData = ({
|
|
|
68
68
|
|
|
69
69
|
useEffect(() => {
|
|
70
70
|
proceedSettingCheckboxData(updatedCheckboxData);
|
|
71
|
-
}, [updatedCheckboxData]);
|
|
71
|
+
}, [JSON.stringify(updatedCheckboxData)]);
|
|
72
72
|
|
|
73
73
|
const onCheckboxToggle = (groupName: string, name: string | number) => {
|
|
74
74
|
const { items, path } = getCheckboxChangedItems(
|