dtable-ui-component 0.1.97 → 0.1.98

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.
@@ -7,7 +7,7 @@ function DtableSwitch(props) {
7
7
  disabled = props.disabled,
8
8
  switchClassName = props.switchClassName;
9
9
  return /*#__PURE__*/React.createElement("div", {
10
- className: "dtable-switch ".concat(switchClassName || '')
10
+ className: "dtable-switch position-relative ".concat(switchClassName || '')
11
11
  }, /*#__PURE__*/React.createElement("label", {
12
12
  className: "custom-switch"
13
13
  }, /*#__PURE__*/React.createElement("input", {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "0.1.97",
3
+ "version": "0.1.98",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "0.0.9",
7
7
  "@seafile/seafile-calendar": "^0.0.21",
8
- "@seafile/seafile-editor": "^0.3.103",
8
+ "@seafile/seafile-editor": "^0.3.107",
9
9
  "antd-mobile": "^2.3.3",
10
10
  "astro-classname": "^2.1.0",
11
11
  "bail": "1.0.5",
@@ -1,103 +0,0 @@
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 isHotkey from 'is-hotkey';
7
- import { Input } from 'reactstrap';
8
-
9
- var TextEditor = /*#__PURE__*/function (_React$Component) {
10
- _inherits(TextEditor, _React$Component);
11
-
12
- var _super = _createSuper(TextEditor);
13
-
14
- function TextEditor(props) {
15
- var _this;
16
-
17
- _classCallCheck(this, TextEditor);
18
-
19
- _this = _super.call(this, props);
20
-
21
- _this.onCommit = function (newValue) {
22
- var updated = {};
23
- var _this$props = _this.props,
24
- column = _this$props.column,
25
- value = _this$props.value;
26
-
27
- if (newValue == value) {
28
- return;
29
- } //let { newValue } = this.state;
30
-
31
-
32
- updated[column.name] = newValue ? newValue.trim() : '';
33
-
34
- _this.props.onCommit(updated);
35
- };
36
-
37
- _this.onBlur = function (e) {
38
- _this.onCommit(e.target.value);
39
- };
40
-
41
- _this.onKeyDown = function (event) {
42
- var _event$currentTarget = event.currentTarget,
43
- selectionStart = _event$currentTarget.selectionStart,
44
- selectionEnd = _event$currentTarget.selectionEnd,
45
- value = _event$currentTarget.value;
46
-
47
- if (isHotkey('enter', event)) {
48
- event.preventDefault();
49
- event.target.blur();
50
- } else if (event.keyCode === 37 && selectionStart === 0 || event.keyCode === 39 && selectionEnd === value.length) {
51
- event.stopPropagation();
52
- }
53
- };
54
-
55
- _this.onPaste = function (e) {
56
- e.stopPropagation();
57
- };
58
-
59
- _this.onCut = function (e) {
60
- e.stopPropagation();
61
- };
62
-
63
- _this.setInputRef = function (input) {
64
- _this.input = input;
65
- };
66
-
67
- _this.state = {//newValue: props.value
68
- };
69
- return _this;
70
- }
71
-
72
- _createClass(TextEditor, [{
73
- key: "render",
74
- value: function render() {
75
- var _this$props2 = this.props,
76
- isReadOnly = _this$props2.isReadOnly,
77
- value = _this$props2.value; //onChange={this.onChange}
78
-
79
- return /*#__PURE__*/React.createElement("div", {
80
- className: "cell-editor text-editor"
81
- }, /*#__PURE__*/React.createElement("div", {
82
- className: "text-editor-container"
83
- }, /*#__PURE__*/React.createElement(Input, {
84
- ref: this.setInputRef,
85
- type: "text",
86
- defaultValue: value,
87
- readOnly: isReadOnly,
88
- onKeyDown: this.onKeyDown,
89
- onBlur: this.onBlur,
90
- onCut: this.onCut,
91
- onPaste: this.onPaste
92
- })));
93
- }
94
- }]);
95
-
96
- return TextEditor;
97
- }(React.Component);
98
-
99
- TextEditor.defaultProps = {
100
- isReadOnly: false,
101
- value: ''
102
- };
103
- export default TextEditor;