@desynova-digital/components 8.19.55 → 8.19.57

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.
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
 
7
7
  var _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; };
8
+ // import colors from "../../../tokens/colors";
9
+
8
10
 
9
11
  var _templateObject = _taggedTemplateLiteral(["\n position: relative;\n &:hover {\n .tooltip-block {\n display: block;\n }\n }\n .tooltip-block {\n position: absolute;\n z-index: 1;\n top: ", ";\n background: #000;\n padding: 10px 8px;\n border-radius: 5px;\n font-size: 12px;\n text-transform: initial;\n display: none;\n color: #fff;\n font-family: SFUIText-Regular;\n left: 50%;\n transform: translateX(-50%);\n &:after {\n content: \"\";\n position: absolute;\n border-left: 5px solid transparent;\n border-right: 5px solid transparent;\n\n ", "\n left: 50%;\n transform: translateX(-50%);\n }\n }\n"], ["\n position: relative;\n &:hover {\n .tooltip-block {\n display: block;\n }\n }\n .tooltip-block {\n position: absolute;\n z-index: 1;\n top: ", ";\n background: #000;\n padding: 10px 8px;\n border-radius: 5px;\n font-size: 12px;\n text-transform: initial;\n display: none;\n color: #fff;\n font-family: SFUIText-Regular;\n left: 50%;\n transform: translateX(-50%);\n &:after {\n content: \"\";\n position: absolute;\n border-left: 5px solid transparent;\n border-right: 5px solid transparent;\n\n ", "\n left: 50%;\n transform: translateX(-50%);\n }\n }\n"]),
