dtable-ui-component 0.2.0 → 0.2.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.
- package/lib/AutoNumberFormatter/index.js +3 -0
- package/lib/ButtonFormatter/index.js +1 -1
- package/lib/CollaboratorFormatter/index.js +3 -0
- package/lib/CreatorFormatter/index.js +3 -0
- package/lib/DTableCustomizeCollaboratorSelect/index.js +1 -1
- package/lib/DTableCustomizeSelect/index.js +1 -1
- package/lib/DTableSelect/index.js +1 -1
- package/lib/FormulaFormatter/index.js +2 -2
- package/lib/HtmlLongTextFormatter/vfile/index.js +0 -2
- package/lib/LastModifierFormatter/index.js +3 -0
- package/lib/LinkFormatter/index.js +4 -1
- package/lib/MultipleSelectFormatter/index.js +3 -0
- package/lib/SelectOptionGroup/KeyCodes.js +1 -1
- package/lib/SingleSelectFormatter/index.js +3 -0
- package/lib/cellFormatterFactory/index.js +3 -3
- package/lib/formatterConfig/base-formatter-config.js +28 -0
- package/lib/formatterConfig/index.js +6 -23
- package/package.json +1 -1
|
@@ -27,7 +27,7 @@ var ButtonFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
27
27
|
button_type = _this$props$data.button_type,
|
|
28
28
|
url_address = _this$props$data.url_address;
|
|
29
29
|
|
|
30
|
-
if (button_type
|
|
30
|
+
if (button_type === 'open_url' && url_address) {
|
|
31
31
|
window.open(url_address);
|
|
32
32
|
}
|
|
33
33
|
};
|
|
@@ -30,7 +30,7 @@ var CollaboratorSelect = /*#__PURE__*/function (_Component) {
|
|
|
30
30
|
|
|
31
31
|
if (_this.state.isShowSelectOptions) event.nativeEvent.stopImmediatePropagation();
|
|
32
32
|
var eventClassName = event.target.className;
|
|
33
|
-
if (_this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'option-group-search') return; //Prevent closing by pressing the spacebar in the search input
|
|
33
|
+
if (_this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'option-group-search') return; //Prevent closing by pressing the spacebar in the search input
|
|
34
34
|
|
|
35
35
|
if (event.target.value === '') return;
|
|
36
36
|
_this.selectedOptionWidth = _this.selectedOptionRef.clientWidth;
|
|
@@ -28,7 +28,7 @@ var DTableCustomizeSelect = /*#__PURE__*/function (_Component) {
|
|
|
28
28
|
|
|
29
29
|
if (_this.state.isShowSelectOptions) event.nativeEvent.stopImmediatePropagation();
|
|
30
30
|
var eventClassName = event.target.className;
|
|
31
|
-
if (_this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'option-group-search') return; //Prevent closing by pressing the spacebar in the search input
|
|
31
|
+
if (_this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'option-group-search') return; //Prevent closing by pressing the spacebar in the search input
|
|
32
32
|
|
|
33
33
|
if (event.target.value === '') return;
|
|
34
34
|
|
|
@@ -113,7 +113,7 @@ var DtableSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
113
113
|
placeholder: placeholder,
|
|
114
114
|
isSearchable: isSearchable,
|
|
115
115
|
isClearable: isClearable,
|
|
116
|
-
menuPosition: menuPosition || 'fixed' // when use default menuPosition(absolute), menuPortalTarget is unnecessary.
|
|
116
|
+
menuPosition: menuPosition || 'fixed' // when use default menuPosition(absolute), menuPortalTarget is unnecessary.
|
|
117
117
|
,
|
|
118
118
|
menuShouldScrollIntoView: true,
|
|
119
119
|
menuPortalTarget: this.getMenuPortalTarget(),
|
|
@@ -5,7 +5,7 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
5
5
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { FORMULA_RESULT_TYPE, CellType } from '../constants';
|
|
8
|
-
import
|
|
8
|
+
import BaseFormatterConfig from '../formatterConfig/base-formatter-config';
|
|
9
9
|
import TextFormatter from '../TextFormatter';
|
|
10
10
|
import { isArrayFormalColumn, isSimpleCellFormatter, isFunction } from './utils';
|
|
11
11
|
import cellValueValidator from './cell-value-validator';
|
|
@@ -55,7 +55,7 @@ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
var Formatter =
|
|
58
|
+
var Formatter = BaseFormatterConfig[array_type];
|
|
59
59
|
|
|
60
60
|
var formatterProps = _this.getFormatterProps(array_type, array_data, collaborators);
|
|
61
61
|
|
|
@@ -140,6 +140,9 @@ var LinkFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
140
140
|
|
|
141
141
|
LinkFormatter.defaultProps = {
|
|
142
142
|
enableOpenLinkedRow: false,
|
|
143
|
-
|
|
143
|
+
currentTableId: '',
|
|
144
|
+
value: [],
|
|
145
|
+
column: {},
|
|
146
|
+
row: {}
|
|
144
147
|
};
|
|
145
148
|
export default LinkFormatter;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import
|
|
3
|
+
import FormatterConfig from '../formatterConfig';
|
|
4
4
|
|
|
5
5
|
var CellFormatterFactory = /*#__PURE__*/function () {
|
|
6
6
|
function CellFormatterFactory() {
|
|
@@ -10,8 +10,8 @@ var CellFormatterFactory = /*#__PURE__*/function () {
|
|
|
10
10
|
_createClass(CellFormatterFactory, [{
|
|
11
11
|
key: "createFormatter",
|
|
12
12
|
value: function createFormatter(formatterType) {
|
|
13
|
-
if (
|
|
14
|
-
return
|
|
13
|
+
if (FormatterConfig[formatterType]) {
|
|
14
|
+
return FormatterConfig[formatterType];
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
return null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
|
|
3
|
+
var _CellType$DEFAULT$Cel;
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { CellType } from '../constants';
|
|
7
|
+
import CheckboxFormatter from '../CheckboxFormatter';
|
|
8
|
+
import ImageFormatter from '../ImageFormatter';
|
|
9
|
+
import SimpleLongTextFormatter from '../SimpleLongTextFormatter';
|
|
10
|
+
import TextCellFormatter from '../TextFormatter';
|
|
11
|
+
import SingleSelectFormatter from '../SingleSelectFormatter';
|
|
12
|
+
import MultipleSelectFormatter from '../MultipleSelectFormatter';
|
|
13
|
+
import FileFormatter from '../FileFormatter';
|
|
14
|
+
import CollaboratorFormatter from '../CollaboratorFormatter';
|
|
15
|
+
import NumberFormatter from '../NumberFormatter';
|
|
16
|
+
import DateFormatter from '../DateFormatter';
|
|
17
|
+
import CreatorFormatter from '../CreatorFormatter';
|
|
18
|
+
import CTimeFormatter from '../CTimeFormatter';
|
|
19
|
+
import LastModifierFormatter from '../LastModifierFormatter';
|
|
20
|
+
import MTimeFormatter from '../MTimeFormatter';
|
|
21
|
+
import GeolocationFormatter from '../GeolocationFormatter';
|
|
22
|
+
import AutoNumberFormatter from '../AutoNumberFormatter';
|
|
23
|
+
import UrlFormatter from '../UrlFormatter';
|
|
24
|
+
import EmailFormatter from '../EmailFormatter';
|
|
25
|
+
import DurationFormatter from '../DurationFormatter';
|
|
26
|
+
import RateFormatter from '../RateFormatter';
|
|
27
|
+
import ButtonFormatter from '../ButtonFormatter';
|
|
28
|
+
export default (_CellType$DEFAULT$Cel = {}, _defineProperty(_CellType$DEFAULT$Cel, CellType.DEFAULT, /*#__PURE__*/React.createElement(TextCellFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.TEXT, /*#__PURE__*/React.createElement(TextCellFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.CHECKBOX, /*#__PURE__*/React.createElement(CheckboxFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.LONG_TEXT, /*#__PURE__*/React.createElement(SimpleLongTextFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.SINGLE_SELECT, /*#__PURE__*/React.createElement(SingleSelectFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.IMAGE, /*#__PURE__*/React.createElement(ImageFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.FILE, /*#__PURE__*/React.createElement(FileFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.MULTIPLE_SELECT, /*#__PURE__*/React.createElement(MultipleSelectFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.COLLABORATOR, /*#__PURE__*/React.createElement(CollaboratorFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.NUMBER, /*#__PURE__*/React.createElement(NumberFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.DATE, /*#__PURE__*/React.createElement(DateFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.CREATOR, /*#__PURE__*/React.createElement(CreatorFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.CTIME, /*#__PURE__*/React.createElement(CTimeFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.LAST_MODIFIER, /*#__PURE__*/React.createElement(LastModifierFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.MTIME, /*#__PURE__*/React.createElement(MTimeFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.GEOLOCATION, /*#__PURE__*/React.createElement(GeolocationFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.AUTO_NUMBER, /*#__PURE__*/React.createElement(AutoNumberFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.URL, /*#__PURE__*/React.createElement(UrlFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.EMAIL, /*#__PURE__*/React.createElement(EmailFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.DURATION, /*#__PURE__*/React.createElement(DurationFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.RATE, /*#__PURE__*/React.createElement(RateFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.BUTTON, /*#__PURE__*/React.createElement(ButtonFormatter, null)), _CellType$DEFAULT$Cel);
|
|
@@ -1,31 +1,14 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
3
|
|
|
3
|
-
var
|
|
4
|
+
var _objectSpread2;
|
|
4
5
|
|
|
5
6
|
import React from 'react';
|
|
6
7
|
import { CellType } from '../constants';
|
|
7
|
-
import
|
|
8
|
-
import ImageFormatter from '../ImageFormatter';
|
|
9
|
-
import SimpleLongTextFormatter from '../SimpleLongTextFormatter';
|
|
10
|
-
import TextCellFormatter from '../TextFormatter';
|
|
11
|
-
import SingleSelectFormatter from '../SingleSelectFormatter';
|
|
12
|
-
import MultipleSelectFormatter from '../MultipleSelectFormatter';
|
|
13
|
-
import FileFormatter from '../FileFormatter';
|
|
8
|
+
import BaseFormatterConfig from './base-formatter-config';
|
|
14
9
|
import LinkFormatter from '../LinkFormatter';
|
|
15
|
-
import CollaboratorFormatter from '../CollaboratorFormatter';
|
|
16
|
-
import NumberFormatter from '../NumberFormatter';
|
|
17
|
-
import DateFormatter from '../DateFormatter';
|
|
18
|
-
import CreatorFormatter from '../CreatorFormatter';
|
|
19
|
-
import CTimeFormatter from '../CTimeFormatter';
|
|
20
|
-
import LastModifierFormatter from '../LastModifierFormatter';
|
|
21
|
-
import MTimeFormatter from '../MTimeFormatter';
|
|
22
|
-
import GeolocationFormatter from '../GeolocationFormatter';
|
|
23
10
|
import FormulaFormatter from '../FormulaFormatter';
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
import DurationFormatter from '../DurationFormatter';
|
|
28
|
-
import RateFormatter from '../RateFormatter';
|
|
29
|
-
import ButtonFormatter from '../ButtonFormatter';
|
|
30
|
-
var FormatterConfig = (_FormatterConfig = {}, _defineProperty(_FormatterConfig, CellType.DEFAULT, /*#__PURE__*/React.createElement(TextCellFormatter, null)), _defineProperty(_FormatterConfig, CellType.TEXT, /*#__PURE__*/React.createElement(TextCellFormatter, null)), _defineProperty(_FormatterConfig, CellType.CHECKBOX, /*#__PURE__*/React.createElement(CheckboxFormatter, null)), _defineProperty(_FormatterConfig, CellType.LONG_TEXT, /*#__PURE__*/React.createElement(SimpleLongTextFormatter, null)), _defineProperty(_FormatterConfig, CellType.SINGLE_SELECT, /*#__PURE__*/React.createElement(SingleSelectFormatter, null)), _defineProperty(_FormatterConfig, CellType.IMAGE, /*#__PURE__*/React.createElement(ImageFormatter, null)), _defineProperty(_FormatterConfig, CellType.FILE, /*#__PURE__*/React.createElement(FileFormatter, null)), _defineProperty(_FormatterConfig, CellType.MULTIPLE_SELECT, /*#__PURE__*/React.createElement(MultipleSelectFormatter, null)), _defineProperty(_FormatterConfig, CellType.COLLABORATOR, /*#__PURE__*/React.createElement(CollaboratorFormatter, null)), _defineProperty(_FormatterConfig, CellType.NUMBER, /*#__PURE__*/React.createElement(NumberFormatter, null)), _defineProperty(_FormatterConfig, CellType.DATE, /*#__PURE__*/React.createElement(DateFormatter, null)), _defineProperty(_FormatterConfig, CellType.LINK, /*#__PURE__*/React.createElement(LinkFormatter, null)), _defineProperty(_FormatterConfig, CellType.CREATOR, /*#__PURE__*/React.createElement(CreatorFormatter, null)), _defineProperty(_FormatterConfig, CellType.CTIME, /*#__PURE__*/React.createElement(CTimeFormatter, null)), _defineProperty(_FormatterConfig, CellType.LAST_MODIFIER, /*#__PURE__*/React.createElement(LastModifierFormatter, null)), _defineProperty(_FormatterConfig, CellType.MTIME, /*#__PURE__*/React.createElement(MTimeFormatter, null)), _defineProperty(_FormatterConfig, CellType.GEOLOCATION, /*#__PURE__*/React.createElement(GeolocationFormatter, null)), _defineProperty(_FormatterConfig, CellType.FORMULA, /*#__PURE__*/React.createElement(FormulaFormatter, null)), _defineProperty(_FormatterConfig, CellType.AUTO_NUMBER, /*#__PURE__*/React.createElement(AutoNumberFormatter, null)), _defineProperty(_FormatterConfig, CellType.URL, /*#__PURE__*/React.createElement(UrlFormatter, null)), _defineProperty(_FormatterConfig, CellType.EMAIL, /*#__PURE__*/React.createElement(EmailFormatter, null)), _defineProperty(_FormatterConfig, CellType.DURATION, /*#__PURE__*/React.createElement(DurationFormatter, null)), _defineProperty(_FormatterConfig, CellType.RATE, /*#__PURE__*/React.createElement(RateFormatter, null)), _defineProperty(_FormatterConfig, CellType.BUTTON, /*#__PURE__*/React.createElement(ButtonFormatter, null)), _FormatterConfig);
|
|
11
|
+
|
|
12
|
+
var FormatterConfig = _objectSpread(_objectSpread({}, BaseFormatterConfig), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, CellType.FORMULA, /*#__PURE__*/React.createElement(FormulaFormatter, null)), _defineProperty(_objectSpread2, CellType.LINK, /*#__PURE__*/React.createElement(LinkFormatter, null)), _objectSpread2));
|
|
13
|
+
|
|
31
14
|
export default FormatterConfig;
|