@doyourjob/gravity-ui-page-constructor 5.31.61 → 5.31.62
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/build/cjs/blocks/Reports/Reports.css +16 -0
- package/build/cjs/blocks/Reports/Reports.d.ts +3 -0
- package/build/cjs/blocks/Reports/Reports.js +31 -0
- package/build/cjs/blocks/Reports/ReportsItem/ReportsItem.css +49 -0
- package/build/cjs/blocks/Reports/ReportsItem/ReportsItem.d.ts +3 -0
- package/build/cjs/blocks/Reports/ReportsItem/ReportsItem.js +18 -0
- package/build/cjs/blocks/Reports/schema.d.ts +18 -0
- package/build/cjs/blocks/Reports/schema.js +15 -0
- package/build/cjs/blocks/index.d.ts +1 -0
- package/build/cjs/blocks/index.js +3 -1
- package/build/cjs/components/ReportFile/ReportFile.css +27 -0
- package/build/cjs/components/ReportFile/ReportFile.d.ts +3 -0
- package/build/cjs/components/ReportFile/ReportFile.js +10 -0
- package/build/cjs/components/Select/Select.css +22 -0
- package/build/cjs/components/Select/Select.d.ts +6 -0
- package/build/cjs/components/Select/Select.js +15 -0
- package/build/cjs/components/index.d.ts +2 -0
- package/build/cjs/components/index.js +5 -1
- package/build/cjs/constructor-items.d.ts +1 -0
- package/build/cjs/constructor-items.js +1 -0
- package/build/cjs/context/reportsContext/ReportsContext.d.ts +15 -0
- package/build/cjs/context/reportsContext/ReportsContext.js +6 -0
- package/build/cjs/context/reportsContext/index.d.ts +1 -0
- package/build/cjs/context/reportsContext/index.js +4 -0
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +1 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +19 -2
- package/build/cjs/models/constructor-items/blocks.js +1 -0
- package/build/cjs/models/constructor-items/common.d.ts +15 -0
- package/build/cjs/schema/constants.js +2 -1
- package/build/cjs/schema/validators/blocks.d.ts +1 -0
- package/build/cjs/schema/validators/blocks.js +1 -0
- package/build/esm/blocks/Reports/Reports.css +16 -0
- package/build/esm/blocks/Reports/Reports.d.ts +4 -0
- package/build/esm/blocks/Reports/Reports.js +27 -0
- package/build/esm/blocks/Reports/ReportsItem/ReportsItem.css +49 -0
- package/build/esm/blocks/Reports/ReportsItem/ReportsItem.d.ts +4 -0
- package/build/esm/blocks/Reports/ReportsItem/ReportsItem.js +14 -0
- package/build/esm/blocks/Reports/schema.d.ts +18 -0
- package/build/esm/blocks/Reports/schema.js +12 -0
- package/build/esm/blocks/index.d.ts +1 -0
- package/build/esm/blocks/index.js +1 -0
- package/build/esm/components/ReportFile/ReportFile.css +27 -0
- package/build/esm/components/ReportFile/ReportFile.d.ts +4 -0
- package/build/esm/components/ReportFile/ReportFile.js +6 -0
- package/build/esm/components/Select/Select.css +22 -0
- package/build/esm/components/Select/Select.d.ts +7 -0
- package/build/esm/components/Select/Select.js +11 -0
- package/build/esm/components/index.d.ts +2 -0
- package/build/esm/components/index.js +2 -0
- package/build/esm/constructor-items.d.ts +1 -0
- package/build/esm/constructor-items.js +2 -1
- package/build/esm/context/reportsContext/ReportsContext.d.ts +15 -0
- package/build/esm/context/reportsContext/ReportsContext.js +2 -0
- package/build/esm/context/reportsContext/index.d.ts +1 -0
- package/build/esm/context/reportsContext/index.js +1 -0
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/models/constructor-items/blocks.d.ts +19 -2
- package/build/esm/models/constructor-items/blocks.js +1 -0
- package/build/esm/models/constructor-items/common.d.ts +15 -0
- package/build/esm/schema/constants.js +3 -2
- package/build/esm/schema/validators/blocks.d.ts +1 -0
- package/build/esm/schema/validators/blocks.js +1 -0
- package/package.json +1 -1
- package/schema/index.js +1 -1
- package/server/models/constructor-items/blocks.d.ts +19 -2
- package/server/models/constructor-items/blocks.js +1 -0
- package/server/models/constructor-items/common.d.ts +15 -0
- package/widget/index.js +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-reports-block__select {
|
|
4
|
+
margin-bottom: 32px;
|
|
5
|
+
}
|
|
6
|
+
.pc-reports-block__empty {
|
|
7
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
8
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
9
|
+
height: 128px;
|
|
10
|
+
width: 100%;
|
|
11
|
+
background-color: var(--g-color-private-blue-50);
|
|
12
|
+
border-radius: 24px;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReportsBlock = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const components_1 = require("../../components");
|
|
7
|
+
const reportsContext_1 = require("../../context/reportsContext");
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
|
+
const ReportsItem_1 = tslib_1.__importDefault(require("./ReportsItem/ReportsItem"));
|
|
10
|
+
const b = (0, utils_1.block)('reports-block');
|
|
11
|
+
const ReportsBlock = ({ typeKey, empty }) => {
|
|
12
|
+
const data = (0, react_1.useContext)(reportsContext_1.ReportsContext);
|
|
13
|
+
const { selects, items, filesOutline } = (0, react_1.useMemo)(() => data[typeKey], [data, typeKey]);
|
|
14
|
+
const initFilters = (0, react_1.useMemo)(() => (selects === null || selects === void 0 ? void 0 : selects.reduce((acc, select) => (Object.assign(Object.assign({}, acc), { [select.name]: select.init })), {})) || {}, [selects]);
|
|
15
|
+
const [localFilters, setLocalFilters] = (0, react_1.useState)(initFilters);
|
|
16
|
+
const handleChange = (0, react_1.useCallback)((name, value) => setLocalFilters((prev) => (Object.assign(Object.assign({}, prev), { [name]: value }))), []);
|
|
17
|
+
const filteredItems = (0, react_1.useMemo)(() => Object.keys(localFilters).length
|
|
18
|
+
? items.filter((item) => Object.entries(localFilters).reduce((acc, [key, value]) => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
if ((_b = (_a = item.filters) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.includes(value)) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return acc;
|
|
24
|
+
}, false))
|
|
25
|
+
: items, [items, localFilters]);
|
|
26
|
+
return (react_1.default.createElement("div", { className: b() },
|
|
27
|
+
(selects === null || selects === void 0 ? void 0 : selects.length) && (react_1.default.createElement("div", { className: b('select') }, selects.map(({ name, options }) => (react_1.default.createElement(components_1.Select, { key: name, name: name, options: options, onChange: handleChange }))))),
|
|
28
|
+
filteredItems.length ? (filteredItems === null || filteredItems === void 0 ? void 0 : filteredItems.map((item, index) => (react_1.default.createElement(ReportsItem_1.default, Object.assign({ key: index }, item, { filesOutline: filesOutline }))))) : (react_1.default.createElement("div", { className: b('empty') }, empty))));
|
|
29
|
+
};
|
|
30
|
+
exports.ReportsBlock = ReportsBlock;
|
|
31
|
+
exports.default = exports.ReportsBlock;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-reports-item {
|
|
4
|
+
padding: 24px 32px;
|
|
5
|
+
border-radius: 24px;
|
|
6
|
+
transition: box-shadow 0.3s ease-in-out;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
}
|
|
10
|
+
.pc-reports-item__wrap {
|
|
11
|
+
flex: 1;
|
|
12
|
+
}
|
|
13
|
+
.pc-reports-item__title {
|
|
14
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
15
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
16
|
+
}
|
|
17
|
+
.pc-reports-item__info {
|
|
18
|
+
font-size: var(--g-text-body-1-font-size, var(--pc-text-body-1-font-size));
|
|
19
|
+
line-height: var(--g-text-body-1-line-height, var(--pc-text-body-1-line-height));
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: 8px;
|
|
23
|
+
color: var(--g-color-private-cool-grey-600-solid);
|
|
24
|
+
margin-top: 8px;
|
|
25
|
+
}
|
|
26
|
+
.pc-reports-item__dot {
|
|
27
|
+
background-color: var(--g-color-private-cool-grey-400);
|
|
28
|
+
border-radius: 100%;
|
|
29
|
+
width: 5px;
|
|
30
|
+
height: 5px;
|
|
31
|
+
}
|
|
32
|
+
.pc-reports-item__files {
|
|
33
|
+
display: flex;
|
|
34
|
+
gap: 8px;
|
|
35
|
+
flex-wrap: wrap;
|
|
36
|
+
}
|
|
37
|
+
.pc-reports-item:hover {
|
|
38
|
+
box-shadow: 0 4px 24px var(--pc-color-sfx-shadow), 0 2px 8px var(--pc-color-sfx-shadow);
|
|
39
|
+
}
|
|
40
|
+
@media (max-width: 769px) {
|
|
41
|
+
.pc-reports-item {
|
|
42
|
+
padding: 24px;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
align-items: flex-start;
|
|
45
|
+
}
|
|
46
|
+
.pc-reports-item__files {
|
|
47
|
+
margin-top: 24px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReportsItem = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const components_1 = require("../../../components");
|
|
7
|
+
const utils_1 = require("../../../utils");
|
|
8
|
+
const b = (0, utils_1.block)('reports-item');
|
|
9
|
+
const ReportsItem = ({ title, date, text, files, filesOutline }) => (react_1.default.createElement("div", { className: b() },
|
|
10
|
+
react_1.default.createElement("div", { className: b('wrap') },
|
|
11
|
+
react_1.default.createElement("div", { className: b('title') }, title),
|
|
12
|
+
(date || text) && (react_1.default.createElement("div", { className: b('info') },
|
|
13
|
+
date && react_1.default.createElement("div", { className: b('date') }, date),
|
|
14
|
+
date && text && react_1.default.createElement("div", { className: b('dot') }),
|
|
15
|
+
text && react_1.default.createElement("div", { className: b('text') }, text)))),
|
|
16
|
+
(files === null || files === void 0 ? void 0 : files.length) && (react_1.default.createElement("div", { className: b('files') }, files.map((file) => (react_1.default.createElement(components_1.ReportFile, Object.assign({ key: file.link }, file, { outline: filesOutline }))))))));
|
|
17
|
+
exports.ReportsItem = ReportsItem;
|
|
18
|
+
exports.default = exports.ReportsItem;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const ReportsBlock: {
|
|
2
|
+
'reports-block': {
|
|
3
|
+
additionalProperties: boolean;
|
|
4
|
+
required: string[];
|
|
5
|
+
properties: {
|
|
6
|
+
typeKey: {
|
|
7
|
+
type: string;
|
|
8
|
+
};
|
|
9
|
+
empty: {
|
|
10
|
+
type: string;
|
|
11
|
+
};
|
|
12
|
+
type: {};
|
|
13
|
+
when: {
|
|
14
|
+
type: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReportsBlock = void 0;
|
|
4
|
+
const common_1 = require("./../../schema/validators/common");
|
|
5
|
+
exports.ReportsBlock = {
|
|
6
|
+
'reports-block': {
|
|
7
|
+
additionalProperties: false,
|
|
8
|
+
required: ['typeKey'],
|
|
9
|
+
properties: Object.assign(Object.assign({}, common_1.BaseProps), { typeKey: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
}, empty: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
} }),
|
|
14
|
+
},
|
|
15
|
+
};
|
|
@@ -21,6 +21,7 @@ export { default as MarqueeLinksBlock } from './MarqueeLinks/MarqueeLinks';
|
|
|
21
21
|
export { default as SolutionsBlock } from './Solutions/Solutions';
|
|
22
22
|
export { default as ServicesBlock } from './Services/Services';
|
|
23
23
|
export { default as QuotesBlock } from './Quotes/Quotes';
|
|
24
|
+
export { default as ReportsBlock } from './Reports/Reports';
|
|
24
25
|
export { default as FormWallBlock } from './FormWallBlock/FormWallBlock';
|
|
25
26
|
export { default as LinkTableBlock } from './LinkTable/LinkTable';
|
|
26
27
|
export { default as EventsFeedBlock } from './EventsFeed/EventsFeed';
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HighlightTableBlock = exports.PressReleasesBlock = exports.RelevantPostsBlock = exports.BlogFeedBlock = exports.EventsFeedBlock = exports.LinkTableBlock = exports.FormWallBlock = exports.QuotesBlock = exports.ServicesBlock = exports.SolutionsBlock = exports.MarqueeLinksBlock = exports.FormBlock = exports.FilterBlock = exports.ShareBlock = exports.ContentLayoutBlock = exports.CardLayoutBlock = exports.HeaderSliderBlock = exports.IconsBlock = exports.HeaderBlock = exports.TabsBlock = exports.TableBlock = exports.QuestionsBlock = exports.PromoFeaturesBlock = exports.ExtendedFeaturesBlock = exports.SliderBlock = exports.MapBlock = exports.MediaBlock = exports.InfoBlock = exports.CompaniesBlock = exports.BannerBlock = void 0;
|
|
6
|
+
exports.HighlightTableBlock = exports.PressReleasesBlock = exports.RelevantPostsBlock = exports.BlogFeedBlock = exports.EventsFeedBlock = exports.LinkTableBlock = exports.FormWallBlock = exports.ReportsBlock = exports.QuotesBlock = exports.ServicesBlock = exports.SolutionsBlock = exports.MarqueeLinksBlock = exports.FormBlock = exports.FilterBlock = exports.ShareBlock = exports.ContentLayoutBlock = exports.CardLayoutBlock = exports.HeaderSliderBlock = exports.IconsBlock = exports.HeaderBlock = exports.TabsBlock = exports.TableBlock = exports.QuestionsBlock = exports.PromoFeaturesBlock = exports.ExtendedFeaturesBlock = exports.SliderBlock = exports.MapBlock = exports.MediaBlock = exports.InfoBlock = exports.CompaniesBlock = exports.BannerBlock = void 0;
|
|
7
7
|
var Banner_1 = require("./Banner/Banner");
|
|
8
8
|
Object.defineProperty(exports, "BannerBlock", { enumerable: true, get: function () { return __importDefault(Banner_1).default; } });
|
|
9
9
|
var Companies_1 = require("./Companies/Companies");
|
|
@@ -50,6 +50,8 @@ var Services_1 = require("./Services/Services");
|
|
|
50
50
|
Object.defineProperty(exports, "ServicesBlock", { enumerable: true, get: function () { return __importDefault(Services_1).default; } });
|
|
51
51
|
var Quotes_1 = require("./Quotes/Quotes");
|
|
52
52
|
Object.defineProperty(exports, "QuotesBlock", { enumerable: true, get: function () { return __importDefault(Quotes_1).default; } });
|
|
53
|
+
var Reports_1 = require("./Reports/Reports");
|
|
54
|
+
Object.defineProperty(exports, "ReportsBlock", { enumerable: true, get: function () { return __importDefault(Reports_1).default; } });
|
|
53
55
|
var FormWallBlock_1 = require("./FormWallBlock/FormWallBlock");
|
|
54
56
|
Object.defineProperty(exports, "FormWallBlock", { enumerable: true, get: function () { return __importDefault(FormWallBlock_1).default; } });
|
|
55
57
|
var LinkTable_1 = require("./LinkTable/LinkTable");
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-report-file {
|
|
4
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
5
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
6
|
+
border-width: 1px;
|
|
7
|
+
border-style: solid;
|
|
8
|
+
border-color: transparent;
|
|
9
|
+
border-radius: 100px;
|
|
10
|
+
padding: 10px 24px;
|
|
11
|
+
text-transform: uppercase;
|
|
12
|
+
text-decoration: none;
|
|
13
|
+
color: inherit;
|
|
14
|
+
display: flex;
|
|
15
|
+
transition: background-color 0.3s ease-in-out;
|
|
16
|
+
background-color: var(--g-color-private-blue-50);
|
|
17
|
+
}
|
|
18
|
+
.pc-report-file:hover {
|
|
19
|
+
background-color: var(--g-color-private-cool-grey-400);
|
|
20
|
+
}
|
|
21
|
+
.pc-report-file_outline {
|
|
22
|
+
border-color: var(--g-color-private-cool-grey-400);
|
|
23
|
+
background-color: transparent;
|
|
24
|
+
}
|
|
25
|
+
.pc-report-file_outline:hover {
|
|
26
|
+
background-color: var(--g-color-private-blue-50);
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReportFile = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const utils_1 = require("../../utils");
|
|
7
|
+
const b = (0, utils_1.block)('report-file');
|
|
8
|
+
const ReportFile = ({ name, link, outline }) => (react_1.default.createElement("a", { className: b({ outline }), href: link }, name));
|
|
9
|
+
exports.ReportFile = ReportFile;
|
|
10
|
+
exports.default = exports.ReportFile;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-select {
|
|
4
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
5
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
6
|
+
padding: 10px 32px 10px 16px;
|
|
7
|
+
border: 1px solid var(--g-color-private-cool-grey-600-solid);
|
|
8
|
+
color: var(--g-color-private-cool-grey-400);
|
|
9
|
+
border-radius: 8px;
|
|
10
|
+
flex-flow: row;
|
|
11
|
+
justify-content: flex-start;
|
|
12
|
+
align-items: center;
|
|
13
|
+
width: 240px;
|
|
14
|
+
height: 44px;
|
|
15
|
+
background: var(--g-color-private-white-1000-solid) url("data:image/svg+xml,<svg height='10px' width='10px' viewBox='0 0 16 16' fill='%23000000' xmlns='http://www.w3.org/2000/svg'><path d='M3.50172 5.44253C3.19384 5.16544 2.71962 5.19039 2.44253 5.49828C2.16544 5.80616 2.19039 6.28038 2.49828 6.55747L3.50172 5.44253ZM8 10.5L7.49828 11.0575C7.7835 11.3142 8.2165 11.3142 8.50172 11.0575L8 10.5ZM13.5017 6.55747C13.8096 6.28038 13.8346 5.80616 13.5575 5.49828C13.2804 5.19039 12.8062 5.16544 12.4983 5.44253L13.5017 6.55747ZM2.49828 6.55747L7.49828 11.0575L8.50172 9.94253L3.50172 5.44253L2.49828 6.55747ZM8.50172 11.0575L13.5017 6.55747L12.4983 5.44253L7.49828 9.94253L8.50172 11.0575Z'/></svg>") no-repeat;
|
|
16
|
+
background-position: calc(100% - 0.75rem) center;
|
|
17
|
+
appearance: none;
|
|
18
|
+
}
|
|
19
|
+
.pc-select:focus {
|
|
20
|
+
border-color: var(--g-color-private-blue-500-solid);
|
|
21
|
+
outline: none;
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Select = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const utils_1 = require("../../utils");
|
|
7
|
+
const b = (0, utils_1.block)('select');
|
|
8
|
+
const Select = ({ name, options, onChange }) => {
|
|
9
|
+
const handleChange = (0, react_1.useCallback)((e) => {
|
|
10
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(name, e.currentTarget.value);
|
|
11
|
+
}, [name, onChange]);
|
|
12
|
+
return (react_1.default.createElement("select", { name: name, className: b(), onChange: handleChange }, options.map(({ text, value }) => (react_1.default.createElement("option", { key: value, value: value }, text)))));
|
|
13
|
+
};
|
|
14
|
+
exports.Select = Select;
|
|
15
|
+
exports.default = exports.Select;
|
|
@@ -41,5 +41,7 @@ export { default as YFMWrapper } from './YFMWrapper/YFMWrapper';
|
|
|
41
41
|
export { default as YandexForm } from './YandexForm/YandexForm';
|
|
42
42
|
export { default as InfiniteScroll } from './InfiniteScroll/InfiniteScroll';
|
|
43
43
|
export { default as Tag } from './Tag/Tag';
|
|
44
|
+
export { default as ReportFile } from './ReportFile/ReportFile';
|
|
45
|
+
export { default as Select } from './Select/Select';
|
|
44
46
|
export type { RouterLinkProps } from './RouterLink/RouterLink';
|
|
45
47
|
export type { ImageBaseProps } from './ImageBase/ImageBase';
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Tag = exports.InfiniteScroll = exports.YandexForm = exports.YFMWrapper = exports.VideoBlock = exports.UnpublishedLabel = exports.ToggleArrow = exports.Title = exports.Table = exports.RouterLink = exports.ReactPlayer = exports.OverflowScroller = exports.OutsideClick = exports.MetaInfo = exports.Media = exports.Links = exports.Link = exports.InnerForm = exports.ImageBase = exports.Image = exports.IconWrapper = exports.HTML = exports.HeaderBreadcrumbs = exports.FullWidthBackground = exports.FullscreenMedia = exports.FullscreenImage = exports.Foldable = exports.FileLink = exports.ErrorWrapper = exports.Control = exports.ContentList = exports.CardBase = exports.BrandFooter = exports.Buttons = exports.Button = exports.BlockBase = exports.BalancedMasonry = exports.BackLink = exports.BackgroundMedia = exports.BackgroundImage = exports.Author = exports.AnimateBlock = exports.Anchor = void 0;
|
|
6
|
+
exports.Select = exports.ReportFile = exports.Tag = exports.InfiniteScroll = exports.YandexForm = exports.YFMWrapper = exports.VideoBlock = exports.UnpublishedLabel = exports.ToggleArrow = exports.Title = exports.Table = exports.RouterLink = exports.ReactPlayer = exports.OverflowScroller = exports.OutsideClick = exports.MetaInfo = exports.Media = exports.Links = exports.Link = exports.InnerForm = exports.ImageBase = exports.Image = exports.IconWrapper = exports.HTML = exports.HeaderBreadcrumbs = exports.FullWidthBackground = exports.FullscreenMedia = exports.FullscreenImage = exports.Foldable = exports.FileLink = exports.ErrorWrapper = exports.Control = exports.ContentList = exports.CardBase = exports.BrandFooter = exports.Buttons = exports.Button = exports.BlockBase = exports.BalancedMasonry = exports.BackLink = exports.BackgroundMedia = exports.BackgroundImage = exports.Author = exports.AnimateBlock = exports.Anchor = void 0;
|
|
7
7
|
var Anchor_1 = require("./Anchor/Anchor");
|
|
8
8
|
Object.defineProperty(exports, "Anchor", { enumerable: true, get: function () { return __importDefault(Anchor_1).default; } });
|
|
9
9
|
var AnimateBlock_1 = require("./AnimateBlock/AnimateBlock");
|
|
@@ -90,3 +90,7 @@ var InfiniteScroll_1 = require("./InfiniteScroll/InfiniteScroll");
|
|
|
90
90
|
Object.defineProperty(exports, "InfiniteScroll", { enumerable: true, get: function () { return __importDefault(InfiniteScroll_1).default; } });
|
|
91
91
|
var Tag_1 = require("./Tag/Tag");
|
|
92
92
|
Object.defineProperty(exports, "Tag", { enumerable: true, get: function () { return __importDefault(Tag_1).default; } });
|
|
93
|
+
var ReportFile_1 = require("./ReportFile/ReportFile");
|
|
94
|
+
Object.defineProperty(exports, "ReportFile", { enumerable: true, get: function () { return __importDefault(ReportFile_1).default; } });
|
|
95
|
+
var Select_1 = require("./Select/Select");
|
|
96
|
+
Object.defineProperty(exports, "Select", { enumerable: true, get: function () { return __importDefault(Select_1).default; } });
|
|
@@ -28,6 +28,7 @@ export declare const blockMap: {
|
|
|
28
28
|
"link-table-block": ({ title, items }: import("./models").LinkTableBlockProps) => JSX.Element;
|
|
29
29
|
"services-block": ({ title, serviceLinkType }: import("./models").ServicesBlockProps) => JSX.Element;
|
|
30
30
|
"quotes-block": ({ theme: localTheme, items, background, backgroundColor, }: import("./models").QuotesBlockProps) => JSX.Element;
|
|
31
|
+
"reports-block": ({ typeKey, empty }: import("./models").ReportsBlockProps) => JSX.Element;
|
|
31
32
|
"form-wall-block": (props: import("./models").FormWallBlockProps) => JSX.Element;
|
|
32
33
|
"slider-new-block": ({ animated, title, description, type, anchorId, arrows, adaptive, autoplay: autoplayMs, dots, className, dotsClassName, disclaimer, children, blockClassName, arrowSize, slidesToShow, onSlideChange, onSlideChangeTransitionStart, onSlideChangeTransitionEnd, onActiveIndexChange, onBreakpoint, }: import("react").PropsWithChildren<import("./blocks/SliderNew/Slider").SliderNewProps>) => JSX.Element;
|
|
33
34
|
};
|
|
@@ -38,6 +38,7 @@ exports.blockMap = {
|
|
|
38
38
|
[models_1.BlockType.LinkTableBlock]: blocks_1.LinkTableBlock,
|
|
39
39
|
[models_1.BlockType.ServicesBlock]: blocks_1.ServicesBlock,
|
|
40
40
|
[models_1.BlockType.QuotesBlock]: blocks_1.QuotesBlock,
|
|
41
|
+
[models_1.BlockType.ReportsBlock]: blocks_1.ReportsBlock,
|
|
41
42
|
[models_1.BlockType.FormWallBlock]: blocks_1.FormWallBlock,
|
|
42
43
|
// unstable
|
|
43
44
|
[models_1.BlockType.SliderNewBlock]: unstable_1.SliderNewBlock,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ReportsItem, ReportsItemProps, SelectProps } from '../../models';
|
|
3
|
+
interface Item extends ReportsItem {
|
|
4
|
+
filters?: Record<string, string[]>;
|
|
5
|
+
}
|
|
6
|
+
interface Select extends SelectProps {
|
|
7
|
+
init: string;
|
|
8
|
+
}
|
|
9
|
+
type ReportsData = {
|
|
10
|
+
selects?: Select[];
|
|
11
|
+
items: Item[];
|
|
12
|
+
} & Pick<ReportsItemProps, 'filesOutline'>;
|
|
13
|
+
export type ReportsContextProps = Record<string, ReportsData>;
|
|
14
|
+
export declare const ReportsContext: React.Context<ReportsContextProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReportsContext = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
exports.ReportsContext = react_1.default.createContext({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ReportsContext';
|
package/build/cjs/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './context/pressReleasesContext';
|
|
|
11
11
|
export * from './context/headerContext';
|
|
12
12
|
export * from './context/relevantPostsContext';
|
|
13
13
|
export * from './context/headerStockContext';
|
|
14
|
+
export * from './context/reportsContext';
|
|
14
15
|
export * from './containers/PageConstructor';
|
|
15
16
|
export * from './grid';
|
|
16
17
|
export * from './blocks';
|
package/build/cjs/index.js
CHANGED
|
@@ -16,6 +16,7 @@ tslib_1.__exportStar(require("./context/pressReleasesContext"), exports);
|
|
|
16
16
|
tslib_1.__exportStar(require("./context/headerContext"), exports);
|
|
17
17
|
tslib_1.__exportStar(require("./context/relevantPostsContext"), exports);
|
|
18
18
|
tslib_1.__exportStar(require("./context/headerStockContext"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./context/reportsContext"), exports);
|
|
19
20
|
tslib_1.__exportStar(require("./containers/PageConstructor"), exports);
|
|
20
21
|
tslib_1.__exportStar(require("./grid"), exports);
|
|
21
22
|
tslib_1.__exportStar(require("./blocks"), exports);
|
|
@@ -3,7 +3,7 @@ import { ButtonSize } from '@gravity-ui/uikit';
|
|
|
3
3
|
import { GridColumnSize, GridColumnSizesType, IndentValue } from '../../grid/types';
|
|
4
4
|
import { BlockBackgroundType, ThemeSupporting } from '../../utils';
|
|
5
5
|
import { AnalyticsEventsBase } from '../common';
|
|
6
|
-
import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, CardBorder, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, ImageProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, MediaView, TextSize, TextTheme, Themable, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps, WithBorder, YandexFormProps } from './common';
|
|
6
|
+
import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, CardBorder, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, ImageProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, MediaView, ReportFileType, TextSize, TextTheme, Themable, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps, WithBorder, YandexFormProps } from './common';
|
|
7
7
|
import { BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels } from './sub-blocks';
|
|
8
8
|
export declare enum BlockType {
|
|
9
9
|
PromoFeaturesBlock = "promo-features-block",
|
|
@@ -29,6 +29,7 @@ export declare enum BlockType {
|
|
|
29
29
|
SolutionsBlock = "solutions-block",
|
|
30
30
|
ServicesBlock = "services-block",
|
|
31
31
|
QuotesBlock = "quotes-block",
|
|
32
|
+
ReportsBlock = "reports-block",
|
|
32
33
|
FormWallBlock = "form-wall-block",
|
|
33
34
|
LinkTableBlock = "link-table-block",
|
|
34
35
|
EventsFeedBlock = "events-feed-block",
|
|
@@ -378,6 +379,19 @@ export interface QuotesBlockProps extends Themable {
|
|
|
378
379
|
background?: string;
|
|
379
380
|
backgroundColor?: string;
|
|
380
381
|
}
|
|
382
|
+
export interface ReportsItem {
|
|
383
|
+
title?: string;
|
|
384
|
+
date?: string;
|
|
385
|
+
text?: string;
|
|
386
|
+
files?: ReportFileType[];
|
|
387
|
+
}
|
|
388
|
+
export interface ReportsItemProps extends ReportsItem {
|
|
389
|
+
filesOutline?: boolean;
|
|
390
|
+
}
|
|
391
|
+
export interface ReportsBlockProps {
|
|
392
|
+
typeKey: string;
|
|
393
|
+
empty?: string;
|
|
394
|
+
}
|
|
381
395
|
export interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {
|
|
382
396
|
title?: TitleItemProps | string;
|
|
383
397
|
titleClassName?: string;
|
|
@@ -569,6 +583,9 @@ export type SolutionsBlockModel = {
|
|
|
569
583
|
export type QuotesBlockModel = {
|
|
570
584
|
type: BlockType.QuotesBlock;
|
|
571
585
|
} & QuotesBlockProps;
|
|
586
|
+
export type ReportsBlockModel = {
|
|
587
|
+
type: BlockType.ReportsBlock;
|
|
588
|
+
} & ReportsBlockProps;
|
|
572
589
|
export type LinkTableBlockModel = {
|
|
573
590
|
type: BlockType.LinkTableBlock;
|
|
574
591
|
} & LinkTableBlockProps;
|
|
@@ -593,7 +610,7 @@ export type FormWallBlockModel = {
|
|
|
593
610
|
export type SliderNewBlockModel = {
|
|
594
611
|
type: BlockType.SliderNewBlock;
|
|
595
612
|
} & SliderNewProps;
|
|
596
|
-
type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | HighlightTableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel | FormBlockModel | MarqueeLinksBlockModel | SolutionsBlockModel | ServicesBlockModel | QuotesBlockModel | LinkTableBlockModel | EventsFeedBlockModel | BlogFeedBlockModel | RelevantPostsBlockModel | PressReleasesBlockModel | FormWallBlockModel;
|
|
613
|
+
type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | HighlightTableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel | FormBlockModel | MarqueeLinksBlockModel | SolutionsBlockModel | ServicesBlockModel | QuotesBlockModel | ReportsBlockModel | LinkTableBlockModel | EventsFeedBlockModel | BlogFeedBlockModel | RelevantPostsBlockModel | PressReleasesBlockModel | FormWallBlockModel;
|
|
597
614
|
type UnstableBlockModels = SliderNewBlockModel;
|
|
598
615
|
export type Block = (BlockModels | UnstableBlockModels) & BlockBaseProps;
|
|
599
616
|
export {};
|
|
@@ -26,6 +26,7 @@ var BlockType;
|
|
|
26
26
|
BlockType["SolutionsBlock"] = "solutions-block";
|
|
27
27
|
BlockType["ServicesBlock"] = "services-block";
|
|
28
28
|
BlockType["QuotesBlock"] = "quotes-block";
|
|
29
|
+
BlockType["ReportsBlock"] = "reports-block";
|
|
29
30
|
BlockType["FormWallBlock"] = "form-wall-block";
|
|
30
31
|
BlockType["LinkTableBlock"] = "link-table-block";
|
|
31
32
|
BlockType["EventsFeedBlock"] = "events-feed-block";
|
|
@@ -384,4 +384,19 @@ export interface TagProps {
|
|
|
384
384
|
backgroundColor: string;
|
|
385
385
|
textColor: string;
|
|
386
386
|
}
|
|
387
|
+
export interface ReportFileType {
|
|
388
|
+
name: string;
|
|
389
|
+
link: string;
|
|
390
|
+
}
|
|
391
|
+
export interface ReportFileProps extends ReportFileType {
|
|
392
|
+
outline?: boolean;
|
|
393
|
+
}
|
|
394
|
+
interface SelectOption {
|
|
395
|
+
text: string;
|
|
396
|
+
value: string;
|
|
397
|
+
}
|
|
398
|
+
export interface SelectProps {
|
|
399
|
+
name: string;
|
|
400
|
+
options: SelectOption[];
|
|
401
|
+
}
|
|
387
402
|
export {};
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.constructorCardSchemaNames = exports.constructorBlockSchemaNames = exports.cardSchemas = exports.blockSchemas = void 0;
|
|
4
4
|
const blocks_1 = require("./validators/blocks");
|
|
5
5
|
const sub_blocks_1 = require("./validators/sub-blocks");
|
|
6
|
-
exports.blockSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.Divider), blocks_1.ExtendedFeaturesBlock), blocks_1.PromoFeaturesBlock), blocks_1.SliderBlock), blocks_1.QuestionsBlock), blocks_1.HeaderBlock), blocks_1.BannerBlock), blocks_1.CompaniesBlock), blocks_1.MediaBlock), blocks_1.MapBlock), blocks_1.InfoBlock), blocks_1.TableBlock), blocks_1.HighlightTableBlock), blocks_1.TabsBlock), blocks_1.HeaderSliderBlock), blocks_1.IconsBlock), blocks_1.CardLayoutBlock), blocks_1.ContentLayoutBlock), blocks_1.ShareBlock), blocks_1.FilterBlock), blocks_1.FormBlock), blocks_1.SliderNewBlock), blocks_1.MarqueeLinksBlock), blocks_1.SolutionsBlock), blocks_1.ServicesBlock), blocks_1.QuotesBlock), blocks_1.LinkTableBlock), blocks_1.EventsFeedBlock), blocks_1.BlogFeedBlock), blocks_1.RelevantPostsBlock), blocks_1.PressReleasesBlock), blocks_1.FormWallBlock);
|
|
6
|
+
exports.blockSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.Divider), blocks_1.ExtendedFeaturesBlock), blocks_1.PromoFeaturesBlock), blocks_1.SliderBlock), blocks_1.QuestionsBlock), blocks_1.HeaderBlock), blocks_1.BannerBlock), blocks_1.CompaniesBlock), blocks_1.MediaBlock), blocks_1.MapBlock), blocks_1.InfoBlock), blocks_1.TableBlock), blocks_1.HighlightTableBlock), blocks_1.TabsBlock), blocks_1.HeaderSliderBlock), blocks_1.IconsBlock), blocks_1.CardLayoutBlock), blocks_1.ContentLayoutBlock), blocks_1.ShareBlock), blocks_1.FilterBlock), blocks_1.FormBlock), blocks_1.SliderNewBlock), blocks_1.MarqueeLinksBlock), blocks_1.SolutionsBlock), blocks_1.ServicesBlock), blocks_1.QuotesBlock), blocks_1.ReportsBlock), blocks_1.LinkTableBlock), blocks_1.EventsFeedBlock), blocks_1.BlogFeedBlock), blocks_1.RelevantPostsBlock), blocks_1.PressReleasesBlock), blocks_1.FormWallBlock);
|
|
7
7
|
exports.cardSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.MediaCardBlock), blocks_1.BannerCard), sub_blocks_1.PriceDetailedBlock), sub_blocks_1.BackgroundCard), sub_blocks_1.Quote), sub_blocks_1.BasicCard), sub_blocks_1.PriceCardBlock), sub_blocks_1.ImageCard), sub_blocks_1.ContentLayoutCard), sub_blocks_1.Card), sub_blocks_1.PostCard), sub_blocks_1.FeedCard), sub_blocks_1.EventPersonCard), sub_blocks_1.AttachmentCard), sub_blocks_1.CaseStudyCard);
|
|
8
8
|
exports.constructorBlockSchemaNames = [
|
|
9
9
|
'divider',
|
|
@@ -37,6 +37,7 @@ exports.constructorBlockSchemaNames = [
|
|
|
37
37
|
'solutions-block',
|
|
38
38
|
'services-block',
|
|
39
39
|
'quotes-block',
|
|
40
|
+
'reports-block',
|
|
40
41
|
'link-table-block',
|
|
41
42
|
'events-feed-block',
|
|
42
43
|
'blog-feed-block',
|
|
@@ -22,6 +22,7 @@ export * from '../../blocks/MarqueeLinks/schema';
|
|
|
22
22
|
export * from '../../blocks/Solutions/schema';
|
|
23
23
|
export * from '../../blocks/Services/schema';
|
|
24
24
|
export * from '../../blocks/Quotes/schema';
|
|
25
|
+
export * from '../../blocks/Reports/schema';
|
|
25
26
|
export * from '../../blocks/LinkTable/schema';
|
|
26
27
|
export * from '../../blocks/EventsFeed/schema';
|
|
27
28
|
export * from '../../blocks/BlogFeed/schema';
|
|
@@ -25,6 +25,7 @@ tslib_1.__exportStar(require("../../blocks/MarqueeLinks/schema"), exports);
|
|
|
25
25
|
tslib_1.__exportStar(require("../../blocks/Solutions/schema"), exports);
|
|
26
26
|
tslib_1.__exportStar(require("../../blocks/Services/schema"), exports);
|
|
27
27
|
tslib_1.__exportStar(require("../../blocks/Quotes/schema"), exports);
|
|
28
|
+
tslib_1.__exportStar(require("../../blocks/Reports/schema"), exports);
|
|
28
29
|
tslib_1.__exportStar(require("../../blocks/LinkTable/schema"), exports);
|
|
29
30
|
tslib_1.__exportStar(require("../../blocks/EventsFeed/schema"), exports);
|
|
30
31
|
tslib_1.__exportStar(require("../../blocks/BlogFeed/schema"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-reports-block__select {
|
|
4
|
+
margin-bottom: 32px;
|
|
5
|
+
}
|
|
6
|
+
.pc-reports-block__empty {
|
|
7
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
8
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
9
|
+
height: 128px;
|
|
10
|
+
width: 100%;
|
|
11
|
+
background-color: var(--g-color-private-blue-50);
|
|
12
|
+
border-radius: 24px;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { useCallback, useContext, useMemo, useState } from 'react';
|
|
2
|
+
import { Select } from '../../components';
|
|
3
|
+
import { ReportsContext } from '../../context/reportsContext';
|
|
4
|
+
import { block } from '../../utils';
|
|
5
|
+
import ReportsItem from './ReportsItem/ReportsItem';
|
|
6
|
+
import './Reports.css';
|
|
7
|
+
const b = block('reports-block');
|
|
8
|
+
export const ReportsBlock = ({ typeKey, empty }) => {
|
|
9
|
+
const data = useContext(ReportsContext);
|
|
10
|
+
const { selects, items, filesOutline } = useMemo(() => data[typeKey], [data, typeKey]);
|
|
11
|
+
const initFilters = useMemo(() => (selects === null || selects === void 0 ? void 0 : selects.reduce((acc, select) => (Object.assign(Object.assign({}, acc), { [select.name]: select.init })), {})) || {}, [selects]);
|
|
12
|
+
const [localFilters, setLocalFilters] = useState(initFilters);
|
|
13
|
+
const handleChange = useCallback((name, value) => setLocalFilters((prev) => (Object.assign(Object.assign({}, prev), { [name]: value }))), []);
|
|
14
|
+
const filteredItems = useMemo(() => Object.keys(localFilters).length
|
|
15
|
+
? items.filter((item) => Object.entries(localFilters).reduce((acc, [key, value]) => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
if ((_b = (_a = item.filters) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.includes(value)) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
return acc;
|
|
21
|
+
}, false))
|
|
22
|
+
: items, [items, localFilters]);
|
|
23
|
+
return (React.createElement("div", { className: b() },
|
|
24
|
+
(selects === null || selects === void 0 ? void 0 : selects.length) && (React.createElement("div", { className: b('select') }, selects.map(({ name, options }) => (React.createElement(Select, { key: name, name: name, options: options, onChange: handleChange }))))),
|
|
25
|
+
filteredItems.length ? (filteredItems === null || filteredItems === void 0 ? void 0 : filteredItems.map((item, index) => (React.createElement(ReportsItem, Object.assign({ key: index }, item, { filesOutline: filesOutline }))))) : (React.createElement("div", { className: b('empty') }, empty))));
|
|
26
|
+
};
|
|
27
|
+
export default ReportsBlock;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-reports-item {
|
|
4
|
+
padding: 24px 32px;
|
|
5
|
+
border-radius: 24px;
|
|
6
|
+
transition: box-shadow 0.3s ease-in-out;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
}
|
|
10
|
+
.pc-reports-item__wrap {
|
|
11
|
+
flex: 1;
|
|
12
|
+
}
|
|
13
|
+
.pc-reports-item__title {
|
|
14
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
15
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
16
|
+
}
|
|
17
|
+
.pc-reports-item__info {
|
|
18
|
+
font-size: var(--g-text-body-1-font-size, var(--pc-text-body-1-font-size));
|
|
19
|
+
line-height: var(--g-text-body-1-line-height, var(--pc-text-body-1-line-height));
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: 8px;
|
|
23
|
+
color: var(--g-color-private-cool-grey-600-solid);
|
|
24
|
+
margin-top: 8px;
|
|
25
|
+
}
|
|
26
|
+
.pc-reports-item__dot {
|
|
27
|
+
background-color: var(--g-color-private-cool-grey-400);
|
|
28
|
+
border-radius: 100%;
|
|
29
|
+
width: 5px;
|
|
30
|
+
height: 5px;
|
|
31
|
+
}
|
|
32
|
+
.pc-reports-item__files {
|
|
33
|
+
display: flex;
|
|
34
|
+
gap: 8px;
|
|
35
|
+
flex-wrap: wrap;
|
|
36
|
+
}
|
|
37
|
+
.pc-reports-item:hover {
|
|
38
|
+
box-shadow: 0 4px 24px var(--pc-color-sfx-shadow), 0 2px 8px var(--pc-color-sfx-shadow);
|
|
39
|
+
}
|
|
40
|
+
@media (max-width: 769px) {
|
|
41
|
+
.pc-reports-item {
|
|
42
|
+
padding: 24px;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
align-items: flex-start;
|
|
45
|
+
}
|
|
46
|
+
.pc-reports-item__files {
|
|
47
|
+
margin-top: 24px;
|
|
48
|
+
}
|
|
49
|
+
}
|