dtable-ui-component 6.0.40 → 6.0.42

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.
@@ -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;
@@ -11,6 +11,29 @@ var _SvgIcon = _interopRequireDefault(require("../SvgIcon"));
11
11
  var _constants = require("../constants");
12
12
  require("./index.css");
13
13
  class CheckboxFormatter extends _react.default.PureComponent {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.renderIcon = (symbol, color) => {
17
+ let className = 'dtable-ui-checkbox-check-mark';
18
+ if (symbol.startsWith('dtable-icon')) {
19
+ return /*#__PURE__*/_react.default.createElement("span", {
20
+ className: "dtable-font ".concat(symbol, " ").concat(className || ''),
21
+ style: {
22
+ color
23
+ }
24
+ });
25
+ }
26
+ className = (0, _classnames.default)(className, {
27
+ 'dtable-ui-checkbox-check-svg': !(symbol !== null && symbol !== void 0 && symbol.startsWith('dtable-icon')),
28
+ 'scale-icon': _constants.isMobile
29
+ });
30
+ return /*#__PURE__*/_react.default.createElement(_SvgIcon.default, {
31
+ className: className,
32
+ symbol: symbol,
33
+ color: color
34
+ });
35
+ };
36
+ }
14
37
  render() {
15
38
  let {
16
39
  value,
@@ -25,16 +48,7 @@ class CheckboxFormatter extends _react.default.PureComponent {
25
48
  const classname = (0, _classnames.default)('dtable-ui cell-formatter-container checkbox-formatter d-flex align-items-center justify-content-center', containerClassName);
26
49
  return /*#__PURE__*/_react.default.createElement("div", {
27
50
  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
- }));
51
+ }, this.renderIcon(checkboxStyle.type, checkboxStyle.color));
38
52
  }
39
53
  }
