dtable-statistic 5.3.24 → 5.3.26-alpha.1

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.
@@ -6,16 +6,21 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ const components = {};
10
+ const requireContext = require.context('../assets/icons', false, /\.svg$/);
11
+ requireContext.keys().forEach(path => {
12
+ const iconName = path.replace(/^\.\/(.*?)\.svg$/, '$1').toLowerCase();
13
+ components[iconName] = requireContext(path).default;
14
+ });
9
15
  function Icon(props) {
10
16
  const {
11
17
  className,
12
18
  symbol
13
19
  } = props;
14
20
  const iconClass = `multicolor-icon multicolor-icon-${symbol} ${className || ''}`;
15
- return /*#__PURE__*/_react.default.createElement("svg", {
21
+ const IconComponent = components[symbol];
22
+ return /*#__PURE__*/_react.default.createElement(IconComponent, {
16
23
  className: iconClass
17
- }, /*#__PURE__*/_react.default.createElement("use", {
18
- xlinkHref: `#${symbol}`
19
- }));
24
+ });
20
25
  }
21
26
  var _default = exports.default = Icon;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-statistic",
3
- "version": "5.3.24",
3
+ "version": "5.3.26-alpha.1",
4
4
  "description": "statistics",
5
5
  "main": "dist/dtable-statistic.js",
6
6
  "author": "seafile",
@@ -18,7 +18,7 @@
18
18
  "react-grid-layout": "^1.2.5",
19
19
  "react-intl-universal": "^2.4.8",
20
20
  "reactstrap": "9.2.3",
21
- "sea-chart": "^1.1.90"
21
+ "sea-chart": "^1.1.93-alpha.2"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "dtable-ui-component": "~6.0.*",
@@ -52,9 +52,9 @@
52
52
  "css-minimizer-webpack-plugin": "^3.2.0",
53
53
  "dotenv": "^10.0.0",
54
54
  "dotenv-expand": "^5.1.0",
55
- "dtable-store": "^5.3.7",
55
+ "dtable-store": "6.0.0",
56
56
  "dtable-ui-component": "^6.0.26",
57
- "dtable-utils": "^5.0.19",
57
+ "dtable-utils": "^5.0.22-alpha.1",
58
58
  "eslint": "^8.3.0",
59
59
  "eslint-config-react-app": "^7.0.1",
60
60
  "eslint-webpack-plugin": "^3.1.1",
@@ -85,7 +85,6 @@
85
85
  "semver": "^7.3.5",
86
86
  "source-map-loader": "^3.0.0",
87
87
  "style-loader": "^3.3.1",
88
- "svg-sprite-loader": "^6.0.11",
89
88
  "svgo-loader": "^3.0.1",
90
89
  "tailwindcss": "^3.0.2",
91
90
  "terser-webpack-plugin": "^5.2.5",