10
- _templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n text-transform: uppercase;\n text-align: center;\n font-size: 14px;\n position: relative;\n align-items: center;\n font-weight: 600;\n top: 0;\n margin: 0 auto;\n width: ", ";\n /* width: ", "; */\n height: ", ";\n border: ", ";\n background: ", ";\n border-color: ", ";\n\n color: ", ";\n\n padding: ", ";\n\n opacity: ", ";\n cursor: ", ";\n pointer-events: ", ";\n\n border-radius: ", ";\n\n /* box-shadow: ", ";\n transition: ", "; */\n\n ", " {\n position: relative;\n top: 0px;\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n background: ", ";\n border-radius: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n &:hover {\n transition: all 0.4s;\n color: ", ";\n box-shadow: ", ";\n /* top: ", "; */\n background: ", ";\n border-color: ", ";\n transition: ", ";\n box-shadow: ", ";\n \n ", " {\n\n path{\n \n ", "\n ", "\n \n }\n }\n }\n\n &:focus {\n background: ", ";\n border-color: ", ";\n outline: none;\n }\n\n &:active {\n background: ", ";\n border-color: ", ";\n outline: none;\n }\n .loader-wrapper{\n position: absolute;\n top:50%;\n left:50%;\n transform: translate(-50%, -50%);\n }\n"], ["\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n text-transform: uppercase;\n text-align: center;\n font-size: 14px;\n position: relative;\n align-items: center;\n font-weight: 600;\n top: 0;\n margin: 0 auto;\n width: ", ";\n /* width: ", "; */\n height: ", ";\n border: ", ";\n background: ", ";\n border-color: ", ";\n\n color: ", ";\n\n padding: ", ";\n\n opacity: ", ";\n cursor: ", ";\n pointer-events: ", ";\n\n border-radius: ", ";\n\n /* box-shadow: ", ";\n transition: ", "; */\n\n ", " {\n position: relative;\n top: 0px;\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n background: ", ";\n border-radius: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n &:hover {\n transition: all 0.4s;\n color: ", ";\n box-shadow: ", ";\n /* top: ", "; */\n background: ", ";\n border-color: ", ";\n transition: ", ";\n box-shadow: ", ";\n \n ", " {\n\n path{\n \n ", "\n ", "\n \n }\n }\n }\n\n &:focus {\n background: ", ";\n border-color: ", ";\n outline: none;\n }\n\n &:active {\n background: ", ";\n border-color: ", ";\n outline: none;\n }\n .loader-wrapper{\n position: absolute;\n top:50%;\n left:50%;\n transform: translate(-50%, -50%);\n }\n"]),
12
+ _templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n text-transform: uppercase;\n text-align: center;\n font-size: 14px;\n position: relative;\n align-items: center;\n font-weight: 600;\n top: 0;\n margin: 0 auto;\n width: ", ";\n height: ", ";\n border: ", ";\n background: ", ";\n border-color: ", ";\n\n color: ", ";\n\n padding: ", ";\n\n opacity: ", ";\n cursor: ", ";\n pointer-events: ", ";\n\n border-radius: ", ";\n\n /* box-shadow: ", ";\n transition: ", "; */\n\n ", " {\n position: relative;\n top: 0px;\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n background: ", ";\n border-radius: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n &:hover {\n transition: all 0.4s;\n color: ", ";\n box-shadow: ", ";\n /* top: ", "; */\n background: ", ";\n border-color: ", ";\n transition: ", ";\n box-shadow: ", ";\n \n ", " {\n\n path{\n \n ", "\n ", "\n \n }\n }\n }\n\n &:focus {\n background: ", ";\n border-color: ", ";\n outline: none;\n }\n\n &:active {\n background: ", ";\n border-color: ", ";\n outline: none;\n }\n .loader-wrapper{\n position: absolute;\n top:50%;\n left:50%;\n transform: translate(-50%, -50%);\n }\n"], ["\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n text-transform: uppercase;\n text-align: center;\n font-size: 14px;\n position: relative;\n align-items: center;\n font-weight: 600;\n top: 0;\n margin: 0 auto;\n width: ", ";\n height: ", ";\n border: ", ";\n background: ", ";\n border-color: ", ";\n\n color: ", ";\n\n padding: ", ";\n\n opacity: ", ";\n cursor: ", ";\n pointer-events: ", ";\n\n border-radius: ", ";\n\n /* box-shadow: ", ";\n transition: ", "; */\n\n ", " {\n position: relative;\n top: 0px;\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n background: ", ";\n border-radius: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n &:hover {\n transition: all 0.4s;\n color: ", ";\n box-shadow: ", ";\n /* top: ", "; */\n background: ", ";\n border-color: ", ";\n transition: ", ";\n box-shadow: ", ";\n \n ", " {\n\n path{\n \n ", "\n ", "\n \n }\n }\n }\n\n &:focus {\n background: ", ";\n border-color: ", ";\n outline: none;\n }\n\n &:active {\n background: ", ";\n border-color: ", ";\n outline: none;\n }\n .loader-wrapper{\n position: absolute;\n top:50%;\n left:50%;\n transform: translate(-50%, -50%);\n }\n"]),
11
13
  _templateObject3 = _taggedTemplateLiteral(["\n display: inline-block;\n vertical-align: middle;\n"], ["\n display: inline-block;\n vertical-align: middle;\n"]);
12
14
 
13
15
  var _react = require("react");
@@ -242,8 +244,6 @@ var Button = function Button(_ref) {
242
244
 
243
245
  Button.Element = _styledComponents2.default.button(_templateObject2, function (props) {
244
246
  return getAttributes(props).width ? getAttributes(props).width : "auto";
245
- }, function (props) {
246
- return props.width ? props.width + "px" : props.stretchWidth ? '100%' : "auto";
247
247
  }, function (props) {
248
248
  return props.height ? props.height + "px" : "auto";
249
249
  }, function (props) {
@@ -21,7 +21,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
21
21
  null,
22
22
  _react2.default.createElement(
23
23
  _components.Button,
24
- null,
24
+ { theme: 'nexc' },
25
25
  'Button'
26
26
  ),
27
27
  _react2.default.createElement(
@@ -116,6 +116,7 @@ var CircleDonut = function (_Component) {
116
116
  var pathD = _this.props.data.graph_type && _this.props.data.graph_type != '' ? circleList[_this.props.data.graph_type].d : circleList['donutDefault'].d;
117
117
  var circleCircumference = _this.props.data.graph_type && _this.props.data.graph_type != '' ? circleList[_this.props.data.graph_type].c : circleList['donutDefault'].c;
118
118
  var graphTitleName = _this.props.data && _this.props.data.data && _this.props.data.data.name ? _this.props.data.data.name : new Date().getTime() + '';
119
+ graphTitleName = graphTitleName.replaceAll(" ", '');
119
120
 
120
121
  return _react2.default.createElement(
121
122
  StyledCircleDonut,
@@ -151,6 +151,15 @@ var Tabs = function (_React$Component) {
151
151
  return selectedIndex;
152
152
  }
153
153
  }, {
154
+ key: 'getNestedTabFromPropsOrState',
155
+ value: function getNestedTabFromPropsOrState() {
156
+ var stateSelectedIndex = this.state.selectedNestedTabIndex;
157
+ var propsSelectedIndex = this.props.selectedNestedTabIndex;
158
+ var selectedIndex = typeof propsSelectedIndex !== 'undefined' ? propsSelectedIndex : stateSelectedIndex;
159
+
160
+ return selectedIndex;
161
+ }
162
+ }, {
154
163
  key: 'changeNestedTab',
155
164
  value: function changeNestedTab(nextIndex, parentTabIndex) {
156
165
  // Deselect main tab when changing the nested tab
@@ -168,7 +177,7 @@ var Tabs = function (_React$Component) {
168
177
  return null;
169
178
  }
170
179
 
171
- var parentTabRef = _react2.default.createRef();
180
+ var nestedIdx = this.getNestedTabFromPropsOrState();
172
181
 
173
182
  return _react2.default.createElement(
174
183
  _react2.default.Fragment,
@@ -176,7 +185,6 @@ var Tabs = function (_React$Component) {
176
185
  _react2.default.createElement(
177
186
  TabLink,
178
187
  {
179
- ref: parentTabRef,
180
188
  selected: this.state.selectedIndex === index,
181
189
  allowPointerEvents: true,
182
190
  key: tab.props.label,
@@ -191,7 +199,7 @@ var Tabs = function (_React$Component) {
191
199
  'div',
192
200
  {
193
201
  key: nestedTab.props.label,
194
- className: _this2.state.selectedNestedTabIndex === nestedIndex ? 'option active' : 'option',
202
+ className: nestedIdx === nestedIndex ? 'option active' : 'option',
195
203
  theme: _this2.props.theme,
196
204
  onClick: function onClick() {
197
205
  return _this2.changeNestedTab(nestedIndex, index);
@@ -255,7 +263,9 @@ Tabs.propTypes = {
255
263
  /** onSelect will be called with the new index when a new tab is selected by the user */
256
264
  onSelect: _propTypes2.default.func,
257
265
 
258
- index: _propTypes2.default.number
266
+ index: _propTypes2.default.number,
267
+
268
+ selectedNestedTabIndex: _propTypes2.default.number
259
269
  };
260
270
 
261
271
  Tabs.defaultProps = {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@desynova-digital/components",
3
- "version": "8.19.55",
3
+ "version": "8.19.57",
4
4
  "description": "Components for Desynova Digital",
5
5
  "main": "index.js",
6
6
  "author": "desynova-digital",
7
7
  "license": "MIT",
8
8
  "repository": "desynova-digital",
9
9
  "dependencies": {
10
- "@desynova-digital/tokens": "8.19.55",
10
+ "@desynova-digital/tokens": "8.19.57",
11
11
  "prop-types": "^15.7.2",
12
12
  "styled-components": "^4.3.2"
13
13
  },