@synerise/ds-sidebar 0.5.50 → 0.6.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/CHANGELOG.md +11 -0
- package/dist/Panel/Panel.d.ts +1 -1
- package/dist/Panel/Panel.js +6 -11
- package/dist/Sidebar.js +5 -2
- package/dist/Sidebar.styles.js +1 -1
- package/dist/Sidebar.types.d.ts +6 -5
- package/dist/modules.d.js +1 -1
- package/dist/style/index.css +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.6.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-sidebar@0.5.50...@synerise/ds-sidebar@0.6.0) (2025-01-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* antd@4.24 react@18 ([d97a667](https://github.com/Synerise/synerise-design/commit/d97a667b1f33aed3177e1851de3b6f60be2d46a6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [0.5.50](https://github.com/Synerise/synerise-design/compare/@synerise/ds-sidebar@0.5.49...@synerise/ds-sidebar@0.5.50) (2025-01-21)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @synerise/ds-sidebar
|
package/dist/Panel/Panel.d.ts
CHANGED
package/dist/Panel/Panel.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
var _excluded = ["header", "children", "id"];
|
|
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
2
|
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
|
-
function
|
|
5
|
-
|
|
6
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
8
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
|
-
import React from 'react';
|
|
3
|
+
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); }
|
|
4
|
+
import React, { useContext, useMemo, useRef } from 'react';
|
|
10
5
|
import { useDrag, useDrop } from 'react-dnd';
|
|
11
6
|
import Icon, { DragHandleM } from '@synerise/ds-icon';
|
|
12
7
|
import { theme } from '@synerise/ds-core';
|
|
@@ -17,7 +12,7 @@ var DraggablePanel = function DraggablePanel(_ref) {
|
|
|
17
12
|
context = _ref.context,
|
|
18
13
|
order = _ref.order,
|
|
19
14
|
children = _ref.children;
|
|
20
|
-
var ref =
|
|
15
|
+
var ref = useRef(null);
|
|
21
16
|
var index = order ? order.indexOf(id) : 0;
|
|
22
17
|
var _useDrop = useDrop({
|
|
23
18
|
accept: 'PANEL',
|
|
@@ -52,7 +47,7 @@ var DraggablePanel = function DraggablePanel(_ref) {
|
|
|
52
47
|
index: index
|
|
53
48
|
},
|
|
54
49
|
begin: function begin() {
|
|
55
|
-
return
|
|
50
|
+
return _extends({}, {
|
|
56
51
|
type: 'PANEL',
|
|
57
52
|
index: index
|
|
58
53
|
});
|
|
@@ -81,11 +76,11 @@ export var Panel = function Panel(_ref2) {
|
|
|
81
76
|
children = _ref2.children,
|
|
82
77
|
id = _ref2.id,
|
|
83
78
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
84
|
-
var context =
|
|
79
|
+
var context = useContext(SidebarContext);
|
|
85
80
|
var _ref3 = context || {},
|
|
86
81
|
order = _ref3.order;
|
|
87
82
|
var isDragDrop = context && !!order;
|
|
88
|
-
var panelContent =
|
|
83
|
+
var panelContent = useMemo(function () {
|
|
89
84
|
return /*#__PURE__*/React.createElement(S.AntdPanel, _extends({
|
|
90
85
|
header: /*#__PURE__*/React.createElement(S.SidebarHeader, null, /*#__PURE__*/React.createElement("span", {
|
|
91
86
|
"data-testid": "header-" + id
|
package/dist/Sidebar.js
CHANGED
|
@@ -66,7 +66,7 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
66
66
|
}
|
|
67
67
|
return /*#__PURE__*/React.createElement(S.AntdCollapse, _extends({}, activeKeysProp, {
|
|
68
68
|
className: isDragDrop ? 'is-drag-drop' : '',
|
|
69
|
-
expandIconPosition: "
|
|
69
|
+
expandIconPosition: "end",
|
|
70
70
|
expandIcon: function expandIcon(panelProps) {
|
|
71
71
|
var checkActive = panelProps.isActive;
|
|
72
72
|
return isActive(checkActive);
|
|
@@ -74,7 +74,10 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
74
74
|
onChange: handleOnChange
|
|
75
75
|
}, collapseProps), isDragDrop ? React.Children.toArray(children).sort(compareByPositionOfKey) : children);
|
|
76
76
|
}, [antdDefaultActiveKey, antdActiveKey, isDragDrop, handleOnChange, collapseProps, children, compareByPositionOfKey]);
|
|
77
|
-
return isDragDrop ?
|
|
77
|
+
return isDragDrop ?
|
|
78
|
+
/*#__PURE__*/
|
|
79
|
+
// @ts-expect-error
|
|
80
|
+
React.createElement(DndProvider, {
|
|
78
81
|
backend: HTML5Backend
|
|
79
82
|
}, /*#__PURE__*/React.createElement(SidebarContext.Provider, {
|
|
80
83
|
value: {
|
package/dist/Sidebar.styles.js
CHANGED
|
@@ -36,7 +36,7 @@ export var PanelWrapper = styled.div.withConfig({
|
|
|
36
36
|
export var AntdCollapse = styled(Collapse).withConfig({
|
|
37
37
|
displayName: "Sidebarstyles__AntdCollapse",
|
|
38
38
|
componentId: "sc-19um1hw-3"
|
|
39
|
-
})(["&.ant-collapse{background-color:", ";border:none;.ant-collapse-header{padding:19px 24px;color:", ";font-weight:500;font-size:14px;background:white;&:hover{color:", ";}&:active{box-shadow:0px 16px 32px 0px rgba(35,41,54,0.1);}}> ", " > .ant-collapse-item > .ant-collapse-header{transition:0.2s ease-in-out;display:flex;align-items:center;justify-content:flex-start;}.ant-collapse-content-active,.ant-collapse-item-active{border-top:0;", ",", "{color:", ";&:hover{color:", ";}}.ant-collapse-header{background:", ";}}.ant-collapse-content-box{padding:16px 24px;}.ant-collapse-item{position:relative;border-top:solid 1px ", ";border-bottom:none;.drag-handle-m:hover{cursor:grabbing;}}}.ant-collapse-item:hover ", "{opacity:1;}&.ant-collapse-icon-position-
|
|
39
|
+
})(["&.ant-collapse{background-color:", ";border:none;.ant-collapse-header{padding:19px 24px;color:", ";font-weight:500;font-size:14px;background:white;&:hover{color:", ";}&:active{box-shadow:0px 16px 32px 0px rgba(35,41,54,0.1);}}> ", " > .ant-collapse-item > .ant-collapse-header{transition:0.2s ease-in-out;display:flex;align-items:center;justify-content:flex-start;}.ant-collapse-content-active,.ant-collapse-item-active{border-top:0;", ",", "{color:", ";&:hover{color:", ";}}.ant-collapse-header{background:", ";}}.ant-collapse-content-box{padding:16px 24px;}.ant-collapse-item{position:relative;border-top:solid 1px ", ";border-bottom:none;.drag-handle-m:hover{cursor:grabbing;}}}.ant-collapse-item:hover ", "{opacity:1;}&.ant-collapse-icon-position-end > ", " > .ant-collapse-item > .ant-collapse-header{padding:18px 24px;user-select:none;.ant-collapse-expand-icon{right:24px;position:absolute;}}&.ant-collapse-icon-position-end.is-drag-drop > ", " > .ant-collapse-item > .ant-collapse-header{padding:18px 24px 18px 0;cursor:pointer;&:hover,&:active{color:", ";box-shadow:0 16px 32px 0 rgba(35,41,54,0.1);}}"], themePaletteBlue050, themePaletteGrey700, themePaletteGrey800, PanelWrapper, SidebarHeader, SidebarHandle, themePaletteGrey700, themePaletteGrey800, themePaletteGrey050, themePaletteGrey200, SidebarHandle, PanelWrapper, PanelWrapper, themePaletteGrey800);
|
|
40
40
|
export var AntdPanel = styled(Panel).withConfig({
|
|
41
41
|
displayName: "Sidebarstyles__AntdPanel",
|
|
42
42
|
componentId: "sc-19um1hw-4"
|
package/dist/Sidebar.types.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { CollapseProps } from 'antd/lib/collapse';
|
|
3
3
|
export type SidebarProps = CollapseProps & {
|
|
4
|
-
children:
|
|
4
|
+
children: ReactNode;
|
|
5
5
|
order?: string[];
|
|
6
6
|
onChangeOrder?: (order: Order) => void;
|
|
7
7
|
};
|
|
8
8
|
export type PanelProps = {
|
|
9
|
-
header:
|
|
10
|
-
children:
|
|
9
|
+
header: ReactNode;
|
|
10
|
+
children: ReactNode;
|
|
11
11
|
id: string;
|
|
12
12
|
};
|
|
13
13
|
export type DraggablePanelProps = {
|
|
14
14
|
id: string;
|
|
15
15
|
order?: Order;
|
|
16
|
+
children?: ReactNode;
|
|
16
17
|
context?: SidebarContextType;
|
|
17
18
|
};
|
|
18
19
|
export type SidebarContextType = {
|
|
@@ -20,4 +21,4 @@ export type SidebarContextType = {
|
|
|
20
21
|
setOrder: (dragIndex: number, hoverIndex: number) => void;
|
|
21
22
|
};
|
|
22
23
|
export type Order = string[] | string;
|
|
23
|
-
export type CompareFnType = (a:
|
|
24
|
+
export type CompareFnType = (a: ReactElement<PanelProps>, b: ReactElement<PanelProps>) => number;
|
package/dist/modules.d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import '@testing-library/jest-dom
|
|
1
|
+
import '@testing-library/jest-dom';
|
package/dist/style/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ant-
|
|
1
|
+
.ant-collapse{box-sizing:border-box;margin:0;padding:0;color:#6a7580;font-size:13px;font-variant:tabular-nums;line-height:1.38;list-style:none;font-feature-settings:'tnum';background-color:#e9edee;border:1px solid #dbe0e3;border-bottom:0;border-radius:3px}.ant-collapse>.ant-collapse-item{border-bottom:1px solid #dbe0e3}.ant-collapse>.ant-collapse-item:last-child,.ant-collapse>.ant-collapse-item:last-child>.ant-collapse-header{border-radius:0 0 3px 3px}.ant-collapse>.ant-collapse-item>.ant-collapse-header{position:relative;display:flex;flex-wrap:nowrap;align-items:flex-start;padding:12px 16px;color:#384350;line-height:1.38;cursor:pointer;transition:all .3s,visibility 0s}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{display:inline-block;margin-right:12px;font-size:11px;vertical-align:-1px}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow svg{transition:transform .24s}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-header-text{flex:auto}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-extra{margin-left:auto}.ant-collapse>.ant-collapse-item>.ant-collapse-header:focus{outline:0}.ant-collapse>.ant-collapse-item .ant-collapse-header-collapsible-only{cursor:default}.ant-collapse>.ant-collapse-item .ant-collapse-header-collapsible-only .ant-collapse-header-text{flex:none;cursor:pointer}.ant-collapse>.ant-collapse-item .ant-collapse-icon-collapsible-only{cursor:default}.ant-collapse>.ant-collapse-item .ant-collapse-icon-collapsible-only .ant-collapse-expand-icon{cursor:pointer}.ant-collapse>.ant-collapse-item.ant-collapse-no-arrow>.ant-collapse-header{padding-left:12px}.ant-collapse-icon-position-end>.ant-collapse-item>.ant-collapse-header{position:relative;padding:12px 16px;padding-right:40px}.ant-collapse-icon-position-end>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{position:absolute;top:50%;right:16px;left:auto;margin:0;transform:translateY(-50%)}.ant-collapse-content{color:#6a7580;background-color:#fff;border-top:1px solid #dbe0e3}.ant-collapse-content>.ant-collapse-content-box{padding:16px}.ant-collapse-content-hidden{display:none}.ant-collapse-item:last-child>.ant-collapse-content{border-radius:0 0 3px 3px}.ant-collapse-borderless{background-color:#e9edee;border:0}.ant-collapse-borderless>.ant-collapse-item{border-bottom:1px solid #dbe0e3}.ant-collapse-borderless>.ant-collapse-item:last-child,.ant-collapse-borderless>.ant-collapse-item:last-child .ant-collapse-header{border-radius:0}.ant-collapse-borderless>.ant-collapse-item:last-child{border-bottom:0}.ant-collapse-borderless>.ant-collapse-item>.ant-collapse-content{background-color:transparent;border-top:0}.ant-collapse-borderless>.ant-collapse-item>.ant-collapse-content>.ant-collapse-content-box{padding-top:4px}.ant-collapse-ghost{background-color:transparent;border:0}.ant-collapse-ghost>.ant-collapse-item{border-bottom:0}.ant-collapse-ghost>.ant-collapse-item>.ant-collapse-content{background-color:transparent;border-top:0}.ant-collapse-ghost>.ant-collapse-item>.ant-collapse-content>.ant-collapse-content-box{padding-top:12px;padding-bottom:12px}.ant-collapse .ant-collapse-item-disabled>.ant-collapse-header,.ant-collapse .ant-collapse-item-disabled>.ant-collapse-header>.arrow{color:#b5bdc3;cursor:not-allowed}.ant-collapse-rtl{direction:rtl}.ant-collapse-rtl.ant-collapse.ant-collapse-icon-position-end>.ant-collapse-item>.ant-collapse-header{position:relative;padding:12px 16px;padding-left:40px}.ant-collapse-rtl.ant-collapse.ant-collapse-icon-position-end>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{position:absolute;top:50%;right:auto;left:16px;margin:0;transform:translateY(-50%)}.ant-collapse-rtl .ant-collapse>.ant-collapse-item>.ant-collapse-header{padding:12px 16px;padding-right:40px}.ant-collapse-rtl.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{margin-right:0;margin-left:12px}.ant-collapse-rtl.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow svg{transform:rotate(180deg)}.ant-collapse-rtl.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-extra{margin-right:auto;margin-left:0}.ant-collapse-rtl.ant-collapse>.ant-collapse-item.ant-collapse-no-arrow>.ant-collapse-header{padding-right:12px;padding-left:0}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-sidebar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Sidebar UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-button": "^0.
|
|
38
|
-
"@synerise/ds-dropdown": "^0.
|
|
39
|
-
"@synerise/ds-icon": "^0.
|
|
40
|
-
"@synerise/ds-menu": "^0.
|
|
41
|
-
"@synerise/ds-utils": "^0.
|
|
37
|
+
"@synerise/ds-button": "^0.23.0",
|
|
38
|
+
"@synerise/ds-dropdown": "^0.19.0",
|
|
39
|
+
"@synerise/ds-icon": "^0.71.0",
|
|
40
|
+
"@synerise/ds-menu": "^0.21.0",
|
|
41
|
+
"@synerise/ds-utils": "^0.32.0",
|
|
42
42
|
"dnd-core": "10.0.2",
|
|
43
43
|
"immutability-helper": "^3.0.1",
|
|
44
44
|
"react-dnd": "^10.0.2",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@synerise/ds-core": "*",
|
|
49
|
-
"antd": "4.
|
|
50
|
-
"react": ">=16.9.0 <=
|
|
51
|
-
"styled-components": "5.
|
|
49
|
+
"antd": "4.24.16",
|
|
50
|
+
"react": ">=16.9.0 <= 18.3.1",
|
|
51
|
+
"styled-components": "^5.3.3"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "fbde34e126b492edaf148e469ab96247a891d6df"
|
|
54
54
|
}
|