@consta/uikit 3.12.4 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Attach/package.json +1 -1
- package/Attachment/package.json +1 -1
- package/Avatar/package.json +1 -1
- package/Badge/package.json +1 -1
- package/BasicSelectDeprecated/package.json +1 -1
- package/Breadcrumbs/package.json +1 -1
- package/BreadcrumbsCanary/es.js +1 -0
- package/BreadcrumbsCanary/index.d.ts +1 -0
- package/BreadcrumbsCanary/index.js +4 -0
- package/BreadcrumbsCanary/package.json +9 -0
- package/Button/package.json +1 -1
- package/CHANGELOG.md +22 -14
- package/Calendar/package.json +1 -1
- package/Card/package.json +1 -1
- package/Checkbox/package.json +1 -1
- package/CheckboxGroup/package.json +1 -1
- package/ChoiceGroup/package.json +1 -1
- package/Collapse/package.json +1 -1
- package/CollapseGroup/package.json +1 -1
- package/Combobox/package.json +1 -1
- package/ComboboxDeprecated/package.json +1 -1
- package/ContextMenu/package.json +1 -1
- package/DatePickerCanary/package.json +1 -1
- package/DateTimeCanary/package.json +1 -1
- package/DragNDropField/package.json +1 -1
- package/EventInterceptor/package.json +1 -1
- package/FieldCaption/package.json +1 -1
- package/FieldLabel/package.json +1 -1
- package/File/package.json +1 -1
- package/FileField/package.json +1 -1
- package/FileIcon/package.json +1 -1
- package/FileIconAvi/package.json +1 -1
- package/FileIconBmp/package.json +1 -1
- package/FileIconCsv/package.json +1 -1
- package/FileIconDoc/package.json +1 -1
- package/FileIconExe/package.json +1 -1
- package/FileIconGif/package.json +1 -1
- package/FileIconJpg/package.json +1 -1
- package/FileIconJson/package.json +1 -1
- package/FileIconLoading/package.json +1 -1
- package/FileIconMov/package.json +1 -1
- package/FileIconMp3/package.json +1 -1
- package/FileIconMp4/package.json +1 -1
- package/FileIconPdf/package.json +1 -1
- package/FileIconPng/package.json +1 -1
- package/FileIconPtt/package.json +1 -1
- package/FileIconRar/package.json +1 -1
- package/FileIconRtf/package.json +1 -1
- package/FileIconTiff/package.json +1 -1
- package/FileIconTxt/package.json +1 -1
- package/FileIconUndefined/package.json +1 -1
- package/FileIconWav/package.json +1 -1
- package/FileIconXls/package.json +1 -1
- package/FileIconZip/package.json +1 -1
- package/Grid/package.json +1 -1
- package/Header/package.json +1 -1
- package/Icon/package.json +1 -1
- package/IconAdd/package.json +1 -1
- package/IconAddToComparison/package.json +1 -1
- package/IconAlert/package.json +1 -1
- package/IconAlignBlocksLeft/package.json +1 -1
- package/IconAlignBlocksRight/package.json +1 -1
- package/IconAlignCenter/package.json +1 -1
- package/IconAlignJustify/package.json +1 -1
- package/IconAlignLeft/package.json +1 -1
- package/IconAlignRight/package.json +1 -1
- package/IconAllDone/package.json +1 -1
- package/IconArrowDown/package.json +1 -1
- package/IconArrowLeft/package.json +1 -1
- package/IconArrowRight/package.json +1 -1
- package/IconArrowUp/package.json +1 -1
- package/IconArtBrush/package.json +1 -1
- package/IconAttach/package.json +1 -1
- package/IconBackward/package.json +1 -1
- package/IconBag/package.json +1 -1
- package/IconBarrier/package.json +1 -1
- package/IconBento/package.json +1 -1
- package/IconBold/package.json +1 -1
- package/IconBook/package.json +1 -1
- package/IconBookmarkFilled/package.json +1 -1
- package/IconBookmarkStroked/package.json +1 -1
- package/IconCalculator/package.json +1 -1
- package/IconCalendar/package.json +1 -1
- package/IconCamera/package.json +1 -1
- package/IconCancel/package.json +1 -1
- package/IconCards/package.json +1 -1
- package/IconChat/package.json +1 -1
- package/IconCheck/package.json +1 -1
- package/IconClose/package.json +1 -1
- package/IconCollapse/package.json +1 -1
- package/IconColorFill/package.json +1 -1
- package/IconColorText/package.json +1 -1
- package/IconColumns/package.json +1 -1
- package/IconComment/package.json +1 -1
- package/IconConnection/package.json +1 -1
- package/IconCopy/package.json +1 -1
- package/IconCrown/package.json +1 -1
- package/IconCursorMouse/package.json +1 -1
- package/IconDataNull/package.json +1 -1
- package/IconDiamond/package.json +1 -1
- package/IconDinosaur/package.json +1 -1
- package/IconDisconnection/package.json +1 -1
- package/IconDocAdd/package.json +1 -1
- package/IconDocBlank/package.json +1 -1
- package/IconDocDelete/package.json +1 -1
- package/IconDocExport/package.json +1 -1
- package/IconDocFilled/package.json +1 -1
- package/IconDown/package.json +1 -1
- package/IconDownload/package.json +1 -1
- package/IconDrag/package.json +1 -1
- package/IconDraggable/package.json +1 -1
- package/IconDrillingRig/package.json +1 -1
- package/IconDrop/package.json +1 -1
- package/IconEdit/package.json +1 -1
- package/IconExit/package.json +1 -1
- package/IconExpand/package.json +1 -1
- package/IconEye/package.json +1 -1
- package/IconEyeClose/package.json +1 -1
- package/IconFavorite/package.json +1 -1
- package/IconFilter/package.json +1 -1
- package/IconFitToDefault/package.json +1 -1
- package/IconFlagFilled/package.json +1 -1
- package/IconFlagStroked/package.json +1 -1
- package/IconFolders/package.json +1 -1
- package/IconForward/package.json +1 -1
- package/IconFunnel/package.json +1 -1
- package/IconGas/package.json +1 -1
- package/IconGeo/package.json +1 -1
- package/IconGrouping/package.json +1 -1
- package/IconHamburger/package.json +1 -1
- package/IconHand/package.json +1 -1
- package/IconHealth/package.json +1 -1
- package/IconInComparison/package.json +1 -1
- package/IconInfo/package.json +1 -1
- package/IconIntroduction/package.json +1 -1
- package/IconIpad/package.json +1 -1
- package/IconItalic/package.json +1 -1
- package/IconKebab/package.json +1 -1
- package/IconLaptop/package.json +1 -1
- package/IconLayers/package.json +1 -1
- package/IconLeaf/package.json +1 -1
- package/IconLightningBolt/package.json +1 -1
- package/IconLineAndBarChart/package.json +1 -1
- package/IconLink/package.json +1 -1
- package/IconList/package.json +1 -1
- package/IconListNumbered/package.json +1 -1
- package/IconLock/package.json +1 -1
- package/IconLogicalElement/package.json +1 -1
- package/IconMBU/package.json +1 -1
- package/IconMGRP/package.json +1 -1
- package/IconMLSP/package.json +1 -1
- package/IconMMP/package.json +1 -1
- package/IconMail/package.json +1 -1
- package/IconMap/package.json +1 -1
- package/IconMaxHeight/package.json +1 -1
- package/IconMaxWidth/package.json +1 -1
- package/IconMeatball/package.json +1 -1
- package/IconMic/package.json +1 -1
- package/IconMolecules/package.json +1 -1
- package/IconMoon/package.json +1 -1
- package/IconNodeEnd/package.json +1 -1
- package/IconNodeStart/package.json +1 -1
- package/IconNodeStep/package.json +1 -1
- package/IconNodes/package.json +1 -1
- package/IconOpenInNew/package.json +1 -1
- package/IconPanelBottom/package.json +1 -1
- package/IconPanelLeft/package.json +1 -1
- package/IconPanelRight/package.json +1 -1
- package/IconPanelTop/package.json +1 -1
- package/IconPaste/package.json +1 -1
- package/IconPause/package.json +1 -1
- package/IconPhone/package.json +1 -1
- package/IconPhoto/package.json +1 -1
- package/IconPlay/package.json +1 -1
- package/IconPressure/package.json +1 -1
- package/IconProcessing/package.json +1 -1
- package/IconQuestion/package.json +1 -1
- package/IconQuote/package.json +1 -1
- package/IconRUO/package.json +1 -1
- package/IconRUS/package.json +1 -1
- package/IconRecord/package.json +1 -1
- package/IconRemove/package.json +1 -1
- package/IconRemoveFromComparison/package.json +1 -1
- package/IconReply/package.json +1 -1
- package/IconResize/package.json +1 -1
- package/IconRestart/package.json +1 -1
- package/IconRevert/package.json +1 -1
- package/IconRing/package.json +1 -1
- package/IconRouble/package.json +1 -1
- package/IconRuler/package.json +1 -1
- package/IconScreen/package.json +1 -1
- package/IconSearch/package.json +1 -1
- package/IconSelect/package.json +1 -1
- package/IconSelectOpen/package.json +1 -1
- package/IconSettings/package.json +1 -1
- package/IconShape/package.json +1 -1
- package/IconShuffle/package.json +1 -1
- package/IconSmile/package.json +1 -1
- package/IconSortDown/package.json +1 -1
- package/IconSortDownCenter/package.json +1 -1
- package/IconSortUp/package.json +1 -1
- package/IconSortUpCenter/package.json +1 -1
- package/IconStop/package.json +1 -1
- package/IconStorage/package.json +1 -1
- package/IconStrikethrough/package.json +1 -1
- package/IconSun/package.json +1 -1
- package/IconTable/package.json +1 -1
- package/IconTarget/package.json +1 -1
- package/IconTeam/package.json +1 -1
- package/IconTest/package.json +1 -1
- package/IconThumbUp/package.json +1 -1
- package/IconTie/package.json +1 -1
- package/IconTop/package.json +1 -1
- package/IconTrash/package.json +1 -1
- package/IconType/package.json +1 -1
- package/IconUnderline/package.json +1 -1
- package/IconUnlock/package.json +1 -1
- package/IconUnsort/package.json +1 -1
- package/IconUnsortCenter/package.json +1 -1
- package/IconUpload/package.json +1 -1
- package/IconUser/package.json +1 -1
- package/IconVZD/package.json +1 -1
- package/IconVideo/package.json +1 -1
- package/IconWarning/package.json +1 -1
- package/IconWatch/package.json +1 -1
- package/IconWideScreen/package.json +1 -1
- package/IconWorld/package.json +1 -1
- package/Informer/package.json +1 -1
- package/LayoutCanary/package.json +1 -1
- package/Loader/package.json +1 -1
- package/MixCard/package.json +1 -1
- package/MixFocus/package.json +1 -1
- package/MixSpace/package.json +1 -1
- package/MixVisuallyHidden/package.json +1 -1
- package/Modal/package.json +1 -1
- package/MultiComboboxDeprecated/package.json +1 -1
- package/Pagination/package.json +1 -1
- package/Popover/package.json +1 -1
- package/PortalWithTheme/package.json +1 -1
- package/ProgressSpin/package.json +1 -1
- package/ProgressStepBarCanary/package.json +1 -1
- package/Radio/package.json +1 -1
- package/RadioGroup/package.json +1 -1
- package/Responses/package.json +1 -1
- package/Responses403/package.json +1 -1
- package/Responses404/package.json +1 -1
- package/Responses500/package.json +1 -1
- package/Responses503/package.json +1 -1
- package/ResponsesConnectionError/package.json +1 -1
- package/ResponsesDeleted/package.json +1 -1
- package/ResponsesEmptyBox/package.json +1 -1
- package/ResponsesEmptyPockets/package.json +1 -1
- package/ResponsesImage/package.json +1 -1
- package/ResponsesImage403/package.json +1 -1
- package/ResponsesImage404/package.json +1 -1
- package/ResponsesImage500/package.json +1 -1
- package/ResponsesImage503/package.json +1 -1
- package/ResponsesImageConnectionError/package.json +1 -1
- package/ResponsesImageDeleted/package.json +1 -1
- package/ResponsesImageEmptyBox/package.json +1 -1
- package/ResponsesImageEmptyPockets/package.json +1 -1
- package/ResponsesImageNothingFound/package.json +1 -1
- package/ResponsesImageSuccess/package.json +1 -1
- package/ResponsesNothingFound/package.json +1 -1
- package/ResponsesSuccess/package.json +1 -1
- package/Select/package.json +1 -1
- package/Sidebar/package.json +1 -1
- package/Skeleton/package.json +1 -1
- package/SliderCanary/package.json +1 -1
- package/SnackBar/package.json +1 -1
- package/Steps/package.json +1 -1
- package/Switch/package.json +1 -1
- package/SwitchGroup/package.json +1 -1
- package/Table/package.json +1 -1
- package/Tabs/package.json +1 -1
- package/Tag/package.json +1 -1
- package/TagBase/package.json +1 -1
- package/Text/package.json +1 -1
- package/TextField/package.json +1 -1
- package/Theme/package.json +1 -1
- package/ThemeToggler/package.json +1 -1
- package/Timer/package.json +1 -1
- package/Tooltip/package.json +1 -1
- package/User/package.json +1 -1
- package/UserSelect/package.json +1 -1
- package/UserSelectDeprecated/package.json +1 -1
- package/__internal__/cjs-src/components/BreadcrumbsCanary/Breadcrumbs.css +75 -0
- package/__internal__/cjs-src/components/BreadcrumbsCanary/BreadcrumbsCanary.d.ts +5 -0
- package/__internal__/cjs-src/components/BreadcrumbsCanary/BreadcrumbsCanary.js +57 -0
- package/__internal__/cjs-src/components/BreadcrumbsCanary/helpers.d.ts +16 -0
- package/__internal__/cjs-src/components/BreadcrumbsCanary/helpers.js +21 -0
- package/__internal__/cjs-src/components/BreadcrumbsCanary/types.d.ts +36 -0
- package/__internal__/cjs-src/components/BreadcrumbsCanary/types.js +5 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js +1 -1
- package/__internal__/cjs-src/components/EventInterceptor/eventInterceptorMap.d.ts +1 -0
- package/__internal__/cjs-src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts +1 -0
- package/__internal__/cjs-src/components/TextField/TextField.js +2 -2
- package/__internal__/cjs-src/components/TextField/helpers.d.ts +1 -0
- package/__internal__/cjs-src/mixs/MixCard/MixCard.css +0 -98
- package/__internal__/cjs-src/mixs/MixCard/MixCard.d.ts +1 -1
- package/__internal__/cjs-src/mixs/MixCard/MixCard.js +10 -1
- package/__internal__/src/components/BreadcrumbsCanary/Breadcrumbs.css +75 -0
- package/__internal__/src/components/BreadcrumbsCanary/BreadcrumbsCanary.d.ts +5 -0
- package/__internal__/src/components/BreadcrumbsCanary/BreadcrumbsCanary.js +54 -0
- package/__internal__/src/components/BreadcrumbsCanary/helpers.d.ts +16 -0
- package/__internal__/src/components/BreadcrumbsCanary/helpers.js +16 -0
- package/__internal__/src/components/BreadcrumbsCanary/types.d.ts +36 -0
- package/__internal__/src/components/BreadcrumbsCanary/types.js +2 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js +1 -1
- package/__internal__/src/components/EventInterceptor/eventInterceptorMap.d.ts +1 -0
- package/__internal__/src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts +1 -0
- package/__internal__/src/components/TextField/TextField.js +2 -2
- package/__internal__/src/components/TextField/helpers.d.ts +1 -0
- package/__internal__/src/mixs/MixCard/MixCard.css +0 -98
- package/__internal__/src/mixs/MixCard/MixCard.d.ts +1 -1
- package/__internal__/src/mixs/MixCard/MixCard.js +10 -1
- package/createIcon/package.json +1 -1
- package/createResponsesImage/package.json +1 -1
- package/package.json +2 -1
- package/useBreakpoints/package.json +1 -1
- package/useChoiceGroup/package.json +1 -1
- package/useChoiceGroupIndexed/package.json +1 -1
- package/useClickOutside/package.json +1 -1
- package/useComponentSize/package.json +1 -1
- package/useDebounce/package.json +1 -1
- package/useFlag/package.json +1 -1
- package/useForkRef/package.json +1 -1
- package/useGlobalKeys/package.json +1 -1
- package/useKeys/package.json +1 -1
- package/useMutableRef/package.json +1 -1
- package/useOverflow/package.json +1 -1
- package/usePrevious/package.json +1 -1
- package/useResizeObserved/package.json +1 -1
- package/useScrollElements/package.json +1 -1
- package/useScrollPosition/package.json +1 -1
- package/useSelect/package.json +1 -1
- package/useThemeVars/package.json +1 -1
- package/useTimer/package.json +1 -1
- package/withTooltip/package.json +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
|
+
import './Breadcrumbs.css';
|
|
3
|
+
import React, { forwardRef, useMemo } from 'react';
|
|
4
|
+
import { IconArrowRight } from '../../icons/IconArrowRight/IconArrowRight';
|
|
5
|
+
import { cn } from '../../utils/bem';
|
|
6
|
+
import { getByMap } from '../../utils/getByMap';
|
|
7
|
+
import { Button } from '../Button/Button';
|
|
8
|
+
import { getItemClick, withDefaultGetters } from './helpers';
|
|
9
|
+
import { breadcrumbPropSizeDefault } from './types';
|
|
10
|
+
export var cnBreadcrumbs = cn('Breadcrumbs');
|
|
11
|
+
var sizeMap = {
|
|
12
|
+
xs: 'xs',
|
|
13
|
+
s: 'xs',
|
|
14
|
+
m: 'xs',
|
|
15
|
+
l: 'm'
|
|
16
|
+
};
|
|
17
|
+
var BreadcrumbsRender = function (props, ref) {
|
|
18
|
+
var _a = withDefaultGetters(props), items = _a.items, getItemHref = _a.getItemHref, getItemLabel = _a.getItemLabel, getItemActive = _a.getItemActive, getItemIcon = _a.getItemIcon, getItemOnClick = _a.getItemOnClick, onItemClick = _a.onItemClick, _b = _a.size, size = _b === void 0 ? breadcrumbPropSizeDefault : _b, _c = _a.maxCount, maxCount = _c === void 0 ? 0 : _c, _d = _a.onlyIconRoot, onlyIconRoot = _d === void 0 ? false : _d, className = _a.className, restProps = __rest(_a, ["items", "getItemHref", "getItemLabel", "getItemActive", "getItemIcon", "getItemOnClick", "onItemClick", "size", "maxCount", "onlyIconRoot", "className"]);
|
|
19
|
+
var iconSize = getByMap(sizeMap, size);
|
|
20
|
+
var _e = useMemo(function () {
|
|
21
|
+
var rest = items.slice();
|
|
22
|
+
var head = rest.splice(0, 1);
|
|
23
|
+
var tail = rest.splice(2 - maxCount);
|
|
24
|
+
return {
|
|
25
|
+
head: head,
|
|
26
|
+
tail: tail,
|
|
27
|
+
rest: rest
|
|
28
|
+
};
|
|
29
|
+
}, [items, maxCount]), head = _e.head, tail = _e.tail, rest = _e.rest;
|
|
30
|
+
var renderPages = function (items, isFirst) {
|
|
31
|
+
if (isFirst === void 0) { isFirst = false; }
|
|
32
|
+
return items.map(function (item, index) {
|
|
33
|
+
var Icon = getItemIcon(item);
|
|
34
|
+
var label = getItemLabel(item);
|
|
35
|
+
var href = getItemHref(item);
|
|
36
|
+
var active = getItemActive(item);
|
|
37
|
+
var onClick = getItemClick(item, getItemOnClick, onItemClick);
|
|
38
|
+
return (React.createElement("li", { className: cnBreadcrumbs('Item'), key: cnBreadcrumbs('Item', { index: index, href: href }) },
|
|
39
|
+
!isFirst && React.createElement(IconArrowRight, { className: cnBreadcrumbs('Delimiter'), size: iconSize }),
|
|
40
|
+
React.createElement("a", { className: cnBreadcrumbs('Link', { active: active }), onClick: onClick, href: href },
|
|
41
|
+
Icon &&
|
|
42
|
+
(onlyIconRoot && isFirst ? (React.createElement(Button, { view: "clear", onlyIcon: true, iconLeft: Icon, size: iconSize })) : (React.createElement(Icon, { className: cnBreadcrumbs('Icon'), size: iconSize }))),
|
|
43
|
+
(!isFirst || !onlyIconRoot) && React.createElement("span", { className: cnBreadcrumbs('Label') }, label))));
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
return (React.createElement("ul", __assign({ className: cnBreadcrumbs({ size: size }, [className]), ref: ref }, restProps),
|
|
47
|
+
renderPages(head, true),
|
|
48
|
+
maxCount && rest.length > 1 ? (React.createElement("li", { className: cnBreadcrumbs('Item') },
|
|
49
|
+
React.createElement(IconArrowRight, { className: cnBreadcrumbs('Delimiter'), size: iconSize }),
|
|
50
|
+
React.createElement("span", { className: cnBreadcrumbs('More') }, "..."))) : (renderPages(rest)),
|
|
51
|
+
renderPages(tail)));
|
|
52
|
+
};
|
|
53
|
+
export var Breadcrumbs = forwardRef(BreadcrumbsRender);
|
|
54
|
+
export * from './types';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BreadcrumbsPropGetItemActive, BreadcrumbsPropGetItemHref, BreadcrumbsPropGetItemIcon, BreadcrumbsPropGetItemLabel, BreadcrumbsPropGetItemOnClick, BreadcrumbsPropOnItemClick, BreadcrumbsProps, DefaultItem } from './types';
|
|
3
|
+
export declare function withDefaultGetters<ITEM>(props: BreadcrumbsProps<ITEM>): {
|
|
4
|
+
getItemLabel: BreadcrumbsPropGetItemLabel<DefaultItem> | BreadcrumbsPropGetItemLabel<ITEM>;
|
|
5
|
+
getItemActive: BreadcrumbsPropGetItemActive<DefaultItem> | BreadcrumbsPropGetItemActive<ITEM>;
|
|
6
|
+
getItemHref: BreadcrumbsPropGetItemHref<DefaultItem> | BreadcrumbsPropGetItemHref<ITEM>;
|
|
7
|
+
getItemOnClick: BreadcrumbsPropGetItemOnClick<DefaultItem> | BreadcrumbsPropGetItemOnClick<ITEM>;
|
|
8
|
+
getItemIcon: BreadcrumbsPropGetItemIcon<DefaultItem> | BreadcrumbsPropGetItemIcon<ITEM>;
|
|
9
|
+
items: ITEM[];
|
|
10
|
+
onItemClick?: BreadcrumbsPropOnItemClick<ITEM> | undefined;
|
|
11
|
+
size?: "xs" | "s" | "m" | "l" | undefined;
|
|
12
|
+
maxCount?: number | undefined;
|
|
13
|
+
onlyIconRoot?: boolean | undefined;
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
export declare function getItemClick<ITEM>(item: ITEM, getItemOnClick: BreadcrumbsPropGetItemOnClick<ITEM>, onItemClick?: BreadcrumbsPropOnItemClick<ITEM>): React.MouseEventHandler;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
var defaultGetItemLabel = function (item) { return item.label; };
|
|
3
|
+
var defaultGetItemIcon = function (item) { return item.icon; };
|
|
4
|
+
var defaultGetItemActive = function (item) { return item.active; };
|
|
5
|
+
var defaultGetItemHref = function (item) { return item.href; };
|
|
6
|
+
var defaultGetItemOnClick = function (item) { return item.onClick; };
|
|
7
|
+
export function withDefaultGetters(props) {
|
|
8
|
+
return __assign(__assign({}, props), { getItemLabel: props.getItemLabel || defaultGetItemLabel, getItemActive: props.getItemActive || defaultGetItemActive, getItemHref: props.getItemHref || defaultGetItemHref, getItemOnClick: props.getItemOnClick || defaultGetItemOnClick, getItemIcon: props.getItemIcon || defaultGetItemIcon });
|
|
9
|
+
}
|
|
10
|
+
export function getItemClick(item, getItemOnClick, onItemClick) {
|
|
11
|
+
return function (e) {
|
|
12
|
+
var _a;
|
|
13
|
+
onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick({ e: e, item: item });
|
|
14
|
+
(_a = getItemOnClick(item)) === null || _a === void 0 ? void 0 : _a(e);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconComponent } from '../../icons/Icon/Icon';
|
|
3
|
+
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
|
|
4
|
+
export declare const breadcrumbPropSize: readonly ["m", "xs", "s", "l"];
|
|
5
|
+
export declare type BreadcrumbPropSize = typeof breadcrumbPropSize[number];
|
|
6
|
+
export declare const breadcrumbPropSizeDefault: "m";
|
|
7
|
+
export declare type BreadcrumbsPropGetItemLabel<ITEM> = (item: ITEM) => string | React.ReactNode;
|
|
8
|
+
export declare type BreadcrumbsPropGetItemActive<ITEM> = (item: ITEM) => boolean | undefined;
|
|
9
|
+
export declare type BreadcrumbsPropGetItemHref<ITEM> = (item: ITEM) => string | undefined;
|
|
10
|
+
export declare type BreadcrumbsPropGetItemIcon<ITEM> = (item: ITEM) => IconComponent | undefined;
|
|
11
|
+
export declare type BreadcrumbsPropGetItemOnClick<ITEM> = (item: ITEM) => React.MouseEventHandler | undefined;
|
|
12
|
+
export declare type BreadcrumbsPropOnItemClick<ITEM> = (props: {
|
|
13
|
+
item: ITEM;
|
|
14
|
+
e: React.MouseEvent;
|
|
15
|
+
}) => void;
|
|
16
|
+
export declare type DefaultItem = {
|
|
17
|
+
label: string;
|
|
18
|
+
active?: boolean;
|
|
19
|
+
icon?: IconComponent;
|
|
20
|
+
href?: string;
|
|
21
|
+
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
22
|
+
};
|
|
23
|
+
export declare type BreadcrumbsProps<ITEM = DefaultItem> = {
|
|
24
|
+
items: ITEM[];
|
|
25
|
+
getItemLabel?: BreadcrumbsPropGetItemLabel<ITEM>;
|
|
26
|
+
getItemActive?: BreadcrumbsPropGetItemActive<ITEM>;
|
|
27
|
+
getItemHref?: BreadcrumbsPropGetItemHref<ITEM>;
|
|
28
|
+
getItemIcon?: BreadcrumbsPropGetItemIcon<ITEM>;
|
|
29
|
+
getItemOnClick?: BreadcrumbsPropGetItemOnClick<ITEM>;
|
|
30
|
+
onItemClick?: BreadcrumbsPropOnItemClick<ITEM>;
|
|
31
|
+
size?: BreadcrumbPropSize;
|
|
32
|
+
maxCount?: number;
|
|
33
|
+
onlyIconRoot?: boolean;
|
|
34
|
+
className?: string;
|
|
35
|
+
};
|
|
36
|
+
export declare type BreadcrumbsComponent = <ITEM>(props: PropsWithHTMLAttributesAndRef<BreadcrumbsProps<ITEM>, HTMLUListElement>) => React.ReactElement | null;
|
|
@@ -137,5 +137,5 @@ export var DatePickerFieldTypeDate = React.forwardRef(function (props, ref) {
|
|
|
137
137
|
var _a;
|
|
138
138
|
(_a = imaskRef.current) === null || _a === void 0 ? void 0 : _a.updateValue();
|
|
139
139
|
}, [stringValue]);
|
|
140
|
-
return (React.createElement(TextField, __assign({}, otherProps, { type: "text",
|
|
140
|
+
return (React.createElement(TextField, __assign({}, otherProps, { type: "text", inputContainerRef: ref, inputRef: useForkRef([inputRef, inputRefProp]), value: stringValue, placeholder: placeholder })));
|
|
141
141
|
});
|
|
@@ -62,6 +62,7 @@ export declare const eventInterceptorMap: {
|
|
|
62
62
|
required?: boolean | undefined;
|
|
63
63
|
step?: string | number | undefined;
|
|
64
64
|
tabIndex?: number | undefined;
|
|
65
|
+
inputContainerRef?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
65
66
|
inputRef?: ((instance: HTMLInputElement | HTMLTextAreaElement | null) => void) | import("react").RefObject<HTMLInputElement | HTMLTextAreaElement> | null | undefined;
|
|
66
67
|
ariaLabel?: string | undefined;
|
|
67
68
|
iconSize?: "xs" | "s" | "m" | undefined;
|
package/__internal__/src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts
CHANGED
|
@@ -71,6 +71,7 @@ export declare const useTextFieldEventsHandler: <P extends {
|
|
|
71
71
|
required?: boolean | undefined;
|
|
72
72
|
step?: string | number | undefined;
|
|
73
73
|
tabIndex?: number | undefined;
|
|
74
|
+
inputContainerRef?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
74
75
|
inputRef?: ((instance: HTMLInputElement | HTMLTextAreaElement | null) => void) | React.RefObject<HTMLInputElement | HTMLTextAreaElement> | null | undefined;
|
|
75
76
|
ariaLabel?: string | undefined;
|
|
76
77
|
iconSize?: "xs" | "s" | "m" | undefined;
|
|
@@ -17,7 +17,7 @@ export var cnTextField = cn(COMPONENT_NAME);
|
|
|
17
17
|
export function TextFieldRender(props, ref) {
|
|
18
18
|
var textFieldRef = React.useRef(null);
|
|
19
19
|
var inputRef = React.useRef(null);
|
|
20
|
-
var _a = usePropsHandler(COMPONENT_NAME, props, textFieldRef), className = _a.className, _b = _a.type, type = _b === void 0 ? 'text' : _b, value = _a.value, onChange = _a.onChange, id = _a.id, name = _a.name, rows = _a.rows, cols = _a.cols, minRows = _a.minRows, maxRows = _a.maxRows, inputRefProp = _a.inputRef, maxLength = _a.maxLength, disabled = _a.disabled, _c = _a.size, size = _c === void 0 ? textFieldPropSizeDefault : _c, _d = _a.view, view = _d === void 0 ? textFieldPropViewDefault : _d, _e = _a.form, form = _e === void 0 ? textFieldPropFormDefault : _e, state = _a.state, status = _a.status, _f = _a.width, width = _f === void 0 ? textFieldPropWidthDefault : _f, onBlur = _a.onBlur, onFocus = _a.onFocus, _g = _a.autoFocus, autoFocus = _g === void 0 ? false : _g, placeholder = _a.placeholder, leftSide = _a.leftSide, rightSide = _a.rightSide, autoComplete = _a.autoComplete, withClearButton = _a.withClearButton, max = _a.max, min = _a.min, readOnly = _a.readOnly, required = _a.required, _h = _a.step, step = _h === void 0 ? 1 : _h, tabIndex = _a.tabIndex, ariaLabel = _a.ariaLabel, label = _a.label, _j = _a.labelPosition, labelPosition = _j === void 0 ? 'top' : _j, caption = _a.caption, iconSizeProp = _a.iconSize, focused = _a.focused, onClick = _a.onClick, otherProps = __rest(_a, ["className", "type", "value", "onChange", "id", "name", "rows", "cols", "minRows", "maxRows", "inputRef", "maxLength", "disabled", "size", "view", "form", "state", "status", "width", "onBlur", "onFocus", "autoFocus", "placeholder", "leftSide", "rightSide", "autoComplete", "withClearButton", "max", "min", "readOnly", "required", "step", "tabIndex", "ariaLabel", "label", "labelPosition", "caption", "iconSize", "focused", "onClick"]);
|
|
20
|
+
var _a = usePropsHandler(COMPONENT_NAME, props, textFieldRef), className = _a.className, _b = _a.type, type = _b === void 0 ? 'text' : _b, value = _a.value, onChange = _a.onChange, id = _a.id, name = _a.name, rows = _a.rows, cols = _a.cols, minRows = _a.minRows, maxRows = _a.maxRows, inputRefProp = _a.inputRef, maxLength = _a.maxLength, disabled = _a.disabled, _c = _a.size, size = _c === void 0 ? textFieldPropSizeDefault : _c, _d = _a.view, view = _d === void 0 ? textFieldPropViewDefault : _d, _e = _a.form, form = _e === void 0 ? textFieldPropFormDefault : _e, state = _a.state, status = _a.status, _f = _a.width, width = _f === void 0 ? textFieldPropWidthDefault : _f, onBlur = _a.onBlur, onFocus = _a.onFocus, _g = _a.autoFocus, autoFocus = _g === void 0 ? false : _g, placeholder = _a.placeholder, leftSide = _a.leftSide, rightSide = _a.rightSide, autoComplete = _a.autoComplete, withClearButton = _a.withClearButton, max = _a.max, min = _a.min, readOnly = _a.readOnly, required = _a.required, _h = _a.step, step = _h === void 0 ? 1 : _h, tabIndex = _a.tabIndex, ariaLabel = _a.ariaLabel, label = _a.label, inputContainerRef = _a.inputContainerRef, _j = _a.labelPosition, labelPosition = _j === void 0 ? 'top' : _j, caption = _a.caption, iconSizeProp = _a.iconSize, focused = _a.focused, onClick = _a.onClick, otherProps = __rest(_a, ["className", "type", "value", "onChange", "id", "name", "rows", "cols", "minRows", "maxRows", "inputRef", "maxLength", "disabled", "size", "view", "form", "state", "status", "width", "onBlur", "onFocus", "autoFocus", "placeholder", "leftSide", "rightSide", "autoComplete", "withClearButton", "max", "min", "readOnly", "required", "step", "tabIndex", "ariaLabel", "label", "inputContainerRef", "labelPosition", "caption", "iconSize", "focused", "onClick"]);
|
|
21
21
|
var _k = __read(useState(autoFocus), 2), focus = _k[0], setFocus = _k[1];
|
|
22
22
|
var textarea = type === 'textarea';
|
|
23
23
|
var LeftIcon = leftSide;
|
|
@@ -113,7 +113,7 @@ export function TextFieldRender(props, ref) {
|
|
|
113
113
|
return (React.createElement("div", __assign({ className: cnTextField({ labelPosition: labelPosition, size: size, view: view, width: width }, [className]), ref: useForkRef([ref, textFieldRef]) }, rootProps, otherProps),
|
|
114
114
|
label && (React.createElement(FieldLabel, { required: required, className: cnTextField('Label', { labelPosition: labelPosition }), size: size }, label)),
|
|
115
115
|
React.createElement("div", { className: cnTextField('Body') },
|
|
116
|
-
React.createElement("div", { className: cnTextField('InputContainer', {
|
|
116
|
+
React.createElement("div", { ref: inputContainerRef, className: cnTextField('InputContainer', {
|
|
117
117
|
view: view,
|
|
118
118
|
form: form,
|
|
119
119
|
status: status || state,
|
|
@@ -74,6 +74,7 @@ export declare type TextFieldProps<TYPE extends string> = PropsWithHTMLAttribute
|
|
|
74
74
|
required?: boolean;
|
|
75
75
|
step?: number | string;
|
|
76
76
|
tabIndex?: number;
|
|
77
|
+
inputContainerRef?: React.Ref<HTMLDivElement>;
|
|
77
78
|
inputRef?: React.Ref<HTMLTextAreaElement | HTMLInputElement>;
|
|
78
79
|
ariaLabel?: string;
|
|
79
80
|
iconSize?: IconPropSize;
|
|
@@ -8,104 +8,6 @@
|
|
|
8
8
|
box-shadow: var(--shadow-group);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.MixCard_verticalSpace_xs,
|
|
12
|
-
.MixCard_verticalSpace_s,
|
|
13
|
-
.MixCard_verticalSpace_m,
|
|
14
|
-
.MixCard_verticalSpace_l,
|
|
15
|
-
.MixCard_verticalSpace_xl,
|
|
16
|
-
.MixCard_verticalSpace_2xl,
|
|
17
|
-
.MixCard_verticalSpace_3xl,
|
|
18
|
-
.MixCard_verticalSpace_4xl,
|
|
19
|
-
.MixCard_verticalSpace_5xl {
|
|
20
|
-
padding-top: var(--vertical-space);
|
|
21
|
-
padding-bottom: var(--vertical-space);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.MixCard_verticalSpace_xs {
|
|
25
|
-
--vertical-space: var(--space-xs);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.MixCard_verticalSpace_s {
|
|
29
|
-
--vertical-space: var(--space-s);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.MixCard_verticalSpace_m {
|
|
33
|
-
--vertical-space: var(--space-m);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.MixCard_verticalSpace_l {
|
|
37
|
-
--vertical-space: var(--space-l);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.MixCard_verticalSpace_xl {
|
|
41
|
-
--vertical-space: var(--space-xl);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.MixCard_verticalSpace_2xl {
|
|
45
|
-
--vertical-space: var(--space-2xl);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.MixCard_verticalSpace_3xl {
|
|
49
|
-
--vertical-space: var(--space-3xl);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.MixCard_verticalSpace_4xl {
|
|
53
|
-
--vertical-space: var(--space-4xl);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.MixCard_verticalSpace_5xl {
|
|
57
|
-
--vertical-space: var(--space-5xl);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.MixCard_horizontalSpace_xs,
|
|
61
|
-
.MixCard_horizontalSpace_s,
|
|
62
|
-
.MixCard_horizontalSpace_m,
|
|
63
|
-
.MixCard_horizontalSpace_l,
|
|
64
|
-
.MixCard_horizontalSpace_xl,
|
|
65
|
-
.MixCard_horizontalSpace_2xl,
|
|
66
|
-
.MixCard_horizontalSpace_3xl,
|
|
67
|
-
.MixCard_horizontalSpace_4xl,
|
|
68
|
-
.MixCard_horizontalSpace_5xl {
|
|
69
|
-
padding-right: var(--horizontal-space);
|
|
70
|
-
padding-left: var(--horizontal-space);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.MixCard_horizontalSpace_xs {
|
|
74
|
-
--horizontal-space: var(--space-xs);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.MixCard_horizontalSpace_s {
|
|
78
|
-
--horizontal-space: var(--space-s);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.MixCard_horizontalSpace_m {
|
|
82
|
-
--horizontal-space: var(--space-m);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.MixCard_horizontalSpace_l {
|
|
86
|
-
--horizontal-space: var(--space-l);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.MixCard_horizontalSpace_xl {
|
|
90
|
-
--horizontal-space: var(--space-xl);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.MixCard_horizontalSpace_2xl {
|
|
94
|
-
--horizontal-space: var(--space-2xl);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.MixCard_horizontalSpace_3xl {
|
|
98
|
-
--horizontal-space: var(--space-3xl);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.MixCard_horizontalSpace_4xl {
|
|
102
|
-
--horizontal-space: var(--space-4xl);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.MixCard_horizontalSpace_5xl {
|
|
106
|
-
--horizontal-space: var(--space-5xl);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
11
|
.MixCard_form_round,
|
|
110
12
|
.MixCard_form_square {
|
|
111
13
|
border-radius: var(--border-radius);
|
|
@@ -11,6 +11,6 @@ declare type Props = {
|
|
|
11
11
|
form?: FormMap;
|
|
12
12
|
status?: CardStatus;
|
|
13
13
|
};
|
|
14
|
-
declare type CnCard = (
|
|
14
|
+
declare type CnCard = (props: Props, classNames?: Array<string | undefined>) => string;
|
|
15
15
|
export declare const cnMixCard: CnCard;
|
|
16
16
|
export {};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import { __assign, __read, __rest, __spread } from "tslib";
|
|
1
2
|
import './MixCard.css';
|
|
2
3
|
import { cn } from '../../utils/bem';
|
|
4
|
+
import { cnMixSpace } from '../MixSpace/MixSpace';
|
|
3
5
|
var formMap = ['round', 'square'];
|
|
4
6
|
var cardStatus = ['alert', 'success', 'warning'];
|
|
5
|
-
|
|
7
|
+
var cnCard = cn('MixCard');
|
|
8
|
+
export var cnMixCard = function (props, classNames) {
|
|
9
|
+
if (classNames === void 0) { classNames = []; }
|
|
10
|
+
var verticalSpace = props.verticalSpace, horizontalSpace = props.horizontalSpace, otherProps = __rest(props, ["verticalSpace", "horizontalSpace"]);
|
|
11
|
+
return cnCard(__assign({}, otherProps), __spread([
|
|
12
|
+
cnMixSpace({ pV: verticalSpace, pH: horizontalSpace })
|
|
13
|
+
], classNames));
|
|
14
|
+
};
|
package/createIcon/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@consta/uikit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"ui-kit",
|
|
6
6
|
"design-system",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"Badge",
|
|
31
31
|
"BasicSelectDeprecated",
|
|
32
32
|
"Breadcrumbs",
|
|
33
|
+
"BreadcrumbsCanary",
|
|
33
34
|
"Button",
|
|
34
35
|
"Calendar",
|
|
35
36
|
"Card",
|
package/useDebounce/package.json
CHANGED
package/useFlag/package.json
CHANGED
package/useForkRef/package.json
CHANGED
package/useKeys/package.json
CHANGED
package/useOverflow/package.json
CHANGED
package/usePrevious/package.json
CHANGED
package/useSelect/package.json
CHANGED
package/useTimer/package.json
CHANGED