@gravity-ui/page-constructor 7.24.0 → 7.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/blocks/Questions/Questions.js +6 -3
- package/build/cjs/blocks/Questions/Questions.js.map +1 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +1 -0
- package/build/cjs/models/constructor-items/blocks.js.map +1 -1
- package/build/esm/blocks/Questions/Questions.js +6 -3
- package/build/esm/blocks/Questions/Questions.js.map +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +1 -0
- package/build/esm/models/constructor-items/blocks.js.map +1 -1
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +1 -0
- package/widget/index.js +1 -1
|
@@ -12,7 +12,7 @@ const b = (0, utils_1.block)('QuestionsBlock');
|
|
|
12
12
|
const QuestionsBlock = (props) => {
|
|
13
13
|
const { title, text, additionalInfo, links, buttons, items, list } = props;
|
|
14
14
|
const [opened, setOpened] = React.useState([0]);
|
|
15
|
-
const toggleItem = (index) => {
|
|
15
|
+
const toggleItem = (index, itemOnClick) => {
|
|
16
16
|
let newState;
|
|
17
17
|
if (opened.includes(index)) {
|
|
18
18
|
newState = opened.filter((itemIndex) => itemIndex !== index);
|
|
@@ -20,6 +20,9 @@ const QuestionsBlock = (props) => {
|
|
|
20
20
|
else {
|
|
21
21
|
newState = [...opened, index];
|
|
22
22
|
}
|
|
23
|
+
if (itemOnClick) {
|
|
24
|
+
itemOnClick(index, !opened.includes(index));
|
|
25
|
+
}
|
|
23
26
|
setOpened(newState);
|
|
24
27
|
};
|
|
25
28
|
const faqMicrodataScript = React.useMemo(() => {
|
|
@@ -44,9 +47,9 @@ const QuestionsBlock = (props) => {
|
|
|
44
47
|
return null;
|
|
45
48
|
}
|
|
46
49
|
}, [items]);
|
|
47
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: b(), children: [faqMicrodataScript, (0, jsx_runtime_1.jsxs)(grid_1.Row, { children: [(0, jsx_runtime_1.jsx)(grid_1.Col, { sizes: { all: 12, md: 4 }, children: (0, jsx_runtime_1.jsx)("div", { className: b('title'), children: (0, jsx_runtime_1.jsx)(sub_blocks_1.Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, list: list, buttons: buttons, colSizes: { all: 12, md: 12 } }) }) }), (0, jsx_runtime_1.jsx)(grid_1.Col, { sizes: { all: 12, md: 8 }, role: 'list', children: items.map(({ title: itemTitle, text: itemText, link, listStyle = 'dash' }, index) => {
|
|
50
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: b(), children: [faqMicrodataScript, (0, jsx_runtime_1.jsxs)(grid_1.Row, { children: [(0, jsx_runtime_1.jsx)(grid_1.Col, { sizes: { all: 12, md: 4 }, children: (0, jsx_runtime_1.jsx)("div", { className: b('title'), children: (0, jsx_runtime_1.jsx)(sub_blocks_1.Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, list: list, buttons: buttons, colSizes: { all: 12, md: 12 } }) }) }), (0, jsx_runtime_1.jsx)(grid_1.Col, { sizes: { all: 12, md: 8 }, role: 'list', children: items.map(({ title: itemTitle, text: itemText, link, listStyle = 'dash', onClick: itemOnClick, }, index) => {
|
|
48
51
|
const isOpened = opened.includes(index);
|
|
49
|
-
const onClick = () => toggleItem(index);
|
|
52
|
+
const onClick = () => toggleItem(index, itemOnClick);
|
|
50
53
|
return ((0, jsx_runtime_1.jsx)(QuestionBlockItem_1.QuestionBlockItem, { title: itemTitle, text: itemText, link: link, listStyle: listStyle, isOpened: isOpened, onClick: onClick }, itemTitle));
|
|
51
54
|
}) })] })] }));
|
|
52
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Questions.js","sourceRoot":"../../../../src","sources":["blocks/Questions/Questions.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,8CAAoC;AAEpC,0DAAyC;AACzC,gDAAkC;AAClC,wDAAwD;AAExD,gFAAwE;AAIxE,MAAM,CAAC,GAAG,IAAA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AI,EAAE,IAAI,EACV,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC,GAC7B,GACA,GACJ,EACN,uBAAC,UAAG,IAAC,KAAK,EAAE,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAC,EAAE,IAAI,EAAE,MAAM,YACrC,KAAK,CAAC,GAAG,CACN,CACI,EACI,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,EACd,IAAI,EACJ,SAAS,GAAG,MAAM,EAClB,OAAO,EAAE,WAAW,GACvB,EACD,KAAK,EACP,EAAE;4BACA,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;4BACxC,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;4BAErD,OAAO,CACH,uBAAC,qCAAiB,IAEd,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,IANX,SAAS,CAOhB,CACL,CAAC;wBACN,CAAC,CACJ,GACC,IACJ,IACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {Col, Row} from '../../grid';\nimport {QuestionsProps} from '../../models';\nimport {Content} from '../../sub-blocks';\nimport {block} from '../../utils';\nimport {sanitizeMicrodata} from '../../utils/microdata';\n\nimport {QuestionBlockItem} from './QuestionBlockItem/QuestionBlockItem';\n\nimport './Questions.scss';\n\nconst b = block('QuestionsBlock');\n\nconst QuestionsBlock = (props: QuestionsProps) => {\n const {title, text, additionalInfo, links, buttons, items, list} = props;\n const [opened, setOpened] = React.useState<number[]>([0]);\n\n const toggleItem = (\n index: number,\n itemOnClick?: QuestionsProps['items'][number]['onClick'],\n ) => {\n let newState;\n\n if (opened.includes(index)) {\n newState = opened.filter((itemIndex: number) => itemIndex !== index);\n } else {\n newState = [...opened, index];\n }\n\n if (itemOnClick) {\n itemOnClick(index, !opened.includes(index));\n }\n\n setOpened(newState);\n };\n\n const faqMicrodataScript = React.useMemo(() => {\n try {\n const json = JSON.stringify({\n '@context': 'https://schema.org',\n '@type': 'FAQPage',\n mainEntity: items.map((item) => ({\n '@type': 'Question',\n name: sanitizeMicrodata(item.title),\n acceptedAnswer: {\n '@type': 'Answer',\n text: sanitizeMicrodata(item.text),\n },\n })),\n });\n return <script type=\"application/ld+json\" dangerouslySetInnerHTML={{__html: json}} />;\n } catch (error) {\n /*eslint-disable no-console */\n console.warn('Problem with FAQ microdata', error);\n return null;\n }\n }, [items]);\n\n return (\n <div className={b()}>\n {faqMicrodataScript}\n <Row>\n <Col sizes={{all: 12, md: 4}}>\n <div className={b('title')}>\n <Content\n title={title}\n text={text}\n additionalInfo={additionalInfo}\n links={links}\n list={list}\n buttons={buttons}\n colSizes={{all: 12, md: 12}}\n />\n </div>\n </Col>\n <Col sizes={{all: 12, md: 8}} role={'list'}>\n {items.map(\n (\n {\n title: itemTitle,\n text: itemText,\n link,\n listStyle = 'dash',\n onClick: itemOnClick,\n },\n index,\n ) => {\n const isOpened = opened.includes(index);\n const onClick = () => toggleItem(index, itemOnClick);\n\n return (\n <QuestionBlockItem\n key={itemTitle}\n title={itemTitle}\n text={itemText}\n link={link}\n listStyle={listStyle}\n isOpened={isOpened}\n onClick={onClick}\n />\n );\n },\n )}\n </Col>\n </Row>\n </div>\n );\n};\n\nexport default QuestionsBlock;\n"]}
|
|
@@ -174,6 +174,7 @@ export interface QuestionItem {
|
|
|
174
174
|
text: string;
|
|
175
175
|
listStyle?: 'dash' | 'disk';
|
|
176
176
|
link?: LinkProps;
|
|
177
|
+
onClick?: (index: number, newOpenState: boolean) => void;
|
|
177
178
|
}
|
|
178
179
|
export interface QuestionsProps extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'labels'> {
|
|
179
180
|
items: QuestionItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":";;;AA6CA,IAAY,SAuBX;AAvBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,kBAAkB;IAClB,gDAAmC,CAAA;IACnC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,uCAA0B,CAAA;IAC1B,kDAAqC,CAAA;IACrC,wDAA2C,CAAA;IAC3C,uCAA0B,CAAA;IAC1B,mCAAsB,CAAA;IACtB,yCAA4B,CAAA;IAC5B,qCAAwB,CAAA;AAC5B,CAAC,EAvBW,SAAS,yBAAT,SAAS,QAuBpB;AAEY,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACtC,QAAA,gBAAgB,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAgCrF,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;AACb,CAAC,EALW,qBAAqB,qCAArB,qBAAqB,QAKhC;AAED,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,sCAAwB,CAAA;IACxB,wCAA0B,CAAA;IAC1B,gDAAkC,CAAA;AACtC,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AA2VD,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,iCAAS,CAAA;IACT,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B;AAOD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {GridColumnSize, GridColumnSizesType, IndentValue} from '../../grid/types';\nimport {ThemeSupporting} from '../../utils';\nimport {DeviceSupporting} from '../../utils/breakpoint';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {\n AnchorProps,\n Animatable,\n BackgroundImageProps,\n ButtonProps,\n CardBorder,\n ContentSize,\n ContentTextSize,\n ContentTheme,\n FileLinkProps,\n GravityIconProps,\n HeaderBreadCrumbsProps,\n HeaderImageSize,\n HeaderOffset,\n HeaderWidth,\n ImageDeviceProps,\n ImageProps,\n Justify,\n LegendTableMarkerType,\n LinkProps,\n MapProps,\n MediaDirection,\n MediaProps,\n MediaView,\n TextSize,\n TextTheme,\n ThemedImage,\n ThemedMediaProps,\n ThemedMediaVideoProps,\n TitleItemBaseProps,\n TitleItemProps,\n WithBorder,\n YandexFormProps,\n} from './common';\nimport {BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels} from './sub-blocks';\n\nexport enum BlockType {\n PromoFeaturesBlock = 'promo-features-block',\n ExtendedFeaturesBlock = 'extended-features-block',\n /** @deprecated */\n SliderOldBlock = 'slider-old-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n FoldableListBlock = 'foldable-list-block',\n BannerBlock = 'banner-block',\n CompaniesBlock = 'companies-block',\n MediaBlock = 'media-block',\n InfoBlock = 'info-block',\n TableBlock = 'table-block',\n TabsBlock = 'tabs-block',\n HeaderSliderBlock = 'header-slider-block',\n HeaderBlock = 'header-block',\n IconsBlock = 'icons-block',\n CardLayoutBlock = 'card-layout-block',\n ContentLayoutBlock = 'content-layout-block',\n ShareBlock = 'share-block',\n MapBlock = 'map-block',\n FilterBlock = 'filter-block',\n FormBlock = 'form-block',\n}\n\nexport const BlockTypes = Object.values(BlockType);\nexport const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];\n\nexport interface Childable {\n children?: SubBlock[];\n}\n\n//block props\nexport interface BlockBaseProps {\n anchor?: AnchorProps;\n visible?: GridColumnSize;\n /** @deprecated */\n resetPaddings?: boolean;\n indent?: {\n top?: IndentValue;\n bottom?: IndentValue;\n };\n qa?: string;\n}\n\nexport interface LoadableProps {\n source: string;\n /**\n * @deprecated Will be moved to params\n */\n serviceId?: number;\n params?: Record<string, string | number | boolean | object>;\n}\n\nexport interface LoadableChildren {\n loadable?: LoadableProps;\n}\n\nexport enum SliderBreakpointNames {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n Xl = 'xl',\n}\n\nexport enum SliderType {\n MediaCard = 'media-card',\n HeaderCard = 'header-card',\n FullscreenCard = 'fullscreen-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderOldProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface SliderProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderOldProps, 'title' | 'description'> {\n items: HeaderBlockProps[];\n}\n\ninterface HeaderBackgroundProps {\n /** @deprecated replaced by Media Props image */\n url?: string;\n /** @deprecated replaced by Media Props image */\n disableCompress?: boolean;\n}\n\nexport interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {\n fullWidth?: boolean;\n fullWidthMedia?: boolean;\n}\n\nexport type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;\n\nexport interface HeaderBlockVideoIframe {\n src: string;\n autoplay?: boolean;\n previewImg?: string;\n height?: number;\n}\n\nexport interface HeaderBlockProps {\n title: string;\n overtitle?: string | JSX.Element;\n description?: string;\n additionalInfo?: string;\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];\n width?: HeaderWidth;\n /** @deprecated imageSize now depends on width */\n imageSize?: HeaderImageSize;\n /**\n * @deprecated used only on the main page\n * TODO: delete after the possibility to remove padding-bottom in the block\n */\n offset?: HeaderOffset;\n image?: ThemedImage;\n video?: ThemedMediaVideoProps;\n videoIframe?: HeaderBlockVideoIframe;\n mediaView?: MediaView;\n centered?: boolean;\n background?: ThemedHeaderBlockBackground;\n theme?: 'light' | 'dark';\n verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';\n breadcrumbs?: HeaderBreadCrumbsProps;\n status?: JSX.Element;\n renderTitle?: (title: string) => React.ReactNode;\n}\n\nexport interface ExtendedFeaturesItem\n extends Omit<\n ContentBlockProps,\n 'theme' | 'centered' | 'colSizes' | 'size' | 'title' | 'labels'\n > {\n title: string;\n label?: string;\n icon?: ThemedImage;\n /** @deprecated **/\n link?: LinkProps;\n}\n\nexport interface ExtendedFeaturesProps extends Animatable {\n items: ExtendedFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n colSizes?: GridColumnSizesType;\n}\n\nexport interface PromoFeaturesItem {\n title: string;\n text: string;\n theme?: 'accent' | 'accent-light' | 'primary';\n media?: ThemeSupporting<MediaProps>;\n}\n\nexport interface PromoFeaturesProps extends Animatable {\n items: PromoFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n theme?: 'grey' | 'default';\n}\n\nexport interface QuestionItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'labels'> {\n items: QuestionItem[];\n}\n\nexport interface QuestionBlockItemProps extends QuestionItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface FoldableListItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface FoldableListProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'labels'> {\n items: FoldableListItem[];\n}\n\nexport interface FoldableListBlockItemProps extends FoldableListItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface BannerBlockProps extends BannerCardProps, Animatable {}\n\nexport interface CompaniesBlockProps extends Animatable {\n title: string;\n description?: string;\n images: ThemeSupporting<ImageDeviceProps>;\n}\n\nexport interface MediaBaseBlockProps extends Animatable, MediaContentProps {\n direction?: MediaDirection;\n mobileDirection?: MediaDirection;\n largeMedia?: boolean;\n mediaOnly?: boolean;\n mediaOnlyColSizes?: GridColumnSizesType;\n}\n\nexport interface MediaContentProps\n extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'theme' | 'centered' | 'labels'> {\n description?: string;\n /** @deprecated Use array of buttons from ContentBlockProps instead**/\n button?: ButtonProps;\n}\n\nexport interface MediaBlockProps extends MediaBaseBlockProps, WithBorder {\n media: ThemeSupporting<MediaProps>;\n}\n\nexport interface MapBlockProps extends MediaBaseBlockProps, WithBorder {\n map: Omit<MapProps, 'forceAspectRatio' | 'areaMargin' | 'copyrightPosition'>;\n}\n\nexport interface InfoBlockProps {\n theme?: TextTheme;\n backgroundColor?: ThemeSupporting<string>;\n /** @deprecated **/\n title?: string;\n /** @deprecated **/\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme'>[];\n /** @deprecated **/\n sectionsTitle?: string;\n /** @deprecated **/\n links?: Pick<LinkProps, 'text' | 'url'>[];\n leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size' | 'labels'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size' | 'labels'>;\n}\n\nexport interface TableProps {\n content: string[][];\n legend?: string[];\n hideLegend?: boolean;\n justify?: Justify[];\n marker?: LegendTableMarkerType;\n /**\n * Only as accessible name, not displayed explicitly\n */\n caption?: string;\n}\n\nexport interface TableBlockProps {\n title: string;\n table: TableProps;\n}\n\nexport interface TabsBlockItem\n extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme' | 'labels'>,\n WithBorder {\n tabName: string;\n /**\n * @deprecated Use array links from ContentBlockProps instead\n */\n link?: LinkProps;\n image?: ThemedImage;\n caption?: string;\n media?: ThemedMediaProps;\n}\n\nexport interface TabsBlockProps extends Animatable {\n title?: TitleItemProps | string;\n description?: string;\n tabsColSizes?: GridColumnSizesType;\n centered?: boolean;\n direction?: MediaDirection;\n items: TabsBlockItem[];\n contentSize?: ContentSize;\n}\n\nexport interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n titleClassName?: string;\n centered?: boolean;\n description?: string;\n colSizes?: GridColumnSizesType;\n background?: ThemeSupporting<\n BackgroundImageProps & {\n border?: CardBorder;\n }\n >;\n}\n\nexport type FilterTag = {\n id: string;\n label: string;\n};\n\nexport type FilterItem = {\n tags: string[];\n card: SubBlockModels;\n};\n\nexport interface FilterBlockProps extends Animatable {\n tags: FilterTag[];\n items: FilterItem[];\n title?: TitleItemProps | string;\n description?: string;\n tagButtonSize?: ButtonSize;\n allTag?: boolean | string;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n}\n\nexport interface IconsBlockItemProps extends AnalyticsEventsBase {\n url: string;\n text: string;\n src: ThemeSupporting<string>;\n}\n\nexport interface IconsBlockProps {\n title?: string;\n description?: string;\n size?: 's' | 'm' | 'l';\n items: IconsBlockItemProps[];\n colSizes?: GridColumnSizesType;\n}\n\ninterface ContentLayoutBlockParams {\n size?: ContentSize;\n background?: ThemeSupporting<BackgroundImageProps>;\n centered?: boolean;\n theme?: ContentTheme;\n textWidth?: ContentTextSize;\n}\n\nexport interface ContentLayoutBlockProps extends ContentLayoutBlockParams {\n textContent: Omit<ContentBlockProps, 'labels'>;\n fileContent?: FileLinkProps[];\n}\n\nexport type SVGIcon = (props: React.SVGProps<SVGSVGElement>) => React.ReactNode;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nexport interface ContentListProps {\n list: ContentItemProps[];\n size: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentLabelProps {\n text: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nexport interface ContentLabelsProps {\n labels: ContentLabelProps[];\n size?: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentBlockProps {\n title?: TitleItemBaseProps | string;\n titleId?: string;\n text?: string;\n textId?: string;\n additionalInfo?: string;\n links?: LinkProps[];\n buttons?: ButtonProps[];\n size?: ContentSize;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n theme?: ContentTheme;\n list?: ContentItemProps[];\n labels?: ContentLabelProps[];\n controlPosition?: 'default' | 'bottom';\n}\n\nexport enum PCShareSocialNetwork {\n Vk = 'vk',\n Telegram = 'telegram',\n Twitter = 'twitter',\n Facebook = 'facebook',\n LinkedIn = 'linkedin',\n}\n\nexport interface ShareBlockProps {\n items: PCShareSocialNetwork[];\n title?: string;\n}\n\nexport enum FormBlockDataTypes {\n YANDEX = 'yandex',\n HUBSPOT = 'hubspot',\n}\n\nexport enum FormBlockDirection {\n FormContent = 'form-content',\n ContentForm = 'content-form',\n Center = 'center',\n}\n\nexport interface FormBlockYandexData {\n yandex: ThemeSupporting<YandexFormProps>;\n}\n\nexport interface FormBlockHubspotData {\n hubspot: ThemeSupporting<HubspotFormProps>;\n}\n\nexport type FormBlockData = FormBlockYandexData | FormBlockHubspotData;\n\nexport interface FormBlockBackgroundProps extends Omit<BackgroundImageProps, 'style'> {\n style?: DeviceSupporting<React.CSSProperties>;\n}\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<FormBlockBackgroundProps>;\n customFormNode?: React.ReactNode;\n}\n\n//block models\nexport type HeaderBlockModel = {\n type: BlockType.HeaderBlock;\n} & HeaderBlockProps;\n\nexport type SliderOldBlockModel = {\n type: BlockType.SliderOldBlock;\n} & SliderOldProps;\n\nexport type ExtendedFeaturesBlockModel = {\n type: BlockType.ExtendedFeaturesBlock;\n} & ExtendedFeaturesProps;\n\nexport type PromoFeaturesBlockModel = {\n type: BlockType.PromoFeaturesBlock;\n} & PromoFeaturesProps;\n\nexport type QuestionsBlockModel = {\n type: BlockType.QuestionsBlock;\n} & QuestionsProps;\n\nexport type FoldableListBlockModel = {\n type: BlockType.FoldableListBlock;\n} & FoldableListProps;\n\nexport type BannerBlockModel = {\n type: BlockType.BannerBlock;\n} & BannerBlockProps;\n\nexport type CompaniesBlockModel = {\n type: BlockType.CompaniesBlock;\n} & CompaniesBlockProps;\n\nexport type MediaBlockModel = {\n type: BlockType.MediaBlock;\n} & MediaBlockProps;\n\nexport type MapBlockModel = {\n type: BlockType.MapBlock;\n} & MapBlockProps;\n\nexport type InfoBlockModel = {\n type: BlockType.InfoBlock;\n} & InfoBlockProps;\n\nexport type TableBlockModel = {\n type: BlockType.TableBlock;\n} & TableBlockProps;\n\nexport type TabsBlockModel = {\n type: BlockType.TabsBlock;\n} & TabsBlockProps;\n\nexport type CardLayoutBlockModel = {\n type: BlockType.CardLayoutBlock;\n} & CardLayoutBlockProps;\n\nexport type FilterBlockModel = {\n type: BlockType.FilterBlock;\n} & FilterBlockProps;\n\nexport type IconsBlockModel = {\n type: BlockType.IconsBlock;\n} & IconsBlockProps;\n\nexport type HeaderSliderBlockModel = {\n type: BlockType.HeaderSliderBlock;\n} & HeaderSliderBlockProps;\n\nexport type ContentLayoutBlockModel = {\n type: BlockType.ContentLayoutBlock;\n} & ContentLayoutBlockProps;\n\nexport type ShareBLockModel = {\n type: BlockType.ShareBlock;\n} & ShareBlockProps;\n\nexport type FormBlockModel = {\n type: BlockType.FormBlock;\n} & FormBlockProps;\n\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\ntype BlockModels =\n | SliderOldBlockModel\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | FoldableListBlockModel\n | BannerBlockModel\n | CompaniesBlockModel\n | MediaBlockModel\n | MapBlockModel\n | InfoBlockModel\n | TableBlockModel\n | TabsBlockModel\n | HeaderBlockModel\n | IconsBlockModel\n | HeaderSliderBlockModel\n | CardLayoutBlockModel\n | ContentLayoutBlockModel\n | ShareBLockModel\n | FilterBlockModel\n | FormBlockModel;\n\nexport type Block = BlockModels & BlockBaseProps;\n"]}
|
|
1
|
+
{"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":";;;AA6CA,IAAY,SAuBX;AAvBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,kBAAkB;IAClB,gDAAmC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;AAJD,WAAY,kBAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {GridColumnSize, GridColumnSizesType, IndentValue} from '../../grid/types';\nimport {ThemeSupporting} from '../../utils';\nimport {DeviceSupporting} from '../../utils/breakpoint';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {\n AnchorProps,\n Animatable,\n BackgroundImageProps,\n ButtonProps,\n CardBorder,\n ContentSize,\n ContentTextSize,\n ContentTheme,\n FileLinkProps,\n GravityIconProps,\n HeaderBreadCrumbsProps,\n HeaderImageSize,\n HeaderOffset,\n HeaderWidth,\n ImageDeviceProps,\n ImageProps,\n Justify,\n LegendTableMarkerType,\n LinkProps,\n MapProps,\n MediaDirection,\n MediaProps,\n MediaView,\n TextSize,\n TextTheme,\n ThemedImage,\n ThemedMediaProps,\n ThemedMediaVideoProps,\n TitleItemBaseProps,\n TitleItemProps,\n WithBorder,\n YandexFormProps,\n} from './common';\nimport {BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels} from './sub-blocks';\n\nexport enum BlockType {\n PromoFeaturesBlock = 'promo-features-block',\n ExtendedFeaturesBlock = 'extended-features-block',\n /** @deprecated */\n SliderOldBlock = 'slider-old-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n FoldableListBlock = 'foldable-list-block',\n BannerBlock = 'banner-block',\n CompaniesBlock = 'companies-block',\n MediaBlock = 'media-block',\n InfoBlock = 'info-block',\n TableBlock = 'table-block',\n TabsBlock = 'tabs-block',\n HeaderSliderBlock = 'header-slider-block',\n HeaderBlock = 'header-block',\n IconsBlock = 'icons-block',\n CardLayoutBlock = 'card-layout-block',\n ContentLayoutBlock = 'content-layout-block',\n ShareBlock = 'share-block',\n MapBlock = 'map-block',\n FilterBlock = 'filter-block',\n FormBlock = 'form-block',\n}\n\nexport const BlockTypes = Object.values(BlockType);\nexport const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];\n\nexport interface Childable {\n children?: SubBlock[];\n}\n\n//block props\nexport interface BlockBaseProps {\n anchor?: AnchorProps;\n visible?: GridColumnSize;\n /** @deprecated */\n resetPaddings?: boolean;\n indent?: {\n top?: IndentValue;\n bottom?: IndentValue;\n };\n qa?: string;\n}\n\nexport interface LoadableProps {\n source: string;\n /**\n * @deprecated Will be moved to params\n */\n serviceId?: number;\n params?: Record<string, string | number | boolean | object>;\n}\n\nexport interface LoadableChildren {\n loadable?: LoadableProps;\n}\n\nexport enum SliderBreakpointNames {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n Xl = 'xl',\n}\n\nexport enum SliderType {\n MediaCard = 'media-card',\n HeaderCard = 'header-card',\n FullscreenCard = 'fullscreen-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderOldProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface SliderProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderOldProps, 'title' | 'description'> {\n items: HeaderBlockProps[];\n}\n\ninterface HeaderBackgroundProps {\n /** @deprecated replaced by Media Props image */\n url?: string;\n /** @deprecated replaced by Media Props image */\n disableCompress?: boolean;\n}\n\nexport interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {\n fullWidth?: boolean;\n fullWidthMedia?: boolean;\n}\n\nexport type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;\n\nexport interface HeaderBlockVideoIframe {\n src: string;\n autoplay?: boolean;\n previewImg?: string;\n height?: number;\n}\n\nexport interface HeaderBlockProps {\n title: string;\n overtitle?: string | JSX.Element;\n description?: string;\n additionalInfo?: string;\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];\n width?: HeaderWidth;\n /** @deprecated imageSize now depends on width */\n imageSize?: HeaderImageSize;\n /**\n * @deprecated used only on the main page\n * TODO: delete after the possibility to remove padding-bottom in the block\n */\n offset?: HeaderOffset;\n image?: ThemedImage;\n video?: ThemedMediaVideoProps;\n videoIframe?: HeaderBlockVideoIframe;\n mediaView?: MediaView;\n centered?: boolean;\n background?: ThemedHeaderBlockBackground;\n theme?: 'light' | 'dark';\n verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';\n breadcrumbs?: HeaderBreadCrumbsProps;\n status?: JSX.Element;\n renderTitle?: (title: string) => React.ReactNode;\n}\n\nexport interface ExtendedFeaturesItem\n extends Omit<\n ContentBlockProps,\n 'theme' | 'centered' | 'colSizes' | 'size' | 'title' | 'labels'\n > {\n title: string;\n label?: string;\n icon?: ThemedImage;\n /** @deprecated **/\n link?: LinkProps;\n}\n\nexport interface ExtendedFeaturesProps extends Animatable {\n items: ExtendedFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n colSizes?: GridColumnSizesType;\n}\n\nexport interface PromoFeaturesItem {\n title: string;\n text: string;\n theme?: 'accent' | 'accent-light' | 'primary';\n media?: ThemeSupporting<MediaProps>;\n}\n\nexport interface PromoFeaturesProps extends Animatable {\n items: PromoFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n theme?: 'grey' | 'default';\n}\n\nexport interface QuestionItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n onClick?: (index: number, newOpenState: boolean) => void;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'labels'> {\n items: QuestionItem[];\n}\n\nexport interface QuestionBlockItemProps extends QuestionItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface FoldableListItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface FoldableListProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'labels'> {\n items: FoldableListItem[];\n}\n\nexport interface FoldableListBlockItemProps extends FoldableListItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface BannerBlockProps extends BannerCardProps, Animatable {}\n\nexport interface CompaniesBlockProps extends Animatable {\n title: string;\n description?: string;\n images: ThemeSupporting<ImageDeviceProps>;\n}\n\nexport interface MediaBaseBlockProps extends Animatable, MediaContentProps {\n direction?: MediaDirection;\n mobileDirection?: MediaDirection;\n largeMedia?: boolean;\n mediaOnly?: boolean;\n mediaOnlyColSizes?: GridColumnSizesType;\n}\n\nexport interface MediaContentProps\n extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'theme' | 'centered' | 'labels'> {\n description?: string;\n /** @deprecated Use array of buttons from ContentBlockProps instead**/\n button?: ButtonProps;\n}\n\nexport interface MediaBlockProps extends MediaBaseBlockProps, WithBorder {\n media: ThemeSupporting<MediaProps>;\n}\n\nexport interface MapBlockProps extends MediaBaseBlockProps, WithBorder {\n map: Omit<MapProps, 'forceAspectRatio' | 'areaMargin' | 'copyrightPosition'>;\n}\n\nexport interface InfoBlockProps {\n theme?: TextTheme;\n backgroundColor?: ThemeSupporting<string>;\n /** @deprecated **/\n title?: string;\n /** @deprecated **/\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme'>[];\n /** @deprecated **/\n sectionsTitle?: string;\n /** @deprecated **/\n links?: Pick<LinkProps, 'text' | 'url'>[];\n leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size' | 'labels'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size' | 'labels'>;\n}\n\nexport interface TableProps {\n content: string[][];\n legend?: string[];\n hideLegend?: boolean;\n justify?: Justify[];\n marker?: LegendTableMarkerType;\n /**\n * Only as accessible name, not displayed explicitly\n */\n caption?: string;\n}\n\nexport interface TableBlockProps {\n title: string;\n table: TableProps;\n}\n\nexport interface TabsBlockItem\n extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme' | 'labels'>,\n WithBorder {\n tabName: string;\n /**\n * @deprecated Use array links from ContentBlockProps instead\n */\n link?: LinkProps;\n image?: ThemedImage;\n caption?: string;\n media?: ThemedMediaProps;\n}\n\nexport interface TabsBlockProps extends Animatable {\n title?: TitleItemProps | string;\n description?: string;\n tabsColSizes?: GridColumnSizesType;\n centered?: boolean;\n direction?: MediaDirection;\n items: TabsBlockItem[];\n contentSize?: ContentSize;\n}\n\nexport interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n titleClassName?: string;\n centered?: boolean;\n description?: string;\n colSizes?: GridColumnSizesType;\n background?: ThemeSupporting<\n BackgroundImageProps & {\n border?: CardBorder;\n }\n >;\n}\n\nexport type FilterTag = {\n id: string;\n label: string;\n};\n\nexport type FilterItem = {\n tags: string[];\n card: SubBlockModels;\n};\n\nexport interface FilterBlockProps extends Animatable {\n tags: FilterTag[];\n items: FilterItem[];\n title?: TitleItemProps | string;\n description?: string;\n tagButtonSize?: ButtonSize;\n allTag?: boolean | string;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n}\n\nexport interface IconsBlockItemProps extends AnalyticsEventsBase {\n url: string;\n text: string;\n src: ThemeSupporting<string>;\n}\n\nexport interface IconsBlockProps {\n title?: string;\n description?: string;\n size?: 's' | 'm' | 'l';\n items: IconsBlockItemProps[];\n colSizes?: GridColumnSizesType;\n}\n\ninterface ContentLayoutBlockParams {\n size?: ContentSize;\n background?: ThemeSupporting<BackgroundImageProps>;\n centered?: boolean;\n theme?: ContentTheme;\n textWidth?: ContentTextSize;\n}\n\nexport interface ContentLayoutBlockProps extends ContentLayoutBlockParams {\n textContent: Omit<ContentBlockProps, 'labels'>;\n fileContent?: FileLinkProps[];\n}\n\nexport type SVGIcon = (props: React.SVGProps<SVGSVGElement>) => React.ReactNode;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nexport interface ContentListProps {\n list: ContentItemProps[];\n size: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentLabelProps {\n text: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nexport interface ContentLabelsProps {\n labels: ContentLabelProps[];\n size?: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentBlockProps {\n title?: TitleItemBaseProps | string;\n titleId?: string;\n text?: string;\n textId?: string;\n additionalInfo?: string;\n links?: LinkProps[];\n buttons?: ButtonProps[];\n size?: ContentSize;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n theme?: ContentTheme;\n list?: ContentItemProps[];\n labels?: ContentLabelProps[];\n controlPosition?: 'default' | 'bottom';\n}\n\nexport enum PCShareSocialNetwork {\n Vk = 'vk',\n Telegram = 'telegram',\n Twitter = 'twitter',\n Facebook = 'facebook',\n LinkedIn = 'linkedin',\n}\n\nexport interface ShareBlockProps {\n items: PCShareSocialNetwork[];\n title?: string;\n}\n\nexport enum FormBlockDataTypes {\n YANDEX = 'yandex',\n HUBSPOT = 'hubspot',\n}\n\nexport enum FormBlockDirection {\n FormContent = 'form-content',\n ContentForm = 'content-form',\n Center = 'center',\n}\n\nexport interface FormBlockYandexData {\n yandex: ThemeSupporting<YandexFormProps>;\n}\n\nexport interface FormBlockHubspotData {\n hubspot: ThemeSupporting<HubspotFormProps>;\n}\n\nexport type FormBlockData = FormBlockYandexData | FormBlockHubspotData;\n\nexport interface FormBlockBackgroundProps extends Omit<BackgroundImageProps, 'style'> {\n style?: DeviceSupporting<React.CSSProperties>;\n}\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<FormBlockBackgroundProps>;\n customFormNode?: React.ReactNode;\n}\n\n//block models\nexport type HeaderBlockModel = {\n type: BlockType.HeaderBlock;\n} & HeaderBlockProps;\n\nexport type SliderOldBlockModel = {\n type: BlockType.SliderOldBlock;\n} & SliderOldProps;\n\nexport type ExtendedFeaturesBlockModel = {\n type: BlockType.ExtendedFeaturesBlock;\n} & ExtendedFeaturesProps;\n\nexport type PromoFeaturesBlockModel = {\n type: BlockType.PromoFeaturesBlock;\n} & PromoFeaturesProps;\n\nexport type QuestionsBlockModel = {\n type: BlockType.QuestionsBlock;\n} & QuestionsProps;\n\nexport type FoldableListBlockModel = {\n type: BlockType.FoldableListBlock;\n} & FoldableListProps;\n\nexport type BannerBlockModel = {\n type: BlockType.BannerBlock;\n} & BannerBlockProps;\n\nexport type CompaniesBlockModel = {\n type: BlockType.CompaniesBlock;\n} & CompaniesBlockProps;\n\nexport type MediaBlockModel = {\n type: BlockType.MediaBlock;\n} & MediaBlockProps;\n\nexport type MapBlockModel = {\n type: BlockType.MapBlock;\n} & MapBlockProps;\n\nexport type InfoBlockModel = {\n type: BlockType.InfoBlock;\n} & InfoBlockProps;\n\nexport type TableBlockModel = {\n type: BlockType.TableBlock;\n} & TableBlockProps;\n\nexport type TabsBlockModel = {\n type: BlockType.TabsBlock;\n} & TabsBlockProps;\n\nexport type CardLayoutBlockModel = {\n type: BlockType.CardLayoutBlock;\n} & CardLayoutBlockProps;\n\nexport type FilterBlockModel = {\n type: BlockType.FilterBlock;\n} & FilterBlockProps;\n\nexport type IconsBlockModel = {\n type: BlockType.IconsBlock;\n} & IconsBlockProps;\n\nexport type HeaderSliderBlockModel = {\n type: BlockType.HeaderSliderBlock;\n} & HeaderSliderBlockProps;\n\nexport type ContentLayoutBlockModel = {\n type: BlockType.ContentLayoutBlock;\n} & ContentLayoutBlockProps;\n\nexport type ShareBLockModel = {\n type: BlockType.ShareBlock;\n} & ShareBlockProps;\n\nexport type FormBlockModel = {\n type: BlockType.FormBlock;\n} & FormBlockProps;\n\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\ntype BlockModels =\n | SliderOldBlockModel\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | FoldableListBlockModel\n | BannerBlockModel\n | CompaniesBlockModel\n | MediaBlockModel\n | MapBlockModel\n | InfoBlockModel\n | TableBlockModel\n | TabsBlockModel\n | HeaderBlockModel\n | IconsBlockModel\n | HeaderSliderBlockModel\n | CardLayoutBlockModel\n | ContentLayoutBlockModel\n | ShareBLockModel\n | FilterBlockModel\n | FormBlockModel;\n\nexport type Block = BlockModels & BlockBaseProps;\n"]}
|
|
@@ -10,7 +10,7 @@ const b = block('QuestionsBlock');
|
|
|
10
10
|
const QuestionsBlock = (props) => {
|
|
11
11
|
const { title, text, additionalInfo, links, buttons, items, list } = props;
|
|
12
12
|
const [opened, setOpened] = React.useState([0]);
|
|
13
|
-
const toggleItem = (index) => {
|
|
13
|
+
const toggleItem = (index, itemOnClick) => {
|
|
14
14
|
let newState;
|
|
15
15
|
if (opened.includes(index)) {
|
|
16
16
|
newState = opened.filter((itemIndex) => itemIndex !== index);
|
|
@@ -18,6 +18,9 @@ const QuestionsBlock = (props) => {
|
|
|
18
18
|
else {
|
|
19
19
|
newState = [...opened, index];
|
|
20
20
|
}
|
|
21
|
+
if (itemOnClick) {
|
|
22
|
+
itemOnClick(index, !opened.includes(index));
|
|
23
|
+
}
|
|
21
24
|
setOpened(newState);
|
|
22
25
|
};
|
|
23
26
|
const faqMicrodataScript = React.useMemo(() => {
|
|
@@ -42,9 +45,9 @@ const QuestionsBlock = (props) => {
|
|
|
42
45
|
return null;
|
|
43
46
|
}
|
|
44
47
|
}, [items]);
|
|
45
|
-
return (_jsxs("div", { className: b(), children: [faqMicrodataScript, _jsxs(Row, { children: [_jsx(Col, { sizes: { all: 12, md: 4 }, children: _jsx("div", { className: b('title'), children: _jsx(Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, list: list, buttons: buttons, colSizes: { all: 12, md: 12 } }) }) }), _jsx(Col, { sizes: { all: 12, md: 8 }, role: 'list', children: items.map(({ title: itemTitle, text: itemText, link, listStyle = 'dash' }, index) => {
|
|
48
|
+
return (_jsxs("div", { className: b(), children: [faqMicrodataScript, _jsxs(Row, { children: [_jsx(Col, { sizes: { all: 12, md: 4 }, children: _jsx("div", { className: b('title'), children: _jsx(Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, list: list, buttons: buttons, colSizes: { all: 12, md: 12 } }) }) }), _jsx(Col, { sizes: { all: 12, md: 8 }, role: 'list', children: items.map(({ title: itemTitle, text: itemText, link, listStyle = 'dash', onClick: itemOnClick, }, index) => {
|
|
46
49
|
const isOpened = opened.includes(index);
|
|
47
|
-
const onClick = () => toggleItem(index);
|
|
50
|
+
const onClick = () => toggleItem(index, itemOnClick);
|
|
48
51
|
return (_jsx(QuestionBlockItem, { title: itemTitle, text: itemText, link: link, listStyle: listStyle, isOpened: isOpened, onClick: onClick }, itemTitle));
|
|
49
52
|
}) })] })] }));
|
|
50
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Questions.js","sourceRoot":"../../../../src","sources":["blocks/Questions/Questions.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,GAAG,EAAE,GAAG,EAAC,4BAAmB;AAEpC,OAAO,EAAC,OAAO,EAAC,kCAAyB;AACzC,OAAO,EAAC,KAAK,EAAC,6BA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ourcesContent":["import * as React from 'react';\n\nimport {Col, Row} from '../../grid';\nimport {QuestionsProps} from '../../models';\nimport {Content} from '../../sub-blocks';\nimport {block} from '../../utils';\nimport {sanitizeMicrodata} from '../../utils/microdata';\n\nimport {QuestionBlockItem} from './QuestionBlockItem/QuestionBlockItem';\n\nimport './Questions.scss';\n\nconst b = block('QuestionsBlock');\n\nconst QuestionsBlock = (props: QuestionsProps) => {\n const {title, text, additionalInfo, links, buttons, items, list} = props;\n const [opened, setOpened] = React.useState<number[]>([0]);\n\n const toggleItem = (\n index: number,\n itemOnClick?: QuestionsProps['items'][number]['onClick'],\n ) => {\n let newState;\n\n if (opened.includes(index)) {\n newState = opened.filter((itemIndex: number) => itemIndex !== index);\n } else {\n newState = [...opened, index];\n }\n\n if (itemOnClick) {\n itemOnClick(index, !opened.includes(index));\n }\n\n setOpened(newState);\n };\n\n const faqMicrodataScript = React.useMemo(() => {\n try {\n const json = JSON.stringify({\n '@context': 'https://schema.org',\n '@type': 'FAQPage',\n mainEntity: items.map((item) => ({\n '@type': 'Question',\n name: sanitizeMicrodata(item.title),\n acceptedAnswer: {\n '@type': 'Answer',\n text: sanitizeMicrodata(item.text),\n },\n })),\n });\n return <script type=\"application/ld+json\" dangerouslySetInnerHTML={{__html: json}} />;\n } catch (error) {\n /*eslint-disable no-console */\n console.warn('Problem with FAQ microdata', error);\n return null;\n }\n }, [items]);\n\n return (\n <div className={b()}>\n {faqMicrodataScript}\n <Row>\n <Col sizes={{all: 12, md: 4}}>\n <div className={b('title')}>\n <Content\n title={title}\n text={text}\n additionalInfo={additionalInfo}\n links={links}\n list={list}\n buttons={buttons}\n colSizes={{all: 12, md: 12}}\n />\n </div>\n </Col>\n <Col sizes={{all: 12, md: 8}} role={'list'}>\n {items.map(\n (\n {\n title: itemTitle,\n text: itemText,\n link,\n listStyle = 'dash',\n onClick: itemOnClick,\n },\n index,\n ) => {\n const isOpened = opened.includes(index);\n const onClick = () => toggleItem(index, itemOnClick);\n\n return (\n <QuestionBlockItem\n key={itemTitle}\n title={itemTitle}\n text={itemText}\n link={link}\n listStyle={listStyle}\n isOpened={isOpened}\n onClick={onClick}\n />\n );\n },\n )}\n </Col>\n </Row>\n </div>\n );\n};\n\nexport default QuestionsBlock;\n"]}
|
|
@@ -174,6 +174,7 @@ export interface QuestionItem {
|
|
|
174
174
|
text: string;
|
|
175
175
|
listStyle?: 'dash' | 'disk';
|
|
176
176
|
link?: LinkProps;
|
|
177
|
+
onClick?: (index: number, newOpenState: boolean) => void;
|
|
177
178
|
}
|
|
178
179
|
export interface QuestionsProps extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'labels'> {
|
|
179
180
|
items: QuestionItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":"AA6CA,MAAM,CAAN,IAAY,SAuBX;AAvBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,kBAAkB;IAClB,gDAAmC,CAAA;IACnC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,uCAA0B,CAAA;IAC1B,kDAAqC,CAAA;IACrC,wDAA2C,CAAA;IAC3C,uCAA0B,CAAA;IAC1B,mCAAsB,CAAA;IACtB,yCAA4B,CAAA;IAC5B,qCAAwB,CAAA;AAC5B,CAAC,EAvBW,SAAS,KAAT,SAAS,QAuBpB;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAgCrF,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;AACb,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;AAED,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,sCAAwB,CAAA;IACxB,wCAA0B,CAAA;IAC1B,gDAAkC,CAAA;AACtC,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AA2VD,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,iCAAS,CAAA;IACT,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B;AAOD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {GridColumnSize, GridColumnSizesType, IndentValue} from '../../grid/types';\nimport {ThemeSupporting} from '../../utils';\nimport {DeviceSupporting} from '../../utils/breakpoint';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {\n AnchorProps,\n Animatable,\n BackgroundImageProps,\n ButtonProps,\n CardBorder,\n ContentSize,\n ContentTextSize,\n ContentTheme,\n FileLinkProps,\n GravityIconProps,\n HeaderBreadCrumbsProps,\n HeaderImageSize,\n HeaderOffset,\n HeaderWidth,\n ImageDeviceProps,\n ImageProps,\n Justify,\n LegendTableMarkerType,\n LinkProps,\n MapProps,\n MediaDirection,\n MediaProps,\n MediaView,\n TextSize,\n TextTheme,\n ThemedImage,\n ThemedMediaProps,\n ThemedMediaVideoProps,\n TitleItemBaseProps,\n TitleItemProps,\n WithBorder,\n YandexFormProps,\n} from './common';\nimport {BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels} from './sub-blocks';\n\nexport enum BlockType {\n PromoFeaturesBlock = 'promo-features-block',\n ExtendedFeaturesBlock = 'extended-features-block',\n /** @deprecated */\n SliderOldBlock = 'slider-old-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n FoldableListBlock = 'foldable-list-block',\n BannerBlock = 'banner-block',\n CompaniesBlock = 'companies-block',\n MediaBlock = 'media-block',\n InfoBlock = 'info-block',\n TableBlock = 'table-block',\n TabsBlock = 'tabs-block',\n HeaderSliderBlock = 'header-slider-block',\n HeaderBlock = 'header-block',\n IconsBlock = 'icons-block',\n CardLayoutBlock = 'card-layout-block',\n ContentLayoutBlock = 'content-layout-block',\n ShareBlock = 'share-block',\n MapBlock = 'map-block',\n FilterBlock = 'filter-block',\n FormBlock = 'form-block',\n}\n\nexport const BlockTypes = Object.values(BlockType);\nexport const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];\n\nexport interface Childable {\n children?: SubBlock[];\n}\n\n//block props\nexport interface BlockBaseProps {\n anchor?: AnchorProps;\n visible?: GridColumnSize;\n /** @deprecated */\n resetPaddings?: boolean;\n indent?: {\n top?: IndentValue;\n bottom?: IndentValue;\n };\n qa?: string;\n}\n\nexport interface LoadableProps {\n source: string;\n /**\n * @deprecated Will be moved to params\n */\n serviceId?: number;\n params?: Record<string, string | number | boolean | object>;\n}\n\nexport interface LoadableChildren {\n loadable?: LoadableProps;\n}\n\nexport enum SliderBreakpointNames {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n Xl = 'xl',\n}\n\nexport enum SliderType {\n MediaCard = 'media-card',\n HeaderCard = 'header-card',\n FullscreenCard = 'fullscreen-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderOldProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface SliderProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderOldProps, 'title' | 'description'> {\n items: HeaderBlockProps[];\n}\n\ninterface HeaderBackgroundProps {\n /** @deprecated replaced by Media Props image */\n url?: string;\n /** @deprecated replaced by Media Props image */\n disableCompress?: boolean;\n}\n\nexport interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {\n fullWidth?: boolean;\n fullWidthMedia?: boolean;\n}\n\nexport type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;\n\nexport interface HeaderBlockVideoIframe {\n src: string;\n autoplay?: boolean;\n previewImg?: string;\n height?: number;\n}\n\nexport interface HeaderBlockProps {\n title: string;\n overtitle?: string | JSX.Element;\n description?: string;\n additionalInfo?: string;\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];\n width?: HeaderWidth;\n /** @deprecated imageSize now depends on width */\n imageSize?: HeaderImageSize;\n /**\n * @deprecated used only on the main page\n * TODO: delete after the possibility to remove padding-bottom in the block\n */\n offset?: HeaderOffset;\n image?: ThemedImage;\n video?: ThemedMediaVideoProps;\n videoIframe?: HeaderBlockVideoIframe;\n mediaView?: MediaView;\n centered?: boolean;\n background?: ThemedHeaderBlockBackground;\n theme?: 'light' | 'dark';\n verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';\n breadcrumbs?: HeaderBreadCrumbsProps;\n status?: JSX.Element;\n renderTitle?: (title: string) => React.ReactNode;\n}\n\nexport interface ExtendedFeaturesItem\n extends Omit<\n ContentBlockProps,\n 'theme' | 'centered' | 'colSizes' | 'size' | 'title' | 'labels'\n > {\n title: string;\n label?: string;\n icon?: ThemedImage;\n /** @deprecated **/\n link?: LinkProps;\n}\n\nexport interface ExtendedFeaturesProps extends Animatable {\n items: ExtendedFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n colSizes?: GridColumnSizesType;\n}\n\nexport interface PromoFeaturesItem {\n title: string;\n text: string;\n theme?: 'accent' | 'accent-light' | 'primary';\n media?: ThemeSupporting<MediaProps>;\n}\n\nexport interface PromoFeaturesProps extends Animatable {\n items: PromoFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n theme?: 'grey' | 'default';\n}\n\nexport interface QuestionItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'labels'> {\n items: QuestionItem[];\n}\n\nexport interface QuestionBlockItemProps extends QuestionItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface FoldableListItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface FoldableListProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'labels'> {\n items: FoldableListItem[];\n}\n\nexport interface FoldableListBlockItemProps extends FoldableListItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface BannerBlockProps extends BannerCardProps, Animatable {}\n\nexport interface CompaniesBlockProps extends Animatable {\n title: string;\n description?: string;\n images: ThemeSupporting<ImageDeviceProps>;\n}\n\nexport interface MediaBaseBlockProps extends Animatable, MediaContentProps {\n direction?: MediaDirection;\n mobileDirection?: MediaDirection;\n largeMedia?: boolean;\n mediaOnly?: boolean;\n mediaOnlyColSizes?: GridColumnSizesType;\n}\n\nexport interface MediaContentProps\n extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'theme' | 'centered' | 'labels'> {\n description?: string;\n /** @deprecated Use array of buttons from ContentBlockProps instead**/\n button?: ButtonProps;\n}\n\nexport interface MediaBlockProps extends MediaBaseBlockProps, WithBorder {\n media: ThemeSupporting<MediaProps>;\n}\n\nexport interface MapBlockProps extends MediaBaseBlockProps, WithBorder {\n map: Omit<MapProps, 'forceAspectRatio' | 'areaMargin' | 'copyrightPosition'>;\n}\n\nexport interface InfoBlockProps {\n theme?: TextTheme;\n backgroundColor?: ThemeSupporting<string>;\n /** @deprecated **/\n title?: string;\n /** @deprecated **/\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme'>[];\n /** @deprecated **/\n sectionsTitle?: string;\n /** @deprecated **/\n links?: Pick<LinkProps, 'text' | 'url'>[];\n leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size' | 'labels'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size' | 'labels'>;\n}\n\nexport interface TableProps {\n content: string[][];\n legend?: string[];\n hideLegend?: boolean;\n justify?: Justify[];\n marker?: LegendTableMarkerType;\n /**\n * Only as accessible name, not displayed explicitly\n */\n caption?: string;\n}\n\nexport interface TableBlockProps {\n title: string;\n table: TableProps;\n}\n\nexport interface TabsBlockItem\n extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme' | 'labels'>,\n WithBorder {\n tabName: string;\n /**\n * @deprecated Use array links from ContentBlockProps instead\n */\n link?: LinkProps;\n image?: ThemedImage;\n caption?: string;\n media?: ThemedMediaProps;\n}\n\nexport interface TabsBlockProps extends Animatable {\n title?: TitleItemProps | string;\n description?: string;\n tabsColSizes?: GridColumnSizesType;\n centered?: boolean;\n direction?: MediaDirection;\n items: TabsBlockItem[];\n contentSize?: ContentSize;\n}\n\nexport interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n titleClassName?: string;\n centered?: boolean;\n description?: string;\n colSizes?: GridColumnSizesType;\n background?: ThemeSupporting<\n BackgroundImageProps & {\n border?: CardBorder;\n }\n >;\n}\n\nexport type FilterTag = {\n id: string;\n label: string;\n};\n\nexport type FilterItem = {\n tags: string[];\n card: SubBlockModels;\n};\n\nexport interface FilterBlockProps extends Animatable {\n tags: FilterTag[];\n items: FilterItem[];\n title?: TitleItemProps | string;\n description?: string;\n tagButtonSize?: ButtonSize;\n allTag?: boolean | string;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n}\n\nexport interface IconsBlockItemProps extends AnalyticsEventsBase {\n url: string;\n text: string;\n src: ThemeSupporting<string>;\n}\n\nexport interface IconsBlockProps {\n title?: string;\n description?: string;\n size?: 's' | 'm' | 'l';\n items: IconsBlockItemProps[];\n colSizes?: GridColumnSizesType;\n}\n\ninterface ContentLayoutBlockParams {\n size?: ContentSize;\n background?: ThemeSupporting<BackgroundImageProps>;\n centered?: boolean;\n theme?: ContentTheme;\n textWidth?: ContentTextSize;\n}\n\nexport interface ContentLayoutBlockProps extends ContentLayoutBlockParams {\n textContent: Omit<ContentBlockProps, 'labels'>;\n fileContent?: FileLinkProps[];\n}\n\nexport type SVGIcon = (props: React.SVGProps<SVGSVGElement>) => React.ReactNode;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nexport interface ContentListProps {\n list: ContentItemProps[];\n size: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentLabelProps {\n text: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nexport interface ContentLabelsProps {\n labels: ContentLabelProps[];\n size?: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentBlockProps {\n title?: TitleItemBaseProps | string;\n titleId?: string;\n text?: string;\n textId?: string;\n additionalInfo?: string;\n links?: LinkProps[];\n buttons?: ButtonProps[];\n size?: ContentSize;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n theme?: ContentTheme;\n list?: ContentItemProps[];\n labels?: ContentLabelProps[];\n controlPosition?: 'default' | 'bottom';\n}\n\nexport enum PCShareSocialNetwork {\n Vk = 'vk',\n Telegram = 'telegram',\n Twitter = 'twitter',\n Facebook = 'facebook',\n LinkedIn = 'linkedin',\n}\n\nexport interface ShareBlockProps {\n items: PCShareSocialNetwork[];\n title?: string;\n}\n\nexport enum FormBlockDataTypes {\n YANDEX = 'yandex',\n HUBSPOT = 'hubspot',\n}\n\nexport enum FormBlockDirection {\n FormContent = 'form-content',\n ContentForm = 'content-form',\n Center = 'center',\n}\n\nexport interface FormBlockYandexData {\n yandex: ThemeSupporting<YandexFormProps>;\n}\n\nexport interface FormBlockHubspotData {\n hubspot: ThemeSupporting<HubspotFormProps>;\n}\n\nexport type FormBlockData = FormBlockYandexData | FormBlockHubspotData;\n\nexport interface FormBlockBackgroundProps extends Omit<BackgroundImageProps, 'style'> {\n style?: DeviceSupporting<React.CSSProperties>;\n}\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<FormBlockBackgroundProps>;\n customFormNode?: React.ReactNode;\n}\n\n//block models\nexport type HeaderBlockModel = {\n type: BlockType.HeaderBlock;\n} & HeaderBlockProps;\n\nexport type SliderOldBlockModel = {\n type: BlockType.SliderOldBlock;\n} & SliderOldProps;\n\nexport type ExtendedFeaturesBlockModel = {\n type: BlockType.ExtendedFeaturesBlock;\n} & ExtendedFeaturesProps;\n\nexport type PromoFeaturesBlockModel = {\n type: BlockType.PromoFeaturesBlock;\n} & PromoFeaturesProps;\n\nexport type QuestionsBlockModel = {\n type: BlockType.QuestionsBlock;\n} & QuestionsProps;\n\nexport type FoldableListBlockModel = {\n type: BlockType.FoldableListBlock;\n} & FoldableListProps;\n\nexport type BannerBlockModel = {\n type: BlockType.BannerBlock;\n} & BannerBlockProps;\n\nexport type CompaniesBlockModel = {\n type: BlockType.CompaniesBlock;\n} & CompaniesBlockProps;\n\nexport type MediaBlockModel = {\n type: BlockType.MediaBlock;\n} & MediaBlockProps;\n\nexport type MapBlockModel = {\n type: BlockType.MapBlock;\n} & MapBlockProps;\n\nexport type InfoBlockModel = {\n type: BlockType.InfoBlock;\n} & InfoBlockProps;\n\nexport type TableBlockModel = {\n type: BlockType.TableBlock;\n} & TableBlockProps;\n\nexport type TabsBlockModel = {\n type: BlockType.TabsBlock;\n} & TabsBlockProps;\n\nexport type CardLayoutBlockModel = {\n type: BlockType.CardLayoutBlock;\n} & CardLayoutBlockProps;\n\nexport type FilterBlockModel = {\n type: BlockType.FilterBlock;\n} & FilterBlockProps;\n\nexport type IconsBlockModel = {\n type: BlockType.IconsBlock;\n} & IconsBlockProps;\n\nexport type HeaderSliderBlockModel = {\n type: BlockType.HeaderSliderBlock;\n} & HeaderSliderBlockProps;\n\nexport type ContentLayoutBlockModel = {\n type: BlockType.ContentLayoutBlock;\n} & ContentLayoutBlockProps;\n\nexport type ShareBLockModel = {\n type: BlockType.ShareBlock;\n} & ShareBlockProps;\n\nexport type FormBlockModel = {\n type: BlockType.FormBlock;\n} & FormBlockProps;\n\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\ntype BlockModels =\n | SliderOldBlockModel\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | FoldableListBlockModel\n | BannerBlockModel\n | CompaniesBlockModel\n | MediaBlockModel\n | MapBlockModel\n | InfoBlockModel\n | TableBlockModel\n | TabsBlockModel\n | HeaderBlockModel\n | IconsBlockModel\n | HeaderSliderBlockModel\n | CardLayoutBlockModel\n | ContentLayoutBlockModel\n | ShareBLockModel\n | FilterBlockModel\n | FormBlockModel;\n\nexport type Block = BlockModels & BlockBaseProps;\n"]}
|
|
1
|
+
{"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":"AA6CA,MAAM,CAAN,IAAY,SAuBX;AAvBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,kBAAkB;IAClB,gDAAmC,CAAA;IACnC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,uCAA0B,CAAA;IAC1B,kDAAqC,CAAA;IACrC,wDAA2C,CAAA;IAC3C,uCAA0B,CAAA;IAC1B,mCAAsB,CAAA;IACtB,yCAA4B,CAAA;IAC5B,qCAAwB,CAAA;AAC5B,CAAC,EAvBW,SAAS,KAAT,SAAS,QAuBpB;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAgCrF,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;AACb,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;AAED,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,sCAAwB,CAAA;IACxB,wCAA0B,CAAA;IAC1B,gDAAkC,CAAA;AACtC,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AA4VD,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,iCAAS,CAAA;IACT,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B;AAOD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {GridColumnSize, GridColumnSizesType, IndentValue} from '../../grid/types';\nimport {ThemeSupporting} from '../../utils';\nimport {DeviceSupporting} from '../../utils/breakpoint';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {\n AnchorProps,\n Animatable,\n BackgroundImageProps,\n ButtonProps,\n CardBorder,\n ContentSize,\n ContentTextSize,\n ContentTheme,\n FileLinkProps,\n GravityIconProps,\n HeaderBreadCrumbsProps,\n HeaderImageSize,\n HeaderOffset,\n HeaderWidth,\n ImageDeviceProps,\n ImageProps,\n Justify,\n LegendTableMarkerType,\n LinkProps,\n MapProps,\n MediaDirection,\n MediaProps,\n MediaView,\n TextSize,\n TextTheme,\n ThemedImage,\n ThemedMediaProps,\n ThemedMediaVideoProps,\n TitleItemBaseProps,\n TitleItemProps,\n WithBorder,\n YandexFormProps,\n} from './common';\nimport {BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels} from './sub-blocks';\n\nexport enum BlockType {\n PromoFeaturesBlock = 'promo-features-block',\n ExtendedFeaturesBlock = 'extended-features-block',\n /** @deprecated */\n SliderOldBlock = 'slider-old-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n FoldableListBlock = 'foldable-list-block',\n BannerBlock = 'banner-block',\n CompaniesBlock = 'companies-block',\n MediaBlock = 'media-block',\n InfoBlock = 'info-block',\n TableBlock = 'table-block',\n TabsBlock = 'tabs-block',\n HeaderSliderBlock = 'header-slider-block',\n HeaderBlock = 'header-block',\n IconsBlock = 'icons-block',\n CardLayoutBlock = 'card-layout-block',\n ContentLayoutBlock = 'content-layout-block',\n ShareBlock = 'share-block',\n MapBlock = 'map-block',\n FilterBlock = 'filter-block',\n FormBlock = 'form-block',\n}\n\nexport const BlockTypes = Object.values(BlockType);\nexport const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];\n\nexport interface Childable {\n children?: SubBlock[];\n}\n\n//block props\nexport interface BlockBaseProps {\n anchor?: AnchorProps;\n visible?: GridColumnSize;\n /** @deprecated */\n resetPaddings?: boolean;\n indent?: {\n top?: IndentValue;\n bottom?: IndentValue;\n };\n qa?: string;\n}\n\nexport interface LoadableProps {\n source: string;\n /**\n * @deprecated Will be moved to params\n */\n serviceId?: number;\n params?: Record<string, string | number | boolean | object>;\n}\n\nexport interface LoadableChildren {\n loadable?: LoadableProps;\n}\n\nexport enum SliderBreakpointNames {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n Xl = 'xl',\n}\n\nexport enum SliderType {\n MediaCard = 'media-card',\n HeaderCard = 'header-card',\n FullscreenCard = 'fullscreen-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderOldProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface SliderProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderOldProps, 'title' | 'description'> {\n items: HeaderBlockProps[];\n}\n\ninterface HeaderBackgroundProps {\n /** @deprecated replaced by Media Props image */\n url?: string;\n /** @deprecated replaced by Media Props image */\n disableCompress?: boolean;\n}\n\nexport interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {\n fullWidth?: boolean;\n fullWidthMedia?: boolean;\n}\n\nexport type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;\n\nexport interface HeaderBlockVideoIframe {\n src: string;\n autoplay?: boolean;\n previewImg?: string;\n height?: number;\n}\n\nexport interface HeaderBlockProps {\n title: string;\n overtitle?: string | JSX.Element;\n description?: string;\n additionalInfo?: string;\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];\n width?: HeaderWidth;\n /** @deprecated imageSize now depends on width */\n imageSize?: HeaderImageSize;\n /**\n * @deprecated used only on the main page\n * TODO: delete after the possibility to remove padding-bottom in the block\n */\n offset?: HeaderOffset;\n image?: ThemedImage;\n video?: ThemedMediaVideoProps;\n videoIframe?: HeaderBlockVideoIframe;\n mediaView?: MediaView;\n centered?: boolean;\n background?: ThemedHeaderBlockBackground;\n theme?: 'light' | 'dark';\n verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';\n breadcrumbs?: HeaderBreadCrumbsProps;\n status?: JSX.Element;\n renderTitle?: (title: string) => React.ReactNode;\n}\n\nexport interface ExtendedFeaturesItem\n extends Omit<\n ContentBlockProps,\n 'theme' | 'centered' | 'colSizes' | 'size' | 'title' | 'labels'\n > {\n title: string;\n label?: string;\n icon?: ThemedImage;\n /** @deprecated **/\n link?: LinkProps;\n}\n\nexport interface ExtendedFeaturesProps extends Animatable {\n items: ExtendedFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n colSizes?: GridColumnSizesType;\n}\n\nexport interface PromoFeaturesItem {\n title: string;\n text: string;\n theme?: 'accent' | 'accent-light' | 'primary';\n media?: ThemeSupporting<MediaProps>;\n}\n\nexport interface PromoFeaturesProps extends Animatable {\n items: PromoFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n theme?: 'grey' | 'default';\n}\n\nexport interface QuestionItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n onClick?: (index: number, newOpenState: boolean) => void;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'labels'> {\n items: QuestionItem[];\n}\n\nexport interface QuestionBlockItemProps extends QuestionItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface FoldableListItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface FoldableListProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'labels'> {\n items: FoldableListItem[];\n}\n\nexport interface FoldableListBlockItemProps extends FoldableListItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface BannerBlockProps extends BannerCardProps, Animatable {}\n\nexport interface CompaniesBlockProps extends Animatable {\n title: string;\n description?: string;\n images: ThemeSupporting<ImageDeviceProps>;\n}\n\nexport interface MediaBaseBlockProps extends Animatable, MediaContentProps {\n direction?: MediaDirection;\n mobileDirection?: MediaDirection;\n largeMedia?: boolean;\n mediaOnly?: boolean;\n mediaOnlyColSizes?: GridColumnSizesType;\n}\n\nexport interface MediaContentProps\n extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'theme' | 'centered' | 'labels'> {\n description?: string;\n /** @deprecated Use array of buttons from ContentBlockProps instead**/\n button?: ButtonProps;\n}\n\nexport interface MediaBlockProps extends MediaBaseBlockProps, WithBorder {\n media: ThemeSupporting<MediaProps>;\n}\n\nexport interface MapBlockProps extends MediaBaseBlockProps, WithBorder {\n map: Omit<MapProps, 'forceAspectRatio' | 'areaMargin' | 'copyrightPosition'>;\n}\n\nexport interface InfoBlockProps {\n theme?: TextTheme;\n backgroundColor?: ThemeSupporting<string>;\n /** @deprecated **/\n title?: string;\n /** @deprecated **/\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme'>[];\n /** @deprecated **/\n sectionsTitle?: string;\n /** @deprecated **/\n links?: Pick<LinkProps, 'text' | 'url'>[];\n leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size' | 'labels'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size' | 'labels'>;\n}\n\nexport interface TableProps {\n content: string[][];\n legend?: string[];\n hideLegend?: boolean;\n justify?: Justify[];\n marker?: LegendTableMarkerType;\n /**\n * Only as accessible name, not displayed explicitly\n */\n caption?: string;\n}\n\nexport interface TableBlockProps {\n title: string;\n table: TableProps;\n}\n\nexport interface TabsBlockItem\n extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme' | 'labels'>,\n WithBorder {\n tabName: string;\n /**\n * @deprecated Use array links from ContentBlockProps instead\n */\n link?: LinkProps;\n image?: ThemedImage;\n caption?: string;\n media?: ThemedMediaProps;\n}\n\nexport interface TabsBlockProps extends Animatable {\n title?: TitleItemProps | string;\n description?: string;\n tabsColSizes?: GridColumnSizesType;\n centered?: boolean;\n direction?: MediaDirection;\n items: TabsBlockItem[];\n contentSize?: ContentSize;\n}\n\nexport interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n titleClassName?: string;\n centered?: boolean;\n description?: string;\n colSizes?: GridColumnSizesType;\n background?: ThemeSupporting<\n BackgroundImageProps & {\n border?: CardBorder;\n }\n >;\n}\n\nexport type FilterTag = {\n id: string;\n label: string;\n};\n\nexport type FilterItem = {\n tags: string[];\n card: SubBlockModels;\n};\n\nexport interface FilterBlockProps extends Animatable {\n tags: FilterTag[];\n items: FilterItem[];\n title?: TitleItemProps | string;\n description?: string;\n tagButtonSize?: ButtonSize;\n allTag?: boolean | string;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n}\n\nexport interface IconsBlockItemProps extends AnalyticsEventsBase {\n url: string;\n text: string;\n src: ThemeSupporting<string>;\n}\n\nexport interface IconsBlockProps {\n title?: string;\n description?: string;\n size?: 's' | 'm' | 'l';\n items: IconsBlockItemProps[];\n colSizes?: GridColumnSizesType;\n}\n\ninterface ContentLayoutBlockParams {\n size?: ContentSize;\n background?: ThemeSupporting<BackgroundImageProps>;\n centered?: boolean;\n theme?: ContentTheme;\n textWidth?: ContentTextSize;\n}\n\nexport interface ContentLayoutBlockProps extends ContentLayoutBlockParams {\n textContent: Omit<ContentBlockProps, 'labels'>;\n fileContent?: FileLinkProps[];\n}\n\nexport type SVGIcon = (props: React.SVGProps<SVGSVGElement>) => React.ReactNode;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nexport interface ContentListProps {\n list: ContentItemProps[];\n size: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentLabelProps {\n text: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nexport interface ContentLabelsProps {\n labels: ContentLabelProps[];\n size?: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentBlockProps {\n title?: TitleItemBaseProps | string;\n titleId?: string;\n text?: string;\n textId?: string;\n additionalInfo?: string;\n links?: LinkProps[];\n buttons?: ButtonProps[];\n size?: ContentSize;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n theme?: ContentTheme;\n list?: ContentItemProps[];\n labels?: ContentLabelProps[];\n controlPosition?: 'default' | 'bottom';\n}\n\nexport enum PCShareSocialNetwork {\n Vk = 'vk',\n Telegram = 'telegram',\n Twitter = 'twitter',\n Facebook = 'facebook',\n LinkedIn = 'linkedin',\n}\n\nexport interface ShareBlockProps {\n items: PCShareSocialNetwork[];\n title?: string;\n}\n\nexport enum FormBlockDataTypes {\n YANDEX = 'yandex',\n HUBSPOT = 'hubspot',\n}\n\nexport enum FormBlockDirection {\n FormContent = 'form-content',\n ContentForm = 'content-form',\n Center = 'center',\n}\n\nexport interface FormBlockYandexData {\n yandex: ThemeSupporting<YandexFormProps>;\n}\n\nexport interface FormBlockHubspotData {\n hubspot: ThemeSupporting<HubspotFormProps>;\n}\n\nexport type FormBlockData = FormBlockYandexData | FormBlockHubspotData;\n\nexport interface FormBlockBackgroundProps extends Omit<BackgroundImageProps, 'style'> {\n style?: DeviceSupporting<React.CSSProperties>;\n}\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<FormBlockBackgroundProps>;\n customFormNode?: React.ReactNode;\n}\n\n//block models\nexport type HeaderBlockModel = {\n type: BlockType.HeaderBlock;\n} & HeaderBlockProps;\n\nexport type SliderOldBlockModel = {\n type: BlockType.SliderOldBlock;\n} & SliderOldProps;\n\nexport type ExtendedFeaturesBlockModel = {\n type: BlockType.ExtendedFeaturesBlock;\n} & ExtendedFeaturesProps;\n\nexport type PromoFeaturesBlockModel = {\n type: BlockType.PromoFeaturesBlock;\n} & PromoFeaturesProps;\n\nexport type QuestionsBlockModel = {\n type: BlockType.QuestionsBlock;\n} & QuestionsProps;\n\nexport type FoldableListBlockModel = {\n type: BlockType.FoldableListBlock;\n} & FoldableListProps;\n\nexport type BannerBlockModel = {\n type: BlockType.BannerBlock;\n} & BannerBlockProps;\n\nexport type CompaniesBlockModel = {\n type: BlockType.CompaniesBlock;\n} & CompaniesBlockProps;\n\nexport type MediaBlockModel = {\n type: BlockType.MediaBlock;\n} & MediaBlockProps;\n\nexport type MapBlockModel = {\n type: BlockType.MapBlock;\n} & MapBlockProps;\n\nexport type InfoBlockModel = {\n type: BlockType.InfoBlock;\n} & InfoBlockProps;\n\nexport type TableBlockModel = {\n type: BlockType.TableBlock;\n} & TableBlockProps;\n\nexport type TabsBlockModel = {\n type: BlockType.TabsBlock;\n} & TabsBlockProps;\n\nexport type CardLayoutBlockModel = {\n type: BlockType.CardLayoutBlock;\n} & CardLayoutBlockProps;\n\nexport type FilterBlockModel = {\n type: BlockType.FilterBlock;\n} & FilterBlockProps;\n\nexport type IconsBlockModel = {\n type: BlockType.IconsBlock;\n} & IconsBlockProps;\n\nexport type HeaderSliderBlockModel = {\n type: BlockType.HeaderSliderBlock;\n} & HeaderSliderBlockProps;\n\nexport type ContentLayoutBlockModel = {\n type: BlockType.ContentLayoutBlock;\n} & ContentLayoutBlockProps;\n\nexport type ShareBLockModel = {\n type: BlockType.ShareBlock;\n} & ShareBlockProps;\n\nexport type FormBlockModel = {\n type: BlockType.FormBlock;\n} & FormBlockProps;\n\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\ntype BlockModels =\n | SliderOldBlockModel\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | FoldableListBlockModel\n | BannerBlockModel\n | CompaniesBlockModel\n | MediaBlockModel\n | MapBlockModel\n | InfoBlockModel\n | TableBlockModel\n | TabsBlockModel\n | HeaderBlockModel\n | IconsBlockModel\n | HeaderSliderBlockModel\n | CardLayoutBlockModel\n | ContentLayoutBlockModel\n | ShareBLockModel\n | FilterBlockModel\n | FormBlockModel;\n\nexport type Block = BlockModels & BlockBaseProps;\n"]}
|
package/package.json
CHANGED
|
@@ -174,6 +174,7 @@ export interface QuestionItem {
|
|
|
174
174
|
text: string;
|
|
175
175
|
listStyle?: 'dash' | 'disk';
|
|
176
176
|
link?: LinkProps;
|
|
177
|
+
onClick?: (index: number, newOpenState: boolean) => void;
|
|
177
178
|
}
|
|
178
179
|
export interface QuestionsProps extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'labels'> {
|
|
179
180
|
items: QuestionItem[];
|
package/widget/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default "(self.webpackChunk_gravity_ui_page_constructor=self.webpackChunk_gravity_ui_page_constructor||[]).push([[
|
|
1
|
+
export default "(self.webpackChunk_gravity_ui_page_constructor=self.webpackChunk_gravity_ui_page_constructor||[]).push([[1349],{31349:function(_,t,Y){_.exports=function(_){\"use strict\";function t(_){return _&&\"object\"==typeof _&&\"default\"in _?_:{default:_}}var Y=t(_),e={name:\"zh-tw\",weekdays:\"星期日_星期一_星期二_星期三_星期四_星期五_星期六\".split(\"_\"),weekdaysShort:\"週日_週一_週二_週三_週四_週五_週六\".split(\"_\"),weekdaysMin:\"日_一_二_三_四_五_六\".split(\"_\"),months:\"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月\".split(\"_\"),monthsShort:\"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月\".split(\"_\"),ordinal:function(_,t){return\"W\"===t?_+\"週\":_+\"日\"},formats:{LT:\"HH:mm\",LTS:\"HH:mm:ss\",L:\"YYYY/MM/DD\",LL:\"YYYY年M月D日\",LLL:\"YYYY年M月D日 HH:mm\",LLLL:\"YYYY年M月D日dddd HH:mm\",l:\"YYYY/M/D\",ll:\"YYYY年M月D日\",lll:\"YYYY年M月D日 HH:mm\",llll:\"YYYY年M月D日dddd HH:mm\"},relativeTime:{future:\"%s內\",past:\"%s前\",s:\"幾秒\",m:\"1 分鐘\",mm:\"%d 分鐘\",h:\"1 小時\",hh:\"%d 小時\",d:\"1 天\",dd:\"%d 天\",M:\"1 個月\",MM:\"%d 個月\",y:\"1 年\",yy:\"%d 年\"},meridiem:function(_,t){var Y=100*_+t;return Y<600?\"凌晨\":Y<900?\"早上\":Y<1100?\"上午\":Y<1300?\"中午\":Y<1800?\"下午\":\"晚上\"}};return Y.default.locale(e,null,!0),e}(Y(74353))}}]);";
|