@semcore/widget-empty 2.6.3 → 2.7.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 +25 -1
- package/lib/cjs/Error/index.js +7 -4
- package/lib/cjs/Error/index.js.map +1 -1
- package/lib/cjs/NoData/index.js +7 -4
- package/lib/cjs/NoData/index.js.map +1 -1
- package/lib/cjs/WidgetEmpty.js +18 -16
- package/lib/cjs/WidgetEmpty.js.map +1 -1
- package/lib/cjs/index.d.ts +65 -0
- package/lib/cjs/index.js +11 -29
- package/lib/cjs/index.js.map +1 -1
- package/lib/es6/Error/index.js +1 -2
- package/lib/es6/Error/index.js.map +1 -1
- package/lib/es6/NoData/index.js +2 -3
- package/lib/es6/NoData/index.js.map +1 -1
- package/lib/es6/WidgetEmpty.js +13 -15
- package/lib/es6/WidgetEmpty.js.map +1 -1
- package/lib/es6/index.d.ts +65 -0
- package/lib/es6/index.js +0 -2
- package/lib/es6/index.js.map +1 -1
- package/package.json +12 -6
- package/src/Error/{index.js → index.jsx} +0 -0
- package/src/NoData/{index.js → index.jsx} +2 -3
- package/src/{WidgetEmpty.js → WidgetEmpty.jsx} +4 -3
- package/src/index.js +0 -2
- package/svg/radial-tree-chart.svg +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,11 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [2.7.0] - 2022-04-14
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added `radial-tree-chart` illustration.
|
|
10
|
+
|
|
11
|
+
## [2.6.6] - 2022-03-14
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Version patch update due to children dependencies update (`@semcore/utils` [3.31.2 ~> 3.31.2], `@semcore/flex-box` [4.5.0 ~> 4.5.1]).
|
|
16
|
+
|
|
17
|
+
## [2.6.5] - 2022-02-24
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- Added repository field to package.json file.
|
|
22
|
+
|
|
23
|
+
## [2.6.4] - 2022-02-24
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Removed unused dependencies `@semcore/link`, `@semcore/button`.
|
|
28
|
+
|
|
5
29
|
## [2.6.3] - 2022-01-18
|
|
6
30
|
|
|
7
31
|
### Changed
|
|
8
32
|
|
|
9
|
-
-
|
|
33
|
+
- Removed unused dependencies `@semcore/icon`.
|
|
10
34
|
|
|
11
35
|
## [2.6.2] - 2021-8-26
|
|
12
36
|
|
package/lib/cjs/Error/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -51,6 +51,10 @@ var _ko = _interopRequireDefault(require("./translations/ko.json"));
|
|
|
51
51
|
|
|
52
52
|
var _vi = _interopRequireDefault(require("./translations/vi.json"));
|
|
53
53
|
|
|
54
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
55
|
+
|
|
56
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
57
|
+
|
|
54
58
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
55
59
|
|
|
56
60
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -82,8 +86,7 @@ var Error = /*#__PURE__*/function (_Component) {
|
|
|
82
86
|
(0, _createClass2["default"])(Error, [{
|
|
83
87
|
key: "render",
|
|
84
88
|
value: function render() {
|
|
85
|
-
var _ref = this
|
|
86
|
-
|
|
89
|
+
var _ref = this.asProps;
|
|
87
90
|
var _this$asProps = this.asProps,
|
|
88
91
|
Children = _this$asProps.Children,
|
|
89
92
|
description = _this$asProps.description,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Error/index.
|
|
1
|
+
{"version":3,"sources":["../../../src/Error/index.jsx"],"names":["i18n","de","en","es","fr","it","ja","ru","zh","pt","ko","vi","Error","asProps","Children","description","getI18nText","title","descriptionText","WidgetEmpty","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA;;AAFA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,IAAI,GAAG;AAAEC,EAAAA,EAAE,EAAFA,cAAF;AAAMC,EAAAA,EAAE,EAAFA,cAAN;AAAUC,EAAAA,EAAE,EAAFA,cAAV;AAAcC,EAAAA,EAAE,EAAFA,cAAd;AAAkBC,EAAAA,EAAE,EAAFA,cAAlB;AAAsBC,EAAAA,EAAE,EAAFA,cAAtB;AAA0BC,EAAAA,EAAE,EAAFA,cAA1B;AAA8BC,EAAAA,EAAE,EAAFA,cAA9B;AAAkCC,EAAAA,EAAE,EAAFA,cAAlC;AAAsCC,EAAAA,EAAE,EAAFA,cAAtC;AAA0CC,EAAAA,EAAE,EAAFA;AAA1C,CAAb;;IAEMC,K;;;;;;;;;;;;WAOJ,kBAAS;AAAA;AACP,0BAA+C,KAAKC,OAApD;AAAA,UAAQC,QAAR,iBAAQA,QAAR;AAAA,UAAkBC,WAAlB,iBAAkBA,WAAlB;AAAA,UAA+BC,WAA/B,iBAA+BA,WAA/B;;AACA,yBAAgDA,WAAW,EAA3D;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAA4BC,eAA5B,gBAAeH,WAAf;;AAEA,0BACE,gCAAcI,uBAAd;AAAA,gBAAiC,8BAAY,SAAZ;AAAjC,6BACE,gCAAC,uBAAD,CAAa,KAAb,QAAoBF,KAApB,CADF,eAEE,gCAAC,uBAAD,CAAa,WAAb,QAA0BF,WAAW,IAAIG,eAAzC,CAFF,eAGE,gCAAC,QAAD,OAHF,CADF;AAOD;;;EAlBiBE,e;;iCAAdR,K,iBACiB,a;iCADjBA,K,kBAEkB;AACpBZ,EAAAA,IAAI,EAAJA;AADoB,C;iCAFlBY,K,aAKa,CAAC,8BAAD,C;;eAgBJ,sBAAgBA,KAAhB,C","sourcesContent":["import React from 'react';\nimport WidgetEmpty, { getIconPath } from '../WidgetEmpty';\nimport createComponent, { Component, Root } from '@semcore/core';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport de from './translations/de.json';\nimport en from './translations/en.json';\nimport es from './translations/es.json';\nimport fr from './translations/fr.json';\nimport it from './translations/it.json';\nimport ja from './translations/ja.json';\nimport pt from './translations/pt.json';\nimport ru from './translations/ru.json';\nimport zh from './translations/zh.json';\nimport ko from './translations/ko.json';\nimport vi from './translations/vi.json';\n\nconst i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };\n\nclass Error extends Component {\n static displayName = 'WidgetError';\n static defaultProps = {\n i18n,\n };\n static enhance = [i18nEnhance()];\n\n render() {\n const { Children, description, getI18nText } = this.asProps;\n const { title, description: descriptionText } = getI18nText();\n\n return (\n <Root render={WidgetEmpty} icon={getIconPath('warning')}>\n <WidgetEmpty.Title>{title}</WidgetEmpty.Title>\n <WidgetEmpty.Description>{description || descriptionText}</WidgetEmpty.Description>\n <Children />\n </Root>\n );\n }\n}\n\nexport default createComponent(Error);\n"],"file":"index.js"}
|
package/lib/cjs/NoData/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -51,6 +51,10 @@ var _ko = _interopRequireDefault(require("./translations/ko.json"));
|
|
|
51
51
|
|
|
52
52
|
var _vi = _interopRequireDefault(require("./translations/vi.json"));
|
|
53
53
|
|
|
54
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
55
|
+
|
|
56
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
57
|
+
|
|
54
58
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
55
59
|
|
|
56
60
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -82,8 +86,7 @@ var NoData = /*#__PURE__*/function (_Component) {
|
|
|
82
86
|
(0, _createClass2["default"])(NoData, [{
|
|
83
87
|
key: "render",
|
|
84
88
|
value: function render() {
|
|
85
|
-
var _ref = this
|
|
86
|
-
|
|
89
|
+
var _ref = this.asProps;
|
|
87
90
|
var _this$asProps = this.asProps,
|
|
88
91
|
Children = _this$asProps.Children,
|
|
89
92
|
type = _this$asProps.type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/NoData/index.
|
|
1
|
+
{"version":3,"sources":["../../../src/NoData/index.jsx"],"names":["i18n","de","en","es","fr","it","ja","ru","zh","pt","ko","vi","NoData","asProps","Children","type","description","getI18nText","title","descriptionText","WidgetEmpty","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA;;AAFA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,IAAI,GAAG;AAAEC,EAAAA,EAAE,EAAFA,cAAF;AAAMC,EAAAA,EAAE,EAAFA,cAAN;AAAUC,EAAAA,EAAE,EAAFA,cAAV;AAAcC,EAAAA,EAAE,EAAFA,cAAd;AAAkBC,EAAAA,EAAE,EAAFA,cAAlB;AAAsBC,EAAAA,EAAE,EAAFA,cAAtB;AAA0BC,EAAAA,EAAE,EAAFA,cAA1B;AAA8BC,EAAAA,EAAE,EAAFA,cAA9B;AAAkCC,EAAAA,EAAE,EAAFA,cAAlC;AAAsCC,EAAAA,EAAE,EAAFA,cAAtC;AAA0CC,EAAAA,EAAE,EAAFA;AAA1C,CAAb;;IAEMC,M;;;;;;;;;;;;WAQJ,kBAAS;AAAA;AACP,0BAAqD,KAAKC,OAA1D;AAAA,UAAQC,QAAR,iBAAQA,QAAR;AAAA,UAAkBC,IAAlB,iBAAkBA,IAAlB;AAAA,UAAwBC,WAAxB,iBAAwBA,WAAxB;AAAA,UAAqCC,WAArC,iBAAqCA,WAArC;;AACA,yBAAgDA,WAAW,EAA3D;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAA4BC,eAA5B,gBAAeH,WAAf;;AACA,0BACE,gCAAcI,uBAAd;AAAA,gBAAiC,8BAAYL,IAAZ;AAAjC,6BACE,gCAAC,uBAAD,CAAa,KAAb,QAAoBG,KAApB,CADF,eAEE,gCAAC,uBAAD,CAAa,WAAb,QAA0BF,WAAW,IAAIG,eAAzC,CAFF,eAGE,gCAAC,QAAD,OAHF,CADF;AAOD;;;EAlBkBE,e;;iCAAfT,M,iBACiB,c;iCADjBA,M,aAEa,CAAC,8BAAD,C;iCAFbA,M,kBAGkB;AACpBZ,EAAAA,IAAI,EAAJA,IADoB;AAEpBe,EAAAA,IAAI,EAAE;AAFc,C;;eAkBT,sBAAgBH,MAAhB,C","sourcesContent":["import React from 'react';\nimport WidgetEmpty, { getIconPath } from '../WidgetEmpty';\nimport createComponent, { Component, Root } from '@semcore/core';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport de from './translations/de.json';\nimport en from './translations/en.json';\nimport es from './translations/es.json';\nimport fr from './translations/fr.json';\nimport it from './translations/it.json';\nimport ja from './translations/ja.json';\nimport pt from './translations/pt.json';\nimport ru from './translations/ru.json';\nimport zh from './translations/zh.json';\nimport ko from './translations/ko.json';\nimport vi from './translations/vi.json';\n\nconst i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };\n\nclass NoData extends Component {\n static displayName = 'WidgetNoData';\n static enhance = [i18nEnhance()];\n static defaultProps = {\n i18n,\n type: 'other-data',\n };\n\n render() {\n const { Children, type, description, getI18nText } = this.asProps;\n const { title, description: descriptionText } = getI18nText();\n return (\n <Root render={WidgetEmpty} icon={getIconPath(type)}>\n <WidgetEmpty.Title>{title}</WidgetEmpty.Title>\n <WidgetEmpty.Description>{description || descriptionText}</WidgetEmpty.Description>\n <Children />\n </Root>\n );\n }\n}\n\nexport default createComponent(NoData);\n"],"file":"index.js"}
|
package/lib/cjs/WidgetEmpty.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports["default"] =
|
|
10
|
+
exports.getIconPath = exports["default"] = void 0;
|
|
11
11
|
|
|
12
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
13
|
|
|
@@ -29,11 +29,13 @@ var _flexBox = require("@semcore/flex-box");
|
|
|
29
29
|
|
|
30
30
|
var _isNode = _interopRequireDefault(require("@semcore/utils/lib/isNode"));
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
33
|
|
|
34
|
-
function
|
|
34
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
35
|
|
|
36
|
-
function
|
|
36
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
37
|
+
|
|
38
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
37
39
|
|
|
38
40
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
39
41
|
|
|
@@ -44,20 +46,20 @@ var style = (
|
|
|
44
46
|
/*__reshadow_css_start__*/
|
|
45
47
|
_core.sstyled.insert(
|
|
46
48
|
/*__inner_css_start__*/
|
|
47
|
-
".
|
|
49
|
+
".___SWidgetEmpty_1ui0d_gg_{flex-direction:column;justify-content:center;align-items:center;margin-bottom:16px}.___SImage_1ui0d_gg_{display:flex;align-items:flex-end;justify-content:center;margin-bottom:12px}.___STitle_1ui0d_gg_{color:#757575}.___STitle_1ui0d_gg_{font-size:16px;line-height:1.5;font-weight:700}.___SDescription_1ui0d_gg_{text-align:center;font-size:14px;line-height:1.42;color:#757575;max-width:400px}.___STitle_1ui0d_gg_+.___SDescription_1ui0d_gg_{margin-top:4px}.___SDescription_1ui0d_gg_+.___SDescription_1ui0d_gg_{margin-top:8px}"
|
|
48
50
|
/*__inner_css_end__*/
|
|
49
51
|
, "1ncdu8o_gg_")
|
|
50
52
|
/*__reshadow_css_end__*/
|
|
51
53
|
, {
|
|
52
|
-
"__SWidgetEmpty": "
|
|
53
|
-
"__SImage": "
|
|
54
|
-
"__STitle": "
|
|
55
|
-
"__SDescription": "
|
|
54
|
+
"__SWidgetEmpty": "___SWidgetEmpty_1ui0d_gg_",
|
|
55
|
+
"__SImage": "___SImage_1ui0d_gg_",
|
|
56
|
+
"__STitle": "___STitle_1ui0d_gg_",
|
|
57
|
+
"__SDescription": "___SDescription_1ui0d_gg_"
|
|
56
58
|
});
|
|
57
|
-
var version = "2.
|
|
59
|
+
var version = "2.7.0";
|
|
58
60
|
|
|
59
61
|
var getIconPath = function getIconPath(name) {
|
|
60
|
-
return "
|
|
62
|
+
return "https://static.semrush.com/ui-kit/widget-empty/".concat(version, "/").concat(name, ".svg");
|
|
61
63
|
};
|
|
62
64
|
|
|
63
65
|
exports.getIconPath = getIconPath;
|
|
@@ -75,7 +77,7 @@ var WidgetEmpty = /*#__PURE__*/function (_Component) {
|
|
|
75
77
|
(0, _createClass2["default"])(WidgetEmpty, [{
|
|
76
78
|
key: "render",
|
|
77
79
|
value: function render() {
|
|
78
|
-
var _ref = this
|
|
80
|
+
var _ref = this.asProps,
|
|
79
81
|
_ref4;
|
|
80
82
|
|
|
81
83
|
var SWidgetEmpty = _flexBox.Flex;
|
|
@@ -86,7 +88,7 @@ var WidgetEmpty = /*#__PURE__*/function (_Component) {
|
|
|
86
88
|
var SImage = 'div';
|
|
87
89
|
return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SWidgetEmpty, _ref4.cn("SWidgetEmpty", _objectSpread({}, (0, _core.assignProps)({}, _ref))), (0, _isNode["default"])(icon) && /*#__PURE__*/_react["default"].createElement(SImage, _ref4.cn("SImage", {}), typeof icon === 'string' ? /*#__PURE__*/_react["default"].createElement("img", _ref4.cn("img", {
|
|
88
90
|
"src": icon,
|
|
89
|
-
"alt":
|
|
91
|
+
"alt": "widget empty icon",
|
|
90
92
|
"width": 100,
|
|
91
93
|
"height": 72
|
|
92
94
|
})) : icon), /*#__PURE__*/_react["default"].createElement(Children, _ref4.cn("Children", {})));
|
|
@@ -99,7 +101,7 @@ var WidgetEmpty = /*#__PURE__*/function (_Component) {
|
|
|
99
101
|
(0, _defineProperty2["default"])(WidgetEmpty, "style", style);
|
|
100
102
|
|
|
101
103
|
var Title = function Title(props) {
|
|
102
|
-
var _ref2 =
|
|
104
|
+
var _ref2 = arguments[0],
|
|
103
105
|
_ref5;
|
|
104
106
|
|
|
105
107
|
var STitle = _flexBox.Box;
|
|
@@ -108,7 +110,7 @@ var Title = function Title(props) {
|
|
|
108
110
|
};
|
|
109
111
|
|
|
110
112
|
var Description = function Description(props) {
|
|
111
|
-
var _ref3 =
|
|
113
|
+
var _ref3 = arguments[0],
|
|
112
114
|
_ref6;
|
|
113
115
|
|
|
114
116
|
var SDescription = _flexBox.Box;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/WidgetEmpty.
|
|
1
|
+
{"version":3,"sources":["../../src/WidgetEmpty.jsx"],"names":["version","getIconPath","name","WidgetEmpty","SWidgetEmpty","Flex","asProps","Children","icon","styles","SImage","Component","style","Title","props","STitle","Box","Description","SDescription"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,OAAO,UAAb;;AAIO,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAACC,IAAD,EAAU;AACnC,kEAAyDF,OAAzD,cAAoEE,IAApE;AACD,CAFM;;;;IAIDC,W;;;;;;;;;;;;WAIJ,kBAAS;AAAA;AAAA;;AACP,UAAMC,YAAY,GAKMC,aALxB;AACA,0BAAmC,KAAKC,OAAxC;AAAA,UAAQC,QAAR,iBAAQA,QAAR;AAAA,UAAkBC,IAAlB,iBAAkBA,IAAlB;AAAA,UAAwBC,MAAxB,iBAAwBA,MAAxB;AACA,UAAMC,MAAM,GAAG,KAAf;AAEA,qBAAO,mBAAQD,MAAR,CAAP,eACE,gCAAC,YAAD,iFACG,wBAAOD,IAAP,kBACC,gCAAC,MAAD,0BACG,OAAOA,IAAP,KAAgB,QAAhB,gBACC;AAAA,eAAUA,IAAV;AAAA,eAAoB,mBAApB;AAAA,iBAA+C,GAA/C;AAAA,kBAA4D;AAA5D,SADD,GAGCA,IAJJ,CAFJ,eAUE,gCAAC,QAAD,2BAVF,CADF;AAcD;;;EAvBuBG,e;;iCAApBR,W,iBACiB,a;iCADjBA,W,WAEWS,K;;AAwBjB,IAAMC,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD,EAAW;AAAA;AAAA;;AACvB,MAAMC,MAAM,GAE2BC,YAFvC;AACA,MAAQP,MAAR,GAAmBK,KAAnB,CAAQL,MAAR;AACA,iBAAO,mBAAQA,MAAR,CAAP,eAAuB,gCAAC,MAAD,2EAAvB;AACD,CAJD;;AAMA,IAAMQ,WAAW,GAAG,SAAdA,WAAc,CAACH,KAAD,EAAW;AAAA;AAAA;;AAC7B,MAAMI,YAAY,GAE2BF,YAF7C;AACA,MAAQP,MAAR,GAAmBK,KAAnB,CAAQL,MAAR;AACA,iBAAO,mBAAQA,MAAR,CAAP,eAAuB,gCAAC,YAAD,iFAAvB;AACD,CAJD;;eAMe,sBAAgBN,WAAhB,EAA6B;AAC1CU,EAAAA,KAAK,EAALA,KAD0C;AAE1CI,EAAAA,WAAW,EAAXA;AAF0C,CAA7B,C","sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box, Flex } from '@semcore/flex-box';\nimport isNode from '@semcore/utils/lib/isNode';\n\nimport style from './style/widget-empty.shadow.css';\n\nconst version = preval`\n module.exports = require('../package.json').version\n`;\n\nexport const getIconPath = (name) => {\n return `https://static.semrush.com/ui-kit/widget-empty/${version}/${name}.svg`;\n};\n\nclass WidgetEmpty extends Component {\n static displayName = 'WidgetEmpty';\n static style = style;\n\n render() {\n const SWidgetEmpty = Root;\n const { Children, icon, styles } = this.asProps;\n const SImage = 'div';\n\n return sstyled(styles)(\n <SWidgetEmpty render={Flex}>\n {isNode(icon) && (\n <SImage>\n {typeof icon === 'string' ? (\n <img src={icon} alt=\"widget empty icon\" width={100} height={72} />\n ) : (\n icon\n )}\n </SImage>\n )}\n <Children />\n </SWidgetEmpty>,\n );\n }\n}\n\nconst Title = (props) => {\n const STitle = Root;\n const { styles } = props;\n return sstyled(styles)(<STitle render={Box} />);\n};\n\nconst Description = (props) => {\n const SDescription = Root;\n const { styles } = props;\n return sstyled(styles)(<SDescription render={Box} />);\n};\n\nexport default createComponent(WidgetEmpty, {\n Title,\n Description,\n});\n"],"file":"WidgetEmpty.js"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
3
|
+
import { Box, IFlexProps } from '@semcore/flex-box';
|
|
4
|
+
import { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';
|
|
5
|
+
|
|
6
|
+
export type iconNames =
|
|
7
|
+
| 'area-chart'
|
|
8
|
+
| 'choropleth-map-chart'
|
|
9
|
+
| 'combined-chart'
|
|
10
|
+
| 'congrats'
|
|
11
|
+
| 'deleted-page'
|
|
12
|
+
| 'donut-chart'
|
|
13
|
+
| 'duplicates'
|
|
14
|
+
| 'funnel-chart'
|
|
15
|
+
| 'good'
|
|
16
|
+
| 'horizontal-bar-chart'
|
|
17
|
+
| 'line-chart'
|
|
18
|
+
| 'lollipop-chart'
|
|
19
|
+
| 'nexttime'
|
|
20
|
+
| 'nothing-found'
|
|
21
|
+
| 'other-data'
|
|
22
|
+
| 'pie-chart'
|
|
23
|
+
| 'processing'
|
|
24
|
+
| 'radar-chart'
|
|
25
|
+
| 'sankey-chart'
|
|
26
|
+
| 'scatter-plot-chart'
|
|
27
|
+
| 'stacked-area-chart'
|
|
28
|
+
| 'suggestions'
|
|
29
|
+
| 'table'
|
|
30
|
+
| 'tag-cloud'
|
|
31
|
+
| 'text-links-etc'
|
|
32
|
+
| 'venn-chart'
|
|
33
|
+
| 'vertical-bar-chart'
|
|
34
|
+
| 'warning';
|
|
35
|
+
|
|
36
|
+
export interface IWidgetEmptyProps extends IFlexProps {
|
|
37
|
+
/**
|
|
38
|
+
* URL before the icon or the whole component
|
|
39
|
+
*/
|
|
40
|
+
icon?: React.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface IWidgetErrorProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
|
|
44
|
+
/** Error description. If it is absent, use the local default one */
|
|
45
|
+
description?: React.ReactNode;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface IWidgetNoDataProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
|
|
49
|
+
/** Error description. If it is absent, use the local default one */
|
|
50
|
+
description?: React.ReactNode;
|
|
51
|
+
/* Data types */
|
|
52
|
+
type?: iconNames;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare const WidgetEmpty: (<T>(props: CProps<IWidgetEmptyProps> & T) => ReturnEl) & {
|
|
56
|
+
Title: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
|
|
57
|
+
Description: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
declare const NoData: <T>(props: CProps<IWidgetNoDataProps> & T) => ReturnEl;
|
|
61
|
+
declare const Error: <T>(props: CProps<IWidgetErrorProps> & T) => ReturnEl;
|
|
62
|
+
declare const getIconPath: (name: string) => string;
|
|
63
|
+
|
|
64
|
+
export default WidgetEmpty;
|
|
65
|
+
export { getIconPath, NoData, Error };
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
@@ -9,10 +11,10 @@ var _exportNames = {
|
|
|
9
11
|
NoData: true,
|
|
10
12
|
Error: true
|
|
11
13
|
};
|
|
12
|
-
Object.defineProperty(exports, "
|
|
14
|
+
Object.defineProperty(exports, "Error", {
|
|
13
15
|
enumerable: true,
|
|
14
16
|
get: function get() {
|
|
15
|
-
return
|
|
17
|
+
return _Error["default"];
|
|
16
18
|
}
|
|
17
19
|
});
|
|
18
20
|
Object.defineProperty(exports, "NoData", {
|
|
@@ -21,10 +23,10 @@ Object.defineProperty(exports, "NoData", {
|
|
|
21
23
|
return _NoData["default"];
|
|
22
24
|
}
|
|
23
25
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
26
|
+
Object.defineProperty(exports, "default", {
|
|
25
27
|
enumerable: true,
|
|
26
28
|
get: function get() {
|
|
27
|
-
return
|
|
29
|
+
return _WidgetEmpty["default"];
|
|
28
30
|
}
|
|
29
31
|
});
|
|
30
32
|
|
|
@@ -42,31 +44,11 @@ Object.keys(_WidgetEmpty).forEach(function (key) {
|
|
|
42
44
|
});
|
|
43
45
|
});
|
|
44
46
|
|
|
45
|
-
var _NoData =
|
|
47
|
+
var _NoData = _interopRequireDefault(require("./NoData"));
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
if (key === "default" || key === "__esModule") return;
|
|
49
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
50
|
-
if (key in exports && exports[key] === _NoData[key]) return;
|
|
51
|
-
Object.defineProperty(exports, key, {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: function get() {
|
|
54
|
-
return _NoData[key];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|
|
49
|
+
var _Error = _interopRequireDefault(require("./Error"));
|
|
58
50
|
|
|
59
|
-
var
|
|
51
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
60
52
|
|
|
61
|
-
Object.
|
|
62
|
-
if (key === "default" || key === "__esModule") return;
|
|
63
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
64
|
-
if (key in exports && exports[key] === _Error[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function get() {
|
|
68
|
-
return _Error[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
53
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
72
54
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AAEA","sourcesContent":["export { default } from './WidgetEmpty';\nexport * from './WidgetEmpty';\n\nexport { default as NoData } from './NoData';\n\nexport { default as Error } from './Error';\n"],"file":"index.js"}
|
package/lib/es6/Error/index.js
CHANGED
|
@@ -53,8 +53,7 @@ var Error = /*#__PURE__*/function (_Component) {
|
|
|
53
53
|
_createClass(Error, [{
|
|
54
54
|
key: "render",
|
|
55
55
|
value: function render() {
|
|
56
|
-
var _ref = this
|
|
57
|
-
|
|
56
|
+
var _ref = this.asProps;
|
|
58
57
|
var _this$asProps = this.asProps,
|
|
59
58
|
Children = _this$asProps.Children,
|
|
60
59
|
description = _this$asProps.description,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Error/index.
|
|
1
|
+
{"version":3,"sources":["../../../src/Error/index.jsx"],"names":["React","WidgetEmpty","getIconPath","createComponent","Component","Root","i18nEnhance","de","en","es","fr","it","ja","pt","ru","zh","ko","vi","i18n","Error","asProps","Children","description","getI18nText","title","descriptionText"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,WAAP,IAAsBC,WAAtB,QAAyC,gBAAzC;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,IAArC,QAAiD,eAAjD;AACA,OAAOC,WAAP,MAAwB,yCAAxB;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AAEA,IAAMC,IAAI,GAAG;AAAEX,EAAAA,EAAE,EAAFA,EAAF;AAAMC,EAAAA,EAAE,EAAFA,EAAN;AAAUC,EAAAA,EAAE,EAAFA,EAAV;AAAcC,EAAAA,EAAE,EAAFA,EAAd;AAAkBC,EAAAA,EAAE,EAAFA,EAAlB;AAAsBC,EAAAA,EAAE,EAAFA,EAAtB;AAA0BE,EAAAA,EAAE,EAAFA,EAA1B;AAA8BC,EAAAA,EAAE,EAAFA,EAA9B;AAAkCF,EAAAA,EAAE,EAAFA,EAAlC;AAAsCG,EAAAA,EAAE,EAAFA,EAAtC;AAA0CC,EAAAA,EAAE,EAAFA;AAA1C,CAAb;;IAEME,K;;;;;;;;;;;;;WAOJ,kBAAS;AAAA;AACP,0BAA+C,KAAKC,OAApD;AAAA,UAAQC,QAAR,iBAAQA,QAAR;AAAA,UAAkBC,WAAlB,iBAAkBA,WAAlB;AAAA,UAA+BC,WAA/B,iBAA+BA,WAA/B;;AACA,yBAAgDA,WAAW,EAA3D;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAA4BC,eAA5B,gBAAeH,WAAf;;AAEA,0BACE,oBAAcrB,WAAd;AAAA,gBAAiCC,WAAW,CAAC,SAAD;AAA5C,6BACE,oBAAC,WAAD,CAAa,KAAb,QAAoBsB,KAApB,CADF,eAEE,oBAAC,WAAD,CAAa,WAAb,QAA0BF,WAAW,IAAIG,eAAzC,CAFF,eAGE,oBAAC,QAAD,OAHF,CADF;AAOD;;;;EAlBiBrB,S;;gBAAde,K,iBACiB,a;;gBADjBA,K,kBAEkB;AACpBD,EAAAA,IAAI,EAAJA;AADoB,C;;gBAFlBC,K,aAKa,CAACb,WAAW,EAAZ,C;;AAgBnB,eAAeH,eAAe,CAACgB,KAAD,CAA9B","sourcesContent":["import React from 'react';\nimport WidgetEmpty, { getIconPath } from '../WidgetEmpty';\nimport createComponent, { Component, Root } from '@semcore/core';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport de from './translations/de.json';\nimport en from './translations/en.json';\nimport es from './translations/es.json';\nimport fr from './translations/fr.json';\nimport it from './translations/it.json';\nimport ja from './translations/ja.json';\nimport pt from './translations/pt.json';\nimport ru from './translations/ru.json';\nimport zh from './translations/zh.json';\nimport ko from './translations/ko.json';\nimport vi from './translations/vi.json';\n\nconst i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };\n\nclass Error extends Component {\n static displayName = 'WidgetError';\n static defaultProps = {\n i18n,\n };\n static enhance = [i18nEnhance()];\n\n render() {\n const { Children, description, getI18nText } = this.asProps;\n const { title, description: descriptionText } = getI18nText();\n\n return (\n <Root render={WidgetEmpty} icon={getIconPath('warning')}>\n <WidgetEmpty.Title>{title}</WidgetEmpty.Title>\n <WidgetEmpty.Description>{description || descriptionText}</WidgetEmpty.Description>\n <Children />\n </Root>\n );\n }\n}\n\nexport default createComponent(Error);\n"],"file":"index.js"}
|
package/lib/es6/NoData/index.js
CHANGED
|
@@ -11,7 +11,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import WidgetEmpty, { getIconPath
|
|
14
|
+
import WidgetEmpty, { getIconPath } from '../WidgetEmpty';
|
|
15
15
|
import createComponent, { Component, Root } from '@semcore/core';
|
|
16
16
|
import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
|
|
17
17
|
import de from './translations/de.json';
|
|
@@ -53,8 +53,7 @@ var NoData = /*#__PURE__*/function (_Component) {
|
|
|
53
53
|
_createClass(NoData, [{
|
|
54
54
|
key: "render",
|
|
55
55
|
value: function render() {
|
|
56
|
-
var _ref = this
|
|
57
|
-
|
|
56
|
+
var _ref = this.asProps;
|
|
58
57
|
var _this$asProps = this.asProps,
|
|
59
58
|
Children = _this$asProps.Children,
|
|
60
59
|
type = _this$asProps.type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/NoData/index.
|
|
1
|
+
{"version":3,"sources":["../../../src/NoData/index.jsx"],"names":["React","WidgetEmpty","getIconPath","createComponent","Component","Root","i18nEnhance","de","en","es","fr","it","ja","pt","ru","zh","ko","vi","i18n","NoData","asProps","Children","type","description","getI18nText","title","descriptionText"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,WAAP,IAAsBC,WAAtB,QAAyC,gBAAzC;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,IAArC,QAAiD,eAAjD;AACA,OAAOC,WAAP,MAAwB,yCAAxB;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AACA,OAAOC,EAAP,MAAe,wBAAf;AAEA,IAAMC,IAAI,GAAG;AAAEX,EAAAA,EAAE,EAAFA,EAAF;AAAMC,EAAAA,EAAE,EAAFA,EAAN;AAAUC,EAAAA,EAAE,EAAFA,EAAV;AAAcC,EAAAA,EAAE,EAAFA,EAAd;AAAkBC,EAAAA,EAAE,EAAFA,EAAlB;AAAsBC,EAAAA,EAAE,EAAFA,EAAtB;AAA0BE,EAAAA,EAAE,EAAFA,EAA1B;AAA8BC,EAAAA,EAAE,EAAFA,EAA9B;AAAkCF,EAAAA,EAAE,EAAFA,EAAlC;AAAsCG,EAAAA,EAAE,EAAFA,EAAtC;AAA0CC,EAAAA,EAAE,EAAFA;AAA1C,CAAb;;IAEME,M;;;;;;;;;;;;;WAQJ,kBAAS;AAAA;AACP,0BAAqD,KAAKC,OAA1D;AAAA,UAAQC,QAAR,iBAAQA,QAAR;AAAA,UAAkBC,IAAlB,iBAAkBA,IAAlB;AAAA,UAAwBC,WAAxB,iBAAwBA,WAAxB;AAAA,UAAqCC,WAArC,iBAAqCA,WAArC;;AACA,yBAAgDA,WAAW,EAA3D;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAA4BC,eAA5B,gBAAeH,WAAf;;AACA,0BACE,oBAActB,WAAd;AAAA,gBAAiCC,WAAW,CAACoB,IAAD;AAA5C,6BACE,oBAAC,WAAD,CAAa,KAAb,QAAoBG,KAApB,CADF,eAEE,oBAAC,WAAD,CAAa,WAAb,QAA0BF,WAAW,IAAIG,eAAzC,CAFF,eAGE,oBAAC,QAAD,OAHF,CADF;AAOD;;;;EAlBkBtB,S;;gBAAfe,M,iBACiB,c;;gBADjBA,M,aAEa,CAACb,WAAW,EAAZ,C;;gBAFba,M,kBAGkB;AACpBD,EAAAA,IAAI,EAAJA,IADoB;AAEpBI,EAAAA,IAAI,EAAE;AAFc,C;;AAkBxB,eAAenB,eAAe,CAACgB,MAAD,CAA9B","sourcesContent":["import React from 'react';\nimport WidgetEmpty, { getIconPath } from '../WidgetEmpty';\nimport createComponent, { Component, Root } from '@semcore/core';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport de from './translations/de.json';\nimport en from './translations/en.json';\nimport es from './translations/es.json';\nimport fr from './translations/fr.json';\nimport it from './translations/it.json';\nimport ja from './translations/ja.json';\nimport pt from './translations/pt.json';\nimport ru from './translations/ru.json';\nimport zh from './translations/zh.json';\nimport ko from './translations/ko.json';\nimport vi from './translations/vi.json';\n\nconst i18n = { de, en, es, fr, it, ja, ru, zh, pt, ko, vi };\n\nclass NoData extends Component {\n static displayName = 'WidgetNoData';\n static enhance = [i18nEnhance()];\n static defaultProps = {\n i18n,\n type: 'other-data',\n };\n\n render() {\n const { Children, type, description, getI18nText } = this.asProps;\n const { title, description: descriptionText } = getI18nText();\n return (\n <Root render={WidgetEmpty} icon={getIconPath(type)}>\n <WidgetEmpty.Title>{title}</WidgetEmpty.Title>\n <WidgetEmpty.Description>{description || descriptionText}</WidgetEmpty.Description>\n <Children />\n </Root>\n );\n }\n}\n\nexport default createComponent(NoData);\n"],"file":"index.js"}
|
package/lib/es6/WidgetEmpty.js
CHANGED
|
@@ -9,11 +9,9 @@ import { assignProps as _assignProps3 } from "@semcore/core";
|
|
|
9
9
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
10
10
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
13
|
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
15
|
|
|
18
16
|
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); }; }
|
|
19
17
|
|
|
@@ -29,19 +27,19 @@ var style = (
|
|
|
29
27
|
/*__reshadow_css_start__*/
|
|
30
28
|
_sstyled.insert(
|
|
31
29
|
/*__inner_css_start__*/
|
|
32
|
-
".
|
|
30
|
+
".___SWidgetEmpty_1ui0d_gg_{flex-direction:column;justify-content:center;align-items:center;margin-bottom:16px}.___SImage_1ui0d_gg_{display:flex;align-items:flex-end;justify-content:center;margin-bottom:12px}.___STitle_1ui0d_gg_{color:#757575}.___STitle_1ui0d_gg_{font-size:16px;line-height:1.5;font-weight:700}.___SDescription_1ui0d_gg_{text-align:center;font-size:14px;line-height:1.42;color:#757575;max-width:400px}.___STitle_1ui0d_gg_+.___SDescription_1ui0d_gg_{margin-top:4px}.___SDescription_1ui0d_gg_+.___SDescription_1ui0d_gg_{margin-top:8px}"
|
|
33
31
|
/*__inner_css_end__*/
|
|
34
32
|
, "1ncdu8o_gg_")
|
|
35
33
|
/*__reshadow_css_end__*/
|
|
36
34
|
, {
|
|
37
|
-
"__SWidgetEmpty": "
|
|
38
|
-
"__SImage": "
|
|
39
|
-
"__STitle": "
|
|
40
|
-
"__SDescription": "
|
|
35
|
+
"__SWidgetEmpty": "___SWidgetEmpty_1ui0d_gg_",
|
|
36
|
+
"__SImage": "___SImage_1ui0d_gg_",
|
|
37
|
+
"__STitle": "___STitle_1ui0d_gg_",
|
|
38
|
+
"__SDescription": "___SDescription_1ui0d_gg_"
|
|
41
39
|
});
|
|
42
|
-
var version = "2.
|
|
40
|
+
var version = "2.7.0";
|
|
43
41
|
export var getIconPath = function getIconPath(name) {
|
|
44
|
-
return "
|
|
42
|
+
return "https://static.semrush.com/ui-kit/widget-empty/".concat(version, "/").concat(name, ".svg");
|
|
45
43
|
};
|
|
46
44
|
|
|
47
45
|
var WidgetEmpty = /*#__PURE__*/function (_Component) {
|
|
@@ -58,7 +56,7 @@ var WidgetEmpty = /*#__PURE__*/function (_Component) {
|
|
|
58
56
|
_createClass(WidgetEmpty, [{
|
|
59
57
|
key: "render",
|
|
60
58
|
value: function render() {
|
|
61
|
-
var _ref = this
|
|
59
|
+
var _ref = this.asProps,
|
|
62
60
|
_ref4;
|
|
63
61
|
|
|
64
62
|
var SWidgetEmpty = Flex;
|
|
@@ -69,7 +67,7 @@ var WidgetEmpty = /*#__PURE__*/function (_Component) {
|
|
|
69
67
|
var SImage = 'div';
|
|
70
68
|
return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SWidgetEmpty, _ref4.cn("SWidgetEmpty", _objectSpread({}, _assignProps({}, _ref))), isNode(icon) && /*#__PURE__*/React.createElement(SImage, _ref4.cn("SImage", {}), typeof icon === 'string' ? /*#__PURE__*/React.createElement("img", _ref4.cn("img", {
|
|
71
69
|
"src": icon,
|
|
72
|
-
"alt":
|
|
70
|
+
"alt": "widget empty icon",
|
|
73
71
|
"width": 100,
|
|
74
72
|
"height": 72
|
|
75
73
|
})) : icon), /*#__PURE__*/React.createElement(Children, _ref4.cn("Children", {})));
|
|
@@ -84,7 +82,7 @@ _defineProperty(WidgetEmpty, "displayName", 'WidgetEmpty');
|
|
|
84
82
|
_defineProperty(WidgetEmpty, "style", style);
|
|
85
83
|
|
|
86
84
|
var Title = function Title(props) {
|
|
87
|
-
var _ref2 =
|
|
85
|
+
var _ref2 = arguments[0],
|
|
88
86
|
_ref5;
|
|
89
87
|
|
|
90
88
|
var STitle = Box;
|
|
@@ -93,7 +91,7 @@ var Title = function Title(props) {
|
|
|
93
91
|
};
|
|
94
92
|
|
|
95
93
|
var Description = function Description(props) {
|
|
96
|
-
var _ref3 =
|
|
94
|
+
var _ref3 = arguments[0],
|
|
97
95
|
_ref6;
|
|
98
96
|
|
|
99
97
|
var SDescription = Box;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/WidgetEmpty.
|
|
1
|
+
{"version":3,"sources":["../../src/WidgetEmpty.jsx"],"names":["React","createComponent","Component","sstyled","Root","Box","Flex","isNode","version","getIconPath","name","WidgetEmpty","SWidgetEmpty","asProps","Children","icon","styles","SImage","style","Title","props","STitle","Description","SDescription"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,EAAcC,IAAd,QAA0B,mBAA1B;AACA,OAAOC,MAAP,MAAmB,2BAAnB;;;;;;;;;;;;;;;;;AAIA,IAAMC,OAAO,UAAb;AAIA,OAAO,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAACC,IAAD,EAAU;AACnC,kEAAyDF,OAAzD,cAAoEE,IAApE;AACD,CAFM;;IAIDC,W;;;;;;;;;;;;;WAIJ,kBAAS;AAAA;AAAA;;AACP,UAAMC,YAAY,GAKMN,IALxB;AACA,0BAAmC,KAAKO,OAAxC;AAAA,UAAQC,QAAR,iBAAQA,QAAR;AAAA,UAAkBC,IAAlB,iBAAkBA,IAAlB;AAAA,UAAwBC,MAAxB,iBAAwBA,MAAxB;AACA,UAAMC,MAAM,GAAG,KAAf;AAEA,qBAAOd,OAAO,CAACa,MAAD,CAAd,eACE,oBAAC,YAAD,uEACGT,MAAM,CAACQ,IAAD,CAAN,iBACC,oBAAC,MAAD,0BACG,OAAOA,IAAP,KAAgB,QAAhB,gBACC;AAAA,eAAUA,IAAV;AAAA,eAAoB,mBAApB;AAAA,iBAA+C,GAA/C;AAAA,kBAA4D;AAA5D,SADD,GAGCA,IAJJ,CAFJ,eAUE,oBAAC,QAAD,2BAVF,CADF;AAcD;;;;EAvBuBb,S;;gBAApBS,W,iBACiB,a;;gBADjBA,W,WAEWO,K;;AAwBjB,IAAMC,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD,EAAW;AAAA;AAAA;;AACvB,MAAMC,MAAM,GAE2BhB,GAFvC;AACA,MAAQW,MAAR,GAAmBI,KAAnB,CAAQJ,MAAR;AACA,iBAAOb,OAAO,CAACa,MAAD,CAAd,eAAuB,oBAAC,MAAD,kEAAvB;AACD,CAJD;;AAMA,IAAMM,WAAW,GAAG,SAAdA,WAAc,CAACF,KAAD,EAAW;AAAA;AAAA;;AAC7B,MAAMG,YAAY,GAE2BlB,GAF7C;AACA,MAAQW,MAAR,GAAmBI,KAAnB,CAAQJ,MAAR;AACA,iBAAOb,OAAO,CAACa,MAAD,CAAd,eAAuB,oBAAC,YAAD,wEAAvB;AACD,CAJD;;AAMA,eAAef,eAAe,CAACU,WAAD,EAAc;AAC1CQ,EAAAA,KAAK,EAALA,KAD0C;AAE1CG,EAAAA,WAAW,EAAXA;AAF0C,CAAd,CAA9B","sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box, Flex } from '@semcore/flex-box';\nimport isNode from '@semcore/utils/lib/isNode';\n\nimport style from './style/widget-empty.shadow.css';\n\nconst version = preval`\n module.exports = require('../package.json').version\n`;\n\nexport const getIconPath = (name) => {\n return `https://static.semrush.com/ui-kit/widget-empty/${version}/${name}.svg`;\n};\n\nclass WidgetEmpty extends Component {\n static displayName = 'WidgetEmpty';\n static style = style;\n\n render() {\n const SWidgetEmpty = Root;\n const { Children, icon, styles } = this.asProps;\n const SImage = 'div';\n\n return sstyled(styles)(\n <SWidgetEmpty render={Flex}>\n {isNode(icon) && (\n <SImage>\n {typeof icon === 'string' ? (\n <img src={icon} alt=\"widget empty icon\" width={100} height={72} />\n ) : (\n icon\n )}\n </SImage>\n )}\n <Children />\n </SWidgetEmpty>,\n );\n }\n}\n\nconst Title = (props) => {\n const STitle = Root;\n const { styles } = props;\n return sstyled(styles)(<STitle render={Box} />);\n};\n\nconst Description = (props) => {\n const SDescription = Root;\n const { styles } = props;\n return sstyled(styles)(<SDescription render={Box} />);\n};\n\nexport default createComponent(WidgetEmpty, {\n Title,\n Description,\n});\n"],"file":"WidgetEmpty.js"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
3
|
+
import { Box, IFlexProps } from '@semcore/flex-box';
|
|
4
|
+
import { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';
|
|
5
|
+
|
|
6
|
+
export type iconNames =
|
|
7
|
+
| 'area-chart'
|
|
8
|
+
| 'choropleth-map-chart'
|
|
9
|
+
| 'combined-chart'
|
|
10
|
+
| 'congrats'
|
|
11
|
+
| 'deleted-page'
|
|
12
|
+
| 'donut-chart'
|
|
13
|
+
| 'duplicates'
|
|
14
|
+
| 'funnel-chart'
|
|
15
|
+
| 'good'
|
|
16
|
+
| 'horizontal-bar-chart'
|
|
17
|
+
| 'line-chart'
|
|
18
|
+
| 'lollipop-chart'
|
|
19
|
+
| 'nexttime'
|
|
20
|
+
| 'nothing-found'
|
|
21
|
+
| 'other-data'
|
|
22
|
+
| 'pie-chart'
|
|
23
|
+
| 'processing'
|
|
24
|
+
| 'radar-chart'
|
|
25
|
+
| 'sankey-chart'
|
|
26
|
+
| 'scatter-plot-chart'
|
|
27
|
+
| 'stacked-area-chart'
|
|
28
|
+
| 'suggestions'
|
|
29
|
+
| 'table'
|
|
30
|
+
| 'tag-cloud'
|
|
31
|
+
| 'text-links-etc'
|
|
32
|
+
| 'venn-chart'
|
|
33
|
+
| 'vertical-bar-chart'
|
|
34
|
+
| 'warning';
|
|
35
|
+
|
|
36
|
+
export interface IWidgetEmptyProps extends IFlexProps {
|
|
37
|
+
/**
|
|
38
|
+
* URL before the icon or the whole component
|
|
39
|
+
*/
|
|
40
|
+
icon?: React.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface IWidgetErrorProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
|
|
44
|
+
/** Error description. If it is absent, use the local default one */
|
|
45
|
+
description?: React.ReactNode;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface IWidgetNoDataProps extends IWidgetEmptyProps, IWithI18nEnhanceProps {
|
|
49
|
+
/** Error description. If it is absent, use the local default one */
|
|
50
|
+
description?: React.ReactNode;
|
|
51
|
+
/* Data types */
|
|
52
|
+
type?: iconNames;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare const WidgetEmpty: (<T>(props: CProps<IWidgetEmptyProps> & T) => ReturnEl) & {
|
|
56
|
+
Title: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
|
|
57
|
+
Description: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
declare const NoData: <T>(props: CProps<IWidgetNoDataProps> & T) => ReturnEl;
|
|
61
|
+
declare const Error: <T>(props: CProps<IWidgetErrorProps> & T) => ReturnEl;
|
|
62
|
+
declare const getIconPath: (name: string) => string;
|
|
63
|
+
|
|
64
|
+
export default WidgetEmpty;
|
|
65
|
+
export { getIconPath, NoData, Error };
|
package/lib/es6/index.js
CHANGED
package/lib/es6/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.js"],"names":["default","NoData","Error"],"mappings":"AAAA,SAASA,OAAT,QAAwB,eAAxB;AACA,cAAc,eAAd;AAEA,SAASA,OAAO,IAAIC,MAApB,QAAkC,UAAlC;
|
|
1
|
+
{"version":3,"sources":["../../src/index.js"],"names":["default","NoData","Error"],"mappings":"AAAA,SAASA,OAAT,QAAwB,eAAxB;AACA,cAAc,eAAd;AAEA,SAASA,OAAO,IAAIC,MAApB,QAAkC,UAAlC;AAEA,SAASD,OAAO,IAAIE,KAApB,QAAiC,SAAjC","sourcesContent":["export { default } from './WidgetEmpty';\nexport * from './WidgetEmpty';\n\nexport { default as NoData } from './NoData';\n\nexport { default as Error } from './Error';\n"],"file":"index.js"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/widget-empty",
|
|
3
3
|
"description": "SEMRush WidgetEmpty Component",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.7.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -11,19 +11,25 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "build --source=js",
|
|
13
13
|
"test": "jest",
|
|
14
|
-
"
|
|
14
|
+
"upload-static": "gcs-upload svg/*.svg"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@semcore/utils": "^3.27",
|
|
18
|
-
"@semcore/flex-box": "^4"
|
|
19
|
-
"@semcore/button": "^3",
|
|
20
|
-
"@semcore/link": "^3"
|
|
18
|
+
"@semcore/flex-box": "^4"
|
|
21
19
|
},
|
|
22
20
|
"peerDependencies": {
|
|
23
21
|
"@semcore/core": "^1.11",
|
|
24
22
|
"react": "16.8 - 17"
|
|
25
23
|
},
|
|
26
24
|
"jest": {
|
|
27
|
-
"preset": "jest-preset-ui"
|
|
25
|
+
"preset": "@semcore/jest-preset-ui"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/semrush/intergalactic.git",
|
|
30
|
+
"directory": "semcore/widget-empty"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@semcore/jest-preset-ui": "1.0.0"
|
|
28
34
|
}
|
|
29
35
|
}
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import WidgetEmpty, { getIconPath
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import WidgetEmpty, { getIconPath } from '../WidgetEmpty';
|
|
3
3
|
import createComponent, { Component, Root } from '@semcore/core';
|
|
4
4
|
import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
|
|
5
5
|
import de from './translations/de.json';
|
|
@@ -27,7 +27,6 @@ class NoData extends Component {
|
|
|
27
27
|
render() {
|
|
28
28
|
const { Children, type, description, getI18nText } = this.asProps;
|
|
29
29
|
const { title, description: descriptionText } = getI18nText();
|
|
30
|
-
|
|
31
30
|
return (
|
|
32
31
|
<Root render={WidgetEmpty} icon={getIconPath(type)}>
|
|
33
32
|
<WidgetEmpty.Title>{title}</WidgetEmpty.Title>
|
|
@@ -9,8 +9,9 @@ const version = preval`
|
|
|
9
9
|
module.exports = require('../package.json').version
|
|
10
10
|
`;
|
|
11
11
|
|
|
12
|
-
export const getIconPath = (name) =>
|
|
13
|
-
|
|
12
|
+
export const getIconPath = (name) => {
|
|
13
|
+
return `https://static.semrush.com/ui-kit/widget-empty/${version}/${name}.svg`;
|
|
14
|
+
};
|
|
14
15
|
|
|
15
16
|
class WidgetEmpty extends Component {
|
|
16
17
|
static displayName = 'WidgetEmpty';
|
|
@@ -26,7 +27,7 @@ class WidgetEmpty extends Component {
|
|
|
26
27
|
{isNode(icon) && (
|
|
27
28
|
<SImage>
|
|
28
29
|
{typeof icon === 'string' ? (
|
|
29
|
-
<img src={icon} alt=
|
|
30
|
+
<img src={icon} alt="widget empty icon" width={100} height={72} />
|
|
30
31
|
) : (
|
|
31
32
|
icon
|
|
32
33
|
)}
|
package/src/index.js
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="72" viewBox="0 0 100 72">
|
|
2
|
+
<g fill="none" transform="translate(1 12)">
|
|
3
|
+
<path fill="#CBD1D3"
|
|
4
|
+
d="M56 18H42a3 3 0 00-3 3v8a3 3 0 003 3h14a3 3 0 003-3v-8a3 3 0 00-3-3zm-14 2h14a1 1 0 011 1v8a1 1 0 01-1 1H42a1 1 0 01-1-1v-8a1 1 0 011-1z" />
|
|
5
|
+
<path fill="#CBD1D3"
|
|
6
|
+
d="M39.81 25.4l13.06-7.027a1 1 0 011.34.38l.015.026a.97.97 0 01-.38 1.34l-13.062 7.027a1 1 0 01-1.34-.38l-.015-.027a.97.97 0 01.381-1.34zM43.96 29.842l13.061-7.239a1 1 0 011.351.375l.009.015a.983.983 0 01-.375 1.35l-13.061 7.24a1 1 0 01-1.351-.375l-.009-.015a.983.983 0 01.375-1.35zM17 0H3a3 3 0 00-3 3v8a3 3 0 003 3h14a3 3 0 003-3V3a3 3 0 00-3-3zM3 2h14a1 1 0 011 1v8a1 1 0 01-1 1H3a1 1 0 01-1-1V3a1 1 0 011-1z" />
|
|
7
|
+
<rect width="18" height="12" x="79" y="1" fill="#EEF0F1" rx="2" />
|
|
8
|
+
<rect width="18" height="12" x="1" y="37" fill="#EEF0F1" rx="2" />
|
|
9
|
+
<path fill="#CBD1D3"
|
|
10
|
+
d="M95 0H81a3 3 0 00-3 3v8a3 3 0 003 3h14a3 3 0 003-3V3a3 3 0 00-3-3zM81 2h14a1 1 0 011 1v8a1 1 0 01-1 1H81a1 1 0 01-1-1V3a1 1 0 011-1zM17 36H3a3 3 0 00-3 3v8a3 3 0 003 3h14a3 3 0 003-3v-8a3 3 0 00-3-3zM3 38h14a1 1 0 011 1v8a1 1 0 01-1 1H3a1 1 0 01-1-1v-8a1 1 0 011-1zm92-2H81a3 3 0 00-3 3v8a3 3 0 003 3h14a3 3 0 003-3v-8a3 3 0 00-3-3zm-14 2h14a1 1 0 011 1v8a1 1 0 01-1 1H81a1 1 0 01-1-1v-8a1 1 0 011-1z" />
|
|
11
|
+
<g fill="#CBD1D3">
|
|
12
|
+
<path
|
|
13
|
+
d="M24.05 12.107a1 1 0 011.343.444c1.582 3.143 4.41 5.657 8.523 7.54a1 1 0 11-.832 1.818c-4.505-2.062-7.677-4.882-9.477-8.46a1 1 0 01.444-1.342zM24.108 37.92a1 1 0 001.312-.528c1.604-3.767 4.424-6.587 8.502-8.485a1 1 0 00-.844-1.814c-4.516 2.102-7.696 5.282-9.498 9.515a1 1 0 00.528 1.312z" />
|
|
14
|
+
</g>
|
|
15
|
+
<g fill="#CBD1D3">
|
|
16
|
+
<path
|
|
17
|
+
d="M73.491 12.13a1 1 0 00-1.362.379c-1.802 3.194-4.646 5.721-8.56 7.588a1 1 0 10.862 1.806c4.27-2.038 7.426-4.843 9.44-8.412a1 1 0 00-.38-1.362zM73.437 37.9a1 1 0 01-1.336-.463c-1.848-3.8-4.687-6.638-8.543-8.54a1 1 0 11.884-1.794c4.253 2.098 7.414 5.26 9.457 9.46a1 1 0 01-.462 1.336z" />
|
|
18
|
+
</g>
|
|
19
|
+
</g>
|
|
20
|
+
</svg>
|