dtable-ui-component 6.0.28 → 6.0.29-beta1

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.
@@ -59,9 +59,7 @@ class CheckboxEditor extends _react.Component {
59
59
  });
60
60
  };
61
61
  this.renderIcon = (symbol, color) => {
62
- const className = (0, _classnames.default)('dtable-ui-checkbox-check-mark', {
63
- 'dtable-ui-checkbox-check-svg': !(symbol !== null && symbol !== void 0 && symbol.startsWith('dtable-icon'))
64
- });
62
+ let className = 'dtable-ui-checkbox-check-mark';
65
63
  if (symbol.startsWith('dtable-icon')) {
66
64
  return /*#__PURE__*/_react.default.createElement("span", {
67
65
  className: "dtable-font ".concat(symbol, " ").concat(className || ''),
@@ -70,6 +68,10 @@ class CheckboxEditor extends _react.Component {
70
68
  }
71
69
  });
72
70
  }
71
+ className = (0, _classnames.default)(className, {
72
+ 'dtable-ui-checkbox-check-svg': !(symbol !== null && symbol !== void 0 && symbol.startsWith('dtable-icon')),
73
+ 'scale-icon': _utils.isMobile
74
+ });
73
75
  return /*#__PURE__*/_react.default.createElement(_SvgIcon.default, {
74
76
  className: className,
75
77
  symbol: symbol,
@@ -1,6 +1,6 @@
1
1
  @import url('../css/cell-formatter.css');
2
2
 
3
- .dtable-ui.checkbox-formatter .checkbox-checked-mark {
3
+ .dtable-ui.checkbox-formatter .dtable-ui-checkbox-check-mark {
4
4
  color: #20c933;
5
5
  display: flex;
6
6
  align-items: center;
@@ -9,8 +9,32 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _classnames = _interopRequireDefault(require("classnames"));
10
10
  var _SvgIcon = _interopRequireDefault(require("../SvgIcon"));
11
11
  var _constants = require("../constants");
12
+ var _utils = require("../utils/utils");
12
13
  require("./index.css");
13
14
  class CheckboxFormatter extends _react.default.PureComponent {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.renderIcon = (symbol, color) => {
18
+ let className = 'dtable-ui-checkbox-check-mark';
19
+ if (symbol.startsWith('dtable-icon')) {
20
+ return /*#__PURE__*/_react.default.createElement("span", {
21
+ className: "dtable-font ".concat(symbol, " ").concat(className || ''),
22
+ style: {
23
+ color
24
+ }
25
+ });
26
+ }
27
+ className = (0, _classnames.default)(className, {
28
+ 'dtable-ui-checkbox-check-svg': !(symbol !== null && symbol !== void 0 && symbol.startsWith('dtable-icon')),
29
+ 'scale-icon': _utils.isMobile
30
+ });
31
+ return /*#__PURE__*/_react.default.createElement(_SvgIcon.default, {
32
+ className: className,
33
+ symbol: symbol,
34
+ color: color
35
+ });
36
+ };
37
+ }
14
38
  render() {
15
39
  let {
16
40
  value,
@@ -25,16 +49,7 @@ class CheckboxFormatter extends _react.default.PureComponent {
25
49
  const classname = (0, _classnames.default)('dtable-ui cell-formatter-container checkbox-formatter d-flex align-items-center justify-content-center', containerClassName);
26
50
  return /*#__PURE__*/_react.default.createElement("div", {
27
51
  className: classname
28
- }, checkboxStyle.type.startsWith('dtable-icon') ? /*#__PURE__*/_react.default.createElement("span", {
29
- className: "dtable-font ".concat(checkboxStyle.type, " checkbox-checked-mark"),
30
- style: {
31
- color: checkboxStyle.color
32
- }
33
- }) : /*#__PURE__*/_react.default.createElement(_SvgIcon.default, {
34
- className: "dtable-ui-checkbox-check-svg",
35
- symbol: checkboxStyle.type,
36
- color: checkboxStyle.color
37
- }));
52
+ }, this.renderIcon(checkboxStyle.type, checkboxStyle.color));
38
53
  }
39
54
  }
40
55
  CheckboxFormatter.defaultProps = {
@@ -127,13 +127,14 @@ class CountryEditor extends _react.Component {
127
127
  }, 300);
128
128
  };
129
129
  this.getLocationData = () => {
130
+ var _window;
130
131
  const {
131
132
  config
132
133
  } = this.props;
133
134
  const {
134
135
  mediaUrl
135
136
  } = {
136
- ...window.dtable,
137
+ ...((_window = window) === null || _window === void 0 ? void 0 : _window.dtable),
137
138
  ...config
138
139
  };
139
140
  let geoFileName = 'en-region-location';
@@ -22,11 +22,12 @@ const MINE_MAP_ONLINE_SERVICE = {
22
22
  SERVICE_URL: 'https://service.minedata.cn/service'
23
23
  };
24
24
  const getMineMapUrl = function () {
25
+ var _window;
25
26
  let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
26
27
  const {
27
28
  dtableMineMapCustomConfig = {}
28
29
  } = {
29
- ...window.dtable,
30
+ ...((_window = window) === null || _window === void 0 ? void 0 : _window.dtable),
30
31
  ...config
31
32
  };
32
33
  const {
@@ -66,13 +67,14 @@ const getInitCenter = function () {
66
67
  };
67
68
  exports.getInitCenter = getInitCenter;
68
69
  const getMapInfo = function () {
70
+ var _window2;
69
71
  let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
70
72
  const {
71
73
  dtableBaiduMapKey: baiduMapKey,
72
74
  dtableGoogleMapKey: googleMapKey,
73
75
  dtableMineMapKey: mineMapKey
74
76
  } = {
75
- ...window.dtable,
77
+ ...((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.dtable),
76
78
  ...config
77
79
  };
78
80
  let mapType;
@@ -83,13 +83,18 @@ class RowExpandGeolocationEditor extends _react.default.Component {
83
83
  });
84
84
  };
85
85
  this.getLocationInfo = value => {
86
+ var _window;
86
87
  const {
87
- column
88
+ column,
89
+ config
88
90
  } = this.props;
89
91
  const {
90
92
  dtableBaiduMapKey,
91
93
  dtableMineMapKey
92
- } = window.dtable;
94
+ } = {
95
+ ...((_window = window) === null || _window === void 0 ? void 0 : _window.dtable),
96
+ ...config
97
+ };
93
98
  const isBaiduMap = !!(dtableBaiduMapKey || dtableMineMapKey);
94
99
  return (0, _dtableUtils.getGeolocationDisplayString)(value, column.data, {
95
100
  isBaiduMap,
@@ -6,24 +6,39 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ var _check = _interopRequireDefault(require("../assets/icons/check.svg"));
10
+ var _cross = _interopRequireDefault(require("../assets/icons/cross.svg"));
11
+ var _dot = _interopRequireDefault(require("../assets/icons/dot.svg"));
9
12
  require("./index.css");
10
- const needScaleIcons = ['check', 'dot', 'cross'];
11
- const SvgIcon = props => {
12
- const {
13
+ const SvgIcon = _ref => {
14
+ let {
13
15
  className,
14
16
  symbol,
15
17
  color
16
- } = props;
17
- let iconClass = "dtable-ui-multicolor-icon multicolor-icon-".concat(symbol, " ").concat(className || '');
18
- if (needScaleIcons.includes(symbol) && window.isMobile) {
19
- iconClass += ' scale-icon';
20
- }
21
- return /*#__PURE__*/_react.default.createElement("svg", {
18
+ } = _ref;
19
+ if (!symbol) return null;
20
+ const iconClass = "dtable-ui-multicolor-icon multicolor-icon-".concat(symbol, " ").concat(className || '');
21
+ const props = {
22
22
  className: iconClass,
23
- "aria-hidden": "true"
24
- }, /*#__PURE__*/_react.default.createElement("use", {
25
- fill: color,
26
- xlinkHref: "#".concat(symbol)
27
- }));
23
+ style: {
24
+ fill: color
25
+ }
26
+ };
27
+ switch (symbol) {
28
+ case 'check':
29
+ {
30
+ return /*#__PURE__*/_react.default.createElement(_check.default, props);
31
+ }
32
+ case 'cross':
33
+ {
34
+ return /*#__PURE__*/_react.default.createElement(_cross.default, props);
35
+ }
36
+ case 'dot':
37
+ {
38
+ return /*#__PURE__*/_react.default.createElement(_dot.default, props);
39
+ }
40
+ default:
41
+ return null;
42
+ }
28
43
  };
29
44
  var _default = exports.default = SvgIcon;
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#999999;}
7
+ </style>
8
+ <title>check</title>
9
+ <g id="check">
10
+ <g id="路径" transform="translate(0.020249, 4.178564)">
11
+ <path class="st0" d="M27.9,0.7L12,18.1L4.1,8.9C3.2,7.9,1.8,7.6,0.7,8.6c-1,0.8-0.9,2.5,0,3.6c6.5,7.3,9.8,11,9.8,11
12
+ c1,0.9,1.9,1,2.8,0l17.9-19c1-1,1-2.5,0.2-3.4C30.4-0.4,28.8-0.2,27.9,0.7z"/>
13
+ </g>
14
+ </g>
15
+ </svg>
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#999999;}
7
+ </style>
8
+ <title>x-check-box</title>
9
+ <g id="x-check-box">
10
+ <g id="fork-number">
11
+ <path id="路径" class="st0" d="M18.8,16l8.5-8.5c0.8-0.8,0.8-2.1,0-2.8s-2.1-0.8-2.8,0L16,13.2L7.5,4.6c-0.8-0.8-2.1-0.8-2.8,0
12
+ s-0.8,2.1,0,2.8l8.5,8.5l-8.5,8.5c-0.8,0.8-0.8,2.1,0,2.8c0.8,0.7,2.1,0.8,2.8,0l8.5-8.5l8.5,8.5c0.8,0.8,2.1,0.8,2.8,0
13
+ c0.8-0.8,0.8-2.1,0-2.8l0,0L18.8,16z"/>
14
+ </g>
15
+ </g>
16
+ </svg>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#999999;}
7
+ </style>
8
+ <title>dot</title>
9
+ <g id="dot">
10
+ <circle id="椭圆形" class="st0" cx="16" cy="16" r="9"/>
11
+ </g>
12
+ </svg>
package/lib/index.js CHANGED
@@ -424,12 +424,6 @@ Object.defineProperty(exports, "SingleSelectFormatter", {
424
424
  return _SingleSelectFormatter.default;
425
425
  }
426
426
  });
427
- Object.defineProperty(exports, "SvgIcon", {
428
- enumerable: true,
429
- get: function () {
430
- return _SvgIcon.default;
431
- }
432
- });
433
427
  Object.defineProperty(exports, "TextEditor", {
434
428
  enumerable: true,
435
429
  get: function () {
@@ -548,5 +542,4 @@ var _CollapsibleSettingLayout = _interopRequireDefault(require("./CollapsibleSet
548
542
  var _DTableRadioGroup = _interopRequireDefault(require("./DTableRadioGroup"));
549
543
  var _DTableEmptyTip = _interopRequireDefault(require("./DTableEmptyTip"));
550
544
  var _IconButton = _interopRequireDefault(require("./IconButton"));
551
- var _UploadProgress = _interopRequireDefault(require("./UploadProgress"));
552
- var _SvgIcon = _interopRequireDefault(require("./SvgIcon"));
545
+ var _UploadProgress = _interopRequireDefault(require("./UploadProgress"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.28",
3
+ "version": "6.0.29-beta1",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "4.0.2",