@synerise/ds-list 0.6.0 → 0.6.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 +32 -0
- package/dist/Elements/Text/Text.styles.js +2 -2
- package/dist/List.js +52 -70
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
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.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-list@0.6.3...@synerise/ds-list@0.6.4) (2021-11-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-list
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.6.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-list@0.6.2...@synerise/ds-list@0.6.3) (2021-11-22)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-list
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.6.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-list@0.6.1...@synerise/ds-list@0.6.2) (2021-11-16)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @synerise/ds-list
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [0.6.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-list@0.5.60...@synerise/ds-list@0.6.1) (2021-11-09)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @synerise/ds-list
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
# [0.6.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-list@0.5.60...@synerise/ds-list@0.6.0) (2021-11-09)
|
|
7
39
|
|
|
8
40
|
**Note:** Version bump only for package @synerise/ds-list
|
|
@@ -19,9 +19,9 @@ export var Wrapper = styled.li.withConfig({
|
|
|
19
19
|
}, function (props) {
|
|
20
20
|
return props.size === 'medium' && css(["padding:12px;padding-left:", ";"], props.icon ? '12px' : '16px');
|
|
21
21
|
}, IconWrapper, function (props) {
|
|
22
|
-
return !props.disabled && "\n fill: "
|
|
22
|
+
return !props.disabled && "\n fill: " + (props.danger ? props.theme.palette['red-600'] : props.theme.palette['grey-600']) + ";\n ";
|
|
23
23
|
}, function (props) {
|
|
24
|
-
return !props.disabled && "\n "
|
|
24
|
+
return !props.disabled && "\n " + IconWrapper + " {\n svg {\n fill: " + (props.danger ? props.theme.palette['red-600'] : props.theme.palette['blue-600']) + ";\n }\n }\n color: " + (props.danger ? props.theme.palette['red-600'] : props.theme.palette['blue-600']) + ";\n background: " + (props.danger ? props.theme.palette['red-050'] : props.theme.palette['grey-050']) + ";\n ";
|
|
25
25
|
}, function (_ref) {
|
|
26
26
|
var theme = _ref.theme;
|
|
27
27
|
return theme.palette['blue-600'];
|
package/dist/List.js
CHANGED
|
@@ -1,32 +1,14 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
|
-
|
|
3
1
|
var _excluded = ["dataSource", "radio", "options", "dashed"];
|
|
4
2
|
|
|
5
3
|
function _extends() { _extends = Object.assign || 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); }
|
|
6
4
|
|
|
7
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8
|
-
|
|
9
5
|
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; }
|
|
10
6
|
|
|
11
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
|
-
|
|
13
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
14
|
-
|
|
15
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
16
|
-
|
|
17
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
18
|
-
|
|
19
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
20
|
-
|
|
21
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
22
|
-
|
|
23
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
24
|
-
|
|
25
7
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
26
8
|
|
|
27
|
-
function
|
|
9
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
28
10
|
|
|
29
|
-
function
|
|
11
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
30
12
|
|
|
31
13
|
import * as React from 'react';
|
|
32
14
|
import { v4 as uuid } from 'uuid';
|
|
@@ -48,78 +30,78 @@ export var isNestedArray = function isNestedArray(array) {
|
|
|
48
30
|
};
|
|
49
31
|
|
|
50
32
|
var List = /*#__PURE__*/function (_React$PureComponent) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var _super = _createSuper(List);
|
|
33
|
+
_inheritsLoose(List, _React$PureComponent);
|
|
54
34
|
|
|
55
35
|
function List(props) {
|
|
56
36
|
var _this;
|
|
57
37
|
|
|
58
|
-
|
|
38
|
+
_this = _React$PureComponent.call(this, props) || this;
|
|
39
|
+
|
|
40
|
+
_defineProperty(_assertThisInitialized(_this), "uuidKey", void 0);
|
|
59
41
|
|
|
60
|
-
_this = _super.call(this, props);
|
|
61
|
-
_this.uuidKey = void 0;
|
|
62
42
|
_this.uuidKey = uuid();
|
|
63
43
|
return _this;
|
|
64
44
|
}
|
|
65
45
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (isNestedArray(dataSource)) {
|
|
79
|
-
ReadyList = !!dataSource && // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
80
|
-
// @ts-ignore
|
|
81
|
-
dataSource.map(function (singleDataSource, index) {
|
|
82
|
-
var isLastItem = dataSource.length === index + 1;
|
|
83
|
-
|
|
84
|
-
if (index === 0) {
|
|
85
|
-
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
86
|
-
key: uuid()
|
|
87
|
-
}, /*#__PURE__*/React.createElement(AntdList, _extends({}, rest, {
|
|
88
|
-
dataSource: singleDataSource
|
|
89
|
-
})), !isLastItem && /*#__PURE__*/React.createElement(ListDivider, {
|
|
90
|
-
dashed: !!dashed,
|
|
91
|
-
"data-testid": "divider"
|
|
92
|
-
}));
|
|
93
|
-
}
|
|
46
|
+
var _proto = List.prototype;
|
|
47
|
+
|
|
48
|
+
_proto.render = function render() {
|
|
49
|
+
var _this$props = this.props,
|
|
50
|
+
dataSource = _this$props.dataSource,
|
|
51
|
+
radio = _this$props.radio,
|
|
52
|
+
options = _this$props.options,
|
|
53
|
+
dashed = _this$props.dashed,
|
|
54
|
+
rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
55
|
+
|
|
56
|
+
var ReadyList;
|
|
94
57
|
|
|
58
|
+
if (isNestedArray(dataSource)) {
|
|
59
|
+
ReadyList = !!dataSource && // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
dataSource.map(function (singleDataSource, index) {
|
|
62
|
+
var isLastItem = dataSource.length === index + 1;
|
|
63
|
+
|
|
64
|
+
if (index === 0) {
|
|
95
65
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
96
66
|
key: uuid()
|
|
97
67
|
}, /*#__PURE__*/React.createElement(AntdList, _extends({}, rest, {
|
|
98
|
-
header: null,
|
|
99
68
|
dataSource: singleDataSource
|
|
100
69
|
})), !isLastItem && /*#__PURE__*/React.createElement(ListDivider, {
|
|
101
70
|
dashed: !!dashed,
|
|
102
71
|
"data-testid": "divider"
|
|
103
72
|
}));
|
|
104
|
-
}
|
|
105
|
-
} else {
|
|
106
|
-
ReadyList = /*#__PURE__*/React.createElement(React.Fragment, {
|
|
107
|
-
key: this.uuidKey || uuid()
|
|
108
|
-
}, /*#__PURE__*/React.createElement(AntdList, _extends({}, rest, {
|
|
109
|
-
dataSource: dataSource
|
|
110
|
-
})));
|
|
111
|
-
}
|
|
73
|
+
}
|
|
112
74
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
75
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
76
|
+
key: uuid()
|
|
77
|
+
}, /*#__PURE__*/React.createElement(AntdList, _extends({}, rest, {
|
|
78
|
+
header: null,
|
|
79
|
+
dataSource: singleDataSource
|
|
80
|
+
})), !isLastItem && /*#__PURE__*/React.createElement(ListDivider, {
|
|
81
|
+
dashed: !!dashed,
|
|
82
|
+
"data-testid": "divider"
|
|
83
|
+
}));
|
|
84
|
+
});
|
|
85
|
+
} else {
|
|
86
|
+
ReadyList = /*#__PURE__*/React.createElement(React.Fragment, {
|
|
87
|
+
key: this.uuidKey || uuid()
|
|
88
|
+
}, /*#__PURE__*/React.createElement(AntdList, _extends({}, rest, {
|
|
89
|
+
dataSource: dataSource
|
|
90
|
+
})));
|
|
116
91
|
}
|
|
117
|
-
|
|
92
|
+
|
|
93
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, radio ? /*#__PURE__*/React.createElement(RadioGroupWrapper, {
|
|
94
|
+
options: options
|
|
95
|
+
}, ReadyList) : ReadyList);
|
|
96
|
+
};
|
|
118
97
|
|
|
119
98
|
return List;
|
|
120
99
|
}(React.PureComponent);
|
|
121
100
|
|
|
122
|
-
List
|
|
123
|
-
|
|
124
|
-
List
|
|
101
|
+
_defineProperty(List, "ItemWrapper", ItemWrapper);
|
|
102
|
+
|
|
103
|
+
_defineProperty(List, "Item", TextItem);
|
|
104
|
+
|
|
105
|
+
_defineProperty(List, "Divider", ListDivider);
|
|
106
|
+
|
|
125
107
|
export default List;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-list",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "List UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-divider": "^0.5.
|
|
36
|
-
"@synerise/ds-radio": "^0.11.
|
|
37
|
-
"@synerise/ds-utils": "^0.21.
|
|
35
|
+
"@synerise/ds-divider": "^0.5.4",
|
|
36
|
+
"@synerise/ds-radio": "^0.11.4",
|
|
37
|
+
"@synerise/ds-utils": "^0.21.4",
|
|
38
38
|
"uuid": "^7.0.2"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"antd": "^4",
|
|
43
43
|
"react": ">=16.9.0 < 17.0.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "3e5f807c3c9ce7bbcb707b1e229ad5d7ef50d830"
|
|
46
46
|
}
|