@gravity-ui/page-constructor 4.1.0 → 4.1.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.
@@ -66,6 +66,9 @@ export declare const FilterProps: {
66
66
  type: string;
67
67
  enum: string[];
68
68
  };
69
+ centered: {
70
+ type: string;
71
+ };
69
72
  title: {
70
73
  oneOf: ({
71
74
  type: string;
@@ -173,6 +176,9 @@ export declare const FilterBlock: {
173
176
  type: string;
174
177
  enum: string[];
175
178
  };
179
+ centered: {
180
+ type: string;
181
+ };
176
182
  title: {
177
183
  oneOf: ({
178
184
  type: string;
@@ -30,7 +30,7 @@ exports.FilterItemProps = {
30
30
  };
31
31
  exports.FilterProps = {
32
32
  additionalProperties: false,
33
- required: ['filterTags', 'block'],
33
+ required: ['tags', 'items'],
34
34
  properties: Object.assign(Object.assign(Object.assign(Object.assign({}, common_1.BlockBaseProps), common_1.AnimatableProps), common_1.BlockHeaderProps), { allTag: {
35
35
  oneOf: [
36
36
  {
@@ -45,7 +45,7 @@ exports.FilterProps = {
45
45
  }, colSizes: common_1.containerSizesObject, tags: (0, utils_1.filteredArray)(exports.FilterTagProps), items: (0, utils_1.filteredArray)(exports.FilterItemProps), tagButtonSize: {
46
46
  type: 'string',
47
47
  enum: ['s', 'm', 'l', 'xl'],
48
- } }),
48
+ }, centered: { type: 'boolean' } }),
49
49
  };
50
50
  exports.FilterBlock = {
51
51
  'filter-block': exports.FilterProps,
@@ -6,12 +6,16 @@ const components_1 = require("../../components");
6
6
  const locationContext_1 = require("../../context/locationContext");
7
7
  const utils_1 = require("../../utils");
8
8
  const b = (0, utils_1.block)('icons-block');
9
+ const getItemContent = (item) => (react_1.default.createElement(react_1.Fragment, null,
10
+ react_1.default.createElement(components_1.Image, { className: b('image'), src: item.src }),
11
+ react_1.default.createElement("p", { className: b('text') }, item.text)));
9
12
  const Icons = ({ title, size = 's', items }) => {
10
13
  const { hostname } = (0, react_1.useContext)(locationContext_1.LocationContext);
11
14
  return (react_1.default.createElement("div", { className: b({ size }) },
12
15
  title && react_1.default.createElement(components_1.Title, { className: b('header'), title: title, colSizes: { all: 12 } }),
13
- items.map((item) => (react_1.default.createElement("a", Object.assign({ className: b('item'), key: item.url, href: item.url }, (0, utils_1.getLinkProps)(item.url, hostname)),
14
- react_1.default.createElement(components_1.Image, { className: b('image'), src: item.src }),
15
- react_1.default.createElement("p", { className: b('text') }, item.text))))));
16
+ items.map((item) => {
17
+ const itemContent = getItemContent(item);
18
+ return item.url ? (react_1.default.createElement("a", Object.assign({ className: b('item'), key: item.url, href: item.url }, (0, utils_1.getLinkProps)(item.url, hostname)), itemContent)) : (react_1.default.createElement("div", { className: b('item'), key: item.url }, itemContent));
19
+ })));
16
20
  };
17
21
  exports.default = Icons;
@@ -1,4 +1,4 @@
1
- import { ClassNameProps } from 'src/models';
1
+ import { ClassNameProps } from '../../models';
2
2
  export interface MetaInfpoProps extends ClassNameProps {
3
3
  items: string[];
4
4
  }
@@ -66,6 +66,9 @@ export declare const FilterProps: {
66
66
  type: string;
67
67
  enum: string[];
68
68
  };
69
+ centered: {
70
+ type: string;
71
+ };
69
72
  title: {
70
73
  oneOf: ({
71
74
  type: string;
@@ -173,6 +176,9 @@ export declare const FilterBlock: {
173
176
  type: string;
174
177
  enum: string[];
175
178
  };
179
+ centered: {
180
+ type: string;
181
+ };
176
182
  title: {
177
183
  oneOf: ({
178
184
  type: string;
@@ -27,7 +27,7 @@ export const FilterItemProps = {
27
27
  };
28
28
  export const FilterProps = {
29
29
  additionalProperties: false,
30
- required: ['filterTags', 'block'],
30
+ required: ['tags', 'items'],
31
31
  properties: Object.assign(Object.assign(Object.assign(Object.assign({}, BlockBaseProps), AnimatableProps), BlockHeaderProps), { allTag: {
32
32
  oneOf: [
33
33
  {
@@ -42,7 +42,7 @@ export const FilterProps = {
42
42
  }, colSizes: containerSizesObject, tags: filteredArray(FilterTagProps), items: filteredArray(FilterItemProps), tagButtonSize: {
43
43
  type: 'string',
44
44
  enum: ['s', 'm', 'l', 'xl'],
45
- } }),
45
+ }, centered: { type: 'boolean' } }),
46
46
  };
47
47
  export const FilterBlock = {
48
48
  'filter-block': FilterProps,
@@ -1,15 +1,19 @@
1
- import React, { useContext } from 'react';
1
+ import React, { Fragment, useContext } from 'react';
2
2
  import { Image, Title } from '../../components';
3
3
  import { LocationContext } from '../../context/locationContext';
4
4
  import { block, getLinkProps } from '../../utils';
5
5
  import './Icons.css';
6
6
  const b = block('icons-block');
7
+ const getItemContent = (item) => (React.createElement(Fragment, null,
8
+ React.createElement(Image, { className: b('image'), src: item.src }),
9
+ React.createElement("p", { className: b('text') }, item.text)));
7
10
  const Icons = ({ title, size = 's', items }) => {
8
11
  const { hostname } = useContext(LocationContext);
9
12
  return (React.createElement("div", { className: b({ size }) },
10
13
  title && React.createElement(Title, { className: b('header'), title: title, colSizes: { all: 12 } }),
11
- items.map((item) => (React.createElement("a", Object.assign({ className: b('item'), key: item.url, href: item.url }, getLinkProps(item.url, hostname)),
12
- React.createElement(Image, { className: b('image'), src: item.src }),
13
- React.createElement("p", { className: b('text') }, item.text))))));
14
+ items.map((item) => {
15
+ const itemContent = getItemContent(item);
16
+ return item.url ? (React.createElement("a", Object.assign({ className: b('item'), key: item.url, href: item.url }, getLinkProps(item.url, hostname)), itemContent)) : (React.createElement("div", { className: b('item'), key: item.url }, itemContent));
17
+ })));
14
18
  };
15
19
  export default Icons;
@@ -1,4 +1,4 @@
1
- import { ClassNameProps } from 'src/models';
1
+ import { ClassNameProps } from '../../models';
2
2
  import './MetaInfo.css';
3
3
  export interface MetaInfpoProps extends ClassNameProps {
4
4
  items: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "4.1.0",
3
+ "version": "4.1.2",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {