@astral/ui 4.34.0 → 4.34.2
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/components/Badge/styles.js +5 -0
- package/components/Badge/types.d.ts +1 -1
- package/components/Chip/Chip.js +3 -3
- package/components/Chip/ChipProvider/ChipProvider.d.ts +26 -0
- package/components/Chip/ChipProvider/ChipProvider.js +13 -0
- package/components/Chip/ChipProvider/index.d.ts +1 -0
- package/components/Chip/ChipProvider/index.js +1 -0
- package/components/Chip/index.d.ts +2 -1
- package/components/Chip/index.js +1 -0
- package/components/Chip/public.d.ts +2 -1
- package/components/Chip/public.js +1 -0
- package/components/Chip/styles.d.ts +7 -3
- package/components/Chip/styles.js +26 -2
- package/components/Chip/types.d.ts +21 -1
- package/components/Chip/useLogic/useLogic.d.ts +5 -4
- package/components/Chip/useLogic/useLogic.js +11 -3
- package/components/Counter/Counter.d.ts +5 -1
- package/components/Counter/Counter.js +1 -1
- package/components/Counter/types.d.ts +1 -1
- package/components/DashboardSidebarCounter/styles.d.ts +1 -0
- package/components/DataGridPaginationContainer/styles.js +1 -1
- package/components/MenuOrganization/faker.js +112 -18
- package/components/PageContent/styles.js +1 -0
- package/components/PageHeader/HeaderContent/FormFiltersProvider/FormFiltersProvider.d.ts +15 -0
- package/components/PageHeader/HeaderContent/FormFiltersProvider/FormFiltersProvider.js +8 -0
- package/components/PageHeader/HeaderContent/FormFiltersProvider/index.d.ts +1 -0
- package/components/PageHeader/HeaderContent/FormFiltersProvider/index.js +1 -0
- package/components/PageHeader/HeaderContent/HeaderContent.js +3 -2
- package/components/PageHeader/HeaderContent/index.d.ts +1 -0
- package/components/PageHeader/HeaderContent/index.js +1 -0
- package/components/PageHeader/HeaderContent/styles.d.ts +0 -4
- package/components/PageHeader/HeaderContent/styles.js +1 -10
- package/components/PageHeader/PageActions/PageActions.js +1 -1
- package/components/PageHeader/constants.d.ts +2 -0
- package/components/PageHeader/constants.js +2 -0
- package/components/PageHeader/index.d.ts +1 -0
- package/components/PageHeader/index.js +1 -0
- package/components/PageHeader/styles.js +21 -0
- package/components/PageLayoutContainer/styles.js +6 -0
- package/components/TagBadge/styles.js +2 -1
- package/hook-form/FormFilters/AllFiltersButton/styles.d.ts +1 -0
- package/hook-form/FormFilters/AllFiltersButton/types.d.ts +1 -0
- package/hook-form/FormFilters/AllFiltersButton/useLogic/useLogic.d.ts +1 -1
- package/hook-form/FormFilters/AllFiltersButton/useLogic/useLogic.js +21 -5
- package/hook-form/FormFilters/FormFilters.js +7 -4
- package/hook-form/FormFilters/FormFiltersDialog/FormFiltersDialog.js +4 -4
- package/hook-form/FormFilters/FormFiltersDialog/ResetButton/ResetButton.d.ts +6 -0
- package/hook-form/FormFilters/FormFiltersDialog/ResetButton/ResetButton.js +11 -0
- package/hook-form/FormFilters/FormFiltersDialog/ResetButton/index.d.ts +1 -0
- package/hook-form/FormFilters/FormFiltersDialog/ResetButton/index.js +1 -0
- package/hook-form/FormFilters/FormFiltersDialog/ResetButton/styles.d.ts +14 -0
- package/hook-form/FormFilters/FormFiltersDialog/ResetButton/styles.js +14 -0
- package/hook-form/FormFilters/FormFiltersDialog/ResetButton/useLogic/index.d.ts +1 -0
- package/hook-form/FormFilters/FormFiltersDialog/ResetButton/useLogic/index.js +1 -0
- package/hook-form/FormFilters/FormFiltersDialog/ResetButton/useLogic/useLogic.d.ts +6 -0
- package/hook-form/FormFilters/FormFiltersDialog/ResetButton/useLogic/useLogic.js +11 -0
- package/hook-form/FormFilters/FormFiltersDialog/styles.d.ts +1 -10
- package/hook-form/FormFilters/FormFiltersDialog/styles.js +1 -9
- package/hook-form/FormFilters/FormFiltersDialog/useLogic/useLogic.d.ts +4 -2
- package/hook-form/FormFilters/FormFiltersDialog/useLogic/useLogic.js +4 -5
- package/hook-form/FormFilters/FormFiltersSkeleton/FormFiltersSkeleton.js +4 -1
- package/hook-form/FormFilters/styles.d.ts +4 -0
- package/hook-form/FormFilters/styles.js +11 -2
- package/hook-form/FormFilters/types.d.ts +24 -4
- package/hook-form/FormFilters/useLogic/useLogic.d.ts +2 -1
- package/hook-form/FormFilters/useLogic/useLogic.js +13 -2
- package/hook-form/FormFilters/utils/checkIsFilledValue/checkIsFilledValue.d.ts +1 -0
- package/hook-form/FormFilters/utils/checkIsFilledValue/checkIsFilledValue.js +18 -0
- package/hook-form/FormFilters/utils/checkIsFilledValue/index.d.ts +1 -0
- package/hook-form/FormFilters/utils/checkIsFilledValue/index.js +1 -0
- package/hook-form/FormFilters/utils/getFilledCount/getFilledCount.d.ts +1 -0
- package/hook-form/FormFilters/utils/getFilledCount/getFilledCount.js +4 -0
- package/hook-form/FormFilters/utils/getFilledCount/index.d.ts +1 -0
- package/hook-form/FormFilters/utils/getFilledCount/index.js +1 -0
- package/hook-form/FormFilters/utils/index.d.ts +2 -0
- package/hook-form/FormFilters/utils/index.js +2 -0
- package/hook-form/FormQuickFilters/FormQuickFilters.d.ts +26 -0
- package/hook-form/FormQuickFilters/FormQuickFilters.js +46 -0
- package/hook-form/FormQuickFilters/constants.d.ts +6 -0
- package/hook-form/FormQuickFilters/constants.js +6 -0
- package/hook-form/FormQuickFilters/index.d.ts +2 -0
- package/hook-form/FormQuickFilters/index.js +1 -0
- package/hook-form/FormQuickFilters/public.d.ts +2 -0
- package/hook-form/FormQuickFilters/public.js +1 -0
- package/hook-form/FormQuickFilters/styles.d.ts +9 -0
- package/hook-form/FormQuickFilters/styles.js +16 -0
- package/hook-form/FormQuickFilters/types.d.ts +62 -0
- package/hook-form/FormQuickFilters/types.js +1 -0
- package/hook-form/FormQuickFilters/useLogic/useLogic.d.ts +18 -0
- package/hook-form/FormQuickFilters/useLogic/useLogic.js +59 -0
- package/hook-form/FormWizard/Footer/Footer.js +1 -1
- package/node/components/Badge/styles.js +5 -0
- package/node/components/Badge/types.d.ts +1 -1
- package/node/components/Chip/Chip.js +2 -2
- package/node/components/Chip/ChipProvider/ChipProvider.d.ts +26 -0
- package/node/components/Chip/ChipProvider/ChipProvider.js +17 -0
- package/node/components/Chip/ChipProvider/index.d.ts +1 -0
- package/node/components/Chip/ChipProvider/index.js +17 -0
- package/node/components/Chip/index.d.ts +2 -1
- package/node/components/Chip/index.js +3 -1
- package/node/components/Chip/public.d.ts +2 -1
- package/node/components/Chip/public.js +3 -1
- package/node/components/Chip/styles.d.ts +7 -3
- package/node/components/Chip/styles.js +27 -3
- package/node/components/Chip/types.d.ts +21 -1
- package/node/components/Chip/useLogic/useLogic.d.ts +5 -4
- package/node/components/Chip/useLogic/useLogic.js +10 -2
- package/node/components/Counter/Counter.d.ts +5 -1
- package/node/components/Counter/Counter.js +1 -1
- package/node/components/Counter/types.d.ts +1 -1
- package/node/components/DashboardSidebarCounter/styles.d.ts +1 -0
- package/node/components/DataGridPaginationContainer/styles.js +1 -1
- package/node/components/MenuOrganization/faker.js +112 -18
- package/node/components/PageContent/styles.js +1 -0
- package/node/components/PageHeader/HeaderContent/FormFiltersProvider/FormFiltersProvider.d.ts +15 -0
- package/node/components/PageHeader/HeaderContent/FormFiltersProvider/FormFiltersProvider.js +12 -0
- package/node/components/PageHeader/HeaderContent/FormFiltersProvider/index.d.ts +1 -0
- package/node/components/PageHeader/HeaderContent/FormFiltersProvider/index.js +6 -0
- package/node/components/PageHeader/HeaderContent/HeaderContent.js +2 -1
- package/node/components/PageHeader/HeaderContent/index.d.ts +1 -0
- package/node/components/PageHeader/HeaderContent/index.js +1 -0
- package/node/components/PageHeader/HeaderContent/styles.d.ts +0 -4
- package/node/components/PageHeader/HeaderContent/styles.js +2 -11
- package/node/components/PageHeader/PageActions/PageActions.js +1 -1
- package/node/components/PageHeader/constants.d.ts +2 -0
- package/node/components/PageHeader/constants.js +2 -0
- package/node/components/PageHeader/index.d.ts +1 -0
- package/node/components/PageHeader/index.js +3 -1
- package/node/components/PageHeader/styles.js +21 -0
- package/node/components/PageLayoutContainer/styles.js +6 -0
- package/node/components/TagBadge/styles.js +2 -1
- package/node/hook-form/FormFilters/AllFiltersButton/styles.d.ts +1 -0
- package/node/hook-form/FormFilters/AllFiltersButton/types.d.ts +1 -0
- package/node/hook-form/FormFilters/AllFiltersButton/useLogic/useLogic.d.ts +1 -1
- package/node/hook-form/FormFilters/AllFiltersButton/useLogic/useLogic.js +27 -11
- package/node/hook-form/FormFilters/FormFilters.js +5 -2
- package/node/hook-form/FormFilters/FormFiltersDialog/FormFiltersDialog.js +3 -3
- package/node/hook-form/FormFilters/FormFiltersDialog/ResetButton/ResetButton.d.ts +6 -0
- package/node/hook-form/FormFilters/FormFiltersDialog/ResetButton/ResetButton.js +15 -0
- package/node/hook-form/FormFilters/FormFiltersDialog/ResetButton/index.d.ts +1 -0
- package/node/hook-form/FormFilters/FormFiltersDialog/ResetButton/index.js +17 -0
- package/node/hook-form/FormFilters/FormFiltersDialog/ResetButton/styles.d.ts +14 -0
- package/node/hook-form/FormFilters/FormFiltersDialog/ResetButton/styles.js +17 -0
- package/node/hook-form/FormFilters/FormFiltersDialog/ResetButton/useLogic/index.d.ts +1 -0
- package/node/hook-form/FormFilters/FormFiltersDialog/ResetButton/useLogic/index.js +17 -0
- package/node/hook-form/FormFilters/FormFiltersDialog/ResetButton/useLogic/useLogic.d.ts +6 -0
- package/node/hook-form/FormFilters/FormFiltersDialog/ResetButton/useLogic/useLogic.js +15 -0
- package/node/hook-form/FormFilters/FormFiltersDialog/styles.d.ts +1 -10
- package/node/hook-form/FormFilters/FormFiltersDialog/styles.js +2 -10
- package/node/hook-form/FormFilters/FormFiltersDialog/useLogic/useLogic.d.ts +4 -2
- package/node/hook-form/FormFilters/FormFiltersDialog/useLogic/useLogic.js +4 -5
- package/node/hook-form/FormFilters/FormFiltersSkeleton/FormFiltersSkeleton.js +4 -1
- package/node/hook-form/FormFilters/styles.d.ts +4 -0
- package/node/hook-form/FormFilters/styles.js +12 -3
- package/node/hook-form/FormFilters/types.d.ts +24 -4
- package/node/hook-form/FormFilters/useLogic/useLogic.d.ts +2 -1
- package/node/hook-form/FormFilters/useLogic/useLogic.js +12 -1
- package/node/hook-form/FormFilters/utils/checkIsFilledValue/checkIsFilledValue.d.ts +1 -0
- package/node/hook-form/FormFilters/utils/checkIsFilledValue/checkIsFilledValue.js +22 -0
- package/node/hook-form/FormFilters/utils/checkIsFilledValue/index.d.ts +1 -0
- package/node/hook-form/FormFilters/utils/checkIsFilledValue/index.js +5 -0
- package/node/hook-form/FormFilters/utils/getFilledCount/getFilledCount.d.ts +1 -0
- package/node/hook-form/FormFilters/utils/getFilledCount/getFilledCount.js +8 -0
- package/node/hook-form/FormFilters/utils/getFilledCount/index.d.ts +1 -0
- package/node/hook-form/FormFilters/utils/getFilledCount/index.js +5 -0
- package/node/hook-form/FormFilters/utils/index.d.ts +2 -0
- package/node/hook-form/FormFilters/utils/index.js +7 -0
- package/node/hook-form/FormQuickFilters/FormQuickFilters.d.ts +26 -0
- package/node/hook-form/FormQuickFilters/FormQuickFilters.js +50 -0
- package/node/hook-form/FormQuickFilters/constants.d.ts +6 -0
- package/node/hook-form/FormQuickFilters/constants.js +9 -0
- package/node/hook-form/FormQuickFilters/index.d.ts +2 -0
- package/node/hook-form/FormQuickFilters/index.js +5 -0
- package/node/hook-form/FormQuickFilters/public.d.ts +2 -0
- package/node/hook-form/FormQuickFilters/public.js +5 -0
- package/node/hook-form/FormQuickFilters/styles.d.ts +9 -0
- package/node/hook-form/FormQuickFilters/styles.js +19 -0
- package/node/hook-form/FormQuickFilters/types.d.ts +62 -0
- package/node/hook-form/FormQuickFilters/types.js +2 -0
- package/node/hook-form/FormQuickFilters/useLogic/useLogic.d.ts +18 -0
- package/node/hook-form/FormQuickFilters/useLogic/useLogic.js +63 -0
- package/node/hook-form/FormWizard/Footer/Footer.js +1 -1
- package/package.json +1 -1
|
@@ -28,7 +28,7 @@ exports.PaginationWrapper = styled_1.styled.div `
|
|
|
28
28
|
padding-top: ${({ theme }) => theme.spacing(4)};
|
|
29
29
|
|
|
30
30
|
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
31
|
-
padding-top: ${({ theme }) => theme.spacing(
|
|
31
|
+
padding-top: ${({ theme }) => theme.spacing(3)};
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
@@ -4,24 +4,118 @@ exports.makeLongOrganizationNameList = exports.makeOrganizationList = void 0;
|
|
|
4
4
|
const faker_1 = require("@ui/dev/faker");
|
|
5
5
|
const makeOrganizationList = (props) => {
|
|
6
6
|
const { length = 16 } = props || {};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
id: '828223d7-648b-4021-b400-659b4e80296b',
|
|
10
|
+
// cSpell:disable
|
|
11
|
+
name: 'AO ШелеховЛимитед',
|
|
12
|
+
inn: '619550717901',
|
|
13
|
+
active: false,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: '94519882-5ff1-4f66-9b0d-d0b6bfea80c7',
|
|
17
|
+
// cSpell:disable
|
|
18
|
+
name: 'МУП СнабТрейд',
|
|
19
|
+
inn: '842492530192',
|
|
20
|
+
active: false,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: '9e48ce0b-472f-42a4-856f-dc57b44065b5',
|
|
24
|
+
// cSpell:disable
|
|
25
|
+
name: 'ИП ТулпанИнкорпорэйтед',
|
|
26
|
+
inn: '325992270803',
|
|
27
|
+
kpp: '456732438',
|
|
28
|
+
active: true,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'c3acf619-27b7-4321-99ca-4b5ae8019b7d',
|
|
32
|
+
// cSpell:disable
|
|
33
|
+
name: 'ФГУП ТырныаузТоргСбытИнкорпорэйтед',
|
|
34
|
+
inn: '182622552754',
|
|
35
|
+
kpp: '719145463',
|
|
36
|
+
active: false,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'c59164d5-c30a-4d7c-9b5a-1682ce5cfb07',
|
|
40
|
+
name: 'НКО Носков',
|
|
41
|
+
inn: '317246626786',
|
|
42
|
+
kpp: '483722344',
|
|
43
|
+
active: false,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'a35d7def-5dbe-4c3f-9d8b-54deaba086c1',
|
|
47
|
+
name: 'ГУП Ангелина',
|
|
48
|
+
inn: '142270260749',
|
|
49
|
+
kpp: '811542051',
|
|
50
|
+
active: false,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: '79b37721-4f0e-4c3a-8f0f-055d8250c9fa',
|
|
54
|
+
name: 'ОАО ГруппТорг',
|
|
55
|
+
inn: '686064143259',
|
|
56
|
+
active: false,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: '22aa8422-ef4e-48f1-aaf1-9a29789bb54e',
|
|
60
|
+
name: 'ООО Жанна',
|
|
61
|
+
inn: '119507796528',
|
|
62
|
+
kpp: '972633982',
|
|
63
|
+
active: false,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: '884114f2-287d-4246-bae7-ca818026211f',
|
|
67
|
+
name: 'ПАО Усть-ОрдынскийГрупп',
|
|
68
|
+
inn: '725534793751',
|
|
69
|
+
active: true,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: '85a162f5-9c93-4016-b0b7-0e5ee60e5111',
|
|
73
|
+
name: 'ГУП Моисеев',
|
|
74
|
+
inn: '371420452084',
|
|
75
|
+
kpp: '400812565',
|
|
76
|
+
active: true,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'cb9e9d67-c355-4742-93dd-c184756366f9',
|
|
80
|
+
name: 'ИП Дорофей',
|
|
81
|
+
inn: '382425812447',
|
|
82
|
+
active: false,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: '7f274985-bdd6-4197-ba6d-1084db1ce55c',
|
|
86
|
+
name: 'ПАО Брагин',
|
|
87
|
+
inn: '287166176754',
|
|
88
|
+
active: true,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: '7e22e1d2-2f09-4e65-adfb-86d354cc5270',
|
|
92
|
+
// cSpell:disable
|
|
93
|
+
name: 'ОП КулуЛимитедИнкорпорэйтедПром',
|
|
94
|
+
inn: '235350171066',
|
|
95
|
+
active: true,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: '94f90867-8998-4614-a1c8-ec7822bbb2a1',
|
|
99
|
+
name: 'ТСЖ Роман',
|
|
100
|
+
inn: '372054729872',
|
|
101
|
+
kpp: '268816135',
|
|
102
|
+
active: false,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: '51da8ba1-dec5-489d-ab02-824ba748181d',
|
|
106
|
+
// cSpell:disable
|
|
107
|
+
name: 'ФГУП Азарий',
|
|
108
|
+
inn: '213960194519',
|
|
109
|
+
active: false,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: '830ce0f2-7398-44e2-90c8-746fa8b29322',
|
|
113
|
+
name: 'ООО Ксения',
|
|
114
|
+
inn: '338051726600',
|
|
115
|
+
kpp: '721606613',
|
|
116
|
+
active: false,
|
|
117
|
+
},
|
|
118
|
+
].slice(0, length);
|
|
25
119
|
};
|
|
26
120
|
exports.makeOrganizationList = makeOrganizationList;
|
|
27
121
|
const makeLongOrganizationNameList = (props) => {
|
|
@@ -64,6 +64,7 @@ exports.Content = styled_1.styled.div `
|
|
|
64
64
|
|
|
65
65
|
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
66
66
|
padding-right: ${({ theme }) => theme.spacing(4)};
|
|
67
|
+
padding-bottom: ${({ theme }) => theme.spacing(3)};
|
|
67
68
|
padding-left: ${({ theme }) => theme.spacing(4)};
|
|
68
69
|
}
|
|
69
70
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
type FormFiltersLayoutContextValue = {
|
|
3
|
+
filtersClassName?: string;
|
|
4
|
+
quickFiltersClassName?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const FormFiltersLayoutContext: import("react").Context<FormFiltersLayoutContextValue | undefined>;
|
|
7
|
+
type FormFiltersProviderProps = FormFiltersLayoutContextValue & {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Задаёт дополнительные классы для корня фильтров и блока быстрых фильтров
|
|
12
|
+
* (например, из разметки PageHeader).
|
|
13
|
+
*/
|
|
14
|
+
export declare const FormFiltersProvider: ({ children, filtersClassName, quickFiltersClassName, }: FormFiltersProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormFiltersProvider = exports.FormFiltersLayoutContext = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
exports.FormFiltersLayoutContext = (0, react_1.createContext)(undefined);
|
|
7
|
+
/**
|
|
8
|
+
* Задаёт дополнительные классы для корня фильтров и блока быстрых фильтров
|
|
9
|
+
* (например, из разметки PageHeader).
|
|
10
|
+
*/
|
|
11
|
+
const FormFiltersProvider = ({ children, filtersClassName, quickFiltersClassName, }) => ((0, jsx_runtime_1.jsx)(exports.FormFiltersLayoutContext.Provider, { value: { filtersClassName, quickFiltersClassName }, children: children }));
|
|
12
|
+
exports.FormFiltersProvider = FormFiltersProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormFiltersProvider, FormFiltersLayoutContext, } from './FormFiltersProvider';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormFiltersLayoutContext = exports.FormFiltersProvider = void 0;
|
|
4
|
+
var FormFiltersProvider_1 = require("./FormFiltersProvider");
|
|
5
|
+
Object.defineProperty(exports, "FormFiltersProvider", { enumerable: true, get: function () { return FormFiltersProvider_1.FormFiltersProvider; } });
|
|
6
|
+
Object.defineProperty(exports, "FormFiltersLayoutContext", { enumerable: true, get: function () { return FormFiltersProvider_1.FormFiltersLayoutContext; } });
|
|
@@ -8,6 +8,7 @@ const constants_1 = require("../constants");
|
|
|
8
8
|
const PageActions_1 = require("../PageActions");
|
|
9
9
|
const Title_1 = require("../Title");
|
|
10
10
|
const Description_1 = require("./Description");
|
|
11
|
+
const FormFiltersProvider_1 = require("./FormFiltersProvider");
|
|
11
12
|
const styles_1 = require("./styles");
|
|
12
13
|
const HeaderContent = ({ backButton, description, subheader, breadcrumbs, actions, title, filters, isLoading, }) => {
|
|
13
14
|
const renderBreadcrumbs = () => {
|
|
@@ -16,6 +17,6 @@ const HeaderContent = ({ backButton, description, subheader, breadcrumbs, action
|
|
|
16
17
|
}
|
|
17
18
|
return ((0, jsx_runtime_1.jsx)(styles_1.BreadcrumbsWrapper, { children: Array.isArray(breadcrumbs) ? ((0, jsx_runtime_1.jsx)(Breadcrumbs_1.Breadcrumbs, { children: breadcrumbs })) : (breadcrumbs) }));
|
|
18
19
|
};
|
|
19
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [renderBreadcrumbs(), (0, jsx_runtime_1.jsx)(styles_1.DesktopTitleWrapper, { children: (0, jsx_runtime_1.jsx)(Title_1.Title, { backButton: backButton, title: title, isLoading: isLoading, hasDescription: Boolean(description), hasBreadcrumbs: Boolean(breadcrumbs) }) }), (0, jsx_runtime_1.jsx)(Description_1.Description, { description: description, isLoading: isLoading }), actions && ((0, jsx_runtime_1.jsx)(PageActions_1.PageActions, { className: (0, classNames_1.classNames)(constants_1.pageHeaderClassnames.pageHeaderActions), isLoading: isLoading, size: "medium", withCollapseOnLaptop: Boolean(filters), ...actions })), filters && (0, jsx_runtime_1.jsx)(
|
|
20
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [renderBreadcrumbs(), (0, jsx_runtime_1.jsx)(styles_1.DesktopTitleWrapper, { children: (0, jsx_runtime_1.jsx)(Title_1.Title, { backButton: backButton, title: title, isLoading: isLoading, hasDescription: Boolean(description), hasBreadcrumbs: Boolean(breadcrumbs) }) }), (0, jsx_runtime_1.jsx)(Description_1.Description, { description: description, isLoading: isLoading }), actions && ((0, jsx_runtime_1.jsx)(PageActions_1.PageActions, { className: (0, classNames_1.classNames)(constants_1.pageHeaderClassnames.pageHeaderActions), isLoading: isLoading, size: "medium", withCollapseOnLaptop: Boolean(filters), ...actions })), filters && ((0, jsx_runtime_1.jsx)(FormFiltersProvider_1.FormFiltersProvider, { filtersClassName: constants_1.pageHeaderClassnames.filters, quickFiltersClassName: constants_1.pageHeaderClassnames.quickFilters, children: filters })), subheader && (0, jsx_runtime_1.jsx)(styles_1.PageSubheader, { children: subheader })] }));
|
|
20
21
|
};
|
|
21
22
|
exports.HeaderContent = HeaderContent;
|
|
@@ -7,10 +7,6 @@ export declare const PageSubheader: import("@emotion/styled/dist/declarations/sr
|
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
8
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
9
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
-
export declare const PageFilters: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
11
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
-
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
13
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
10
|
export declare const DesktopTitleWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
15
11
|
theme?: import("@emotion/react").Theme | undefined;
|
|
16
12
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DesktopTitleWrapper = exports.
|
|
3
|
+
exports.DesktopTitleWrapper = exports.PageSubheader = exports.BreadcrumbsWrapper = void 0;
|
|
4
4
|
const styled_1 = require("../../styled");
|
|
5
5
|
exports.BreadcrumbsWrapper = styled_1.styled.div `
|
|
6
6
|
grid-column: 2;
|
|
@@ -14,7 +14,7 @@ exports.BreadcrumbsWrapper = styled_1.styled.div `
|
|
|
14
14
|
`;
|
|
15
15
|
exports.PageSubheader = styled_1.styled.div `
|
|
16
16
|
grid-column: 1 / -1;
|
|
17
|
-
grid-row:
|
|
17
|
+
grid-row: 6;
|
|
18
18
|
|
|
19
19
|
padding-top: ${({ theme }) => theme.spacing(4)};
|
|
20
20
|
|
|
@@ -22,15 +22,6 @@ exports.PageSubheader = styled_1.styled.div `
|
|
|
22
22
|
padding: ${({ theme }) => theme.spacing(0, 4, 4, 4)};
|
|
23
23
|
}
|
|
24
24
|
`;
|
|
25
|
-
exports.PageFilters = styled_1.styled.div `
|
|
26
|
-
grid-column: 1 / -1;
|
|
27
|
-
grid-row: 4;
|
|
28
|
-
|
|
29
|
-
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
30
|
-
grid-column: 3;
|
|
31
|
-
grid-row: 1 / 4;
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
25
|
exports.DesktopTitleWrapper = styled_1.styled.div `
|
|
35
26
|
display: contents;
|
|
36
27
|
|
|
@@ -18,6 +18,6 @@ const PageActionsInner = (props, ref) => {
|
|
|
18
18
|
if (isLoading) {
|
|
19
19
|
return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { children: (0, jsx_runtime_1.jsx)(PageActionSkeleton_1.PageActionSkeleton, { size: size }) }));
|
|
20
20
|
}
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: className, ref: ref, children: (0, jsx_runtime_1.jsxs)(styles_1.ActionWrapper, { "$spacing": spacing, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: tooltipTitle, enterDelay: 400, enterNextDelay: 400, placement: "bottom-end", children: (0, jsx_runtime_1.jsx)(styles_1.FocusModeButton, { className: buttonClassnames, variant: "outlined", onClick: handleClick, "aria-label": tooltipTitle, color: "grey", children: isFocusedMode ? (0, jsx_runtime_1.jsx)(MinimizeOutlineMd_1.MinimizeOutlineMd, {}) : (0, jsx_runtime_1.jsx)(FullSizeOutlineMd_1.FullSizeOutlineMd, {}) }) }), (0, jsx_runtime_1.jsx)(styles_1.MainActionsWrapper, { "$spacing": spacing, className: classnames, children: (0, jsx_runtime_1.jsx)(MainActions_1.MainActions, { isDisabled: disabledAction, actions: main, size: size, spacing: spacing }) }), (0, jsx_runtime_1.jsxs)(styles_1.SecondaryVisibleWrapper, { "$spacing": spacing, className: classnames, children: [secondaryVisible && ((0, jsx_runtime_1.jsx)(SecondaryVisibleActions_1.SecondaryVisibleActions, { actions: secondaryVisible, size: size })), secondary && ((0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: size }))] }), collapsedActions.length > 0 && ((0, jsx_runtime_1.jsx)(styles_1.CollapsedActionsWrapper, { className: classnames, children: (0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: disabledAction, actions: collapsedActions, size: size }) }))] }) }));
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: className, ref: ref, children: (0, jsx_runtime_1.jsxs)(styles_1.ActionWrapper, { "$spacing": spacing, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: tooltipTitle, enterDelay: 400, enterNextDelay: 400, placement: "bottom-end", children: (0, jsx_runtime_1.jsx)(styles_1.FocusModeButton, { className: buttonClassnames, variant: "outlined", onClick: handleClick, "aria-label": tooltipTitle, color: "grey", children: isFocusedMode ? (0, jsx_runtime_1.jsx)(MinimizeOutlineMd_1.MinimizeOutlineMd, {}) : (0, jsx_runtime_1.jsx)(FullSizeOutlineMd_1.FullSizeOutlineMd, {}) }) }), (0, jsx_runtime_1.jsx)(styles_1.MainActionsWrapper, { "$spacing": spacing, className: classnames, children: (0, jsx_runtime_1.jsx)(MainActions_1.MainActions, { isDisabled: disabledAction, actions: main, size: size, spacing: spacing }) }), (secondaryVisible || secondary) && ((0, jsx_runtime_1.jsxs)(styles_1.SecondaryVisibleWrapper, { "$spacing": spacing, className: classnames, children: [secondaryVisible && ((0, jsx_runtime_1.jsx)(SecondaryVisibleActions_1.SecondaryVisibleActions, { actions: secondaryVisible, size: size })), secondary && ((0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: size }))] })), collapsedActions.length > 0 && ((0, jsx_runtime_1.jsx)(styles_1.CollapsedActionsWrapper, { className: classnames, children: (0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: disabledAction, actions: collapsedActions, size: size }) }))] }) }));
|
|
22
22
|
};
|
|
23
23
|
exports.PageActions = (0, forwardRefWithGeneric_1.forwardRefWithGeneric)(PageActionsInner);
|
|
@@ -7,5 +7,7 @@ exports.pageHeaderClassnames = {
|
|
|
7
7
|
pageHeaderActions: (0, createUIKitClassname_1.createUIKitClassname)('page-header__actions'),
|
|
8
8
|
hasBackButton: (0, createUIKitClassname_1.createUIKitClassname)('page-header_has-back-button'),
|
|
9
9
|
hasTitle: (0, createUIKitClassname_1.createUIKitClassname)('page-header_has-title'),
|
|
10
|
+
filters: (0, createUIKitClassname_1.createUIKitClassname)('page-header__filters'),
|
|
11
|
+
quickFilters: (0, createUIKitClassname_1.createUIKitClassname)('page-header__quick-filters'),
|
|
10
12
|
};
|
|
11
13
|
exports.PAGE_HEADER_HEIGHT_MOBILE = '48px';
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.PageActions = exports.PageActionSkeleton = exports.pageHeaderClassnames = void 0;
|
|
17
|
+
exports.FormFiltersLayoutContext = exports.PageActions = exports.PageActionSkeleton = exports.pageHeaderClassnames = void 0;
|
|
18
18
|
var constants_1 = require("./constants");
|
|
19
19
|
Object.defineProperty(exports, "pageHeaderClassnames", { enumerable: true, get: function () { return constants_1.pageHeaderClassnames; } });
|
|
20
20
|
var PageActions_1 = require("./PageActions");
|
|
@@ -22,3 +22,5 @@ Object.defineProperty(exports, "PageActionSkeleton", { enumerable: true, get: fu
|
|
|
22
22
|
Object.defineProperty(exports, "PageActions", { enumerable: true, get: function () { return PageActions_1.PageActions; } });
|
|
23
23
|
__exportStar(require("./PageHeader"), exports);
|
|
24
24
|
__exportStar(require("./types"), exports);
|
|
25
|
+
var HeaderContent_1 = require("./HeaderContent");
|
|
26
|
+
Object.defineProperty(exports, "FormFiltersLayoutContext", { enumerable: true, get: function () { return HeaderContent_1.FormFiltersLayoutContext; } });
|
|
@@ -25,6 +25,27 @@ exports.Wrapper = styled_1.styled.header `
|
|
|
25
25
|
|
|
26
26
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
.${constants_1.pageHeaderClassnames.filters} {
|
|
30
|
+
grid-column: 1 / -1;
|
|
31
|
+
grid-row: 4;
|
|
32
|
+
|
|
33
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
34
|
+
grid-column: 3;
|
|
35
|
+
grid-row: 1 / -1;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.${constants_1.pageHeaderClassnames.quickFilters} {
|
|
40
|
+
grid-column: 1 / -1;
|
|
41
|
+
grid-row: 5;
|
|
42
|
+
|
|
43
|
+
margin-top: ${({ theme }) => theme.spacing(4)};
|
|
44
|
+
|
|
45
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
28
49
|
`;
|
|
29
50
|
exports.MobileTitleWrapper = styled_1.styled.div `
|
|
30
51
|
display: none;
|
|
@@ -16,6 +16,12 @@ exports.Wrapper = styled_1.styled.div `
|
|
|
16
16
|
|
|
17
17
|
background-color: ${({ theme }) => theme.palette.common.white};
|
|
18
18
|
|
|
19
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
20
|
+
grid-row-gap: ${({ theme }) => theme.spacing(2)};
|
|
21
|
+
|
|
22
|
+
padding-top: ${({ theme }) => theme.spacing(3)};
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
20
26
|
scroll-behavior: smooth;
|
|
21
27
|
|
|
@@ -14,6 +14,7 @@ const getBadgeBgColor = ({ color, theme, variant, }) => {
|
|
|
14
14
|
warning: theme.palette.warning[800],
|
|
15
15
|
error: theme.palette.error[800],
|
|
16
16
|
white: theme.palette.grey[300],
|
|
17
|
+
transparent: 'transparent',
|
|
17
18
|
};
|
|
18
19
|
return bgColor[color];
|
|
19
20
|
};
|
|
@@ -27,7 +28,7 @@ const getBadgeColor = ({ color, theme, variant, isChecked, isDisabled, }) => {
|
|
|
27
28
|
if (color === 'white') {
|
|
28
29
|
return theme.palette.grey[900];
|
|
29
30
|
}
|
|
30
|
-
if (color === 'grey') {
|
|
31
|
+
if (color === 'grey' || color === 'transparent') {
|
|
31
32
|
return variant === 'text'
|
|
32
33
|
? theme.palette.primary.contrastText
|
|
33
34
|
: theme.palette.grey[900];
|
|
@@ -17,6 +17,7 @@ export declare const StyledCounter: import("@emotion/styled/dist/declarations/sr
|
|
|
17
17
|
color: import("../../../components/Counter/types").CounterColor;
|
|
18
18
|
variant?: import("../../../components/Counter/types").CounterVariants | undefined;
|
|
19
19
|
content?: number | undefined;
|
|
20
|
+
withBorder?: boolean | undefined;
|
|
20
21
|
} & {
|
|
21
22
|
theme?: import("@emotion/react").Theme | undefined;
|
|
22
23
|
}, {}, {}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AllFiltersButtonProps } from '../types';
|
|
2
|
-
export declare const useLogic: <TFieldValues extends Record<string, unknown>>({ form, onOpenModal, hasMainFilters, hasSecondaryFilters, hasSearch, }: AllFiltersButtonProps<TFieldValues>) => {
|
|
2
|
+
export declare const useLogic: <TFieldValues extends Record<string, unknown>>({ form, onOpenModal, hasMainFilters, hasSecondaryFilters, hasSearch, hasQuickFilters, }: AllFiltersButtonProps<TFieldValues>) => {
|
|
3
3
|
allFiltersButtonClassName: string;
|
|
4
4
|
counter: number;
|
|
5
5
|
onOpenModal: () => void;
|
|
@@ -3,35 +3,51 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useLogic = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const react_hook_form_1 = require("react-hook-form");
|
|
6
|
+
const useViewportType_1 = require("../../../../components/useViewportType");
|
|
6
7
|
const classNames_1 = require("../../../../components/utils/classNames");
|
|
7
8
|
const constants_1 = require("../../../FormFiltersSearchField/constants");
|
|
8
|
-
const constants_2 = require("
|
|
9
|
-
const
|
|
9
|
+
const constants_2 = require("../../../FormQuickFilters/constants");
|
|
10
|
+
const constants_3 = require("../../constants");
|
|
11
|
+
const utils_1 = require("../../utils");
|
|
12
|
+
const useLogic = ({ form, onOpenModal, hasMainFilters, hasSecondaryFilters, hasSearch, hasQuickFilters, }) => {
|
|
13
|
+
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
10
14
|
const formValues = (0, react_hook_form_1.useWatch)({
|
|
11
15
|
control: form.control,
|
|
12
16
|
});
|
|
13
17
|
const [searchName, setSearchName] = (0, react_1.useState)('');
|
|
18
|
+
const [quickFiltersName, setQuickFiltersName] = (0, react_1.useState)('');
|
|
14
19
|
(0, react_1.useEffect)(() => {
|
|
15
20
|
const searchFieldName = document
|
|
16
21
|
.getElementById(constants_1.FORM_FILTERS_SEARCH_FIELD_ID)
|
|
17
22
|
?.getAttribute('name') || '';
|
|
18
23
|
setSearchName(searchFieldName);
|
|
19
24
|
}, [hasSearch]);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
(0, react_1.useEffect)(() => {
|
|
26
|
+
const quickFiltersFieldName = document
|
|
27
|
+
.getElementById(constants_2.FORM_FILTERS_QUICK_FILTERS_ID)
|
|
28
|
+
?.getAttribute('name') || '';
|
|
29
|
+
setQuickFiltersName(quickFiltersFieldName);
|
|
30
|
+
}, [hasQuickFilters]);
|
|
31
|
+
const getCounter = () => {
|
|
32
|
+
const filledValuesCount = (0, utils_1.getFilledCount)(formValues);
|
|
33
|
+
// Исключаем поиск и quickFilters из счётчика — они видны на странице
|
|
34
|
+
// quickFilters учитывается только на мобильных устройствах
|
|
35
|
+
const searchValue = formValues?.[searchName];
|
|
36
|
+
const quickFiltersValue = !isMobile && (0, utils_1.checkIsFilledValue)(formValues?.[quickFiltersName]);
|
|
37
|
+
return (filledValuesCount - (searchValue ? 1 : 0) - (quickFiltersValue ? 1 : 0));
|
|
38
|
+
};
|
|
23
39
|
const allFiltersButtonClassName = (0, react_1.useMemo)(() => {
|
|
24
40
|
return (0, classNames_1.classNames)({
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
41
|
+
[constants_3.formFiltersClassnames.showAllFiltersButtonOnDesktop]: hasSecondaryFilters,
|
|
42
|
+
[constants_3.formFiltersClassnames.showAllFiltersButtonOnLaptop]: hasMainFilters || hasSecondaryFilters,
|
|
43
|
+
[constants_3.formFiltersClassnames.showAllFiltersButtonOnMobile]: hasMainFilters || hasSecondaryFilters,
|
|
44
|
+
[constants_3.formFiltersClassnames.withSearch]: hasSearch,
|
|
45
|
+
[constants_3.formFiltersClassnames.withoutSearch]: !hasSearch,
|
|
30
46
|
});
|
|
31
47
|
}, [hasMainFilters, hasSecondaryFilters, hasSearch]);
|
|
32
48
|
return {
|
|
33
49
|
allFiltersButtonClassName,
|
|
34
|
-
counter,
|
|
50
|
+
counter: getCounter(),
|
|
35
51
|
onOpenModal,
|
|
36
52
|
};
|
|
37
53
|
};
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FormFilters = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const PageHeader_1 = require("../../components/PageHeader");
|
|
5
7
|
const Form_1 = require("../Form");
|
|
6
8
|
const FormControlProvider_1 = require("../FormControlProvider");
|
|
7
9
|
const AllFiltersButton_1 = require("./AllFiltersButton");
|
|
@@ -14,10 +16,11 @@ const useLogic_1 = require("./useLogic");
|
|
|
14
16
|
* Компонент для отображения фильтров формы
|
|
15
17
|
*/
|
|
16
18
|
const FormFilters = (props) => {
|
|
17
|
-
const { form, onSubmit, searchField: SearchField, mainFilters: MainFilters, submitButton: SubmitButton, secondaryFilters: SecondaryFilters, onOpenModal, dialogProps, mainFiltersColumns, isLoading, } = (0, useLogic_1.useLogic)(props);
|
|
19
|
+
const { form, onSubmit, searchField: SearchField, mainFilters: MainFilters, quickFilters: QuickFilters, submitButton: SubmitButton, secondaryFilters: SecondaryFilters, onOpenModal, dialogProps, mainFiltersColumns, isLoading, } = (0, useLogic_1.useLogic)(props);
|
|
20
|
+
const { filtersClassName, quickFiltersClassName } = (0, react_1.useContext)(PageHeader_1.FormFiltersLayoutContext) ?? {};
|
|
18
21
|
if (isLoading) {
|
|
19
22
|
return (0, jsx_runtime_1.jsx)(FormFiltersSkeleton_1.FormFiltersSkeleton, {});
|
|
20
23
|
}
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)(Form_1.Form, { name: "form", form: form, onSubmit: form.handleSubmit(onSubmit || (() => undefined)),
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(FormControlProvider_1.FormControlProvider, { size: "small", hideHelperText: true, children: (0, jsx_runtime_1.jsx)(Form_1.Form, { name: "astral-ui-form-filters", form: form, onSubmit: form.handleSubmit(onSubmit || (() => undefined)), className: filtersClassName, children: (0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { children: [SearchField && (0, jsx_runtime_1.jsx)(SearchField, { control: form.control }), (0, jsx_runtime_1.jsx)(AllFiltersButton_1.AllFiltersButton, { form: form, onOpenModal: onOpenModal, hasMainFilters: Boolean(MainFilters), hasSecondaryFilters: Boolean(SecondaryFilters), hasSearch: Boolean(SearchField), hasQuickFilters: Boolean(QuickFilters) }), (0, jsx_runtime_1.jsx)(styles_1.MainFiltersWrapper, { columns: mainFiltersColumns, children: MainFilters && ((0, jsx_runtime_1.jsx)(MainFilters, { control: form.control, isModal: false })) }), SubmitButton && ((0, jsx_runtime_1.jsx)(styles_1.SubmitButtonWrapper, { children: (0, jsx_runtime_1.jsx)(SubmitButton, { size: "medium", className: constants_1.formFiltersClassnames.submitButton }) }))] }) }) }), QuickFilters && ((0, jsx_runtime_1.jsx)(styles_1.QuickFiltersWrapper, { className: quickFiltersClassName, children: (0, jsx_runtime_1.jsx)(QuickFilters, { control: form.control }) })), (0, jsx_runtime_1.jsx)(FormFiltersDialog_1.FormFiltersDialog, { ...dialogProps })] }));
|
|
22
25
|
};
|
|
23
26
|
exports.FormFilters = FormFilters;
|
|
@@ -6,14 +6,14 @@ const Button_1 = require("../../../components/Button");
|
|
|
6
6
|
const DialogContent_1 = require("../../../components/DialogContent");
|
|
7
7
|
const Form_1 = require("../../Form");
|
|
8
8
|
const constants_1 = require("../constants");
|
|
9
|
+
const ResetButton_1 = require("./ResetButton");
|
|
9
10
|
const styles_1 = require("./styles");
|
|
10
11
|
const useLogic_1 = require("./useLogic");
|
|
11
12
|
/**
|
|
12
13
|
* Компонент для отображения фильтров формы
|
|
13
14
|
*/
|
|
14
15
|
const FormFiltersDialog = (props) => {
|
|
15
|
-
const { modalForm, onCloseModal, onResetModal, onSubmitModal, mainFilters: MainFilters, secondaryFilters: SecondaryFilters, isModalOpen,
|
|
16
|
-
|
|
17
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.StyledDialog, { open: isModalOpen, onClose: onCloseModal, title: "\u0424\u0438\u043B\u044C\u0442\u0440\u044B", size: "md", headerContent: headerContent, children: (0, jsx_runtime_1.jsxs)(Form_1.Form, { form: modalForm, onSubmit: modalForm.handleSubmit(onSubmitModal), children: [(0, jsx_runtime_1.jsx)(DialogContent_1.DialogContent, { children: (0, jsx_runtime_1.jsxs)(styles_1.FiltersModalContent, { className: constants_1.formFiltersClassnames.modalFilters, children: [MainFilters && ((0, jsx_runtime_1.jsx)(MainFilters, { control: modalForm.control, isModal: true })), SecondaryFilters && ((0, jsx_runtime_1.jsx)(SecondaryFilters, { control: modalForm.control }))] }) }), (0, jsx_runtime_1.jsxs)(styles_1.StyledDialogContent, { children: [(0, jsx_runtime_1.jsx)(styles_1.DesktopResetButton, { children: (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "text", onClick: onResetModal, size: "large", disabled: isResetButtonDisabled, children: "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C" }) }), (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "text", onClick: onCloseModal, size: "large", children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), (0, jsx_runtime_1.jsx)(Button_1.Button, { type: "submit", variant: "contained", size: "large", children: "\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C" })] })] }) }));
|
|
16
|
+
const { modalForm, onCloseModal, onResetModal, onSubmitModal, mainFilters: MainFilters, quickFilters: QuickFilters, secondaryFilters: SecondaryFilters, isModalOpen, } = (0, useLogic_1.useLogic)(props);
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StyledDialog, { open: isModalOpen, onClose: onCloseModal, title: "\u0424\u0438\u043B\u044C\u0442\u0440\u044B", size: "md", headerContent: (0, jsx_runtime_1.jsx)(ResetButton_1.ResetButton, { onResetModal: onResetModal, modalForm: modalForm, isMobile: true }), children: (0, jsx_runtime_1.jsxs)(Form_1.Form, { form: modalForm, onSubmit: modalForm.handleSubmit(onSubmitModal), children: [(0, jsx_runtime_1.jsx)(DialogContent_1.DialogContent, { children: (0, jsx_runtime_1.jsxs)(styles_1.FiltersModalContent, { className: constants_1.formFiltersClassnames.modalFilters, children: [MainFilters && ((0, jsx_runtime_1.jsx)(MainFilters, { control: modalForm.control, isModal: true })), SecondaryFilters && ((0, jsx_runtime_1.jsx)(SecondaryFilters, { control: modalForm.control })), QuickFilters && ((0, jsx_runtime_1.jsx)(styles_1.QuickFiltersWrapper, { children: (0, jsx_runtime_1.jsx)(QuickFilters, { control: modalForm.control }) }))] }) }), (0, jsx_runtime_1.jsxs)(styles_1.StyledDialogContent, { children: [(0, jsx_runtime_1.jsx)(ResetButton_1.ResetButton, { onResetModal: onResetModal, modalForm: modalForm }), (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "text", onClick: onCloseModal, size: "large", children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), (0, jsx_runtime_1.jsx)(Button_1.Button, { type: "submit", variant: "contained", size: "large", children: "\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C" })] })] }) }));
|
|
18
18
|
};
|
|
19
19
|
exports.FormFiltersDialog = FormFiltersDialog;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type UseFormReturn } from 'react-hook-form';
|
|
2
|
+
export declare const ResetButton: <TFieldValues extends Record<string, unknown>>({ onResetModal, modalForm, isMobile, }: {
|
|
3
|
+
onResetModal: () => void;
|
|
4
|
+
modalForm: UseFormReturn<TFieldValues>;
|
|
5
|
+
isMobile?: boolean | undefined;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResetButton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Button_1 = require("../../../../components/Button");
|
|
6
|
+
const styles_1 = require("./styles");
|
|
7
|
+
const useLogic_1 = require("./useLogic");
|
|
8
|
+
const ResetButton = ({ onResetModal, modalForm, isMobile = false, }) => {
|
|
9
|
+
const { isResetButtonDisabled } = (0, useLogic_1.useLogic)({ modalForm });
|
|
10
|
+
if (isMobile) {
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.MobileResetButtonWrapper, { variant: "text", onClick: onResetModal, size: "large", disabled: isResetButtonDisabled, children: "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C" }));
|
|
12
|
+
}
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.DesktopResetButtonWrapper, { children: (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "text", onClick: onResetModal, size: "large", disabled: isResetButtonDisabled, color: "error", children: "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C" }) }));
|
|
14
|
+
};
|
|
15
|
+
exports.ResetButton = ResetButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ResetButton';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ResetButton"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const MobileResetButtonWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
|
|
3
|
+
variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
|
|
4
|
+
loading?: boolean | undefined;
|
|
5
|
+
color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
|
|
6
|
+
component?: import("react").ElementType | undefined;
|
|
7
|
+
selected?: boolean | undefined;
|
|
8
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
9
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
10
|
+
}, {}, {}>;
|
|
11
|
+
export declare const DesktopResetButtonWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
12
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
13
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
14
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DesktopResetButtonWrapper = exports.MobileResetButtonWrapper = void 0;
|
|
4
|
+
const Button_1 = require("../../../../components/Button");
|
|
5
|
+
const styled_1 = require("../../../../components/styled");
|
|
6
|
+
exports.MobileResetButtonWrapper = (0, styled_1.styled)(Button_1.Button) `
|
|
7
|
+
margin-left: auto;
|
|
8
|
+
|
|
9
|
+
${({ theme }) => theme.breakpoints.up('sm')} {
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
exports.DesktopResetButtonWrapper = styled_1.styled.div `
|
|
14
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|