@redneckz/wildless-cms-uni-blocks 0.5.13 → 0.5.14
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/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +14 -18
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Blocks.d.ts +2 -1
- package/bundle/components/OtherProducts/OtherProducts.d.ts +2 -1
- package/bundle/components/OtherProducts/OtherProductsContent.d.ts +1 -21
- package/bundle/components/OtherProductsItem/OtherProductsItem.d.ts +6 -0
- package/bundle/components/OtherProductsItem/OtherProductsItemContent.d.ts +14 -0
- package/dist/components/Blocks.d.ts +2 -1
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/ContentPage/renderBlock.js +7 -6
- package/dist/components/ContentPage/renderBlock.js.map +1 -1
- package/dist/components/OtherProducts/OtherProducts.d.ts +2 -1
- package/dist/components/OtherProducts/OtherProducts.js +2 -4
- package/dist/components/OtherProducts/OtherProducts.js.map +1 -1
- package/dist/components/OtherProducts/OtherProductsContent.d.ts +1 -21
- package/dist/components/OtherProductsItem/OtherProductsItem.d.ts +6 -0
- package/dist/components/OtherProductsItem/OtherProductsItem.js +11 -0
- package/dist/components/OtherProductsItem/OtherProductsItem.js.map +1 -0
- package/dist/components/OtherProductsItem/OtherProductsItemContent.d.ts +14 -0
- package/dist/components/OtherProductsItem/OtherProductsItemContent.js +2 -0
- package/dist/components/OtherProductsItem/OtherProductsItemContent.js.map +1 -0
- package/dist/ui-kit/Foldable/FoldableSection.js +1 -1
- package/dist/ui-kit/Foldable/FoldableSection.js.map +1 -1
- package/lib/components/Blocks.d.ts +2 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/ContentPage/renderBlock.js +7 -6
- package/lib/components/ContentPage/renderBlock.js.map +1 -1
- package/lib/components/OtherProducts/OtherProducts.d.ts +2 -1
- package/lib/components/OtherProducts/OtherProducts.fixture.d.ts +1 -0
- package/lib/components/OtherProducts/OtherProducts.js +2 -4
- package/lib/components/OtherProducts/OtherProducts.js.map +1 -1
- package/lib/components/OtherProducts/OtherProductsContent.d.ts +1 -21
- package/lib/components/OtherProductsItem/OtherProductsItem.d.ts +6 -0
- package/lib/components/OtherProductsItem/OtherProductsItem.fixture.d.ts +5 -0
- package/lib/components/OtherProductsItem/OtherProductsItem.js +9 -0
- package/lib/components/OtherProductsItem/OtherProductsItem.js.map +1 -0
- package/lib/components/OtherProductsItem/OtherProductsItemContent.d.ts +14 -0
- package/lib/components/OtherProductsItem/OtherProductsItemContent.js +2 -0
- package/lib/components/OtherProductsItem/OtherProductsItemContent.js.map +1 -0
- package/lib/ui-kit/Foldable/FoldableSection.js +1 -1
- package/lib/ui-kit/Foldable/FoldableSection.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +8 -7
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/OtherProducts/OtherProducts.d.ts +2 -1
- package/mobile/bundle/components/OtherProducts/OtherProductsContent.d.ts +1 -21
- package/mobile/bundle/components/OtherProductsItem/OtherProductsItem.d.ts +6 -0
- package/mobile/bundle/components/OtherProductsItem/OtherProductsItemContent.d.ts +14 -0
- package/mobile/dist/components/ContentPage/renderBlock.js +7 -6
- package/mobile/dist/components/ContentPage/renderBlock.js.map +1 -1
- package/mobile/dist/components/OtherProducts/OtherProducts.d.ts +2 -1
- package/mobile/dist/components/OtherProducts/OtherProducts.js +2 -4
- package/mobile/dist/components/OtherProducts/OtherProducts.js.map +1 -1
- package/mobile/dist/components/OtherProducts/OtherProductsContent.d.ts +1 -21
- package/mobile/dist/components/OtherProductsItem/OtherProductsItem.d.ts +6 -0
- package/mobile/dist/components/OtherProductsItem/OtherProductsItem.js +11 -0
- package/mobile/dist/components/OtherProductsItem/OtherProductsItem.js.map +1 -0
- package/mobile/dist/components/OtherProductsItem/OtherProductsItemContent.d.ts +14 -0
- package/mobile/dist/components/OtherProductsItem/OtherProductsItemContent.js +2 -0
- package/mobile/dist/components/OtherProductsItem/OtherProductsItemContent.js.map +1 -0
- package/mobile/dist/ui-kit/Foldable/FoldableSection.js +1 -1
- package/mobile/dist/ui-kit/Foldable/FoldableSection.js.map +1 -1
- package/mobile/lib/components/ContentPage/renderBlock.js +7 -6
- package/mobile/lib/components/ContentPage/renderBlock.js.map +1 -1
- package/mobile/lib/components/OtherProducts/OtherProducts.d.ts +2 -1
- package/mobile/lib/components/OtherProducts/OtherProducts.js +2 -4
- package/mobile/lib/components/OtherProducts/OtherProducts.js.map +1 -1
- package/mobile/lib/components/OtherProducts/OtherProductsContent.d.ts +1 -21
- package/mobile/lib/components/OtherProductsItem/OtherProductsItem.d.ts +6 -0
- package/mobile/lib/components/OtherProductsItem/OtherProductsItem.js +9 -0
- package/mobile/lib/components/OtherProductsItem/OtherProductsItem.js.map +1 -0
- package/mobile/lib/components/OtherProductsItem/OtherProductsItemContent.d.ts +14 -0
- package/mobile/lib/components/OtherProductsItem/OtherProductsItemContent.js +2 -0
- package/mobile/lib/components/OtherProductsItem/OtherProductsItemContent.js.map +1 -0
- package/mobile/lib/ui-kit/Foldable/FoldableSection.js +1 -1
- package/mobile/lib/ui-kit/Foldable/FoldableSection.js.map +1 -1
- package/mobile/src/components/ContentPage/renderBlock.tsx +14 -9
- package/mobile/src/components/OtherProducts/OtherProducts.example.json +1 -54
- package/mobile/src/components/OtherProducts/OtherProducts.tsx +13 -24
- package/mobile/src/components/OtherProducts/OtherProducts.ui.json +1 -76
- package/mobile/src/components/OtherProducts/OtherProductsContent.ts +1 -22
- package/mobile/src/components/OtherProductsItem/OtherProductsItem.example.json +3 -0
- package/mobile/src/components/OtherProductsItem/OtherProductsItem.tsx +39 -0
- package/mobile/src/components/OtherProductsItem/OtherProductsItem.ui.json +1 -0
- package/mobile/src/components/OtherProductsItem/OtherProductsItemContent.ts +17 -0
- package/mobile/src/ui-kit/Foldable/FoldableSection.tsx +1 -1
- package/package.json +1 -1
- package/src/components/Blocks.ts +2 -0
- package/src/components/ContentPage/renderBlock.tsx +14 -9
- package/src/components/OtherProducts/OtherProducts.example.json +1 -54
- package/src/components/OtherProducts/OtherProducts.fixture.tsx +77 -126
- package/src/components/OtherProducts/OtherProducts.tsx +13 -24
- package/src/components/OtherProducts/OtherProducts.ui.json +1 -76
- package/src/components/OtherProducts/OtherProductsContent.ts +1 -22
- package/src/components/OtherProductsItem/OtherProductsItem.example.json +3 -0
- package/src/components/OtherProductsItem/OtherProductsItem.fixture.tsx +5 -0
- package/src/components/OtherProductsItem/OtherProductsItem.tsx +39 -0
- package/src/components/OtherProductsItem/OtherProductsItem.ui.json +1 -0
- package/src/components/OtherProductsItem/OtherProductsItemContent.ts +17 -0
- package/src/ui-kit/Foldable/FoldableSection.tsx +1 -1
- package/bundle/components/OtherProducts/OtherProductsItem.d.ts +0 -6
- package/dist/components/OtherProducts/OtherProductsItem.d.ts +0 -6
- package/dist/components/OtherProducts/OtherProductsItem.js +0 -17
- package/dist/components/OtherProducts/OtherProductsItem.js.map +0 -1
- package/lib/components/OtherProducts/OtherProductsItem.d.ts +0 -6
- package/lib/components/OtherProducts/OtherProductsItem.js +0 -15
- package/lib/components/OtherProducts/OtherProductsItem.js.map +0 -1
- package/mobile/bundle/components/OtherProducts/OtherProductsItem.d.ts +0 -6
- package/mobile/dist/components/OtherProducts/OtherProductsItem.d.ts +0 -6
- package/mobile/dist/components/OtherProducts/OtherProductsItem.js +0 -17
- package/mobile/dist/components/OtherProducts/OtherProductsItem.js.map +0 -1
- package/mobile/lib/components/OtherProducts/OtherProductsItem.d.ts +0 -6
- package/mobile/lib/components/OtherProducts/OtherProductsItem.js +0 -15
- package/mobile/lib/components/OtherProducts/OtherProductsItem.js.map +0 -1
- package/mobile/src/components/OtherProducts/OtherProductsItem.tsx +0 -52
- package/src/components/OtherProducts/OtherProductsItem.tsx +0 -52
|
@@ -22,7 +22,8 @@ export declare const Blocks: {
|
|
|
22
22
|
ProductGallery: import("@redneckz/uni-jsx").UNIComponent<import("./ProductGallery/ProductGallery").ProductGalleryProps, any, any>;
|
|
23
23
|
ProductTile: import("@redneckz/uni-jsx").UNIComponent<import("./ProductTile/ProductTile").ProductTileProps, any, any>;
|
|
24
24
|
PromoTile: import("@redneckz/uni-jsx").UNIComponent<import("./PromoTile/PromoTile").PromoTileProps, any, any>;
|
|
25
|
-
OtherProducts: import("
|
|
25
|
+
OtherProducts: import("../model/BlocksRegistry").JSXBlock<import("./OtherProducts/OtherProducts").OtherProductsProps>;
|
|
26
|
+
OtherProductsItem: import("../model/BlocksRegistry").JSXBlock<import("./OtherProductsItem/OtherProductsItem").OtherProductsItemProps>;
|
|
26
27
|
Recommendation: import("@redneckz/uni-jsx").UNIComponent<import("./Recommendation/Recommendation").RecommendationProps, any, any>;
|
|
27
28
|
StepsBlock: import("@redneckz/uni-jsx").UNIComponent<import("./StepsBlock/StepsBlock").StepsBlockProps, any, any>;
|
|
28
29
|
TariffsTable: import("@redneckz/uni-jsx").UNIComponent<import("./TariffsTable/TariffsTable").TariffsTableProps, any, any>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { JSXBlock } from '../../model/BlocksRegistry';
|
|
1
2
|
import type { UniBlockProps } from '../../model/ContentPageDef';
|
|
2
3
|
import type { OtherProductsContent } from './OtherProductsContent';
|
|
3
4
|
export interface OtherProductsProps extends OtherProductsContent, UniBlockProps {
|
|
4
5
|
}
|
|
5
|
-
export declare const OtherProducts:
|
|
6
|
+
export declare const OtherProducts: JSXBlock<OtherProductsProps>;
|
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
import type { ColorPalette } from '../../model/ContentPageDef';
|
|
2
1
|
import type { TitleProps } from '../../model/HeadlineType';
|
|
3
|
-
import type { BlockDef } from '../../ui-kit/BlocksList/BlocksListProps';
|
|
4
|
-
/**
|
|
5
|
-
* @title Элемент списка
|
|
6
|
-
*/
|
|
7
|
-
export interface BlockItemCommonProps {
|
|
8
|
-
/**
|
|
9
|
-
* @title Название
|
|
10
|
-
* @default Список
|
|
11
|
-
*/
|
|
12
|
-
label?: string;
|
|
13
|
-
/** @title Отображать в раскрытом виде */
|
|
14
|
-
isUnfolded?: boolean;
|
|
15
|
-
/** @title Блоки */
|
|
16
|
-
blocks?: BlockDef[];
|
|
17
|
-
}
|
|
18
2
|
/**
|
|
19
3
|
* @title Другие продукты
|
|
20
4
|
*/
|
|
21
|
-
export declare type OtherProductsContent = TitleProps
|
|
22
|
-
/** @title Список */
|
|
23
|
-
blockItems?: BlockItemCommonProps[];
|
|
24
|
-
colorPalette?: ColorPalette;
|
|
25
|
-
};
|
|
5
|
+
export declare type OtherProductsContent = TitleProps;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { JSXBlock } from '../../model/BlocksRegistry';
|
|
2
|
+
import type { UniBlockProps } from '../../model/ContentPageDef';
|
|
3
|
+
import type { OtherProductsItemContent } from './OtherProductsItemContent';
|
|
4
|
+
export interface OtherProductsItemProps extends OtherProductsItemContent, UniBlockProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const OtherProductsItem: JSXBlock<OtherProductsItemProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ColorPalette } from '../../model/ContentPageDef';
|
|
2
|
+
/**
|
|
3
|
+
* @title Элемент списка
|
|
4
|
+
*/
|
|
5
|
+
export interface OtherProductsItemContent {
|
|
6
|
+
/**
|
|
7
|
+
* @title Название
|
|
8
|
+
* @default Список
|
|
9
|
+
*/
|
|
10
|
+
label?: string;
|
|
11
|
+
/** @title Отображать в раскрытом виде */
|
|
12
|
+
isUnfolded?: boolean;
|
|
13
|
+
colorPalette?: ColorPalette;
|
|
14
|
+
}
|
|
@@ -22,7 +22,8 @@ export declare const Blocks: {
|
|
|
22
22
|
ProductGallery: import("@redneckz/uni-jsx").UNIComponent<import("./ProductGallery/ProductGallery").ProductGalleryProps, any, any>;
|
|
23
23
|
ProductTile: import("@redneckz/uni-jsx").UNIComponent<import("./ProductTile/ProductTile").ProductTileProps, any, any>;
|
|
24
24
|
PromoTile: import("@redneckz/uni-jsx").UNIComponent<import("./PromoTile/PromoTile").PromoTileProps, any, any>;
|
|
25
|
-
OtherProducts: import("
|
|
25
|
+
OtherProducts: import("../model/BlocksRegistry").JSXBlock<import("./OtherProducts/OtherProducts").OtherProductsProps>;
|
|
26
|
+
OtherProductsItem: import("../model/BlocksRegistry").JSXBlock<import("./OtherProductsItem/OtherProductsItem").OtherProductsItemProps>;
|
|
26
27
|
Recommendation: import("@redneckz/uni-jsx").UNIComponent<import("./Recommendation/Recommendation").RecommendationProps, any, any>;
|
|
27
28
|
StepsBlock: import("@redneckz/uni-jsx").UNIComponent<import("./StepsBlock/StepsBlock").StepsBlockProps, any, any>;
|
|
28
29
|
TariffsTable: import("@redneckz/uni-jsx").UNIComponent<import("./TariffsTable/TariffsTable").TariffsTableProps, any, any>;
|
|
@@ -22,6 +22,7 @@ const MiniGallery_1 = require("./MiniGallery/MiniGallery");
|
|
|
22
22
|
const MobileAppTile_1 = require("./MobileAppTile/MobileAppTile");
|
|
23
23
|
const OfficeServicesBlock_1 = require("./OfficeServicesBlock/OfficeServicesBlock");
|
|
24
24
|
const OtherProducts_1 = require("./OtherProducts/OtherProducts");
|
|
25
|
+
const OtherProductsItem_1 = require("./OtherProductsItem/OtherProductsItem");
|
|
25
26
|
const PictureText_1 = require("./PictureText/PictureText");
|
|
26
27
|
const Placeholder_1 = require("./Placeholder/Placeholder");
|
|
27
28
|
const ProductBlock_1 = require("./ProductBlock/ProductBlock");
|
|
@@ -60,6 +61,7 @@ exports.Blocks = {
|
|
|
60
61
|
ProductTile: ProductTile_1.ProductTile,
|
|
61
62
|
PromoTile: PromoTile_1.PromoTile,
|
|
62
63
|
OtherProducts: OtherProducts_1.OtherProducts,
|
|
64
|
+
OtherProductsItem: OtherProductsItem_1.OtherProductsItem,
|
|
63
65
|
Recommendation: Recommendation_1.Recommendation,
|
|
64
66
|
StepsBlock: StepsBlock_1.StepsBlock,
|
|
65
67
|
TariffsTable: TariffsTable_1.TariffsTable,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Blocks.js","sourceRoot":"","sources":["../../src/components/Blocks.ts"],"names":[],"mappings":";;AAAA,qDAAkD;AAClD,iEAA8D;AAC9D,yCAAsC;AACtC,gFAA6E;AAC7E,wDAAqD;AACrD,8DAA2D;AAC3D,+CAA4C;AAC5C,uEAAoE;AACpE,wDAAqD;AACrD,0EAAuE;AACvE,4CAAyC;AACzC,+CAA4C;AAC5C,2DAAwD;AACxD,4CAAyC;AACzC,kDAA+C;AAC/C,sFAAmF;AACnF,oEAAiE;AACjE,kDAA+C;AAC/C,2DAAwD;AACxD,iEAA8D;AAC9D,mFAAgF;AAChF,iEAA8D;AAC9D,2DAAwD;AACxD,2DAAwD;AACxD,8DAA2D;AAC3D,oEAAiE;AACjE,2DAAwD;AACxD,qDAAkD;AAClD,oEAAiE;AACjE,6EAA0E;AAC1E,wDAAqD;AACrD,sCAAmC;AACnC,8DAA2D;AAC3D,qDAAkD;AAClD,sCAAmC;AAEtB,QAAA,MAAM,GAAG;IACpB,SAAS,EAAT,qBAAS;IACT,aAAa,EAAb,6BAAa;IACb,KAAK,EAAL,aAAK;IACL,YAAY,EAAZ,2BAAY;IACZ,eAAe,EAAf,iCAAe;IACf,UAAU,EAAV,uBAAU;IACV,OAAO,EAAP,iBAAO;IACP,gBAAgB,EAAhB,mCAAgB;IAChB,MAAM,EAAN,eAAM;IACN,OAAO,EAAP,iBAAO;IACP,WAAW,EAAX,yBAAW;IACX,MAAM,EAAN,eAAM;IACN,QAAQ,EAAR,mBAAQ;IACR,oBAAoB,EAApB,2CAAoB;IACpB,cAAc,EAAd,+BAAc;IACd,QAAQ,EAAR,mBAAQ;IACR,WAAW,EAAX,yBAAW;IACX,aAAa,EAAb,6BAAa;IACb,WAAW,EAAX,yBAAW;IACX,YAAY,EAAZ,2BAAY;IACZ,cAAc,EAAd,+BAAc;IACd,WAAW,EAAX,yBA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P,iBAAO;IACP,WAAW,EAAX,yBAAW;IACX,MAAM,EAAN,eAAM;IACN,QAAQ,EAAR,mBAAQ;IACR,oBAAoB,EAApB,2CAAoB;IACpB,cAAc,EAAd,+BAAc;IACd,QAAQ,EAAR,mBAAQ;IACR,WAAW,EAAX,yBAAW;IACX,aAAa,EAAb,6BAAa;IACb,WAAW,EAAX,yBAAW;IACX,YAAY,EAAZ,2BAAY;IACZ,cAAc,EAAd,+BAAc;IACd,WAAW,EAAX,yBAAW;IACX,SAAS,EAAT,qBAAS;IACT,aAAa,EAAb,6BAAa;IACb,iBAAiB,EAAjB,qCAAiB;IACjB,cAAc,EAAd,+BAAc;IACd,UAAU,EAAV,uBAAU;IACV,YAAY,EAAZ,2BAAY;IACZ,SAAS,EAAT,qBAAS;IACT,IAAI,EAAJ,WAAI;IACJ,WAAW,EAAX,yBAAW;IACX,kBAAkB,EAAlB,uCAAkB;IAClB,iBAAiB,EAAjB,qCAAiB;IACjB,IAAI,EAAJ,WAAI;IACJ,UAAU,EAAV,uBAAU;IACV,mBAAmB,EAAnB,yCAAmB;CACpB,CAAC"}
|
|
@@ -3,24 +3,25 @@ exports.renderBlock = void 0;
|
|
|
3
3
|
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
4
|
const BlockDecorator_1 = require("../../model/BlockDecorator");
|
|
5
5
|
const style2className_1 = require("../../utils/style2className");
|
|
6
|
+
const defaultChildRenderer = (_) => _;
|
|
6
7
|
function renderBlock(block, options, ancestors = BlockDecorator_1.DEFAULT_ANCESTORS) {
|
|
7
8
|
const { key, page, blockDecorator, blocksRegistry, context } = options;
|
|
8
|
-
const { type } = block;
|
|
9
|
+
const { type, blocks: childBlocks } = block;
|
|
9
10
|
if (!(type && type in blocksRegistry)) {
|
|
10
11
|
console.warn(`No block with "${type}" is registered`);
|
|
11
12
|
}
|
|
12
13
|
const BlockComponent = type && blocksRegistry[type];
|
|
14
|
+
const { renderChild = defaultChildRenderer } = BlockComponent || {};
|
|
15
|
+
const renderChildBlock = (_, j) => renderChild(renderBlock(_, { ...options, key: `${options.key}-${j}` }, [...ancestors, block]), j);
|
|
16
|
+
const children = childBlocks?.length ? childBlocks.map(renderChildBlock) : null;
|
|
13
17
|
return blockDecorator({
|
|
14
18
|
blockClassName: `scroll-mt-12 ${(0, style2className_1.style2className)(block.style)}`,
|
|
15
19
|
block,
|
|
16
20
|
ancestors,
|
|
17
21
|
// Adjusted by decorator block and blockClassName
|
|
18
22
|
render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
|
|
19
|
-
const { version,
|
|
20
|
-
|
|
21
|
-
? childBlocks.map((_, j) => renderBlock(_, { ...options, key: `${options.key}-${j}` }, [...ancestors, block]))
|
|
22
|
-
: null;
|
|
23
|
-
return BlockComponent ? ((0, jsx_runtime_1.jsx)(BlockComponent, { className: adjustedBlockClassName, version: version, context: context, page: page, anchor: anchor, labels: labels, ...content, children: children }, key)) : null;
|
|
23
|
+
const { version, anchor, labels, content } = adjustedBlock;
|
|
24
|
+
return BlockComponent ? ((0, jsx_runtime_1.jsx)(BlockComponent, { className: adjustedBlockClassName, context: context, page: page, version: version, anchor: anchor, labels: labels, ...content, children: children }, key)) : null;
|
|
24
25
|
},
|
|
25
26
|
}, key);
|
|
26
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderBlock.js","sourceRoot":"","sources":["../../../src/components/ContentPage/renderBlock.tsx"],"names":[],"mappings":";;;AAAA,+DAA+F;
|
|
1
|
+
{"version":3,"file":"renderBlock.js","sourceRoot":"","sources":["../../../src/components/ContentPage/renderBlock.tsx"],"names":[],"mappings":";;;AAAA,+DAA+F;AAI/F,iEAA8D;AAW9D,MAAM,oBAAoB,GAAG,CAAC,CAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAE7C,SAAgB,WAAW,CACzB,KAAe,EACf,OAA2B,EAC3B,YAA4B,kCAAiB;IAE7C,MAAM,EAAE,GAAG,EAAE,IAAI,EAA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AAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,KACV,OAAO,YAEV,QAAQ,IATJ,GAAG,CAUO,CAClB,CAAC,CAAC,CAAC,IAAI,CAAC;QACX,CAAC;KACF,EACD,GAAG,CACJ,CAAC;AACJ,CAAC;AAjDD,kCAiDC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { JSXBlock } from '../../model/BlocksRegistry';
|
|
1
2
|
import type { UniBlockProps } from '../../model/ContentPageDef';
|
|
2
3
|
import type { OtherProductsContent } from './OtherProductsContent';
|
|
3
4
|
export interface OtherProductsProps extends OtherProductsContent, UniBlockProps {
|
|
4
5
|
}
|
|
5
|
-
export declare const OtherProducts:
|
|
6
|
+
export declare const OtherProducts: JSXBlock<OtherProductsProps>;
|
|
@@ -3,8 +3,6 @@ exports.OtherProducts = void 0;
|
|
|
3
3
|
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
5
|
const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
6
|
-
|
|
7
|
-
exports.OtherProducts
|
|
8
|
-
return ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { context: context, className: `font-sans text-primary-text ${className}`, ...rest, children: blockItems?.length ? ((0, jsx_runtime_1.jsx)("div", { className: "box-border1", children: blockItems.map((item, i) => ((0, jsx_runtime_1.jsx)(OtherProductsItem_1.OtherProductsItem, { ...item, dataTheme: colorPalette, context: context }, `BlockItem${i}`))) })) : null }));
|
|
9
|
-
});
|
|
6
|
+
exports.OtherProducts = (0, uni_jsx_1.JSX)(({ context, className = '', children, ...rest }) => ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { context: context, className: `font-sans text-primary-text ${className}`, ...rest, children: children ? (0, jsx_runtime_1.jsx)("div", { className: "box-border1", children: children }) : null })));
|
|
7
|
+
exports.OtherProducts.childrenTypes = ['OtherProductsItem'];
|
|
10
8
|
//# sourceMappingURL=OtherProducts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OtherProducts.js","sourceRoot":"","sources":["../../../src/components/OtherProducts/OtherProducts.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;
|
|
1
|
+
{"version":3,"file":"OtherProducts.js","sourceRoot":"","sources":["../../../src/components/OtherProducts/OtherProducts.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAGxC,4DAAyD;AAK5C,QAAA,aAAa,GAAG,IAAA,aAAG,EAC9B,CAAC,EAAE,OAAO,EAAE,SAAS,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CAClD,uBAAC,2BAAY,IACX,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,+BAA+B,SAAS,EAAE,KACjD,IAAI,YAEP,QAAQ,CAAC,CAAC,CAAC,gCAAK,SAAS,EAAC,aAAa,YAAE,QAAQ,GAAO,CAAC,CAAC,CAAC,IAAI,GACnD,CAChB,CAC8B,CAAC;AAElC,qBAAa,CAAC,aAAa,GAAG,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
import type { ColorPalette } from '../../model/ContentPageDef';
|
|
2
1
|
import type { TitleProps } from '../../model/HeadlineType';
|
|
3
|
-
import type { BlockDef } from '../../ui-kit/BlocksList/BlocksListProps';
|
|
4
|
-
/**
|
|
5
|
-
* @title Элемент списка
|
|
6
|
-
*/
|
|
7
|
-
export interface BlockItemCommonProps {
|
|
8
|
-
/**
|
|
9
|
-
* @title Название
|
|
10
|
-
* @default Список
|
|
11
|
-
*/
|
|
12
|
-
label?: string;
|
|
13
|
-
/** @title Отображать в раскрытом виде */
|
|
14
|
-
isUnfolded?: boolean;
|
|
15
|
-
/** @title Блоки */
|
|
16
|
-
blocks?: BlockDef[];
|
|
17
|
-
}
|
|
18
2
|
/**
|
|
19
3
|
* @title Другие продукты
|
|
20
4
|
*/
|
|
21
|
-
export declare type OtherProductsContent = TitleProps
|
|
22
|
-
/** @title Список */
|
|
23
|
-
blockItems?: BlockItemCommonProps[];
|
|
24
|
-
colorPalette?: ColorPalette;
|
|
25
|
-
};
|
|
5
|
+
export declare type OtherProductsContent = TitleProps;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { JSXBlock } from '../../model/BlocksRegistry';
|
|
2
|
+
import type { UniBlockProps } from '../../model/ContentPageDef';
|
|
3
|
+
import type { OtherProductsItemContent } from './OtherProductsItemContent';
|
|
4
|
+
export interface OtherProductsItemProps extends OtherProductsItemContent, UniBlockProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const OtherProductsItem: JSXBlock<OtherProductsItemProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.OtherProductsItem = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
+
const DefaultFoldButton_1 = require("../../ui-kit/Foldable/DefaultFoldButton");
|
|
6
|
+
const Foldable_1 = require("../../ui-kit/Foldable/Foldable");
|
|
7
|
+
const FoldableSection_1 = require("../../ui-kit/Foldable/FoldableSection");
|
|
8
|
+
const icons = ['ArrowDownIcon', 'ArrowUpIcon'];
|
|
9
|
+
exports.OtherProductsItem = (0, uni_jsx_1.JSX)(({ className, label = '', colorPalette, isUnfolded: unfoldedByDefault, children }) => ((0, jsx_runtime_1.jsx)("div", { className: `border-0 border-b border-solid border-main-divider ${className}`, children: (0, jsx_runtime_1.jsx)(Foldable_1.Foldable, { unfoldedByDefault: unfoldedByDefault, renderFoldableSection: ({ isUnfolded }) => ((0, jsx_runtime_1.jsx)("div", { className: "box-border", children: (0, jsx_runtime_1.jsx)(FoldableSection_1.FoldableSection, { className: "grid grid-cols-12 gap-1 border-box", isUnfolded: isUnfolded, children: children }) })), renderFoldButton: ({ isUnfolded, onToggle }) => ((0, jsx_runtime_1.jsx)(DefaultFoldButton_1.DefaultFoldButton, { label: label, icon: icons[Number(isUnfolded)], dataTheme: colorPalette, onClick: onToggle })) }) })));
|
|
10
|
+
exports.OtherProductsItem.childrenTypes = []; // All types of blocks are suitable
|
|
11
|
+
//# sourceMappingURL=OtherProductsItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtherProductsItem.js","sourceRoot":"","sources":["../../../src/components/OtherProductsItem/OtherProductsItem.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAGxC,+EAA4E;AAC5E,6DAA0D;AAC1D,2EAAwE;AAMxE,MAAM,KAAK,GAAe,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;AAE9C,QAAA,iBAAiB,GAAG,IAAA,aAAG,EAClC,CAAC,EAAE,SAAS,EAAE,KAAK,GAAG,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACpF,gCAAK,SAAS,EAAE,sDAAsD,SAAS,EAAE,YAC/E,uBAAC,mBAAQ,IACP,iBAAiB,EAAE,iBAAiB,EACpC,qBAAqB,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CACzC,gCAAK,SAAS,EAAC,YAAY,YACzB,uBAAC,iCAAe,IAAC,SAAS,EAAC,oCAAoC,EAAC,UAAU,EAAE,UAAU,YACnF,QAAQ,GACO,GACd,CACP,EACD,gBAAgB,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAC9C,uBAAC,qCAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAC/B,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,QAAQ,GACjB,CACH,GACD,GACE,CACP,CACkC,CAAC;AAEtC,yBAAiB,CAAC,aAAa,GAAG,EAAE,CAAC,CAAC,mCAAmC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ColorPalette } from '../../model/ContentPageDef';
|
|
2
|
+
/**
|
|
3
|
+
* @title Элемент списка
|
|
4
|
+
*/
|
|
5
|
+
export interface OtherProductsItemContent {
|
|
6
|
+
/**
|
|
7
|
+
* @title Название
|
|
8
|
+
* @default Список
|
|
9
|
+
*/
|
|
10
|
+
label?: string;
|
|
11
|
+
/** @title Отображать в раскрытом виде */
|
|
12
|
+
isUnfolded?: boolean;
|
|
13
|
+
colorPalette?: ColorPalette;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtherProductsItemContent.js","sourceRoot":"","sources":["../../../src/components/OtherProductsItem/OtherProductsItemContent.ts"],"names":[],"mappings":""}
|
|
@@ -11,7 +11,7 @@ exports.FoldableSection = (0, uni_jsx_1.JSX)(({ className = '', isUnfolded, chil
|
|
|
11
11
|
? `${containerRef.current.scrollHeight}px`
|
|
12
12
|
: '';
|
|
13
13
|
}
|
|
14
|
-
}, [isUnfolded]);
|
|
14
|
+
}, [isUnfolded, children?.length]);
|
|
15
15
|
return ((0, jsx_runtime_1.jsx)("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden max-h-0 ${className}`, children: children }));
|
|
16
16
|
});
|
|
17
17
|
//# sourceMappingURL=FoldableSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FoldableSection.js","sourceRoot":"","sources":["../../../src/ui-kit/Foldable/FoldableSection.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAAgE;AAOnD,QAAA,eAAe,GAAG,IAAA,aAAG,EAChC,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3C,MAAM,YAAY,GAAG,IAAA,cAAM,EAAwB,IAAI,CAAC,CAAC;IAEzD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,YAAY,CAAC,OAAO,EAAE;YACxB,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,UAAU;gBAC/C,CAAC,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,YAAY,IAAI;gBAC1C,CAAC,CAAC,EAAE,CAAC;SACR;IACH,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"FoldableSection.js","sourceRoot":"","sources":["../../../src/ui-kit/Foldable/FoldableSection.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAAgE;AAOnD,QAAA,eAAe,GAAG,IAAA,aAAG,EAChC,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3C,MAAM,YAAY,GAAG,IAAA,cAAM,EAAwB,IAAI,CAAC,CAAC;IAEzD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,YAAY,CAAC,OAAO,EAAE;YACxB,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,UAAU;gBAC/C,CAAC,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,YAAY,IAAI;gBAC1C,CAAC,CAAC,EAAE,CAAC;SACR;IACH,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IAEnC,OAAO,CACL,gCACE,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,yDAAyD,SAAS,EAAE,YAE9E,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -22,7 +22,8 @@ export declare const Blocks: {
|
|
|
22
22
|
ProductGallery: import("@redneckz/uni-jsx").UNIComponent<import("./ProductGallery/ProductGallery").ProductGalleryProps, any, any>;
|
|
23
23
|
ProductTile: import("@redneckz/uni-jsx").UNIComponent<import("./ProductTile/ProductTile").ProductTileProps, any, any>;
|
|
24
24
|
PromoTile: import("@redneckz/uni-jsx").UNIComponent<import("./PromoTile/PromoTile").PromoTileProps, any, any>;
|
|
25
|
-
OtherProducts: import("
|
|
25
|
+
OtherProducts: import("../model/BlocksRegistry").JSXBlock<import("./OtherProducts/OtherProducts").OtherProductsProps>;
|
|
26
|
+
OtherProductsItem: import("../model/BlocksRegistry").JSXBlock<import("./OtherProductsItem/OtherProductsItem").OtherProductsItemProps>;
|
|
26
27
|
Recommendation: import("@redneckz/uni-jsx").UNIComponent<import("./Recommendation/Recommendation").RecommendationProps, any, any>;
|
|
27
28
|
StepsBlock: import("@redneckz/uni-jsx").UNIComponent<import("./StepsBlock/StepsBlock").StepsBlockProps, any, any>;
|
|
28
29
|
TariffsTable: import("@redneckz/uni-jsx").UNIComponent<import("./TariffsTable/TariffsTable").TariffsTableProps, any, any>;
|
package/lib/components/Blocks.js
CHANGED
|
@@ -20,6 +20,7 @@ import { MiniGallery } from './MiniGallery/MiniGallery.js';
|
|
|
20
20
|
import { MobileAppTile } from './MobileAppTile/MobileAppTile.js';
|
|
21
21
|
import { OfficeServicesBlock } from './OfficeServicesBlock/OfficeServicesBlock.js';
|
|
22
22
|
import { OtherProducts } from './OtherProducts/OtherProducts.js';
|
|
23
|
+
import { OtherProductsItem } from './OtherProductsItem/OtherProductsItem.js';
|
|
23
24
|
import { PictureText } from './PictureText/PictureText.js';
|
|
24
25
|
import { Placeholder } from './Placeholder/Placeholder.js';
|
|
25
26
|
import { ProductBlock } from './ProductBlock/ProductBlock.js';
|
|
@@ -58,6 +59,7 @@ export const Blocks = {
|
|
|
58
59
|
ProductTile,
|
|
59
60
|
PromoTile,
|
|
60
61
|
OtherProducts,
|
|
62
|
+
OtherProductsItem,
|
|
61
63
|
Recommendation,
|
|
62
64
|
StepsBlock,
|
|
63
65
|
TariffsTable,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Blocks.js","sourceRoot":"","sources":["../../src/components/Blocks.ts"],"names":[],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,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS;IACT,aAAa;IACb,KAAK;IACL,YAAY;IACZ,eAAe;IACf,UAAU;IACV,OAAO;IACP,gBAAgB;IAChB,MAAM;IACN,OAAO;IACP,WAAW;IACX,MAAM;IACN,QAAQ;IACR,oBAAoB;IACpB,cAAc;IACd,QAAQ;IACR,WAAW;IACX,aAAa;IACb,WAAW;IACX,YAAY;IACZ,cAAc;IACd,WAAW;IACX,SAAS;IACT,aAAa;IACb,iBAAiB;IACjB,cAAc;IACd,UAAU;IACV,YAAY;IACZ,SAAS;IACT,IAAI;IACJ,WAAW;IACX,kBAAkB;IAClB,iBAAiB;IACjB,IAAI;IACJ,UAAU;IACV,mBAAmB;CACpB,CAAC"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { DEFAULT_ANCESTORS } from '../../model/BlockDecorator.js';
|
|
3
3
|
import { style2className } from '../../utils/style2className.js';
|
|
4
|
+
const defaultChildRenderer = (_) => _;
|
|
4
5
|
export function renderBlock(block, options, ancestors = DEFAULT_ANCESTORS) {
|
|
5
6
|
const { key, page, blockDecorator, blocksRegistry, context } = options;
|
|
6
|
-
const { type } = block;
|
|
7
|
+
const { type, blocks: childBlocks } = block;
|
|
7
8
|
if (!(type && type in blocksRegistry)) {
|
|
8
9
|
console.warn(`No block with "${type}" is registered`);
|
|
9
10
|
}
|
|
10
11
|
const BlockComponent = type && blocksRegistry[type];
|
|
12
|
+
const { renderChild = defaultChildRenderer } = BlockComponent || {};
|
|
13
|
+
const renderChildBlock = (_, j) => renderChild(renderBlock(_, { ...options, key: `${options.key}-${j}` }, [...ancestors, block]), j);
|
|
14
|
+
const children = childBlocks?.length ? childBlocks.map(renderChildBlock) : null;
|
|
11
15
|
return blockDecorator({
|
|
12
16
|
blockClassName: `scroll-mt-12 ${style2className(block.style)}`,
|
|
13
17
|
block,
|
|
14
18
|
ancestors,
|
|
15
19
|
// Adjusted by decorator block and blockClassName
|
|
16
20
|
render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
|
|
17
|
-
const { version,
|
|
18
|
-
|
|
19
|
-
? childBlocks.map((_, j) => renderBlock(_, { ...options, key: `${options.key}-${j}` }, [...ancestors, block]))
|
|
20
|
-
: null;
|
|
21
|
-
return BlockComponent ? (_jsx(BlockComponent, { className: adjustedBlockClassName, version: version, context: context, page: page, anchor: anchor, labels: labels, ...content, children: children }, key)) : null;
|
|
21
|
+
const { version, anchor, labels, content } = adjustedBlock;
|
|
22
|
+
return BlockComponent ? (_jsx(BlockComponent, { className: adjustedBlockClassName, context: context, page: page, version: version, anchor: anchor, labels: labels, ...content, children: children }, key)) : null;
|
|
22
23
|
},
|
|
23
24
|
}, key);
|
|
24
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderBlock.js","sourceRoot":"","sources":["../../../src/components/ContentPage/renderBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkC,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"renderBlock.js","sourceRoot":"","sources":["../../../src/components/ContentPage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ACT,iDAAiD;QACjD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,sBAAsB,EAAE,EAAE,EAAE;YAC3E,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,aAAa,CAAC;YAE3D,OAAO,cAAc,CAAC,CAAC,CAAC,CACtB,KAAC,cAAc,IAEb,SAAS,EAAE,sBAAsB,EACjC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,KACV,OAAO,YAEV,QAAQ,IATJ,GAAG,CAUO,CAClB,CAAC,CAAC,CAAC,IAAI,CAAC;QACX,CAAC;KACF,EACD,GAAG,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { JSXBlock } from '../../model/BlocksRegistry';
|
|
1
2
|
import type { UniBlockProps } from '../../model/ContentPageDef';
|
|
2
3
|
import type { OtherProductsContent } from './OtherProductsContent';
|
|
3
4
|
export interface OtherProductsProps extends OtherProductsContent, UniBlockProps {
|
|
4
5
|
}
|
|
5
|
-
export declare const OtherProducts:
|
|
6
|
+
export declare const OtherProducts: JSXBlock<OtherProductsProps>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return (_jsx(BlockWrapper, { context: context, className: `font-sans text-primary-text ${className}`, ...rest, children: blockItems?.length ? (_jsx("div", { className: "box-border1", children: blockItems.map((item, i) => (_jsx(OtherProductsItem, { ...item, dataTheme: colorPalette, context: context }, `BlockItem${i}`))) })) : null }));
|
|
7
|
-
});
|
|
4
|
+
export const OtherProducts = JSX(({ context, className = '', children, ...rest }) => (_jsx(BlockWrapper, { context: context, className: `font-sans text-primary-text ${className}`, ...rest, children: children ? _jsx("div", { className: "box-border1", children: children }) : null })));
|
|
5
|
+
OtherProducts.childrenTypes = ['OtherProductsItem'];
|
|
8
6
|
//# sourceMappingURL=OtherProducts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OtherProducts.js","sourceRoot":"","sources":["../../../src/components/OtherProducts/OtherProducts.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"OtherProducts.js","sourceRoot":"","sources":["../../../src/components/OtherProducts/OtherProducts.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAKzD,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAC9B,CAAC,EAAE,OAAO,EAAE,SAAS,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CAClD,KAAC,YAAY,IACX,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,+BAA+B,SAAS,EAAE,KACjD,IAAI,YAEP,QAAQ,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,aAAa,YAAE,QAAQ,GAAO,CAAC,CAAC,CAAC,IAAI,GACnD,CAChB,CAC8B,CAAC;AAElC,aAAa,CAAC,aAAa,GAAG,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
import type { ColorPalette } from '../../model/ContentPageDef';
|
|
2
1
|
import type { TitleProps } from '../../model/HeadlineType';
|
|
3
|
-
import type { BlockDef } from '../../ui-kit/BlocksList/BlocksListProps';
|
|
4
|
-
/**
|
|
5
|
-
* @title Элемент списка
|
|
6
|
-
*/
|
|
7
|
-
export interface BlockItemCommonProps {
|
|
8
|
-
/**
|
|
9
|
-
* @title Название
|
|
10
|
-
* @default Список
|
|
11
|
-
*/
|
|
12
|
-
label?: string;
|
|
13
|
-
/** @title Отображать в раскрытом виде */
|
|
14
|
-
isUnfolded?: boolean;
|
|
15
|
-
/** @title Блоки */
|
|
16
|
-
blocks?: BlockDef[];
|
|
17
|
-
}
|
|
18
2
|
/**
|
|
19
3
|
* @title Другие продукты
|
|
20
4
|
*/
|
|
21
|
-
export declare type OtherProductsContent = TitleProps
|
|
22
|
-
/** @title Список */
|
|
23
|
-
blockItems?: BlockItemCommonProps[];
|
|
24
|
-
colorPalette?: ColorPalette;
|
|
25
|
-
};
|
|
5
|
+
export declare type OtherProductsContent = TitleProps;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { JSXBlock } from '../../model/BlocksRegistry';
|
|
2
|
+
import type { UniBlockProps } from '../../model/ContentPageDef';
|
|
3
|
+
import type { OtherProductsItemContent } from './OtherProductsItemContent';
|
|
4
|
+
export interface OtherProductsItemProps extends OtherProductsItemContent, UniBlockProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const OtherProductsItem: JSXBlock<OtherProductsItemProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { DefaultFoldButton } from '../../ui-kit/Foldable/DefaultFoldButton.js';
|
|
4
|
+
import { Foldable } from '../../ui-kit/Foldable/Foldable.js';
|
|
5
|
+
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection.js';
|
|
6
|
+
const icons = ['ArrowDownIcon', 'ArrowUpIcon'];
|
|
7
|
+
export const OtherProductsItem = JSX(({ className, label = '', colorPalette, isUnfolded: unfoldedByDefault, children }) => (_jsx("div", { className: `border-0 border-b border-solid border-main-divider ${className}`, children: _jsx(Foldable, { unfoldedByDefault: unfoldedByDefault, renderFoldableSection: ({ isUnfolded }) => (_jsx("div", { className: "box-border", children: _jsx(FoldableSection, { className: "grid grid-cols-12 gap-1 border-box", isUnfolded: isUnfolded, children: children }) })), renderFoldButton: ({ isUnfolded, onToggle }) => (_jsx(DefaultFoldButton, { label: label, icon: icons[Number(isUnfolded)], dataTheme: colorPalette, onClick: onToggle })) }) })));
|
|
8
|
+
OtherProductsItem.childrenTypes = []; // All types of blocks are suitable
|
|
9
|
+
//# sourceMappingURL=OtherProductsItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtherProductsItem.js","sourceRoot":"","sources":["../../../src/components/OtherProductsItem/OtherProductsItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAMxE,MAAM,KAAK,GAAe,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;AAE3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAClC,CAAC,EAAE,SAAS,EAAE,KAAK,GAAG,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACpF,cAAK,SAAS,EAAE,sDAAsD,SAAS,EAAE,YAC/E,KAAC,QAAQ,IACP,iBAAiB,EAAE,iBAAiB,EACpC,qBAAqB,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CACzC,cAAK,SAAS,EAAC,YAAY,YACzB,KAAC,eAAe,IAAC,SAAS,EAAC,oCAAoC,EAAC,UAAU,EAAE,UAAU,YACnF,QAAQ,GACO,GACd,CACP,EACD,gBAAgB,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAC9C,KAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAC/B,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,QAAQ,GACjB,CACH,GACD,GACE,CACP,CACkC,CAAC;AAEtC,iBAAiB,CAAC,aAAa,GAAG,EAAE,CAAC,CAAC,mCAAmC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ColorPalette } from '../../model/ContentPageDef';
|
|
2
|
+
/**
|
|
3
|
+
* @title Элемент списка
|
|
4
|
+
*/
|
|
5
|
+
export interface OtherProductsItemContent {
|
|
6
|
+
/**
|
|
7
|
+
* @title Название
|
|
8
|
+
* @default Список
|
|
9
|
+
*/
|
|
10
|
+
label?: string;
|
|
11
|
+
/** @title Отображать в раскрытом виде */
|
|
12
|
+
isUnfolded?: boolean;
|
|
13
|
+
colorPalette?: ColorPalette;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtherProductsItemContent.js","sourceRoot":"","sources":["../../../src/components/OtherProductsItem/OtherProductsItemContent.ts"],"names":[],"mappings":""}
|
|
@@ -9,7 +9,7 @@ export const FoldableSection = JSX(({ className = '', isUnfolded, children }) =>
|
|
|
9
9
|
? `${containerRef.current.scrollHeight}px`
|
|
10
10
|
: '';
|
|
11
11
|
}
|
|
12
|
-
}, [isUnfolded]);
|
|
12
|
+
}, [isUnfolded, children?.length]);
|
|
13
13
|
return (_jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden max-h-0 ${className}`, children: children }));
|
|
14
14
|
});
|
|
15
15
|
//# sourceMappingURL=FoldableSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FoldableSection.js","sourceRoot":"","sources":["../../../src/ui-kit/Foldable/FoldableSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MA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DAAyD,SAAS,EAAE,YAE9E,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -953,7 +953,7 @@
|
|
|
953
953
|
? `${containerRef.current.scrollHeight}px`
|
|
954
954
|
: '';
|
|
955
955
|
}
|
|
956
|
-
}, [isUnfolded]);
|
|
956
|
+
}, [isUnfolded, children?.length]);
|
|
957
957
|
return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden max-h-0 ${className}`, children: children }));
|
|
958
958
|
});
|
|
959
959
|
|
|
@@ -1555,24 +1555,25 @@
|
|
|
1555
1555
|
const DEFAULT_SLOT_NAME = null;
|
|
1556
1556
|
const DEFAULT_ANCESTORS = [DEFAULT_SLOT_NAME];
|
|
1557
1557
|
|
|
1558
|
+
const defaultChildRenderer = (_) => _;
|
|
1558
1559
|
function renderBlock(block, options, ancestors = DEFAULT_ANCESTORS) {
|
|
1559
1560
|
const { key, page, blockDecorator, blocksRegistry, context } = options;
|
|
1560
|
-
const { type } = block;
|
|
1561
|
+
const { type, blocks: childBlocks } = block;
|
|
1561
1562
|
if (!(type && type in blocksRegistry)) {
|
|
1562
1563
|
console.warn(`No block with "${type}" is registered`);
|
|
1563
1564
|
}
|
|
1564
1565
|
const BlockComponent = type && blocksRegistry[type];
|
|
1566
|
+
const { renderChild = defaultChildRenderer } = BlockComponent || {};
|
|
1567
|
+
const renderChildBlock = (_, j) => renderChild(renderBlock(_, { ...options, key: `${options.key}-${j}` }, [...ancestors, block]), j);
|
|
1568
|
+
const children = childBlocks?.length ? childBlocks.map(renderChildBlock) : null;
|
|
1565
1569
|
return blockDecorator({
|
|
1566
1570
|
blockClassName: `scroll-mt-12 ${style2className(block.style)}`,
|
|
1567
1571
|
block,
|
|
1568
1572
|
ancestors,
|
|
1569
1573
|
// Adjusted by decorator block and blockClassName
|
|
1570
1574
|
render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
|
|
1571
|
-
const { version,
|
|
1572
|
-
|
|
1573
|
-
? childBlocks.map((_, j) => renderBlock(_, { ...options, key: `${options.key}-${j}` }, [...ancestors, block]))
|
|
1574
|
-
: null;
|
|
1575
|
-
return BlockComponent ? (jsx(BlockComponent, { className: adjustedBlockClassName, version: version, context: context, page: page, anchor: anchor, labels: labels, ...content, children: children }, key)) : null;
|
|
1575
|
+
const { version, anchor, labels, content } = adjustedBlock;
|
|
1576
|
+
return BlockComponent ? (jsx(BlockComponent, { className: adjustedBlockClassName, context: context, page: page, version: version, anchor: anchor, labels: labels, ...content, children: children }, key)) : null;
|
|
1576
1577
|
},
|
|
1577
1578
|
}, key);
|
|
1578
1579
|
}
|