dtable-ui-component 0.3.2 → 0.3.4-alpha1

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.
Files changed (65) hide show
  1. package/assets/dtable-font/dtable-font.eot +0 -0
  2. package/assets/dtable-font/dtable-font.svg +319 -11
  3. package/assets/dtable-font/dtable-font.ttf +0 -0
  4. package/assets/dtable-font/dtable-font.woff +0 -0
  5. package/assets/dtable-font/dtable-font.woff2 +0 -0
  6. package/assets/dtable-font.css +630 -14
  7. package/lib/AutoNumberFormatter/index.js +2 -2
  8. package/lib/ButtonFormatter/index.js +4 -8
  9. package/lib/CTimeFormatter/index.js +2 -2
  10. package/lib/CheckboxFormatter/index.js +2 -2
  11. package/lib/CollaboratorFormatter/index.js +2 -2
  12. package/lib/CreatorFormatter/index.js +2 -2
  13. package/lib/DTableCustomizeCollaboratorSelect/index.css +1 -1
  14. package/lib/DTableSearchInput/index.js +2 -2
  15. package/lib/DateFormatter/index.js +2 -2
  16. package/lib/DigitalSignFormatter/index.js +2 -2
  17. package/lib/DurationFormatter/index.js +2 -2
  18. package/lib/EmailFormatter/index.js +2 -2
  19. package/lib/FileFormatter/index.js +4 -3
  20. package/lib/FileItemFormatter/index.js +1 -1
  21. package/lib/FormulaFormatter/index.js +24 -5
  22. package/lib/FormulaFormatter/utils.js +91 -0
  23. package/lib/GeolocationFormatter/index.js +2 -2
  24. package/lib/HtmlLongTextFormatter/index.js +2 -2
  25. package/lib/ImageFormatter/images-lazy-load.js +12 -16
  26. package/lib/ImageFormatter/index.js +2 -2
  27. package/lib/ImagePreviewerLightbox/index.js +3 -3
  28. package/lib/LastModifierFormatter/index.js +2 -2
  29. package/lib/LinkFormatter/index.js +4 -4
  30. package/lib/MTimeFormatter/index.js +2 -2
  31. package/lib/MultipleSelectFormatter/index.js +2 -2
  32. package/lib/NumberFormatter/index.js +2 -2
  33. package/lib/RateFormatter/index.js +2 -2
  34. package/lib/RowExpandFileFormatter/index.css +72 -0
  35. package/lib/RowExpandFileFormatter/index.js +59 -0
  36. package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +125 -0
  37. package/lib/RowExpandFormatter/index.css +73 -0
  38. package/lib/RowExpandFormatter/index.js +441 -0
  39. package/lib/RowExpandImageFormatter/index.css +79 -0
  40. package/lib/RowExpandImageFormatter/index.js +127 -0
  41. package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +128 -0
  42. package/lib/RowExpandImageFormatter/utils.js +7 -0
  43. package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +164 -0
  44. package/lib/RowExpandLinkFormatter/column-data-constants.js +20 -0
  45. package/lib/RowExpandLinkFormatter/date-utils.js +127 -0
  46. package/lib/RowExpandLinkFormatter/formula-constants.js +9 -0
  47. package/lib/RowExpandLinkFormatter/index.css +25 -0
  48. package/lib/RowExpandLinkFormatter/index.js +170 -0
  49. package/lib/RowExpandLinkFormatter/number-precision.js +116 -0
  50. package/lib/RowExpandLinkFormatter/utils.js +58 -0
  51. package/lib/RowExpandLinkFormatter/value-display-utils.js +401 -0
  52. package/lib/SimpleLongTextFormatter/index.js +2 -2
  53. package/lib/SingleSelectFormatter/index.js +2 -2
  54. package/lib/TextFormatter/index.js +2 -2
  55. package/lib/UrlFormatter/index.js +2 -2
  56. package/lib/common/delete-tip.css +16 -0
  57. package/lib/common/delete-tip.js +84 -0
  58. package/lib/common/modal-portal.js +44 -0
  59. package/lib/constants/cell-types.js +5 -1
  60. package/lib/data/dtable-value.js +2731 -0
  61. package/lib/index.js +7 -1
  62. package/lib/lang/index.js +1 -1
  63. package/lib/locals/en.js +17 -13
  64. package/lib/locals/zh-CN.js +16 -12
  65. package/package.json +5 -4
