@redneckz/wildless-cms-uni-blocks 0.14.46 → 0.14.48
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/bin/migration-scripts/0.14.45.js +17 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +10 -10
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/RollupItem/{PrimaryFoldButton.d.ts → AccordionFoldButton.d.ts} +2 -2
- package/bundle/components/RollupItem/RollupItemContent.d.ts +6 -0
- package/dist/components/RollupItem/{PrimaryFoldButton.d.ts → AccordionFoldButton.d.ts} +2 -2
- package/dist/components/RollupItem/AccordionFoldButton.js +12 -0
- package/dist/components/RollupItem/AccordionFoldButton.js.map +1 -0
- package/dist/components/RollupItem/RollupItem.js +5 -5
- package/dist/components/RollupItem/RollupItem.js.map +1 -1
- package/dist/components/RollupItem/RollupItemContent.d.ts +6 -0
- package/lib/components/RollupItem/{PrimaryFoldButton.d.ts → AccordionFoldButton.d.ts} +2 -2
- package/lib/components/RollupItem/AccordionFoldButton.js +10 -0
- package/lib/components/RollupItem/AccordionFoldButton.js.map +1 -0
- package/lib/components/RollupItem/RollupItem.fixture.d.ts +2 -2
- package/lib/components/RollupItem/RollupItem.js +5 -5
- package/lib/components/RollupItem/RollupItem.js.map +1 -1
- package/lib/components/RollupItem/RollupItemContent.d.ts +6 -0
- package/lib/components/VerticalLayout/VerticalLayout.fixture.d.ts +1 -1
- package/mobile/bundle/bundle.umd.js +10 -10
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/RollupItem/{PrimaryFoldButton.d.ts → AccordionFoldButton.d.ts} +2 -2
- package/mobile/bundle/components/RollupItem/RollupItemContent.d.ts +6 -0
- package/mobile/dist/components/RollupItem/AccordionFoldButton.d.ts +12 -0
- package/mobile/dist/components/RollupItem/AccordionFoldButton.js +12 -0
- package/mobile/dist/components/RollupItem/AccordionFoldButton.js.map +1 -0
- package/mobile/dist/components/RollupItem/RollupItem.js +5 -5
- package/mobile/dist/components/RollupItem/RollupItem.js.map +1 -1
- package/mobile/dist/components/RollupItem/RollupItemContent.d.ts +6 -0
- package/mobile/lib/components/RollupItem/AccordionFoldButton.d.ts +12 -0
- package/mobile/lib/components/RollupItem/AccordionFoldButton.js +10 -0
- package/mobile/lib/components/RollupItem/AccordionFoldButton.js.map +1 -0
- package/mobile/lib/components/RollupItem/RollupItem.js +5 -5
- package/mobile/lib/components/RollupItem/RollupItem.js.map +1 -1
- package/mobile/lib/components/RollupItem/RollupItemContent.d.ts +6 -0
- package/mobile/src/components/RollupItem/{PrimaryFoldButton.tsx → AccordionFoldButton.tsx} +2 -2
- package/mobile/src/components/RollupItem/RollupItem.example.json +2 -1
- package/mobile/src/components/RollupItem/RollupItem.tsx +8 -9
- package/mobile/src/components/RollupItem/RollupItemContent.ts +7 -0
- package/package.json +1 -1
- package/src/components/RollupItem/{PrimaryFoldButton.tsx → AccordionFoldButton.tsx} +2 -2
- package/src/components/RollupItem/RollupItem.example.json +2 -1
- package/src/components/RollupItem/RollupItem.fixture.mobile.tsx +1 -1
- package/src/components/RollupItem/RollupItem.fixture.tsx +6 -6
- package/src/components/RollupItem/RollupItem.tsx +8 -9
- package/src/components/RollupItem/RollupItemContent.ts +7 -0
- package/src/components/VerticalLayout/VerticalLayout.fixture.tsx +29 -28
- package/dist/components/RollupItem/PrimaryFoldButton.js +0 -12
- package/dist/components/RollupItem/PrimaryFoldButton.js.map +0 -1
- package/lib/components/RollupItem/PrimaryFoldButton.js +0 -10
- package/lib/components/RollupItem/PrimaryFoldButton.js.map +0 -1
- package/mobile/dist/components/RollupItem/PrimaryFoldButton.d.ts +0 -12
- package/mobile/dist/components/RollupItem/PrimaryFoldButton.js +0 -12
- package/mobile/dist/components/RollupItem/PrimaryFoldButton.js.map +0 -1
- package/mobile/lib/components/RollupItem/PrimaryFoldButton.d.ts +0 -12
- package/mobile/lib/components/RollupItem/PrimaryFoldButton.js +0 -10
- package/mobile/lib/components/RollupItem/PrimaryFoldButton.js.map +0 -1
package/mobile/bundle/components/RollupItem/{PrimaryFoldButton.d.ts → AccordionFoldButton.d.ts}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type IconName } from '../../icons/IconName';
|
|
2
2
|
import { type Picture } from '../../model/Picture';
|
|
3
3
|
import { type IconBgVersion } from '../../ui-kit/Icon/IconProps';
|
|
4
|
-
interface
|
|
4
|
+
interface RollupButtonProps {
|
|
5
5
|
label?: string;
|
|
6
6
|
labelIcon?: Picture;
|
|
7
7
|
labelIconBgVersion?: IconBgVersion;
|
|
8
8
|
icon?: IconName;
|
|
9
9
|
onToggle?: () => void;
|
|
10
10
|
}
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const AccordionFoldButton: import("@redneckz/uni-jsx").UNIComponent<RollupButtonProps, any, any>;
|
|
12
12
|
export {};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { type LabelProps } from '../../model/HeadlineType';
|
|
2
2
|
import { type UniBlockContent } from '../../model/JSXBlock';
|
|
3
|
+
/**
|
|
4
|
+
* @title Вид кнопки сворачивания
|
|
5
|
+
* @enumNames ["Основная", "Аккордион"]
|
|
6
|
+
*/
|
|
7
|
+
export declare type FoldButtonVersion = 'default' | 'accordion';
|
|
3
8
|
/**
|
|
4
9
|
* @title Сворачивающаяся секция
|
|
5
10
|
*/
|
|
@@ -8,4 +13,5 @@ export declare type RollupItemContent = UniBlockContent & LabelProps & {
|
|
|
8
13
|
isExpanded?: boolean;
|
|
9
14
|
/** @title Кнопка сверху */
|
|
10
15
|
isFoldButtonOnTop?: boolean;
|
|
16
|
+
foldButtonVersion?: FoldButtonVersion;
|
|
11
17
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IconName } from '../../icons/IconName';
|
|
2
|
+
import { type Picture } from '../../model/Picture';
|
|
3
|
+
import { type IconBgVersion } from '../../ui-kit/Icon/IconProps';
|
|
4
|
+
interface RollupButtonProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
labelIcon?: Picture;
|
|
7
|
+
labelIconBgVersion?: IconBgVersion;
|
|
8
|
+
icon?: IconName;
|
|
9
|
+
onToggle?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const AccordionFoldButton: import("@redneckz/uni-jsx").UNIComponent<RollupButtonProps, any, any>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.AccordionFoldButton = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
+
const Icon_1 = require("../../ui-kit/Icon/Icon");
|
|
6
|
+
const Text_1 = require("../../ui-kit/Text/Text");
|
|
7
|
+
const TextWithIcon_1 = require("../../ui-kit/TextWithIcon/TextWithIcon");
|
|
8
|
+
const style_1 = require("../../utils/style");
|
|
9
|
+
const renderRoundedIcon_1 = require("./renderRoundedIcon");
|
|
10
|
+
const rollupIconVersion_1 = require("./rollupIconVersion");
|
|
11
|
+
exports.AccordionFoldButton = (0, uni_jsx_1.JSX)(({ label, labelIconBgVersion, icon, onToggle, labelIcon }) => ((0, jsx_runtime_1.jsx)(TextWithIcon_1.TextWithIcon, { tag: "button", className: (0, style_1.style)('border-none bg-transparent items-center group/button', labelIcon?.icon ? 'py-xs' : 'py-lg'), onClick: onToggle, textNode: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center text-start group-hover/button:text-primary-main gap-s", children: [(0, renderRoundedIcon_1.renderRoundedIcon)(labelIcon, labelIconBgVersion), label ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { size: "text-h6", font: "font-normal", children: label })) : null] }), iconNode: icon ? (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon, iconVersion: rollupIconVersion_1.rollupIconVersion, width: "24", height: "24" }) : null })));
|
|
12
|
+
//# sourceMappingURL=AccordionFoldButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionFoldButton.js","sourceRoot":"","sources":["../../../src/components/RollupItem/AccordionFoldButton.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAGxC,iDAA8C;AAE9C,iDAA8C;AAC9C,yEAAsE;AACtE,6CAA0C;AAC1C,2DAAwD;AACxD,2DAAwD;AAU3C,QAAA,mBAAmB,GAAG,IAAA,aAAG,EACpC,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAC5D,uBAAC,2BAAY,IACX,GAAG,EAAC,QAAQ,EACZ,SAAS,EAAE,IAAA,aAAK,EACd,sDAAsD,EACtD,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CACpC,EACD,OAAO,EAAE,QAAQ,EACjB,QAAQ,EACN,iCAAK,SAAS,EAAC,yEAAyE,aACrF,IAAA,qCAAiB,EAAC,SAAS,EAAE,kBAAkB,CAAC,EAChD,KAAK,CAAC,CAAC,CAAC,CACP,uBAAC,WAAI,IAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,aAAa,YACpC,KAAK,GACD,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,EAER,QAAQ,EACN,IAAI,CAAC,CAAC,CAAC,uBAAC,WAAI,IAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,qCAAiB,EAAE,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,GAE3F,CACH,CACF,CAAC"}
|
|
@@ -8,15 +8,15 @@ const DefaultFoldButton_1 = require("../../ui-kit/Foldable/DefaultFoldButton");
|
|
|
8
8
|
const Foldable_1 = require("../../ui-kit/Foldable/Foldable");
|
|
9
9
|
const FoldableSection_1 = require("../../ui-kit/Foldable/FoldableSection");
|
|
10
10
|
const style_1 = require("../../utils/style");
|
|
11
|
+
const AccordionFoldButton_1 = require("./AccordionFoldButton");
|
|
11
12
|
const foldableSectionStyles_1 = require("./foldableSectionStyles");
|
|
12
13
|
const getIconName_1 = require("./getIconName");
|
|
13
|
-
const PrimaryFoldButton_1 = require("./PrimaryFoldButton");
|
|
14
14
|
const rollupItemStyles_1 = require("./rollupItemStyles");
|
|
15
|
-
exports.RollupItem = (0, uni_jsx_1.JSX)(({ className = '', isExpanded, isFoldButtonOnTop = true, label = 'Развернуть', labelIcon, labelIconBgVersion,
|
|
15
|
+
exports.RollupItem = (0, uni_jsx_1.JSX)(({ className = '', isExpanded, isFoldButtonOnTop = true, label = 'Развернуть', labelIcon, labelIconBgVersion, foldButtonVersion = 'accordion', ...rest }) => ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: (0, style_1.style)('w-full', rollupItemStyles_1.rollupItemStyles, className), defaultPadding: "p-0", tag: "div", version: "transparent", ...rest, children: (0, jsx_runtime_1.jsx)(Foldable_1.Foldable, { isFoldButtonOnTop: isFoldButtonOnTop, unfoldedByDefault: isExpanded, renderFoldableSection: ({ isUnfolded }) => ((0, jsx_runtime_1.jsx)(FoldableSection_1.FoldableSection, { className: (0, style_1.style)('gap-lg', foldableSectionStyles_1.foldableSectionStyles), isUnfolded: isUnfolded, children: (0, renderChildren_1.renderChildren)({
|
|
16
16
|
...rest,
|
|
17
17
|
extraProps: { className: 'w-full', padding: 'p-0' },
|
|
18
18
|
}) })), renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton({
|
|
19
|
-
|
|
19
|
+
foldButtonVersion,
|
|
20
20
|
label,
|
|
21
21
|
labelIcon,
|
|
22
22
|
labelIconBgVersion,
|
|
@@ -26,9 +26,9 @@ exports.RollupItem = (0, uni_jsx_1.JSX)(({ className = '', isExpanded, isFoldBut
|
|
|
26
26
|
exports.RollupItem.childrenTypes = {
|
|
27
27
|
exclude: ['RollupItem'],
|
|
28
28
|
};
|
|
29
|
-
const renderFoldButton = ({
|
|
29
|
+
const renderFoldButton = ({ foldButtonVersion, label: defaultLabel, labelIcon, labelIconBgVersion, isUnfolded, onToggle, }) => {
|
|
30
30
|
const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
|
|
31
31
|
const icon = (0, getIconName_1.getIconName)(isUnfolded);
|
|
32
|
-
return
|
|
32
|
+
return foldButtonVersion === 'accordion' ? ((0, jsx_runtime_1.jsx)(AccordionFoldButton_1.AccordionFoldButton, { label: label, labelIcon: labelIcon, labelIconBgVersion: labelIconBgVersion, icon: icon, onToggle: onToggle })) : ((0, jsx_runtime_1.jsx)(DefaultFoldButton_1.DefaultFoldButton, { label: label, icon: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', onClick: onToggle }));
|
|
33
33
|
};
|
|
34
34
|
//# sourceMappingURL=RollupItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RollupItem.js","sourceRoot":"","sources":["../../../src/components/RollupItem/RollupItem.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uEAAoE;
|
|
1
|
+
{"version":3,"file":"RollupItem.js","sourceRoot":"","sources":["../../../src/components/RollupItem/RollupItem.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uEAAoE;AAGpE,4DAAyD;AACzD,+EAA4E;AAC5E,6DAA0D;AAE1D,2EAAwE;AAExE,6CAA0C;AAC1C,+DAA4D;AAC5D,mEAAgE;AAChE,+CAA4C;AAE5C,yDAAsD;AAOzC,QAAA,UAAU,GAA8B,IAAA,aAAG,EACtD,CAAC,EACC,SAAS,GAAG,EAAE,EACd,UAAU,EACV,iBAAiB,GAAG,IAAI,EACxB,KAAK,GAAG,YAAY,EACpB,SAAS,EACT,kBAAkB,EAClB,iBAAiB,GAAG,WAAW,EAC/B,GAAG,IAAI,EACR,EAAE,EAAE,CAAC,CACJ,uBAAC,2BAAY,IACX,SAAS,EAAE,IAAA,aAAK,EAAC,QAAQ,EAAE,mCAAgB,EAAE,SAAS,CAAC,EACvD,cAAc,EAAC,KAAK,EACpB,GAAG,EAAC,KAAK,EACT,OAAO,EAAC,aAAa,KACjB,IAAI,YAER,uBAAC,mBAAQ,IACP,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,UAAU,EAC7B,qBAAqB,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CACzC,uBAAC,iCAAe,IACd,SAAS,EAAE,IAAA,aAAK,EAAC,QAAQ,EAAE,6CAAqB,CAAC,EACjD,UAAU,EAAE,UAAU,YAErB,IAAA,+BAAc,EAAC;gBACd,GAAG,IAAI;gBACP,UAAU,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;aACpD,CAAC,GACc,CACnB,EACD,gBAAgB,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,CAC7C,gBAAgB,CAAC;YACf,iBAAiB;YACjB,KAAK;YACL,SAAS;YACT,kBAAkB;YAClB,UAAU;YACV,QAAQ;SACT,CAAC,GAEJ,GACW,CAChB,CACF,CAAC;AAEF,kBAAU,CAAC,aAAa,GAAG;IACzB,OAAO,EAAE,CAAC,YAAY,CAAC;CACxB,CAAC;AAUF,MAAM,gBAAgB,GAAG,CAAC,EACxB,iBAAiB,EACjB,KAAK,EAAE,YAAY,EACnB,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,QAAQ,GACQ,EAAE,EAAE;IACpB,MAAM,KAAK,GAAG,YAAY,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IACrE,MAAM,IAAI,GAAG,IAAA,yBAAW,EAAC,UAAU,CAAC,CAAC;IAErC,OAAO,iBAAiB,KAAK,WAAW,CAAC,CAAC,CAAC,CACzC,uBAAC,yCAAmB,IAClB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,CACF,uBAAC,qCAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,EAClD,OAAO,EAAE,QAAQ,GACjB,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { type LabelProps } from '../../model/HeadlineType';
|
|
2
2
|
import { type UniBlockContent } from '../../model/JSXBlock';
|
|
3
|
+
/**
|
|
4
|
+
* @title Вид кнопки сворачивания
|
|
5
|
+
* @enumNames ["Основная", "Аккордион"]
|
|
6
|
+
*/
|
|
7
|
+
export declare type FoldButtonVersion = 'default' | 'accordion';
|
|
3
8
|
/**
|
|
4
9
|
* @title Сворачивающаяся секция
|
|
5
10
|
*/
|
|
@@ -8,4 +13,5 @@ export declare type RollupItemContent = UniBlockContent & LabelProps & {
|
|
|
8
13
|
isExpanded?: boolean;
|
|
9
14
|
/** @title Кнопка сверху */
|
|
10
15
|
isFoldButtonOnTop?: boolean;
|
|
16
|
+
foldButtonVersion?: FoldButtonVersion;
|
|
11
17
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IconName } from '../../icons/IconName';
|
|
2
|
+
import { type Picture } from '../../model/Picture';
|
|
3
|
+
import { type IconBgVersion } from '../../ui-kit/Icon/IconProps';
|
|
4
|
+
interface RollupButtonProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
labelIcon?: Picture;
|
|
7
|
+
labelIconBgVersion?: IconBgVersion;
|
|
8
|
+
icon?: IconName;
|
|
9
|
+
onToggle?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const AccordionFoldButton: import("@redneckz/uni-jsx").UNIComponent<RollupButtonProps, any, any>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { Icon } from '../../ui-kit/Icon/Icon.js';
|
|
4
|
+
import { Text } from '../../ui-kit/Text/Text.js';
|
|
5
|
+
import { TextWithIcon } from '../../ui-kit/TextWithIcon/TextWithIcon.js';
|
|
6
|
+
import { style } from '../../utils/style.js';
|
|
7
|
+
import { renderRoundedIcon } from './renderRoundedIcon.js';
|
|
8
|
+
import { rollupIconVersion } from './rollupIconVersion.js';
|
|
9
|
+
export const AccordionFoldButton = JSX(({ label, labelIconBgVersion, icon, onToggle, labelIcon }) => (_jsx(TextWithIcon, { tag: "button", className: style('border-none bg-transparent items-center group/button', labelIcon?.icon ? 'py-xs' : 'py-lg'), onClick: onToggle, textNode: _jsxs("div", { className: "flex items-center text-start group-hover/button:text-primary-main gap-s", children: [renderRoundedIcon(labelIcon, labelIconBgVersion), label ? (_jsx(Text, { size: "text-h6", font: "font-normal", children: label })) : null] }), iconNode: icon ? _jsx(Icon, { name: icon, iconVersion: rollupIconVersion, width: "24", height: "24" }) : null })));
|
|
10
|
+
//# sourceMappingURL=AccordionFoldButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionFoldButton.js","sourceRoot":"","sources":["../../../src/components/RollupItem/AccordionFoldButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAUxD,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CACpC,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAC5D,KAAC,YAAY,IACX,GAAG,EAAC,QAAQ,EACZ,SAAS,EAAE,KAAK,CACd,sDAAsD,EACtD,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CACpC,EACD,OAAO,EAAE,QAAQ,EACjB,QAAQ,EACN,eAAK,SAAS,EAAC,yEAAyE,aACrF,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,CAAC,EAChD,KAAK,CAAC,CAAC,CAAC,CACP,KAAC,IAAI,IAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,aAAa,YACpC,KAAK,GACD,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,EAER,QAAQ,EACN,IAAI,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,GAE3F,CACH,CACF,CAAC"}
|
|
@@ -6,15 +6,15 @@ import { DefaultFoldButton } from '../../ui-kit/Foldable/DefaultFoldButton.js';
|
|
|
6
6
|
import { Foldable } from '../../ui-kit/Foldable/Foldable.js';
|
|
7
7
|
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection.js';
|
|
8
8
|
import { style } from '../../utils/style.js';
|
|
9
|
+
import { AccordionFoldButton } from './AccordionFoldButton.js';
|
|
9
10
|
import { foldableSectionStyles } from './foldableSectionStyles.js';
|
|
10
11
|
import { getIconName } from './getIconName.js';
|
|
11
|
-
import { PrimaryFoldButton } from './PrimaryFoldButton.js';
|
|
12
12
|
import { rollupItemStyles } from './rollupItemStyles.js';
|
|
13
|
-
export const RollupItem = JSX(({ className = '', isExpanded, isFoldButtonOnTop = true, label = 'Развернуть', labelIcon, labelIconBgVersion,
|
|
13
|
+
export const RollupItem = JSX(({ className = '', isExpanded, isFoldButtonOnTop = true, label = 'Развернуть', labelIcon, labelIconBgVersion, foldButtonVersion = 'accordion', ...rest }) => (_jsx(BlockWrapper, { className: style('w-full', rollupItemStyles, className), defaultPadding: "p-0", tag: "div", version: "transparent", ...rest, children: _jsx(Foldable, { isFoldButtonOnTop: isFoldButtonOnTop, unfoldedByDefault: isExpanded, renderFoldableSection: ({ isUnfolded }) => (_jsx(FoldableSection, { className: style('gap-lg', foldableSectionStyles), isUnfolded: isUnfolded, children: renderChildren({
|
|
14
14
|
...rest,
|
|
15
15
|
extraProps: { className: 'w-full', padding: 'p-0' },
|
|
16
16
|
}) })), renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton({
|
|
17
|
-
|
|
17
|
+
foldButtonVersion,
|
|
18
18
|
label,
|
|
19
19
|
labelIcon,
|
|
20
20
|
labelIconBgVersion,
|
|
@@ -24,9 +24,9 @@ export const RollupItem = JSX(({ className = '', isExpanded, isFoldButtonOnTop =
|
|
|
24
24
|
RollupItem.childrenTypes = {
|
|
25
25
|
exclude: ['RollupItem'],
|
|
26
26
|
};
|
|
27
|
-
const renderFoldButton = ({
|
|
27
|
+
const renderFoldButton = ({ foldButtonVersion, label: defaultLabel, labelIcon, labelIconBgVersion, isUnfolded, onToggle, }) => {
|
|
28
28
|
const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
|
|
29
29
|
const icon = getIconName(isUnfolded);
|
|
30
|
-
return
|
|
30
|
+
return foldButtonVersion === 'accordion' ? (_jsx(AccordionFoldButton, { label: label, labelIcon: labelIcon, labelIconBgVersion: labelIconBgVersion, icon: icon, onToggle: onToggle })) : (_jsx(DefaultFoldButton, { label: label, icon: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', onClick: onToggle }));
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=RollupItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RollupItem.js","sourceRoot":"","sources":["../../../src/components/RollupItem/RollupItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"RollupItem.js","sourceRoot":"","sources":["../../../src/components/RollupItem/RollupItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGpE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAOtD,MAAM,CAAC,MAAM,UAAU,GAA8B,GAAG,CACtD,CAAC,EACC,SAAS,GAAG,EAAE,EACd,UAAU,EACV,iBAAiB,GAAG,IAAI,EACxB,KAAK,GAAG,YAAY,EACpB,SAAS,EACT,kBAAkB,EAClB,iBAAiB,GAAG,WAAW,EAC/B,GAAG,IAAI,EACR,EAAE,EAAE,CAAC,CACJ,KAAC,YAAY,IACX,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE,gBAAgB,EAAE,SAAS,CAAC,EACvD,cAAc,EAAC,KAAK,EACpB,GAAG,EAAC,KAAK,EACT,OAAO,EAAC,aAAa,KACjB,IAAI,YAER,KAAC,QAAQ,IACP,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,UAAU,EAC7B,qBAAqB,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CACzC,KAAC,eAAe,IACd,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE,qBAAqB,CAAC,EACjD,UAAU,EAAE,UAAU,YAErB,cAAc,CAAC;gBACd,GAAG,IAAI;gBACP,UAAU,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;aACpD,CAAC,GACc,CACnB,EACD,gBAAgB,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,CAC7C,gBAAgB,CAAC;YACf,iBAAiB;YACjB,KAAK;YACL,SAAS;YACT,kBAAkB;YAClB,UAAU;YACV,QAAQ;SACT,CAAC,GAEJ,GACW,CAChB,CACF,CAAC;AAEF,UAAU,CAAC,aAAa,GAAG;IACzB,OAAO,EAAE,CAAC,YAAY,CAAC;CACxB,CAAC;AAUF,MAAM,gBAAgB,GAAG,CAAC,EACxB,iBAAiB,EACjB,KAAK,EAAE,YAAY,EACnB,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,QAAQ,GACQ,EAAE,EAAE;IACpB,MAAM,KAAK,GAAG,YAAY,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IACrE,MAAM,IAAI,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IAErC,OAAO,iBAAiB,KAAK,WAAW,CAAC,CAAC,CAAC,CACzC,KAAC,mBAAmB,IAClB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,CACF,KAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,EAClD,OAAO,EAAE,QAAQ,GACjB,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { type LabelProps } from '../../model/HeadlineType';
|
|
2
2
|
import { type UniBlockContent } from '../../model/JSXBlock';
|
|
3
|
+
/**
|
|
4
|
+
* @title Вид кнопки сворачивания
|
|
5
|
+
* @enumNames ["Основная", "Аккордион"]
|
|
6
|
+
*/
|
|
7
|
+
export declare type FoldButtonVersion = 'default' | 'accordion';
|
|
3
8
|
/**
|
|
4
9
|
* @title Сворачивающаяся секция
|
|
5
10
|
*/
|
|
@@ -8,4 +13,5 @@ export declare type RollupItemContent = UniBlockContent & LabelProps & {
|
|
|
8
13
|
isExpanded?: boolean;
|
|
9
14
|
/** @title Кнопка сверху */
|
|
10
15
|
isFoldButtonOnTop?: boolean;
|
|
16
|
+
foldButtonVersion?: FoldButtonVersion;
|
|
11
17
|
};
|
|
@@ -9,7 +9,7 @@ import { style } from '../../utils/style';
|
|
|
9
9
|
import { renderRoundedIcon } from './renderRoundedIcon';
|
|
10
10
|
import { rollupIconVersion } from './rollupIconVersion';
|
|
11
11
|
|
|
12
|
-
interface
|
|
12
|
+
interface RollupButtonProps {
|
|
13
13
|
label?: string;
|
|
14
14
|
labelIcon?: Picture;
|
|
15
15
|
labelIconBgVersion?: IconBgVersion;
|
|
@@ -17,7 +17,7 @@ interface PrimaryFoldButtonProps {
|
|
|
17
17
|
onToggle?: () => void;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export const
|
|
20
|
+
export const AccordionFoldButton = JSX<RollupButtonProps>(
|
|
21
21
|
({ label, labelIconBgVersion, icon, onToggle, labelIcon }) => (
|
|
22
22
|
<TextWithIcon
|
|
23
23
|
tag="button"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { renderChildren } from '../../BlockRenderer/renderChildren';
|
|
3
|
-
import { type BlockVersion } from '../../model/BlockVersion';
|
|
4
3
|
import { type JSXBlock, type UniBlockProps } from '../../model/JSXBlock';
|
|
5
4
|
import { type Picture } from '../../model/Picture';
|
|
6
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
@@ -10,10 +9,10 @@ import { type FoldablePartProps } from '../../ui-kit/Foldable/FoldablePartProps'
|
|
|
10
9
|
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
|
|
11
10
|
import { type IconBgVersion, type IconProps } from '../../ui-kit/Icon/IconProps';
|
|
12
11
|
import { style } from '../../utils/style';
|
|
12
|
+
import { AccordionFoldButton } from './AccordionFoldButton';
|
|
13
13
|
import { foldableSectionStyles } from './foldableSectionStyles';
|
|
14
14
|
import { getIconName } from './getIconName';
|
|
15
|
-
import {
|
|
16
|
-
import { type RollupItemContent } from './RollupItemContent';
|
|
15
|
+
import { type FoldButtonVersion, type RollupItemContent } from './RollupItemContent';
|
|
17
16
|
import { rollupItemStyles } from './rollupItemStyles';
|
|
18
17
|
|
|
19
18
|
interface RollupItemProps extends RollupItemContent, UniBlockProps {
|
|
@@ -29,7 +28,7 @@ export const RollupItem: JSXBlock<RollupItemProps> = JSX<RollupItemProps>(
|
|
|
29
28
|
label = 'Развернуть',
|
|
30
29
|
labelIcon,
|
|
31
30
|
labelIconBgVersion,
|
|
32
|
-
|
|
31
|
+
foldButtonVersion = 'accordion',
|
|
33
32
|
...rest
|
|
34
33
|
}) => (
|
|
35
34
|
<BlockWrapper
|
|
@@ -55,7 +54,7 @@ export const RollupItem: JSXBlock<RollupItemProps> = JSX<RollupItemProps>(
|
|
|
55
54
|
)}
|
|
56
55
|
renderFoldButton={({ isUnfolded, onToggle }) =>
|
|
57
56
|
renderFoldButton({
|
|
58
|
-
|
|
57
|
+
foldButtonVersion,
|
|
59
58
|
label,
|
|
60
59
|
labelIcon,
|
|
61
60
|
labelIconBgVersion,
|
|
@@ -73,7 +72,7 @@ RollupItem.childrenTypes = {
|
|
|
73
72
|
};
|
|
74
73
|
|
|
75
74
|
interface FoldButtonProps extends FoldablePartProps {
|
|
76
|
-
|
|
75
|
+
foldButtonVersion?: FoldButtonVersion;
|
|
77
76
|
label?: string;
|
|
78
77
|
labelIcon?: IconProps;
|
|
79
78
|
labelIconBgVersion?: IconBgVersion;
|
|
@@ -81,7 +80,7 @@ interface FoldButtonProps extends FoldablePartProps {
|
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
const renderFoldButton = ({
|
|
84
|
-
|
|
83
|
+
foldButtonVersion,
|
|
85
84
|
label: defaultLabel,
|
|
86
85
|
labelIcon,
|
|
87
86
|
labelIconBgVersion,
|
|
@@ -91,8 +90,8 @@ const renderFoldButton = ({
|
|
|
91
90
|
const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
|
|
92
91
|
const icon = getIconName(isUnfolded);
|
|
93
92
|
|
|
94
|
-
return
|
|
95
|
-
<
|
|
93
|
+
return foldButtonVersion === 'accordion' ? (
|
|
94
|
+
<AccordionFoldButton
|
|
96
95
|
label={label}
|
|
97
96
|
labelIcon={labelIcon}
|
|
98
97
|
labelIconBgVersion={labelIconBgVersion}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { type LabelProps } from '../../model/HeadlineType';
|
|
2
2
|
import { type UniBlockContent } from '../../model/JSXBlock';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @title Вид кнопки сворачивания
|
|
6
|
+
* @enumNames ["Основная", "Аккордион"]
|
|
7
|
+
*/
|
|
8
|
+
export type FoldButtonVersion = 'default' | 'accordion';
|
|
9
|
+
|
|
4
10
|
/**
|
|
5
11
|
* @title Сворачивающаяся секция
|
|
6
12
|
*/
|
|
@@ -10,4 +16,5 @@ export type RollupItemContent = UniBlockContent &
|
|
|
10
16
|
isExpanded?: boolean;
|
|
11
17
|
/** @title Кнопка сверху */
|
|
12
18
|
isFoldButtonOnTop?: boolean;
|
|
19
|
+
foldButtonVersion?: FoldButtonVersion;
|
|
13
20
|
};
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ import { style } from '../../utils/style';
|
|
|
9
9
|
import { renderRoundedIcon } from './renderRoundedIcon';
|
|
10
10
|
import { rollupIconVersion } from './rollupIconVersion';
|
|
11
11
|
|
|
12
|
-
interface
|
|
12
|
+
interface RollupButtonProps {
|
|
13
13
|
label?: string;
|
|
14
14
|
labelIcon?: Picture;
|
|
15
15
|
labelIconBgVersion?: IconBgVersion;
|
|
@@ -17,7 +17,7 @@ interface PrimaryFoldButtonProps {
|
|
|
17
17
|
onToggle?: () => void;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export const
|
|
20
|
+
export const AccordionFoldButton = JSX<RollupButtonProps>(
|
|
21
21
|
({ label, labelIconBgVersion, icon, onToggle, labelIcon }) => (
|
|
22
22
|
<TextWithIcon
|
|
23
23
|
tag="button"
|
|
@@ -13,7 +13,9 @@ export default {
|
|
|
13
13
|
default: (
|
|
14
14
|
<RollupItem
|
|
15
15
|
label="Rollup button 1"
|
|
16
|
-
|
|
16
|
+
foldButtonVersion="default"
|
|
17
|
+
isFoldButtonOnTop={false}
|
|
18
|
+
isExpanded={false}
|
|
17
19
|
block={{
|
|
18
20
|
type: 'RollupItem',
|
|
19
21
|
blocks: [
|
|
@@ -24,11 +26,9 @@ export default {
|
|
|
24
26
|
options={options}
|
|
25
27
|
/>
|
|
26
28
|
),
|
|
27
|
-
|
|
29
|
+
accordion: (
|
|
28
30
|
<RollupItem
|
|
29
31
|
label="Rollup button 2"
|
|
30
|
-
version="secondary"
|
|
31
|
-
isFoldButtonOnTop={false}
|
|
32
32
|
isExpanded={true}
|
|
33
33
|
block={{
|
|
34
34
|
type: 'RollupItem',
|
|
@@ -40,10 +40,10 @@ export default {
|
|
|
40
40
|
options={options}
|
|
41
41
|
/>
|
|
42
42
|
),
|
|
43
|
-
'
|
|
43
|
+
'default-open': (
|
|
44
44
|
<RollupItem
|
|
45
|
-
version="secondary"
|
|
46
45
|
label="Rollup button 2"
|
|
46
|
+
foldButtonVersion="default"
|
|
47
47
|
isExpanded={true}
|
|
48
48
|
block={{
|
|
49
49
|
type: 'RollupItem',
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { renderChildren } from '../../BlockRenderer/renderChildren';
|
|
3
|
-
import { type BlockVersion } from '../../model/BlockVersion';
|
|
4
3
|
import { type JSXBlock, type UniBlockProps } from '../../model/JSXBlock';
|
|
5
4
|
import { type Picture } from '../../model/Picture';
|
|
6
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
@@ -10,10 +9,10 @@ import { type FoldablePartProps } from '../../ui-kit/Foldable/FoldablePartProps'
|
|
|
10
9
|
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
|
|
11
10
|
import { type IconBgVersion, type IconProps } from '../../ui-kit/Icon/IconProps';
|
|
12
11
|
import { style } from '../../utils/style';
|
|
12
|
+
import { AccordionFoldButton } from './AccordionFoldButton';
|
|
13
13
|
import { foldableSectionStyles } from './foldableSectionStyles';
|
|
14
14
|
import { getIconName } from './getIconName';
|
|
15
|
-
import {
|
|
16
|
-
import { type RollupItemContent } from './RollupItemContent';
|
|
15
|
+
import { type FoldButtonVersion, type RollupItemContent } from './RollupItemContent';
|
|
17
16
|
import { rollupItemStyles } from './rollupItemStyles';
|
|
18
17
|
|
|
19
18
|
interface RollupItemProps extends RollupItemContent, UniBlockProps {
|
|
@@ -29,7 +28,7 @@ export const RollupItem: JSXBlock<RollupItemProps> = JSX<RollupItemProps>(
|
|
|
29
28
|
label = 'Развернуть',
|
|
30
29
|
labelIcon,
|
|
31
30
|
labelIconBgVersion,
|
|
32
|
-
|
|
31
|
+
foldButtonVersion = 'accordion',
|
|
33
32
|
...rest
|
|
34
33
|
}) => (
|
|
35
34
|
<BlockWrapper
|
|
@@ -55,7 +54,7 @@ export const RollupItem: JSXBlock<RollupItemProps> = JSX<RollupItemProps>(
|
|
|
55
54
|
)}
|
|
56
55
|
renderFoldButton={({ isUnfolded, onToggle }) =>
|
|
57
56
|
renderFoldButton({
|
|
58
|
-
|
|
57
|
+
foldButtonVersion,
|
|
59
58
|
label,
|
|
60
59
|
labelIcon,
|
|
61
60
|
labelIconBgVersion,
|
|
@@ -73,7 +72,7 @@ RollupItem.childrenTypes = {
|
|
|
73
72
|
};
|
|
74
73
|
|
|
75
74
|
interface FoldButtonProps extends FoldablePartProps {
|
|
76
|
-
|
|
75
|
+
foldButtonVersion?: FoldButtonVersion;
|
|
77
76
|
label?: string;
|
|
78
77
|
labelIcon?: IconProps;
|
|
79
78
|
labelIconBgVersion?: IconBgVersion;
|
|
@@ -81,7 +80,7 @@ interface FoldButtonProps extends FoldablePartProps {
|
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
const renderFoldButton = ({
|
|
84
|
-
|
|
83
|
+
foldButtonVersion,
|
|
85
84
|
label: defaultLabel,
|
|
86
85
|
labelIcon,
|
|
87
86
|
labelIconBgVersion,
|
|
@@ -91,8 +90,8 @@ const renderFoldButton = ({
|
|
|
91
90
|
const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
|
|
92
91
|
const icon = getIconName(isUnfolded);
|
|
93
92
|
|
|
94
|
-
return
|
|
95
|
-
<
|
|
93
|
+
return foldButtonVersion === 'accordion' ? (
|
|
94
|
+
<AccordionFoldButton
|
|
96
95
|
label={label}
|
|
97
96
|
labelIcon={labelIcon}
|
|
98
97
|
labelIconBgVersion={labelIconBgVersion}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { type LabelProps } from '../../model/HeadlineType';
|
|
2
2
|
import { type UniBlockContent } from '../../model/JSXBlock';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @title Вид кнопки сворачивания
|
|
6
|
+
* @enumNames ["Основная", "Аккордион"]
|
|
7
|
+
*/
|
|
8
|
+
export type FoldButtonVersion = 'default' | 'accordion';
|
|
9
|
+
|
|
4
10
|
/**
|
|
5
11
|
* @title Сворачивающаяся секция
|
|
6
12
|
*/
|
|
@@ -10,4 +16,5 @@ export type RollupItemContent = UniBlockContent &
|
|
|
10
16
|
isExpanded?: boolean;
|
|
11
17
|
/** @title Кнопка сверху */
|
|
12
18
|
isFoldButtonOnTop?: boolean;
|
|
19
|
+
foldButtonVersion?: FoldButtonVersion;
|
|
13
20
|
};
|
|
@@ -137,19 +137,23 @@ export default {
|
|
|
137
137
|
/>
|
|
138
138
|
</div>
|
|
139
139
|
),
|
|
140
|
+
|
|
140
141
|
rollup: (
|
|
141
142
|
<div className="container grid grid-cols-12">
|
|
142
143
|
<VerticalLayout
|
|
144
|
+
gap="XS"
|
|
145
|
+
version="transparent"
|
|
143
146
|
className="col-span-12"
|
|
144
|
-
version="primary"
|
|
145
|
-
isPadding={true}
|
|
146
147
|
block={{
|
|
147
148
|
type: 'VerticalLayout',
|
|
148
149
|
blocks: [
|
|
149
150
|
{
|
|
150
151
|
type: 'RollupItem',
|
|
151
152
|
content: {
|
|
152
|
-
label: 'Rollup button 1',
|
|
153
|
+
label: 'Rollup button 1 with TEXT_BLOCK',
|
|
154
|
+
foldButtonVersion: 'default',
|
|
155
|
+
isFoldButtonOnTop: false,
|
|
156
|
+
isExpanded: true,
|
|
153
157
|
},
|
|
154
158
|
blocks: [
|
|
155
159
|
{ type: 'TextBlock', content: TEXT_BLOCK },
|
|
@@ -159,22 +163,14 @@ export default {
|
|
|
159
163
|
{
|
|
160
164
|
type: 'RollupItem',
|
|
161
165
|
content: {
|
|
162
|
-
label: 'Rollup button 2',
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
blocks: [{ type: 'LinkDocs', content: linkDocsExample }],
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
type: 'RollupItem',
|
|
169
|
-
content: {
|
|
170
|
-
label: 'Rollup button 3 RichText',
|
|
166
|
+
label: 'Rollup button 2 with TEXT_BLOCK',
|
|
167
|
+
foldButtonVersion: 'default',
|
|
168
|
+
isFoldButtonOnTop: false,
|
|
171
169
|
isExpanded: true,
|
|
172
170
|
},
|
|
173
171
|
blocks: [
|
|
174
|
-
{
|
|
175
|
-
|
|
176
|
-
content: RICH_TEXT_SEPARATOR,
|
|
177
|
-
},
|
|
172
|
+
{ type: 'TextBlock', content: TEXT_BLOCK },
|
|
173
|
+
{ type: 'TextBlock', content: TEXT_BLOCK },
|
|
178
174
|
],
|
|
179
175
|
},
|
|
180
176
|
],
|
|
@@ -183,22 +179,19 @@ export default {
|
|
|
183
179
|
/>
|
|
184
180
|
</div>
|
|
185
181
|
),
|
|
186
|
-
'rollup
|
|
182
|
+
'rollup accordion': (
|
|
187
183
|
<div className="container grid grid-cols-12">
|
|
188
184
|
<VerticalLayout
|
|
189
|
-
gap="XS"
|
|
190
|
-
version="transparent"
|
|
191
185
|
className="col-span-12"
|
|
186
|
+
version="primary"
|
|
187
|
+
isPadding={true}
|
|
192
188
|
block={{
|
|
193
189
|
type: 'VerticalLayout',
|
|
194
190
|
blocks: [
|
|
195
191
|
{
|
|
196
192
|
type: 'RollupItem',
|
|
197
193
|
content: {
|
|
198
|
-
label: 'Rollup button 1
|
|
199
|
-
version: 'secondary',
|
|
200
|
-
isFoldButtonOnTop: false,
|
|
201
|
-
isExpanded: true,
|
|
194
|
+
label: 'Rollup button 1',
|
|
202
195
|
},
|
|
203
196
|
blocks: [
|
|
204
197
|
{ type: 'TextBlock', content: TEXT_BLOCK },
|
|
@@ -208,14 +201,22 @@ export default {
|
|
|
208
201
|
{
|
|
209
202
|
type: 'RollupItem',
|
|
210
203
|
content: {
|
|
211
|
-
label: 'Rollup button 2
|
|
212
|
-
|
|
213
|
-
|
|
204
|
+
label: 'Rollup button 2',
|
|
205
|
+
isExpanded: true,
|
|
206
|
+
},
|
|
207
|
+
blocks: [{ type: 'LinkDocs', content: linkDocsExample }],
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
type: 'RollupItem',
|
|
211
|
+
content: {
|
|
212
|
+
label: 'Rollup button 3 RichText',
|
|
214
213
|
isExpanded: true,
|
|
215
214
|
},
|
|
216
215
|
blocks: [
|
|
217
|
-
{
|
|
218
|
-
|
|
216
|
+
{
|
|
217
|
+
type: 'RichTextBlock',
|
|
218
|
+
content: RICH_TEXT_SEPARATOR,
|
|
219
|
+
},
|
|
219
220
|
],
|
|
220
221
|
},
|
|
221
222
|
],
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.PrimaryFoldButton = void 0;
|
|
3
|
-
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
-
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
-
const Icon_1 = require("../../ui-kit/Icon/Icon");
|
|
6
|
-
const Text_1 = require("../../ui-kit/Text/Text");
|
|
7
|
-
const TextWithIcon_1 = require("../../ui-kit/TextWithIcon/TextWithIcon");
|
|
8
|
-
const style_1 = require("../../utils/style");
|
|
9
|
-
const renderRoundedIcon_1 = require("./renderRoundedIcon");
|
|
10
|
-
const rollupIconVersion_1 = require("./rollupIconVersion");
|
|
11
|
-
exports.PrimaryFoldButton = (0, uni_jsx_1.JSX)(({ label, labelIconBgVersion, icon, onToggle, labelIcon }) => ((0, jsx_runtime_1.jsx)(TextWithIcon_1.TextWithIcon, { tag: "button", className: (0, style_1.style)('border-none bg-transparent items-center group/button', labelIcon?.icon ? 'py-xs' : 'py-lg'), onClick: onToggle, textNode: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center text-start group-hover/button:text-primary-main gap-s", children: [(0, renderRoundedIcon_1.renderRoundedIcon)(labelIcon, labelIconBgVersion), label ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { size: "text-h6", font: "font-normal", children: label })) : null] }), iconNode: icon ? (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon, iconVersion: rollupIconVersion_1.rollupIconVersion, width: "24", height: "24" }) : null })));
|
|
12
|
-
//# sourceMappingURL=PrimaryFoldButton.js.map
|