dtable-ui-component 0.1.75-beta10 → 0.1.75-beta11
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/README.md
CHANGED
|
@@ -24,8 +24,4 @@ If you want to use on-demand loading, add the following content to the ` .babelr
|
|
|
24
24
|
"plugins": [
|
|
25
25
|
["on-demand-loading", {"library": "dtable-ui-component"}]
|
|
26
26
|
]
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Long text formatter
|
|
30
|
-
|
|
31
|
-
If your project does not require complex formatted display of long text, you can just introduce the ` SimpleLongTextFormatter` component
|
|
27
|
+
```
|
|
@@ -3,6 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React, { Component } from 'react';
|
|
6
|
+
import cn from 'astro-classname';
|
|
6
7
|
import { processor } from './markdown2html';
|
|
7
8
|
import './index.css';
|
|
8
9
|
|
|
@@ -80,7 +81,8 @@ var HtmlLongTextFormatter = /*#__PURE__*/function (_Component) {
|
|
|
80
81
|
key: "render",
|
|
81
82
|
value: function render() {
|
|
82
83
|
var innerHtml = this.state.innerHtml;
|
|
83
|
-
var
|
|
84
|
+
var containerClassName = this.props.containerClassName;
|
|
85
|
+
var className = cn('dtable-ui cell-formatter-container long-text-formatter', containerClassName);
|
|
84
86
|
if (!innerHtml) return null;
|
|
85
87
|
return /*#__PURE__*/React.createElement("div", {
|
|
86
88
|
className: "".concat(className, " article"),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import cn from 'astro-classname';
|
|
3
2
|
import HtmlLongTextFormatter from '../HtmlLongTextFormatter';
|
|
4
3
|
import SimpleLongTextFormatter from '../SimpleLongTextFormatter';
|
|
5
4
|
|
|
@@ -7,18 +6,17 @@ function LongTextFormatter(props) {
|
|
|
7
6
|
var isSample = props.isSample,
|
|
8
7
|
value = props.value,
|
|
9
8
|
containerClassName = props.containerClassName;
|
|
10
|
-
var className = cn('dtable-ui cell-formatter-container long-text-formatter', containerClassName);
|
|
11
9
|
|
|
12
10
|
if (isSample) {
|
|
13
11
|
return /*#__PURE__*/React.createElement(SimpleLongTextFormatter, {
|
|
14
12
|
value: value,
|
|
15
|
-
|
|
13
|
+
containerClassName: containerClassName
|
|
16
14
|
});
|
|
17
15
|
}
|
|
18
16
|
|
|
19
17
|
return /*#__PURE__*/React.createElement(HtmlLongTextFormatter, {
|
|
20
18
|
value: value,
|
|
21
|
-
|
|
19
|
+
containerClassName: containerClassName
|
|
22
20
|
});
|
|
23
21
|
}
|
|
24
22
|
|
|
@@ -3,6 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import cn from 'astro-classname';
|
|
6
7
|
import getPreviewContent from './normalize-long-text-value';
|
|
7
8
|
import './index.css';
|
|
8
9
|
|
|
@@ -83,7 +84,8 @@ var SimpleLongTextFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
83
84
|
_createClass(SimpleLongTextFormatter, [{
|
|
84
85
|
key: "render",
|
|
85
86
|
value: function render() {
|
|
86
|
-
var
|
|
87
|
+
var containerClassName = this.props.containerClassName;
|
|
88
|
+
var className = cn('dtable-ui cell-formatter-container long-text-formatter', containerClassName);
|
|
87
89
|
var value = this.translateValue();
|
|
88
90
|
return /*#__PURE__*/React.createElement("div", {
|
|
89
91
|
className: className
|
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
|
6
6
|
import { CellType } from '../constants';
|
|
7
7
|
import CheckboxFormatter from '../CheckboxFormatter';
|
|
8
8
|
import ImageFormatter from '../ImageFormatter';
|
|
9
|
-
import
|
|
9
|
+
import SimpleLongTextFormatter from '../SimpleLongTextFormatter';
|
|
10
10
|
import TextCellFormatter from '../TextFormatter';
|
|
11
11
|
import SingleSelectFormatter from '../SingleSelectFormatter';
|
|
12
12
|
import MultipleSelectFormatter from '../MultipleSelectFormatter';
|
|
@@ -27,5 +27,5 @@ import EmailFormatter from '../EmailFormatter';
|
|
|
27
27
|
import DurationFormatter from '../DurationFormatter';
|
|
28
28
|
import RateFormatter from '../RateFormatter';
|
|
29
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(
|
|
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);
|
|
31
31
|
export default FormatterConfig;
|
package/lib/index.js
CHANGED
|
@@ -9,8 +9,6 @@ export { getDateDisplayString, getNumberDisplayString, formatStringToNumber, for
|
|
|
9
9
|
export { default as CheckboxFormatter } from './CheckboxFormatter';
|
|
10
10
|
export { default as ImageFormatter } from './ImageFormatter';
|
|
11
11
|
export { default as LongTextFormatter } from './LongTextFormatter';
|
|
12
|
-
export { default as SimpleLongTextFormatter } from './SimpleLongTextFormatter';
|
|
13
|
-
export { default as HtmlLongTextFormatter } from './HtmlLongTextFormatter';
|
|
14
12
|
export { default as TextFormatter } from './TextFormatter';
|
|
15
13
|
export { default as SingleSelectFormatter } from './SingleSelectFormatter';
|
|
16
14
|
export { default as MultipleSelectFormatter } from './MultipleSelectFormatter';
|