@cloud-ru/uikit-product-widget 0.9.4
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/CHANGELOG.md +998 -0
- package/LICENSE +201 -0
- package/README.md +8 -0
- package/dist/cjs/components/ProductsWidget/ProductsWidget.d.ts +10 -0
- package/dist/cjs/components/ProductsWidget/ProductsWidget.js +36 -0
- package/dist/cjs/components/ProductsWidget/constants.d.ts +4 -0
- package/dist/cjs/components/ProductsWidget/constants.js +7 -0
- package/dist/cjs/components/ProductsWidget/index.d.ts +1 -0
- package/dist/cjs/components/ProductsWidget/index.js +17 -0
- package/dist/cjs/components/ProductsWidget/styles.module.css +45 -0
- package/dist/cjs/components/ProductsWidget/utils/getLoadingCards.d.ts +6 -0
- package/dist/cjs/components/ProductsWidget/utils/getLoadingCards.js +17 -0
- package/dist/cjs/components/ProductsWidget/utils/getProductColumns.d.ts +8 -0
- package/dist/cjs/components/ProductsWidget/utils/getProductColumns.js +19 -0
- package/dist/cjs/components/SolutionsWidget/SolutionsWidget.d.ts +8 -0
- package/dist/cjs/components/SolutionsWidget/SolutionsWidget.js +30 -0
- package/dist/cjs/components/SolutionsWidget/index.d.ts +1 -0
- package/dist/cjs/components/SolutionsWidget/index.js +17 -0
- package/dist/cjs/components/SolutionsWidget/styles.module.css +28 -0
- package/dist/cjs/components/Widget/Widget.d.ts +2 -0
- package/dist/cjs/components/Widget/Widget.js +101 -0
- package/dist/cjs/components/Widget/index.d.ts +2 -0
- package/dist/cjs/components/Widget/index.js +18 -0
- package/dist/cjs/components/Widget/styles.module.css +56 -0
- package/dist/cjs/components/Widget/types.d.ts +27 -0
- package/dist/cjs/components/Widget/types.js +2 -0
- package/dist/cjs/components/index.d.ts +3 -0
- package/dist/cjs/components/index.js +19 -0
- package/dist/cjs/helperComponents/Actions/ActionView.d.ts +10 -0
- package/dist/cjs/helperComponents/Actions/ActionView.js +49 -0
- package/dist/cjs/helperComponents/Actions/DesktopActions.d.ts +2 -0
- package/dist/cjs/helperComponents/Actions/DesktopActions.js +19 -0
- package/dist/cjs/helperComponents/Actions/MobileActions.d.ts +2 -0
- package/dist/cjs/helperComponents/Actions/MobileActions.js +70 -0
- package/dist/cjs/helperComponents/Actions/constants.d.ts +9 -0
- package/dist/cjs/helperComponents/Actions/constants.js +12 -0
- package/dist/cjs/helperComponents/Actions/helpers.d.ts +2 -0
- package/dist/cjs/helperComponents/Actions/helpers.js +6 -0
- package/dist/cjs/helperComponents/Actions/index.d.ts +3 -0
- package/dist/cjs/helperComponents/Actions/index.js +19 -0
- package/dist/cjs/helperComponents/Actions/styles.module.css +35 -0
- package/dist/cjs/helperComponents/Actions/types.d.ts +30 -0
- package/dist/cjs/helperComponents/Actions/types.js +2 -0
- package/dist/cjs/helperComponents/ButtonDropdown/ButtonDropdown.d.ts +8 -0
- package/dist/cjs/helperComponents/ButtonDropdown/ButtonDropdown.js +13 -0
- package/dist/cjs/helperComponents/ButtonDropdown/index.d.ts +1 -0
- package/dist/cjs/helperComponents/ButtonDropdown/index.js +17 -0
- package/dist/cjs/helperComponents/ButtonDroplist/ButtonDroplist.d.ts +12 -0
- package/dist/cjs/helperComponents/ButtonDroplist/ButtonDroplist.js +21 -0
- package/dist/cjs/helperComponents/ButtonDroplist/index.d.ts +1 -0
- package/dist/cjs/helperComponents/ButtonDroplist/index.js +17 -0
- package/dist/cjs/helperComponents/ButtonKebab/ButtonKebab.d.ts +8 -0
- package/dist/cjs/helperComponents/ButtonKebab/ButtonKebab.js +15 -0
- package/dist/cjs/helperComponents/ButtonKebab/index.d.ts +1 -0
- package/dist/cjs/helperComponents/ButtonKebab/index.js +17 -0
- package/dist/cjs/helperComponents/index.d.ts +1 -0
- package/dist/cjs/helperComponents/index.js +17 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +17 -0
- package/dist/esm/components/ProductsWidget/ProductsWidget.d.ts +10 -0
- package/dist/esm/components/ProductsWidget/ProductsWidget.js +30 -0
- package/dist/esm/components/ProductsWidget/constants.d.ts +4 -0
- package/dist/esm/components/ProductsWidget/constants.js +4 -0
- package/dist/esm/components/ProductsWidget/index.d.ts +1 -0
- package/dist/esm/components/ProductsWidget/index.js +1 -0
- package/dist/esm/components/ProductsWidget/styles.module.css +45 -0
- package/dist/esm/components/ProductsWidget/utils/getLoadingCards.d.ts +6 -0
- package/dist/esm/components/ProductsWidget/utils/getLoadingCards.js +14 -0
- package/dist/esm/components/ProductsWidget/utils/getProductColumns.d.ts +8 -0
- package/dist/esm/components/ProductsWidget/utils/getProductColumns.js +16 -0
- package/dist/esm/components/SolutionsWidget/SolutionsWidget.d.ts +8 -0
- package/dist/esm/components/SolutionsWidget/SolutionsWidget.js +24 -0
- package/dist/esm/components/SolutionsWidget/index.d.ts +1 -0
- package/dist/esm/components/SolutionsWidget/index.js +1 -0
- package/dist/esm/components/SolutionsWidget/styles.module.css +28 -0
- package/dist/esm/components/Widget/Widget.d.ts +2 -0
- package/dist/esm/components/Widget/Widget.js +95 -0
- package/dist/esm/components/Widget/index.d.ts +2 -0
- package/dist/esm/components/Widget/index.js +2 -0
- package/dist/esm/components/Widget/styles.module.css +56 -0
- package/dist/esm/components/Widget/types.d.ts +27 -0
- package/dist/esm/components/Widget/types.js +1 -0
- package/dist/esm/components/index.d.ts +3 -0
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/helperComponents/Actions/ActionView.d.ts +10 -0
- package/dist/esm/helperComponents/Actions/ActionView.js +46 -0
- package/dist/esm/helperComponents/Actions/DesktopActions.d.ts +2 -0
- package/dist/esm/helperComponents/Actions/DesktopActions.js +13 -0
- package/dist/esm/helperComponents/Actions/MobileActions.d.ts +2 -0
- package/dist/esm/helperComponents/Actions/MobileActions.js +64 -0
- package/dist/esm/helperComponents/Actions/constants.d.ts +9 -0
- package/dist/esm/helperComponents/Actions/constants.js +9 -0
- package/dist/esm/helperComponents/Actions/helpers.d.ts +2 -0
- package/dist/esm/helperComponents/Actions/helpers.js +3 -0
- package/dist/esm/helperComponents/Actions/index.d.ts +3 -0
- package/dist/esm/helperComponents/Actions/index.js +3 -0
- package/dist/esm/helperComponents/Actions/styles.module.css +35 -0
- package/dist/esm/helperComponents/Actions/types.d.ts +30 -0
- package/dist/esm/helperComponents/Actions/types.js +1 -0
- package/dist/esm/helperComponents/ButtonDropdown/ButtonDropdown.d.ts +8 -0
- package/dist/esm/helperComponents/ButtonDropdown/ButtonDropdown.js +10 -0
- package/dist/esm/helperComponents/ButtonDropdown/index.d.ts +1 -0
- package/dist/esm/helperComponents/ButtonDropdown/index.js +1 -0
- package/dist/esm/helperComponents/ButtonDroplist/ButtonDroplist.d.ts +12 -0
- package/dist/esm/helperComponents/ButtonDroplist/ButtonDroplist.js +18 -0
- package/dist/esm/helperComponents/ButtonDroplist/index.d.ts +1 -0
- package/dist/esm/helperComponents/ButtonDroplist/index.js +1 -0
- package/dist/esm/helperComponents/ButtonKebab/ButtonKebab.d.ts +8 -0
- package/dist/esm/helperComponents/ButtonKebab/ButtonKebab.js +12 -0
- package/dist/esm/helperComponents/ButtonKebab/index.d.ts +1 -0
- package/dist/esm/helperComponents/ButtonKebab/index.js +1 -0
- package/dist/esm/helperComponents/index.d.ts +1 -0
- package/dist/esm/helperComponents/index.js +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/package.json +58 -0
- package/src/components/ProductsWidget/ProductsWidget.tsx +66 -0
- package/src/components/ProductsWidget/constants.ts +7 -0
- package/src/components/ProductsWidget/index.ts +1 -0
- package/src/components/ProductsWidget/styles.module.scss +40 -0
- package/src/components/ProductsWidget/utils/getLoadingCards.tsx +23 -0
- package/src/components/ProductsWidget/utils/getProductColumns.tsx +30 -0
- package/src/components/SolutionsWidget/SolutionsWidget.tsx +43 -0
- package/src/components/SolutionsWidget/index.ts +1 -0
- package/src/components/SolutionsWidget/styles.module.scss +31 -0
- package/src/components/Widget/Widget.tsx +173 -0
- package/src/components/Widget/index.ts +2 -0
- package/src/components/Widget/styles.module.scss +60 -0
- package/src/components/Widget/types.ts +39 -0
- package/src/components/index.ts +3 -0
- package/src/helperComponents/Actions/ActionView.tsx +67 -0
- package/src/helperComponents/Actions/DesktopActions.tsx +25 -0
- package/src/helperComponents/Actions/MobileActions.tsx +111 -0
- package/src/helperComponents/Actions/constants.ts +9 -0
- package/src/helperComponents/Actions/helpers.ts +5 -0
- package/src/helperComponents/Actions/index.ts +3 -0
- package/src/helperComponents/Actions/styles.module.scss +42 -0
- package/src/helperComponents/Actions/types.ts +33 -0
- package/src/helperComponents/ButtonDropdown/ButtonDropdown.tsx +22 -0
- package/src/helperComponents/ButtonDropdown/index.ts +1 -0
- package/src/helperComponents/ButtonDroplist/ButtonDroplist.tsx +46 -0
- package/src/helperComponents/ButtonDroplist/index.ts +1 -0
- package/src/helperComponents/ButtonKebab/ButtonKebab.tsx +31 -0
- package/src/helperComponents/ButtonKebab/index.ts +1 -0
- package/src/helperComponents/index.ts +1 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.widget{
|
|
2
|
+
box-sizing:border-box;
|
|
3
|
+
display:flex;
|
|
4
|
+
flex-direction:column;
|
|
5
|
+
gap:calc(var(--dimension-1m, 8px) + var(--dimension-050m, 4px));
|
|
6
|
+
background-color:var(--sys-neutral-background1-level, #fdfdfd);
|
|
7
|
+
border-radius:calc(var(--dimension-1m, 8px) + var(--dimension-050m, 4px));
|
|
8
|
+
padding:var(--dimension-2m, 16px);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.widgetHeader{
|
|
12
|
+
display:flex;
|
|
13
|
+
align-items:center;
|
|
14
|
+
justify-content:space-between;
|
|
15
|
+
gap:var(--dimension-1m, 8px);
|
|
16
|
+
min-width:0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.titleClickable{
|
|
20
|
+
flex:1;
|
|
21
|
+
min-width:0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.widgetContent{
|
|
25
|
+
color:var(--sys-neutral-text-main, #41424e);
|
|
26
|
+
min-height:0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.actionsWrapper{
|
|
30
|
+
flex-shrink:0;
|
|
31
|
+
display:flex;
|
|
32
|
+
align-items:center;
|
|
33
|
+
gap:var(--dimension-050m, 4px);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.actionsWide{
|
|
37
|
+
justify-content:flex-end;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.skeletonContent{
|
|
41
|
+
display:flex;
|
|
42
|
+
flex-direction:column;
|
|
43
|
+
gap:var(--dimension-050m, 4px);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.skeletonHeader{
|
|
47
|
+
flex:1;
|
|
48
|
+
min-width:0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.skeletonActions{
|
|
52
|
+
display:flex;
|
|
53
|
+
align-items:center;
|
|
54
|
+
gap:var(--dimension-1m, 8px);
|
|
55
|
+
width:100%;
|
|
56
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TitleClickableProps } from '@sbercloud/uikit-product-title-clickable';
|
|
3
|
+
import { WithLayoutType } from '@sbercloud/uikit-product-utils';
|
|
4
|
+
import type { InfoBlockProps } from '@snack-uikit/info-block';
|
|
5
|
+
import { WithSupportProps } from '@snack-uikit/utils';
|
|
6
|
+
import { Action } from '../../helperComponents/Actions/types';
|
|
7
|
+
export type WidgetState = 'default' | 'loading' | 'error';
|
|
8
|
+
export type WidgetHeaderProps = Pick<TitleClickableProps, 'title' | 'icon' | 'avatar' | 'href' | 'target' | 'onClick' | 'titleTag' | 'fullWidth' | 'children' | 'className'>;
|
|
9
|
+
export type WidgetLoadingStateProps = {
|
|
10
|
+
loadingContent?: ReactNode;
|
|
11
|
+
showSkeleton?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type WidgetErrorStateProps = {
|
|
14
|
+
errorTitle?: string;
|
|
15
|
+
errorDescription?: string;
|
|
16
|
+
errorIcon?: InfoBlockProps['icon'];
|
|
17
|
+
};
|
|
18
|
+
export type WidgetProps = WithLayoutType<WithSupportProps<{
|
|
19
|
+
header: WidgetHeaderProps;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
actions?: Action[];
|
|
22
|
+
wide?: boolean;
|
|
23
|
+
state?: WidgetState;
|
|
24
|
+
loadingState?: WidgetLoadingStateProps;
|
|
25
|
+
errorState?: WidgetErrorStateProps;
|
|
26
|
+
className?: string;
|
|
27
|
+
}>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ProductsWidget"), exports);
|
|
18
|
+
__exportStar(require("./SolutionsWidget"), exports);
|
|
19
|
+
__exportStar(require("./Widget"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { WithLayoutType } from '@sbercloud/uikit-product-utils';
|
|
3
|
+
import { Action } from './types';
|
|
4
|
+
export declare function ActionView({ variant, tooltip, hidden, layoutType, commonProps, ...buttonProps }: WithLayoutType<Action & {
|
|
5
|
+
commonProps: {
|
|
6
|
+
className?: string;
|
|
7
|
+
size?: 's' | 'm' | 'l';
|
|
8
|
+
fullWidth?: boolean;
|
|
9
|
+
};
|
|
10
|
+
}>): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.ActionView = ActionView;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const uikit_product_mobile_tooltip_1 = require("@sbercloud/uikit-product-mobile-tooltip");
|
|
17
|
+
const button_1 = require("@snack-uikit/button");
|
|
18
|
+
const ButtonDroplist_1 = require("../ButtonDroplist");
|
|
19
|
+
const ButtonKebab_1 = require("../ButtonKebab");
|
|
20
|
+
const constants_1 = require("./constants");
|
|
21
|
+
function ActionView(_a) {
|
|
22
|
+
var { variant, tooltip, hidden = false, layoutType, commonProps } = _a, buttonProps = __rest(_a, ["variant", "tooltip", "hidden", "layoutType", "commonProps"]);
|
|
23
|
+
if (hidden) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const addTooltip = (component) => tooltip ? ((0, jsx_runtime_1.jsx)(uikit_product_mobile_tooltip_1.AdaptiveTooltip, Object.assign({ layoutType: layoutType }, tooltip, { children: component }))) : (component);
|
|
27
|
+
switch (variant) {
|
|
28
|
+
case constants_1.BUTTON_TYPE.Filled:
|
|
29
|
+
return addTooltip((0, jsx_runtime_1.jsx)(button_1.ButtonFilled, Object.assign({}, buttonProps, commonProps)));
|
|
30
|
+
case constants_1.BUTTON_TYPE.Outline:
|
|
31
|
+
return addTooltip((0, jsx_runtime_1.jsx)(button_1.ButtonOutline, Object.assign({}, buttonProps, commonProps)));
|
|
32
|
+
case constants_1.BUTTON_TYPE.Tonal:
|
|
33
|
+
return addTooltip((0, jsx_runtime_1.jsx)(button_1.ButtonTonal, Object.assign({}, buttonProps, commonProps)));
|
|
34
|
+
case constants_1.BUTTON_TYPE.Function:
|
|
35
|
+
return addTooltip((0, jsx_runtime_1.jsx)(button_1.ButtonFunction, Object.assign({}, buttonProps, commonProps)));
|
|
36
|
+
case constants_1.BUTTON_TYPE.Simple:
|
|
37
|
+
return addTooltip((0, jsx_runtime_1.jsx)(button_1.ButtonSimple, Object.assign({}, buttonProps, commonProps)));
|
|
38
|
+
case constants_1.BUTTON_TYPE.Kebab: {
|
|
39
|
+
const { button, list } = buttonProps;
|
|
40
|
+
return addTooltip((0, jsx_runtime_1.jsx)(ButtonKebab_1.ButtonKebab, { button: Object.assign(Object.assign({}, button), commonProps), list: list, layoutType: layoutType }));
|
|
41
|
+
}
|
|
42
|
+
case constants_1.BUTTON_TYPE.Droplist: {
|
|
43
|
+
const { button, list } = buttonProps;
|
|
44
|
+
return addTooltip((0, jsx_runtime_1.jsx)(ButtonDroplist_1.ButtonDroplist, { button: Object.assign(Object.assign({}, button), commonProps), list: list, layoutType: layoutType }));
|
|
45
|
+
}
|
|
46
|
+
default:
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DesktopActions = DesktopActions;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const ActionView_1 = require("./ActionView");
|
|
10
|
+
const helpers_1 = require("./helpers");
|
|
11
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
12
|
+
function DesktopActions({ items }) {
|
|
13
|
+
if (!(0, helpers_1.hasVisibleActions)(items)) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.desktopActionsWrapper, children: items.map((action, index) => ((0, react_1.createElement)(ActionView_1.ActionView, Object.assign({}, action, { key: index, layoutType: 'desktop', commonProps: {
|
|
17
|
+
className: styles_module_scss_1.default.button,
|
|
18
|
+
} })))) }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MobileActions = MobileActions;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const react_2 = require("react");
|
|
10
|
+
const uikit_product_icons_1 = require("@sbercloud/uikit-product-icons");
|
|
11
|
+
const uikit_product_mobile_dropdown_1 = require("@sbercloud/uikit-product-mobile-dropdown");
|
|
12
|
+
const uikit_product_mobile_tooltip_1 = require("@sbercloud/uikit-product-mobile-tooltip");
|
|
13
|
+
const button_1 = require("@snack-uikit/button");
|
|
14
|
+
const utils_1 = require("@snack-uikit/utils");
|
|
15
|
+
const ActionView_1 = require("./ActionView");
|
|
16
|
+
const constants_1 = require("./constants");
|
|
17
|
+
const helpers_1 = require("./helpers");
|
|
18
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
19
|
+
function MobileActions({ items }) {
|
|
20
|
+
const containerRef = (0, react_2.useRef)(null);
|
|
21
|
+
const [isOpen, setIsOpen] = (0, react_2.useState)(false);
|
|
22
|
+
const { visibleItems, hiddenItems } = (0, utils_1.useDynamicList)({ parentContainerRef: containerRef, items, maxVisibleItems: 2 });
|
|
23
|
+
if (!(0, helpers_1.hasVisibleActions)(items)) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const hiddenItemsWithKebab = hiddenItems.concat(visibleItems.filter(item => item.variant === 'kebab'));
|
|
27
|
+
const visibleItemsWithoutKebab = visibleItems.filter(item => item.variant !== 'kebab');
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.mobileActionsWrapper, ref: containerRef, children: [hiddenItemsWithKebab.length > 0 && ((0, jsx_runtime_1.jsx)(uikit_product_mobile_dropdown_1.MobileDroplist, { open: isOpen, onOpenChange: setIsOpen, items: hiddenItemsWithKebab.reduce((acc, action) => {
|
|
29
|
+
var _a;
|
|
30
|
+
switch (action.variant) {
|
|
31
|
+
case constants_1.BUTTON_TYPE.Tonal:
|
|
32
|
+
case constants_1.BUTTON_TYPE.Simple:
|
|
33
|
+
case constants_1.BUTTON_TYPE.Outline:
|
|
34
|
+
case constants_1.BUTTON_TYPE.Function:
|
|
35
|
+
case constants_1.BUTTON_TYPE.Filled: {
|
|
36
|
+
acc.push(Object.assign(Object.assign({}, action), { content: { option: (_a = action.label) !== null && _a !== void 0 ? _a : '' }, onClick: event => {
|
|
37
|
+
var _a;
|
|
38
|
+
setIsOpen(false);
|
|
39
|
+
(_a = action.onClick) === null || _a === void 0 ? void 0 : _a.call(action, event);
|
|
40
|
+
}, beforeContent: action === null || action === void 0 ? void 0 : action.icon, itemWrapRender: action.tooltip
|
|
41
|
+
? item => {
|
|
42
|
+
var _a, _b;
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)(uikit_product_mobile_tooltip_1.MobileTooltip, Object.assign({ tip: (_b = (_a = action.tooltip) === null || _a === void 0 ? void 0 : _a.tip) !== null && _b !== void 0 ? _b : '' }, action.tooltip, { children: item })));
|
|
44
|
+
}
|
|
45
|
+
: undefined }));
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
case constants_1.BUTTON_TYPE.Droplist:
|
|
49
|
+
case constants_1.BUTTON_TYPE.Kebab: {
|
|
50
|
+
const needDivider = Boolean(action.variant === 'droplist' && (action === null || action === void 0 ? void 0 : action.button.label)) || acc.length > 0;
|
|
51
|
+
acc.push(Object.assign(Object.assign({}, action), { type: 'group', label: action.variant === 'droplist' ? action === null || action === void 0 ? void 0 : action.button.label : undefined, divider: needDivider, items: action.list.items.map(item => (Object.assign(Object.assign({}, item), { onClick: event => {
|
|
52
|
+
var _a;
|
|
53
|
+
setIsOpen(false);
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
55
|
+
// @ts-expect-error
|
|
56
|
+
(_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, event);
|
|
57
|
+
} }))) }));
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
default: {
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return acc;
|
|
65
|
+
}, []), children: (0, jsx_runtime_1.jsx)(button_1.ButtonOutline, { appearance: 'neutral', icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.KebabSVG, {}), size: 's' }) })), visibleItemsWithoutKebab.map((action, index) => ((0, react_1.createElement)(ActionView_1.ActionView, Object.assign({}, action, { key: index, layoutType: 'mobile', commonProps: {
|
|
66
|
+
className: styles_module_scss_1.default.button,
|
|
67
|
+
size: 's',
|
|
68
|
+
fullWidth: true,
|
|
69
|
+
} }))))] }));
|
|
70
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BUTTON_TYPE = void 0;
|
|
4
|
+
exports.BUTTON_TYPE = {
|
|
5
|
+
Filled: 'filled',
|
|
6
|
+
Outline: 'outline',
|
|
7
|
+
Tonal: 'tonal',
|
|
8
|
+
Function: 'function',
|
|
9
|
+
Simple: 'simple',
|
|
10
|
+
Droplist: 'droplist',
|
|
11
|
+
Kebab: 'kebab',
|
|
12
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DesktopActions"), exports);
|
|
18
|
+
__exportStar(require("./MobileActions"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.desktopActionsWrapper{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:row-reverse;
|
|
4
|
+
align-items:center;
|
|
5
|
+
flex-shrink:0;
|
|
6
|
+
gap:var(--dimension-1m, 8px);
|
|
7
|
+
height:100%;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.mobileActionsWrapper{
|
|
11
|
+
display:flex;
|
|
12
|
+
gap:8px;
|
|
13
|
+
flex-shrink:0;
|
|
14
|
+
width:100%;
|
|
15
|
+
justify-content:stretch;
|
|
16
|
+
overflow-y:auto;
|
|
17
|
+
flex-direction:row-reverse;
|
|
18
|
+
-ms-overflow-style:none;
|
|
19
|
+
scrollbar-width:none;
|
|
20
|
+
}
|
|
21
|
+
.mobileActionsWrapper::-webkit-scrollbar{
|
|
22
|
+
display:none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.button{
|
|
26
|
+
white-space:nowrap;
|
|
27
|
+
}
|
|
28
|
+
.button[data-full-width]:not([data-variant=icon-only]){
|
|
29
|
+
flex-shrink:0;
|
|
30
|
+
width:auto;
|
|
31
|
+
}
|
|
32
|
+
.button[data-variant=icon-only]{
|
|
33
|
+
flex-grow:0;
|
|
34
|
+
flex-shrink:0;
|
|
35
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TooltipProps } from '@sbercloud/uikit-product-mobile-tooltip';
|
|
2
|
+
import { ButtonFilledProps, ButtonFunctionProps, ButtonOutlineProps, ButtonSimpleProps, ButtonTonalProps } from '@snack-uikit/button';
|
|
3
|
+
import { ButtonDroplistProps } from '../ButtonDroplist';
|
|
4
|
+
import { ButtonKebabProps } from '../ButtonKebab';
|
|
5
|
+
import { BUTTON_TYPE } from './constants';
|
|
6
|
+
type ButtonKebabPropsWithoutLayout = Omit<ButtonKebabProps, 'layoutType'>;
|
|
7
|
+
type ButtonDroplistWithoutLayout = Omit<ButtonDroplistProps, 'layoutType'>;
|
|
8
|
+
export type Action = {
|
|
9
|
+
tooltip?: TooltipProps;
|
|
10
|
+
hidden?: boolean;
|
|
11
|
+
} & (({
|
|
12
|
+
variant?: typeof BUTTON_TYPE.Filled;
|
|
13
|
+
} & ButtonFilledProps) | ({
|
|
14
|
+
variant: typeof BUTTON_TYPE.Outline;
|
|
15
|
+
} & ButtonOutlineProps) | ({
|
|
16
|
+
variant: typeof BUTTON_TYPE.Tonal;
|
|
17
|
+
} & ButtonTonalProps) | ({
|
|
18
|
+
variant: typeof BUTTON_TYPE.Function;
|
|
19
|
+
} & ButtonFunctionProps) | ({
|
|
20
|
+
variant: typeof BUTTON_TYPE.Simple;
|
|
21
|
+
} & ButtonSimpleProps) | ({
|
|
22
|
+
variant: typeof BUTTON_TYPE.Kebab;
|
|
23
|
+
} & ButtonKebabPropsWithoutLayout) | ({
|
|
24
|
+
variant: typeof BUTTON_TYPE.Droplist;
|
|
25
|
+
} & ButtonDroplistWithoutLayout));
|
|
26
|
+
export type ActionsProps = {
|
|
27
|
+
items: Action[];
|
|
28
|
+
maxVisibleItems?: number;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AdaptiveDropdownProps } from '@sbercloud/uikit-product-mobile-dropdown';
|
|
2
|
+
import { WithLayoutType } from '@sbercloud/uikit-product-utils';
|
|
3
|
+
import { ButtonFunctionProps } from '@snack-uikit/button';
|
|
4
|
+
export type ButtonDropdownProps = WithLayoutType<{
|
|
5
|
+
button: Omit<ButtonFunctionProps, 'icon' | 'iconPosition' | 'appearance'>;
|
|
6
|
+
dropdown: Omit<AdaptiveDropdownProps, 'children' | 'layoutType' | 'placement'>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function ButtonDropdown({ layoutType, button, dropdown }: ButtonDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ButtonDropdown = ButtonDropdown;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const uikit_product_icons_1 = require("@sbercloud/uikit-product-icons");
|
|
6
|
+
const uikit_product_mobile_dropdown_1 = require("@sbercloud/uikit-product-mobile-dropdown");
|
|
7
|
+
const button_1 = require("@snack-uikit/button");
|
|
8
|
+
const utils_1 = require("@snack-uikit/utils");
|
|
9
|
+
function ButtonDropdown({ layoutType, button, dropdown }) {
|
|
10
|
+
const [open, onOpenChange] = (0, utils_1.useValueControl)({ onChange: dropdown.onOpenChange, value: dropdown.open });
|
|
11
|
+
const Icon = open ? uikit_product_icons_1.ChevronUpSVG : uikit_product_icons_1.ChevronDownSVG;
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(uikit_product_mobile_dropdown_1.AdaptiveDropdown, Object.assign({}, dropdown, { open: open, onOpenChange: onOpenChange, layoutType: layoutType, children: (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, Object.assign({}, button, { icon: (0, jsx_runtime_1.jsx)(Icon, {}), iconPosition: 'after', appearance: 'neutral' })) })));
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ButtonDropdown';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ButtonDropdown"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AdaptiveDroplistProps } from '@sbercloud/uikit-product-mobile-dropdown';
|
|
2
|
+
import { WithLayoutType } from '@sbercloud/uikit-product-utils';
|
|
3
|
+
import { ButtonFilledProps, ButtonFunctionProps } from '@snack-uikit/button';
|
|
4
|
+
export type ButtonDroplistProps = WithLayoutType<{
|
|
5
|
+
button: (Omit<ButtonFilledProps, 'appearance'> & {
|
|
6
|
+
buttonType?: 'filled';
|
|
7
|
+
}) | (Omit<ButtonFunctionProps, 'icon' | 'iconPosition' | 'appearance'> & {
|
|
8
|
+
buttonType?: 'function';
|
|
9
|
+
});
|
|
10
|
+
list: Pick<AdaptiveDroplistProps, 'items' | 'closeDroplistOnItemClick' | 'className' | 'open' | 'onOpenChange'>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare function ButtonDroplist({ layoutType, button, list }: ButtonDroplistProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ButtonDroplist = ButtonDroplist;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const uikit_product_icons_1 = require("@sbercloud/uikit-product-icons");
|
|
7
|
+
const uikit_product_mobile_dropdown_1 = require("@sbercloud/uikit-product-mobile-dropdown");
|
|
8
|
+
const button_1 = require("@snack-uikit/button");
|
|
9
|
+
const utils_1 = require("@snack-uikit/utils");
|
|
10
|
+
function ButtonDroplist({ layoutType, button, list }) {
|
|
11
|
+
var _a;
|
|
12
|
+
const [open, onOpenChange] = (0, utils_1.useValueControl)({ onChange: list.onOpenChange, value: list.open });
|
|
13
|
+
const Icon = open ? uikit_product_icons_1.ChevronUpSVG : uikit_product_icons_1.ChevronDownSVG;
|
|
14
|
+
const buttonType = (_a = button.buttonType) !== null && _a !== void 0 ? _a : 'function';
|
|
15
|
+
const Button = buttonType === 'filled' ? button_1.ButtonFilled : button_1.ButtonFunction;
|
|
16
|
+
const buttonProps = (0, react_1.useMemo)(() => buttonType === 'filled' ? button : Object.assign(Object.assign({}, button), { appearance: 'neutral', icon: (0, jsx_runtime_1.jsx)(Icon, {}), iconPosition: 'after' }), [buttonType, button, Icon]);
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(uikit_product_mobile_dropdown_1.AdaptiveDroplist, Object.assign({}, list, { open: open, onOpenChange: onOpenChange, layoutType: layoutType, selection: {
|
|
18
|
+
mode: 'single',
|
|
19
|
+
value: 'null',
|
|
20
|
+
}, size: 's', children: (0, jsx_runtime_1.jsx)(Button, Object.assign({}, buttonProps)) })));
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ButtonDroplist';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ButtonDroplist"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AdaptiveDroplistProps } from '@sbercloud/uikit-product-mobile-dropdown';
|
|
2
|
+
import { WithLayoutType } from '@sbercloud/uikit-product-utils';
|
|
3
|
+
import { ButtonOutlineProps } from '@snack-uikit/button';
|
|
4
|
+
export type ButtonKebabProps = WithLayoutType<{
|
|
5
|
+
button?: Omit<ButtonOutlineProps, 'label' | 'icon'>;
|
|
6
|
+
list: Pick<AdaptiveDroplistProps, 'items' | 'closeDroplistOnItemClick' | 'open' | 'onOpenChange' | 'className'>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function ButtonKebab({ layoutType, button, list }: ButtonKebabProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ButtonKebab = ButtonKebab;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const uikit_product_icons_1 = require("@sbercloud/uikit-product-icons");
|
|
6
|
+
const uikit_product_mobile_dropdown_1 = require("@sbercloud/uikit-product-mobile-dropdown");
|
|
7
|
+
const button_1 = require("@snack-uikit/button");
|
|
8
|
+
const utils_1 = require("@snack-uikit/utils");
|
|
9
|
+
function ButtonKebab({ layoutType, button, list }) {
|
|
10
|
+
const [open, onOpenChange] = (0, utils_1.useValueControl)({ onChange: list.onOpenChange, value: list.open });
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(uikit_product_mobile_dropdown_1.AdaptiveDroplist, Object.assign({}, list, { open: open, onOpenChange: onOpenChange, layoutType: layoutType, selection: {
|
|
12
|
+
mode: 'single',
|
|
13
|
+
value: 'null',
|
|
14
|
+
}, placement: 'bottom-end', size: 's', children: (0, jsx_runtime_1.jsx)(button_1.ButtonOutline, Object.assign({}, button, { icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.KebabSVG, {}), appearance: 'neutral' })) })));
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ButtonKebab';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ButtonKebab"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Actions';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Actions"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./components"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CarouselProps } from '@sbercloud/uikit-product-mobile-carousel';
|
|
3
|
+
import { WithLayoutType, WithSupportProps } from '@sbercloud/uikit-product-utils';
|
|
4
|
+
export type ProductsWidgetProps = WithLayoutType<Pick<CarouselProps, 'arrows' | 'pagination'> & WithSupportProps<{
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
cards: ReactNode[];
|
|
7
|
+
columnSize?: number;
|
|
8
|
+
rowSize?: number;
|
|
9
|
+
}>>;
|
|
10
|
+
export declare function ProductsWidget({ layoutType, cards, loading, columnSize: columnSizeProp, rowSize: rowSizeProp, arrows, pagination, ...rest }: ProductsWidgetProps): import("react/jsx-runtime").JSX.Element;
|