40
54
  CheckboxFormatter.defaultProps = {
@@ -382,7 +382,7 @@ class MapEditor extends _react.default.Component {
382
382
  value: lat,
383
383
  editable: isEdit,
384
384
  onChange: this.handleLatitudeChange,
385
- placeholder: (0, _lang.getLocale)('Enter_latitude')
385
+ placeholder: (0, _lang.getLocale)('Latitude')
386
386
  }), /*#__PURE__*/_react.default.createElement("div", {
387
387
  className: "view-subtitle"
388
388
  }, /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Longitude_abbr'))), /*#__PURE__*/_react.default.createElement(_InputItem.default, {
@@ -394,7 +394,7 @@ class MapEditor extends _react.default.Component {
394
394
  value: lng,
395
395
  editable: isEdit,
396
396
  onChange: this.handleLongitudeChange,
397
- placeholder: (0, _lang.getLocale)('Enter_longitude')
397
+ placeholder: (0, _lang.getLocale)('Longitude')
398
398
  })), /*#__PURE__*/_react.default.createElement("div", {
399
399
  className: "dtable-ui-mobile-geolocation-map-editor-map"
400
400
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -444,7 +444,7 @@ class MapEditor extends _react.Component {
444
444
  onChange: this.onChangeLatitude,
445
445
  onKeyDown: this.onKeyDown,
446
446
  className: "form-control",
447
- placeholder: (0, _lang.getLocale)('Enter_latitude'),
447
+ placeholder: (0, _lang.getLocale)('Latitude'),
448
448
  autoFocus: true
449
449
  })), /*#__PURE__*/_react.default.createElement("div", {
450
450
  className: "dtable-ui-geolocation-map-lng-lat-input-container map-lng-input-container"
@@ -456,7 +456,7 @@ class MapEditor extends _react.Component {
456
456
  onChange: this.onChangeLongitude,
457
457
  onKeyDown: this.onKeyDown,
458
458
  className: "form-control",
459
- placeholder: (0, _lang.getLocale)('Enter_longitude')
459
+ placeholder: (0, _lang.getLocale)('Longitude')
460
460
  }))), /*#__PURE__*/_react.default.createElement("div", {
461
461
  className: this.readOnly ? 'geolocation-map-read-only-container' : 'geolocation-map-container'
462
462
  }, this.mapType && isLoading && /*#__PURE__*/_react.default.createElement(_Loading.default, null), !this.mapType && /*#__PURE__*/_react.default.createElement("div", {
@@ -441,7 +441,7 @@ class LargeMapEditorDialog extends _react.default.Component {
441
441
  onChange: this.onChangeLatitude,
442
442
  onKeyDown: this.onKeyDown,
443
443
  className: "form-control",
444
- placeholder: (0, _lang.getLocale)('Enter_latitude'),
444
+ placeholder: (0, _lang.getLocale)('Latitude'),
445
445
  autoFocus: true
446
446
  })), /*#__PURE__*/_react.default.createElement("div", {
447
447
  className: "dtable-ui-geolocation-map-lng-lat-input-container dtable-ui-geolocation-map-lng-input-container"
@@ -453,7 +453,7 @@ class LargeMapEditorDialog extends _react.default.Component {
453
453
  onChange: this.onChangeLongitude,
454
454
  onKeyDown: this.onKeyDown,
455
455
  className: "form-control",
456
- placeholder: (0, _lang.getLocale)('Enter_longitude')
456
+ placeholder: (0, _lang.getLocale)('Longitude')
457
457
  }))), /*#__PURE__*/_react.default.createElement("div", {
458
458
  className: this.readOnly ? 'geolocation-map-read-only-container' : 'geolocation-map-container-large'
459
459
  }, this.mapType && isLoading && /*#__PURE__*/_react.default.createElement(_Loading.default, null), !this.mapType && /*#__PURE__*/_react.default.createElement("div", {
@@ -6,25 +6,30 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
- var _constants = require("../constants");
10
9
  require("./index.css");
11
- const needScaleIcons = ['check', 'dot', 'cross'];
12
- const SvgIcon = props => {
13
- const {
10
+ const iconComponents = {};
11
+ const requireContext = require.context('../assets/icons', false, /\.svg$/);
12
+ requireContext.keys().forEach(path => {
13
+ const iconName = path.replace(/^\.\/(.*?)\.svg$/, '$1').toLowerCase();
14
+ iconComponents[iconName] = requireContext(path).default;
15
+ });
16
+ const SvgIcon = _ref => {
17
+ let {
14
18
  className,
15
19
  symbol,
16
20
  color
17
- } = props;
18
- let iconClass = "dtable-ui-multicolor-icon multicolor-icon-".concat(symbol, " ").concat(className || '');
19
- if (needScaleIcons.includes(symbol) && _constants.isMobile) {
20
- iconClass += ' scale-icon';
21
- }
22
- return /*#__PURE__*/_react.default.createElement("svg", {
21
+ } = _ref;
22
+ if (!symbol) return null;
23
+ const iconClass = "dtable-ui-multicolor-icon multicolor-icon-".concat(symbol, " ").concat(className || '');
24
+ const props = {
23
25
  className: iconClass,
24
- "aria-hidden": "true"
25
- }, /*#__PURE__*/_react.default.createElement("use", {
26
- fill: color,
27
- xlinkHref: "#".concat(symbol)
28
- }));
26
+ style: {
27
+ fill: color
28
+ },
29
+ ariaHidden: 'true'
30
+ };
31
+ const IconComponent = iconComponents[symbol];
32
+ if (!IconComponent) return null;
33
+ return /*#__PURE__*/_react.default.createElement(IconComponent, props);
29
34
  };
30
35
  var _default = exports.default = SvgIcon;
@@ -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
+ <title>check</title>
6
+ <g id="check">
7
+ <g id="路径" transform="translate(0.020249, 4.178564)">
8
+ <path 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
9
+ 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"/>
10
+ </g>
11
+ </g>
12
+ </svg>
@@ -0,0 +1,13 @@
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
+ <title>x-check-box</title>
6
+ <g id="x-check-box">
7
+ <g id="fork-number">
8
+ <path id="路径" 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
9
+ 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
10
+ c0.8-0.8,0.8-2.1,0-2.8l0,0L18.8,16z"/>
11
+ </g>
12
+ </g>
13
+ </svg>
@@ -0,0 +1,9 @@
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
+ <title>dot</title>
6
+ <g id="dot">
7
+ <circle id="椭圆形" cx="16" cy="16" r="9"/>
8
+ </g>
9
+ </svg>
@@ -166,6 +166,6 @@
166
166
  "Close": "Schließen",
167
167
  "Latitude_abbr": "Breite",
168
168
  "Longitude_abbr": "Länge",
169
- "Enter_latitude": "Breitengrad eingeben",
170
- "Enter_longitude": "Längengrad eingeben"
169
+ "Latitude": "Breitengrad",
170
+ "Longitude": "Längengrad"
171
171
  }
@@ -166,6 +166,6 @@
166
166
  "Close": "Close",
167
167
  "Latitude_abbr": "Lat",
168
168
  "Longitude_abbr": "Lng",
169
- "Enter_latitude": "Enter latitude",
170
- "Enter_longitude": "Enter longitude"
169
+ "Latitude": "Latitude",
170
+ "Longitude": "Longitude"
171
171
  }
@@ -166,6 +166,6 @@
166
166
  "Close": "Cerrar",
167
167
  "Latitude_abbr": "Lat",
168
168
  "Longitude_abbr": "Lng",
169
- "Enter_latitude": "Enter latitude",
170
- "Enter_longitude": "Enter longitude"
169
+ "Latitude": "Latitude",
170
+ "Longitude": "Longitude"
171
171
  }
@@ -166,6 +166,6 @@
166
166
  "Close": "Fermer",
167
167
  "Latitude_abbr": "Lat",
168
168
  "Longitude_abbr": "Lng",
169
- "Enter_latitude": "Enter latitude",
170
- "Enter_longitude": "Enter longitude"
169
+ "Latitude": "Latitude",
170
+ "Longitude": "Longitude"
171
171
  }
@@ -166,6 +166,6 @@
166
166
  "Close": "Fechar",
167
167
  "Latitude_abbr": "Lat",
168
168
  "Longitude_abbr": "Lng",
169
- "Enter_latitude": "Enter latitude",
170
- "Enter_longitude": "Enter longitude"
169
+ "Latitude": "Latitude",
170
+ "Longitude": "Longitude"
171
171
  }
@@ -166,6 +166,6 @@
166
166
  "Close": "Закрыть",
167
167
  "Latitude_abbr": "Lat",
168
168
  "Longitude_abbr": "Lng",
169
- "Enter_latitude": "Enter latitude",
170
- "Enter_longitude": "Enter longitude"
169
+ "Latitude": "Latitude",
170
+ "Longitude": "Longitude"
171
171
  }
@@ -166,6 +166,6 @@
166
166
  "Close": "关闭",
167
167
  "Latitude_abbr": "纬度",
168
168
  "Longitude_abbr": "经度",
169
- "Enter_latitude": "输入纬度",
170
- "Enter_longitude": "输入经度"
169
+ "Latitude": "纬度",
170
+ "Longitude": "经度"
171
171
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.40",
3
+ "version": "6.0.42",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "4.0.2",