@synerise/ds-cascader 0.5.30 → 0.5.32
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 +19 -0
- package/dist/Cascader.js +2 -1
- package/dist/Elements/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/Elements/Breadcrumb/Breadcrumb.js +4 -2
- package/dist/Elements/Breadcrumb/Breadcrumb.styles.d.ts +3 -1
- package/dist/Elements/Breadcrumb/Breadcrumb.styles.js +6 -16
- package/dist/Elements/Breadcrumb/Breadcrumb.types.d.ts +4 -3
- package/dist/Elements/Breadcrumb/utils.d.ts +1 -1
- package/dist/Elements/BreadcrumbsList/BreadcrumbsList.d.ts +1 -1
- package/dist/Elements/BreadcrumbsList/BreadcrumbsList.js +10 -5
- package/dist/Elements/BreadcrumbsList/BreadcrumbsList.types.d.ts +5 -3
- package/dist/Elements/Navigation/Navigation.js +1 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.5.32](https://github.com/Synerise/synerise-design/compare/@synerise/ds-cascader@0.5.31...@synerise/ds-cascader@0.5.32) (2025-01-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-cascader
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.5.31](https://github.com/Synerise/synerise-design/compare/@synerise/ds-cascader@0.5.30...@synerise/ds-cascader@0.5.31) (2024-12-16)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **cascader:** display tick icon for search results ([c61cf06](https://github.com/Synerise/synerise-design/commit/c61cf0606556f146d48396b8712b22b6c9c14fe5))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.5.30](https://github.com/Synerise/synerise-design/compare/@synerise/ds-cascader@0.5.29...@synerise/ds-cascader@0.5.30) (2024-12-13)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-cascader
|
package/dist/Cascader.js
CHANGED
|
@@ -162,7 +162,8 @@ export var Cascader = function Cascader(_ref) {
|
|
|
162
162
|
paths: filteredPaths,
|
|
163
163
|
highlight: searchQuery,
|
|
164
164
|
onBreadCrumbClick: handleBreadCrumbClick,
|
|
165
|
-
scrollTop: scrollTop
|
|
165
|
+
scrollTop: scrollTop,
|
|
166
|
+
selectedIds: selectedIds
|
|
166
167
|
})), /*#__PURE__*/React.createElement(Navigation, {
|
|
167
168
|
backActionVisible: backActionVisible,
|
|
168
169
|
breadcrumbVisible: !searchQuery && !!activeCategory.path,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BreadcrumbProps } from './Breadcrumb.types';
|
|
3
|
-
export declare const Breadcrumb: ({ path, disabled, highlight, description, onPathClick, compact, startWithArrow, gradientOverlap, highlightActivePath, className, prefixel, ...rest }: BreadcrumbProps) => React.JSX.Element;
|
|
3
|
+
export declare const Breadcrumb: ({ path, disabled, highlight, description, onPathClick, compact, startWithArrow, gradientOverlap, highlightActivePath, className, prefixel, isNavigation, ...rest }: BreadcrumbProps) => React.JSX.Element;
|
|
4
4
|
export default Breadcrumb;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["path", "disabled", "highlight", "description", "onPathClick", "compact", "startWithArrow", "gradientOverlap", "highlightActivePath", "className", "prefixel"];
|
|
1
|
+
var _excluded = ["path", "disabled", "highlight", "description", "onPathClick", "compact", "startWithArrow", "gradientOverlap", "highlightActivePath", "className", "prefixel", "isNavigation"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
4
|
import React, { useEffect, useState, useRef, useMemo } from 'react';
|
|
@@ -19,6 +19,7 @@ export var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
19
19
|
highlightActivePath = _ref.highlightActivePath,
|
|
20
20
|
className = _ref.className,
|
|
21
21
|
prefixel = _ref.prefixel,
|
|
22
|
+
isNavigation = _ref.isNavigation,
|
|
22
23
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
23
24
|
var pathToDisplay = useMemo(function () {
|
|
24
25
|
var breadcrumbsArray = [].concat(path);
|
|
@@ -46,7 +47,8 @@ export var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
46
47
|
prefixel: !!prefixel,
|
|
47
48
|
disabled: disabled,
|
|
48
49
|
compact: compact,
|
|
49
|
-
clickable: !!onPathClick
|
|
50
|
+
clickable: !!onPathClick,
|
|
51
|
+
isNavigation: isNavigation
|
|
50
52
|
}, rest), /*#__PURE__*/React.createElement(S.OuterWrapper, null, prefixel && /*#__PURE__*/React.createElement(S.PrefixWrapper, {
|
|
51
53
|
"data-testid": "list-item-prefix",
|
|
52
54
|
disabled: disabled
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ThemeProps } from '@synerise/ds-core';
|
|
2
3
|
export declare const PrefixWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
3
4
|
visible?: boolean | undefined;
|
|
@@ -20,11 +21,12 @@ export declare const disableDefaultClickingStyles: (props: ThemeProps & {
|
|
|
20
21
|
}) => import("styled-components").FlattenSimpleInterpolation;
|
|
21
22
|
export declare const OuterWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
22
23
|
export declare const InnerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
23
|
-
export declare const Breadcrumb: import("styled-components").StyledComponent<"
|
|
24
|
+
export declare const Breadcrumb: import("styled-components").StyledComponent<(props: import("@synerise/ds-list-item").ListItemProps) => import("react").JSX.Element, any, {
|
|
24
25
|
clickable?: boolean | undefined;
|
|
25
26
|
prefixel?: boolean | undefined;
|
|
26
27
|
size?: string | undefined;
|
|
27
28
|
disabled?: boolean | undefined;
|
|
28
29
|
compact?: boolean | undefined;
|
|
30
|
+
isNavigation?: boolean | undefined;
|
|
29
31
|
}, never>;
|
|
30
32
|
export declare const BreadcrumbRoute: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
+
import ListItem from '@synerise/ds-list-item';
|
|
3
|
+
import { Inner } from '@synerise/ds-list-item/dist/components/Text/Text.styles';
|
|
2
4
|
var TRANSITION_FN = '0.3s ease-in-out';
|
|
3
5
|
export var PrefixWrapper = styled.div.withConfig({
|
|
4
6
|
displayName: "Breadcrumbstyles__PrefixWrapper",
|
|
@@ -53,29 +55,17 @@ export var InnerWrapper = styled.div.withConfig({
|
|
|
53
55
|
displayName: "Breadcrumbstyles__InnerWrapper",
|
|
54
56
|
componentId: "sc-1rgfkd8-8"
|
|
55
57
|
})(["text-overflow:ellipsis;order:2;overflow:hidden;white-space:nowrap;font-size:13px;line-height:1.39;min-height:18px;user-select:none;"]);
|
|
56
|
-
export var Breadcrumb = styled.
|
|
58
|
+
export var Breadcrumb = styled(ListItem).withConfig({
|
|
57
59
|
displayName: "Breadcrumbstyles__Breadcrumb",
|
|
58
60
|
componentId: "sc-1rgfkd8-9"
|
|
59
|
-
})(["
|
|
60
|
-
return props.theme.palette['grey-700'];
|
|
61
|
-
}, BreadcrumbContent, function (props) {
|
|
61
|
+
})(["", "{direction:", ";flex-wrap:", ";}&:hover{", "::after{opacity:0;}", "::before{opacity:0;}}", " ", ""], BreadcrumbContent, function (props) {
|
|
62
62
|
return props.compact ? 'rtl' : 'ltr';
|
|
63
63
|
}, function (props) {
|
|
64
64
|
return props.compact ? 'no-wrap' : 'wrap';
|
|
65
|
-
}, function (props) {
|
|
66
|
-
return props.theme.palette['grey-050'];
|
|
67
|
-
}, function (props) {
|
|
68
|
-
return props.theme.palette['blue-600'];
|
|
69
|
-
}, ArrowRight, function (props) {
|
|
70
|
-
return props.disabled ? props.theme.palette['grey-600'] : props.theme.palette['blue-600'];
|
|
71
|
-
}, BreadcrumbName, Description, function (props) {
|
|
72
|
-
return props.disabled ? props.theme.palette['grey-600'] : props.theme.palette['blue-600'];
|
|
73
65
|
}, ContentWrapper, ContentWrapper, function (props) {
|
|
74
|
-
return props.theme.palette['blue-600'];
|
|
75
|
-
}, ContentWrapper, function (props) {
|
|
76
|
-
return "-webkit-linear-gradient( left,\n " + props.theme.palette['grey-100'] + " 0%,\n rgba(255,255,255,0) 100%\n )";
|
|
66
|
+
return props.isNavigation ? css(["&:hover,&:active,&:focus,&:focus:active{", "{background:transparent;}}", ",", "{&:hover{color:", ";}}&&&{", ":hover{.ds-icon > svg{fill:", " !important;}}&:focus{", "{box-shadow:none;}}"], Inner, BreadcrumbName, Description, props.disabled ? props.theme.palette['grey-600'] : props.theme.palette['blue-600'], PrefixWrapper, props.theme.palette['blue-600'], Inner) : css(["&:hover{background:", ";color:", ";", " > .ds-icon > svg{fill:", ";}", ",", "{color:", ";}}&:focus:not(:active){box-shadow:inset 0 0 0 2px ", ";}&:focus:active{", "::before{background-image:", ";}}"], props.theme.palette['grey-050'], props.theme.palette['blue-600'], ArrowRight, props.disabled ? props.theme.palette['grey-600'] : props.theme.palette['blue-600'], BreadcrumbName, Description, props.disabled ? props.theme.palette['grey-600'] : props.theme.palette['blue-600'], props.theme.palette['blue-600'], ContentWrapper, "-webkit-linear-gradient( left, " + props.theme.palette['grey-100'] + " 0%, rgba(255,255,255,0) 100%)");
|
|
77
67
|
}, function (props) {
|
|
78
|
-
return
|
|
68
|
+
return props.clickable && !props.isNavigation && disableDefaultClickingStyles(props);
|
|
79
69
|
});
|
|
80
70
|
export var BreadcrumbRoute = styled.div.withConfig({
|
|
81
71
|
displayName: "Breadcrumbstyles__BreadcrumbRoute",
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { ListItemProps } from '@synerise/ds-list-item';
|
|
2
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
export type BreadcrumbProps = ListItemProps & {
|
|
3
4
|
prefixel?: ReactNode;
|
|
4
5
|
disabled?: boolean;
|
|
6
|
+
isNavigation?: boolean;
|
|
5
7
|
path: string[];
|
|
6
8
|
highlight?: string;
|
|
7
9
|
className?: string;
|
|
@@ -9,7 +11,6 @@ export type BreadcrumbProps = {
|
|
|
9
11
|
onPathClick?: (path: string & {
|
|
10
12
|
id?: number | string;
|
|
11
13
|
}) => void;
|
|
12
|
-
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
13
14
|
compact?: boolean;
|
|
14
15
|
startWithArrow?: boolean;
|
|
15
16
|
gradientOverlap?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
|
-
export declare const attachActiveClassName: (index: number, highlightActivePath: boolean, path: Array<string>, compact: boolean) => "
|
|
2
|
+
export declare const attachActiveClassName: (index: number, highlightActivePath: boolean, path: Array<string>, compact: boolean) => "" | "active";
|
|
3
3
|
export declare const shouldRenderArrow: (breadCrumbPath: string[], index: number, startWithArrow: boolean) => boolean;
|
|
4
4
|
export declare const shouldHaveArrowPlaceholder: (index: number, path: string[], compact: boolean, startWithArrow: boolean) => boolean;
|
|
5
5
|
export declare const isOverflown: (elementRef: RefObject<HTMLDivElement>) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Path } from '../../Cascader.types';
|
|
3
3
|
import { BreadcrumbsListProps } from './BreadcrumbsList.types';
|
|
4
|
-
export declare const BreadcrumbsList: ({ paths, highlight, width, visibleRows, onBreadCrumbClick, rowHeight, scrollTop, }: BreadcrumbsListProps) => React.ReactElement<import("@synerise/ds-search/dist/Elements/SearchItems/SearchItems.types").SearchItemListProps<Path>, string | React.JSXElementConstructor<any>>;
|
|
4
|
+
export declare const BreadcrumbsList: ({ paths, highlight, width, visibleRows, onBreadCrumbClick, rowHeight, scrollTop, selectedIds, }: BreadcrumbsListProps) => React.ReactElement<import("@synerise/ds-search/dist/Elements/SearchItems/SearchItems.types").SearchItemListProps<Path>, string | React.JSXElementConstructor<any>>;
|
|
5
5
|
export default BreadcrumbsList;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { renderSearchList } from '@synerise/ds-search/dist/Elements/SearchItems/SearchItems';
|
|
3
|
+
import Icon, { CheckS } from '@synerise/ds-icon';
|
|
4
|
+
import { theme } from '@synerise/ds-core';
|
|
3
5
|
import Breadcrumb from '../Breadcrumb/Breadcrumb';
|
|
4
6
|
var DEFAULT_VISIBLE_ROWS = 6;
|
|
5
7
|
var DEFAULT_ROW_HEIGHT = 50;
|
|
@@ -10,7 +12,8 @@ export var BreadcrumbsList = function BreadcrumbsList(_ref) {
|
|
|
10
12
|
visibleRows = _ref.visibleRows,
|
|
11
13
|
onBreadCrumbClick = _ref.onBreadCrumbClick,
|
|
12
14
|
rowHeight = _ref.rowHeight,
|
|
13
|
-
scrollTop = _ref.scrollTop
|
|
15
|
+
scrollTop = _ref.scrollTop,
|
|
16
|
+
selectedIds = _ref.selectedIds;
|
|
14
17
|
var listPropsObject = {
|
|
15
18
|
scrollTop: scrollTop
|
|
16
19
|
};
|
|
@@ -22,16 +25,18 @@ export var BreadcrumbsList = function BreadcrumbsList(_ref) {
|
|
|
22
25
|
rowHeight: rowHeight || DEFAULT_ROW_HEIGHT,
|
|
23
26
|
onItemClick: onBreadCrumbClick,
|
|
24
27
|
itemRender: function itemRender(item) {
|
|
28
|
+
var tickIcon = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Icon, {
|
|
29
|
+
color: theme.palette['green-600'],
|
|
30
|
+
component: /*#__PURE__*/React.createElement(CheckS, null)
|
|
31
|
+
}));
|
|
25
32
|
return /*#__PURE__*/React.createElement(Breadcrumb, {
|
|
26
33
|
gradientOverlap: true,
|
|
27
34
|
compact: true,
|
|
28
35
|
path: item.path,
|
|
29
36
|
key: "" + item.id,
|
|
37
|
+
suffixel: selectedIds.includes(item.id) ? tickIcon : undefined,
|
|
30
38
|
description: item.path[item.path.length - 1],
|
|
31
|
-
highlight: highlight
|
|
32
|
-
onClick: function onClick() {
|
|
33
|
-
return onBreadCrumbClick && onBreadCrumbClick(item);
|
|
34
|
-
}
|
|
39
|
+
highlight: highlight
|
|
35
40
|
});
|
|
36
41
|
},
|
|
37
42
|
listProps: listPropsObject
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { ReactText } from 'react';
|
|
2
|
+
import type { Path } from '../../Cascader.types';
|
|
3
|
+
export type BreadcrumbsListProps = {
|
|
3
4
|
paths: Path[];
|
|
4
5
|
width: number | string;
|
|
5
6
|
rowHeight?: number;
|
|
@@ -7,4 +8,5 @@ export interface BreadcrumbsListProps {
|
|
|
7
8
|
highlight?: string;
|
|
8
9
|
onBreadCrumbClick?: (breadcrumb: Path) => void;
|
|
9
10
|
scrollTop: number;
|
|
10
|
-
|
|
11
|
+
selectedIds: ReactText[];
|
|
12
|
+
};
|
|
@@ -14,6 +14,7 @@ export var Navigation = function Navigation(_ref) {
|
|
|
14
14
|
breadcrumbVisible = _ref.breadcrumbVisible;
|
|
15
15
|
var renderBreadcrumbs = function renderBreadcrumbs() {
|
|
16
16
|
return breadcrumbVisible && activeCategory ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Breadcrumb, {
|
|
17
|
+
isNavigation: true,
|
|
17
18
|
path: activeCategory.path,
|
|
18
19
|
onPathClick: onPathClick,
|
|
19
20
|
gradientOverlap: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-cascader",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.32",
|
|
4
4
|
"description": "Cascader UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-divider": "^0.7.
|
|
38
|
-
"@synerise/ds-icon": "^0.
|
|
39
|
-
"@synerise/ds-list-item": "^0.6.
|
|
40
|
-
"@synerise/ds-scrollbar": "^0.11.
|
|
41
|
-
"@synerise/ds-search": "^0.9.
|
|
42
|
-
"@synerise/ds-search-bar": "^0.7.
|
|
37
|
+
"@synerise/ds-divider": "^0.7.20",
|
|
38
|
+
"@synerise/ds-icon": "^0.69.1",
|
|
39
|
+
"@synerise/ds-list-item": "^0.6.2",
|
|
40
|
+
"@synerise/ds-scrollbar": "^0.11.23",
|
|
41
|
+
"@synerise/ds-search": "^0.9.24",
|
|
42
|
+
"@synerise/ds-search-bar": "^0.7.8",
|
|
43
43
|
"@synerise/ds-utils": "^0.31.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"react": ">=16.9.0 <= 17.0.2",
|
|
48
48
|
"styled-components": "5.0.1"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "f591d14d24d6a14aab76edcb60f04aaadec8336d"
|
|
51
51
|
}
|