@@ -0,0 +1,84 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
4
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
+ import React from 'react';
6
+ import ModalPortal from './modal-portal';
7
+ import { getLocale } from '../lang';
8
+ import './delete-tip.css';
9
+
10
+ var DeleteTip = /*#__PURE__*/function (_React$Component) {
11
+ _inherits(DeleteTip, _React$Component);
12
+
13
+ var _super = _createSuper(DeleteTip);
14
+
15
+ function DeleteTip() {
16
+ var _this;
17
+
18
+ _classCallCheck(this, DeleteTip);
19
+
20
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
21
+ args[_key] = arguments[_key];
22
+ }
23
+
24
+ _this = _super.call.apply(_super, [this].concat(args));
25
+
26
+ _this.handleOutsideClick = function (e) {
27
+ if (_this.tipContainer && !_this.tipContainer.contains(e.target)) {
28
+ _this.props.toggle();
29
+ }
30
+ };
31
+
32
+ return _this;
33
+ }
34
+
35
+ _createClass(DeleteTip, [{
36
+ key: "componentDidMount",
37
+ value: function componentDidMount() {
38
+ document.addEventListener('click', this.handleOutsideClick);
39
+ }
40
+ }, {
41
+ key: "componentWillUnmount",
42
+ value: function componentWillUnmount() {
43
+ document.removeEventListener('click', this.handleOutsideClick);
44
+ }
45
+ }, {
46
+ key: "render",
47
+ value: function render() {
48
+ var _this2 = this;
49
+
50
+ var _this$props = this.props,
51
+ toggle = _this$props.toggle,
52
+ onDelete = _this$props.onDelete,
53
+ position = _this$props.position,
54
+ deleteTip = _this$props.deleteTip;
55
+ return /*#__PURE__*/React.createElement(ModalPortal, null, /*#__PURE__*/React.createElement("div", {
56
+ ref: function ref(node) {
57
+ return _this2.tipContainer = node;
58
+ },
59
+ className: "dtable-tip tip-container",
60
+ style: {
61
+ top: position.top,
62
+ left: position.left
63
+ },
64
+ onClick: function onClick(e) {
65
+ return e.stopPropagation();
66
+ }
67
+ }, /*#__PURE__*/React.createElement("b", {
68
+ className: "mb-4"
69
+ }, deleteTip), /*#__PURE__*/React.createElement("div", {
70
+ className: "d-flex justify-content-end"
71
+ }, /*#__PURE__*/React.createElement("button", {
72
+ className: "btn btn-secondary mr-2",
73
+ onClick: toggle
74
+ }, getLocale('Cancel')), /*#__PURE__*/React.createElement("button", {
75
+ className: "btn btn-primary",
76
+ onClick: onDelete
77
+ }, getLocale('Delete')))));
78
+ }
79
+ }]);
80
+
81
+ return DeleteTip;
82
+ }(React.Component);
83
+
84
+ export { DeleteTip as default };
@@ -0,0 +1,44 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
4
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
+ import React from 'react';
6
+ import ReactDOM from 'react-dom';
7
+ var modalRoot = document.getElementById('modal-wrapper');
8
+
9
+ var ModalPortal = /*#__PURE__*/function (_React$Component) {
10
+ _inherits(ModalPortal, _React$Component);
11
+
12
+ var _super = _createSuper(ModalPortal);
13
+
14
+ function ModalPortal(props) {
15
+ var _this;
16
+
17
+ _classCallCheck(this, ModalPortal);
18
+
19
+ _this = _super.call(this, props);
20
+ _this.el = document.createElement('div');
21
+ return _this;
22
+ }
23
+
24
+ _createClass(ModalPortal, [{
25
+ key: "componentDidMount",
26
+ value: function componentDidMount() {
27
+ modalRoot.appendChild(this.el);
28
+ }
29
+ }, {
30
+ key: "componentWillUnmount",
31
+ value: function componentWillUnmount() {
32
+ modalRoot.removeChild(this.el);
33
+ }
34
+ }, {
35
+ key: "render",
36
+ value: function render() {
37
+ return ReactDOM.createPortal(this.props.children, this.el);
38
+ }
39
+ }]);
40
+
41
+ return ModalPortal;
42
+ }(React.Component);
43
+
44
+ export { ModalPortal as default };
@@ -22,4 +22,8 @@ export var URL = 'url';
22
22
  export var EMAIL = 'email';
23
23
  export var DURATION = 'duration';
24
24
  export var RATE = 'rate';
25
- export var BUTTON = 'button';
25
+ export var BUTTON = 'button';
26
+ export var DIGITAL_SIGN = 'digital-sign'; // formula | link-formula column calculate result type
27
+
28
+ export var BOOL = 'bool';
29
+ export var STRING = 'string';