dtable-ui-component 0.1.75-beta2 → 0.1.75-beta3
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/es/AutoNumberFormatter/index.css +1 -0
- package/es/AutoNumberFormatter/index.js +36 -0
- package/es/ButtonFormatter/index.css +13 -0
- package/es/ButtonFormatter/index.js +56 -0
- package/es/CTimeFormatter/index.css +1 -0
- package/es/CTimeFormatter/index.js +58 -0
- package/es/CheckboxFormatter/index.css +1 -0
- package/es/CheckboxFormatter/index.js +45 -0
- package/es/CollaboratorFormatter/index.css +1 -0
- package/es/CollaboratorFormatter/index.js +91 -0
- package/es/CollaboratorItem/index.css +49 -0
- package/es/CollaboratorItem/index.js +64 -0
- package/es/CreatorFormatter/index.css +1 -0
- package/es/CreatorFormatter/index.js +87 -0
- package/es/DateFormatter/index.css +1 -0
- package/es/DateFormatter/index.js +60 -0
- package/es/DurationFormatter/index.css +1 -0
- package/es/DurationFormatter/index.js +38 -0
- package/es/EmailFormatter/index.css +5 -0
- package/es/EmailFormatter/index.js +36 -0
- package/es/FileFormatter/index.css +29 -0
- package/es/FileFormatter/index.js +64 -0
- package/es/FileItemFormatter/index.js +50 -0
- package/es/FileUploader/index.js +53 -0
- package/es/FormulaFormatter/index.css +19 -0
- package/es/FormulaFormatter/index.js +164 -0
- package/es/GeolocationFormatter/index.css +1 -0
- package/es/GeolocationFormatter/index.js +53 -0
- package/es/ImageFormatter/images-lazy-load.js +150 -0
- package/es/ImageFormatter/index.css +34 -0
- package/es/ImageFormatter/index.js +154 -0
- package/es/ImagePreviewerLightbox/index.css +87 -0
- package/es/ImagePreviewerLightbox/index.js +119 -0
- package/es/LastModifierFormatter/index.css +1 -0
- package/es/LastModifierFormatter/index.js +87 -0
- package/es/LinkFormatter/index.css +27 -0
- package/es/LinkFormatter/index.js +144 -0
- package/es/Loading/index.css +54 -0
- package/es/Loading/index.js +7 -0
- package/es/LongTextFormatter/html-long-text-formatter.js +96 -0
- package/es/LongTextFormatter/index.css +63 -0
- package/es/LongTextFormatter/index.js +29 -0
- package/es/LongTextFormatter/simple-long-text-formatter.js +104 -0
- package/es/MTimeFormatter/index.css +1 -0
- package/es/MTimeFormatter/index.js +58 -0
- package/es/ModalPortal/index.js +44 -0
- package/es/MultipleSelectFormatter/index.css +1 -0
- package/es/MultipleSelectFormatter/index.js +70 -0
- package/es/NumberFormatter/index.css +1 -0
- package/es/NumberFormatter/index.js +47 -0
- package/es/RateFormatter/index.css +1 -0
- package/es/RateFormatter/index.js +80 -0
- package/es/SelectItem/index.js +58 -0
- package/es/SingleSelectFormatter/index.css +1 -0
- package/es/SingleSelectFormatter/index.js +70 -0
- package/es/TextFormatter/index.css +1 -0
- package/es/TextFormatter/index.js +56 -0
- package/es/UrlFormatter/index.css +5 -0
- package/es/UrlFormatter/index.js +36 -0
- package/es/app.css +20 -0
- package/es/app.js +91 -0
- package/es/assets/images/avatar/default_avatar.png +0 -0
- package/es/assets/images/file/192/excel.png +0 -0
- package/es/assets/images/file/192/file.png +0 -0
- package/es/assets/images/file/192/music.png +0 -0
- package/es/assets/images/file/192/pdf.png +0 -0
- package/es/assets/images/file/192/pic.png +0 -0
- package/es/assets/images/file/192/ppt.png +0 -0
- package/es/assets/images/file/192/txt.png +0 -0
- package/es/assets/images/file/192/video.png +0 -0
- package/es/assets/images/file/192/word.png +0 -0
- package/es/assets/images/file/24/excel.png +0 -0
- package/es/assets/images/file/24/file.png +0 -0
- package/es/assets/images/file/24/music.png +0 -0
- package/es/assets/images/file/24/pdf.png +0 -0
- package/es/assets/images/file/24/pic.png +0 -0
- package/es/assets/images/file/24/ppt.png +0 -0
- package/es/assets/images/file/24/txt.png +0 -0
- package/es/assets/images/file/24/video.png +0 -0
- package/es/assets/images/file/24/word.png +0 -0
- package/es/assets/images/folder/folder-192.png +0 -0
- package/es/assets/images/folder/folder-24.png +0 -0
- package/es/cellFormatterFactory/index.js +25 -0
- package/es/components/cell-editor/checkbox-editor.js +104 -0
- package/es/components/cell-editor/collaborator-editor.js +236 -0
- package/es/components/cell-editor/date-editor.js +151 -0
- package/es/components/cell-editor/index.js +9 -0
- package/es/components/cell-editor/link-editor.js +303 -0
- package/es/components/cell-editor/multiple-select-editor.js +237 -0
- package/es/components/cell-editor/number-editor.js +154 -0
- package/es/components/cell-editor/single-select-editor.js +202 -0
- package/es/components/cell-editor/text-editor.js +122 -0
- package/es/components/cell-editor-dialog/pc-file-editor-dialog.js +46 -0
- package/es/components/cell-editor-dialog/pc-files-addition/index.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-preview/index.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -0
- package/es/components/cell-editor-popover/mb-collaborator-editor-popover.js +177 -0
- package/es/components/cell-editor-popover/mb-date-editor-popover.js +245 -0
- package/es/components/cell-editor-popover/mb-link-editor-popover.js +170 -0
- package/es/components/cell-editor-popover/mb-select-editor-popover.js +230 -0
- package/es/components/cell-editor-popover/pc-collaborator-editor-popover.js +109 -0
- package/es/components/cell-editor-popover/pc-date-editor-popover.js +142 -0
- package/es/components/cell-editor-popover/pc-link-editor-popover.js +114 -0
- package/es/components/cell-editor-popover/pc-select-editor-popover.js +143 -0
- package/es/components/common/collaborator-item.js +63 -0
- package/es/components/common/edit-editor-button.js +56 -0
- package/es/components/common/link-editor-option.js +113 -0
- package/es/components/common/mobile/mb-editor-header.js +48 -0
- package/es/components/common/select-editor-option.js +106 -0
- package/es/constants/cell-types.js +25 -0
- package/es/constants/index.js +49 -0
- package/es/css/cell-editor.css +614 -0
- package/es/css/cell-formatter.css +4 -0
- package/es/css/custom-rc-calendar.css +118 -0
- package/es/formatterConfig/index.js +31 -0
- package/es/index.js +31 -0
- package/es/lang/index.js +50 -0
- package/es/locals/de.js +2 -0
- package/es/locals/en.js +17 -0
- package/es/locals/fr.js +2 -0
- package/es/locals/zh-CN.js +17 -0
- package/{lib/toast → es/toaster}/alert.js +0 -0
- package/{lib/toast → es/toaster}/index.js +0 -0
- package/{lib/toast → es/toaster}/toast.js +0 -0
- package/{lib/toast → es/toaster}/toastManager.js +0 -0
- package/{lib/toast → es/toaster}/toaster.js +0 -0
- package/es/utils/cell-value-validator.js +31 -0
- package/es/utils/column-utils.js +7 -0
- package/es/utils/editor-utils.js +71 -0
- package/es/utils/markdown2html.js +62 -0
- package/es/utils/normalize-long-text-value.js +69 -0
- package/es/utils/number-precision.js +164 -0
- package/es/utils/unified/index.js +470 -0
- package/es/utils/utils.js +116 -0
- package/es/utils/value-format-utils.js +497 -0
- package/es/utils/vfile/core.js +172 -0
- package/es/utils/vfile/index.js +48 -0
- package/lib/AutoNumberFormatter/index.js +38 -27
- package/lib/ButtonFormatter/index.js +59 -47
- package/lib/CTimeFormatter/index.js +53 -39
- package/lib/CheckboxFormatter/index.js +48 -35
- package/lib/CollaboratorFormatter/index.js +64 -42
- package/lib/CollaboratorItem/index.js +61 -44
- package/lib/CreatorFormatter/index.js +62 -42
- package/lib/DateFormatter/index.js +55 -40
- package/lib/DurationFormatter/index.js +42 -29
- package/lib/EmailFormatter/index.js +38 -27
- package/lib/FileFormatter/index.js +65 -50
- package/lib/FileItemFormatter/index.js +44 -31
- package/lib/FileUploader/index.js +44 -34
- package/lib/FormulaFormatter/index.js +102 -81
- package/lib/GeolocationFormatter/index.js +50 -35
- package/lib/ImageFormatter/images-lazy-load.js +81 -73
- package/lib/ImageFormatter/index.js +109 -90
- package/lib/ImagePreviewerLightbox/index.js +60 -27
- package/lib/LastModifierFormatter/index.js +62 -42
- package/lib/LinkFormatter/index.js +80 -59
- package/lib/Loading/index.js +13 -4
- package/lib/LongTextFormatter/html-long-text-formatter.js +60 -49
- package/lib/LongTextFormatter/index.js +28 -9
- package/lib/LongTextFormatter/simple-long-text-formatter.js +58 -52
- package/lib/MTimeFormatter/index.js +53 -39
- package/lib/ModalPortal/index.js +37 -30
- package/lib/MultipleSelectFormatter/index.js +55 -39
- package/lib/NumberFormatter/index.js +50 -35
- package/lib/RateFormatter/index.js +52 -37
- package/lib/SelectItem/index.js +46 -31
- package/lib/SingleSelectFormatter/index.js +54 -38
- package/lib/TextFormatter/index.js +44 -31
- package/lib/UrlFormatter/index.js +38 -27
- package/lib/app.js +80 -75
- package/lib/cellFormatterFactory/index.js +20 -17
- package/lib/components/cell-editor/checkbox-editor.js +66 -59
- package/lib/components/cell-editor/collaborator-editor.js +126 -113
- package/lib/components/cell-editor/date-editor.js +119 -99
- package/lib/components/cell-editor/index.js +40 -9
- package/lib/components/cell-editor/link-editor.js +140 -122
- package/lib/components/cell-editor/multiple-select-editor.js +127 -114
- package/lib/components/cell-editor/number-editor.js +86 -78
- package/lib/components/cell-editor/single-select-editor.js +120 -106
- package/lib/components/cell-editor/text-editor.js +72 -65
- package/lib/components/cell-editor-dialog/pc-file-editor-dialog.js +51 -31
- package/lib/components/cell-editor-dialog/pc-files-addition/index.js +1 -0
- package/lib/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +1 -0
- package/lib/components/cell-editor-dialog/pc-files-preview/index.js +1 -0
- package/lib/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +1 -0
- package/lib/components/cell-editor-popover/mb-collaborator-editor-popover.js +111 -105
- package/lib/components/cell-editor-popover/mb-date-editor-popover.js +157 -140
- package/lib/components/cell-editor-popover/mb-link-editor-popover.js +109 -103
- package/lib/components/cell-editor-popover/mb-select-editor-popover.js +155 -142
- package/lib/components/cell-editor-popover/pc-collaborator-editor-popover.js +89 -74
- package/lib/components/cell-editor-popover/pc-date-editor-popover.js +102 -88
- package/lib/components/cell-editor-popover/pc-link-editor-popover.js +91 -77
- package/lib/components/cell-editor-popover/pc-select-editor-popover.js +105 -91
- package/lib/components/common/collaborator-item.js +59 -43
- package/lib/components/common/edit-editor-button.js +39 -28
- package/lib/components/common/link-editor-option.js +71 -63
- package/lib/components/common/mobile/mb-editor-header.js +52 -39
- package/lib/components/common/select-editor-option.js +74 -58
- package/lib/constants/cell-types.js +54 -25
- package/lib/constants/index.js +28 -5
- package/lib/formatterConfig/index.js +59 -28
- package/lib/index.js +139 -31
- package/lib/lang/index.js +27 -11
- package/lib/locals/de.js +6 -1
- package/lib/locals/en.js +6 -1
- package/lib/locals/fr.js +6 -1
- package/lib/locals/zh-CN.js +6 -1
- package/lib/toaster/alert.js +164 -0
- package/lib/toaster/index.js +12 -0
- package/lib/toaster/toast.js +223 -0
- package/lib/toaster/toastManager.js +189 -0
- package/lib/toaster/toaster.js +92 -0
- package/lib/utils/cell-value-validator.js +9 -5
- package/lib/utils/column-utils.js +13 -5
- package/lib/utils/editor-utils.js +13 -3
- package/lib/utils/markdown2html.js +7 -1
- package/lib/utils/normalize-long-text-value.js +6 -1
- package/lib/utils/number-precision.js +32 -13
- package/lib/utils/utils.js +33 -8
- package/lib/utils/value-format-utils.js +110 -58
- package/package.json +5 -5
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('path');
|
|
4
|
+
|
|
5
|
+
var replace = require('replace-ext');
|
|
6
|
+
|
|
7
|
+
var buffer = require('is-buffer');
|
|
8
|
+
|
|
9
|
+
module.exports = VFile;
|
|
10
|
+
var own = {}.hasOwnProperty;
|
|
11
|
+
var proto = VFile.prototype;
|
|
12
|
+
proto.toString = toString;
|
|
13
|
+
/* Order of setting (least specific to most), we need this because
|
|
14
|
+
* otherwise `{stem: 'a', path: '~/b.js'}` would throw, as a path
|
|
15
|
+
* is needed before a stem can be set. */
|
|
16
|
+
|
|
17
|
+
var order = ['history', 'path', 'basename', 'stem', 'extname', 'dirname'];
|
|
18
|
+
/* Construct a new file. */
|
|
19
|
+
|
|
20
|
+
function VFile(options) {
|
|
21
|
+
var prop;
|
|
22
|
+
var index;
|
|
23
|
+
var length;
|
|
24
|
+
|
|
25
|
+
if (typeof options === 'number') {
|
|
26
|
+
options = options.toString();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (!options) {
|
|
30
|
+
options = {};
|
|
31
|
+
} else if (typeof options === 'string' || buffer(options)) {
|
|
32
|
+
options = {
|
|
33
|
+
contents: options
|
|
34
|
+
};
|
|
35
|
+
} else if ('message' in options && 'messages' in options) {
|
|
36
|
+
return options;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!(this instanceof VFile)) {
|
|
40
|
+
return new VFile(options);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
this.data = {};
|
|
44
|
+
this.messages = [];
|
|
45
|
+
this.history = [];
|
|
46
|
+
this.cwd = process.cwd();
|
|
47
|
+
/* Set path related properties in the correct order. */
|
|
48
|
+
|
|
49
|
+
index = -1;
|
|
50
|
+
length = order.length;
|
|
51
|
+
|
|
52
|
+
while (++index < length) {
|
|
53
|
+
prop = order[index];
|
|
54
|
+
|
|
55
|
+
if (own.call(options, prop)) {
|
|
56
|
+
this[prop] = options[prop];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/* Set non-path related properties. */
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
for (prop in options) {
|
|
63
|
+
if (order.indexOf(prop) === -1) {
|
|
64
|
+
this[prop] = options[prop];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/* Access full path (`~/index.min.js`). */
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
Object.defineProperty(proto, 'path', {
|
|
72
|
+
get: function get() {
|
|
73
|
+
return this.history[this.history.length - 1];
|
|
74
|
+
},
|
|
75
|
+
set: function set(path) {
|
|
76
|
+
assertNonEmpty(path, 'path');
|
|
77
|
+
|
|
78
|
+
if (path !== this.path) {
|
|
79
|
+
this.history.push(path);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
/* Access parent path (`~`). */
|
|
84
|
+
|
|
85
|
+
Object.defineProperty(proto, 'dirname', {
|
|
86
|
+
get: function get() {
|
|
87
|
+
return typeof this.path === 'string' ? path.dirname(this.path) : undefined;
|
|
88
|
+
},
|
|
89
|
+
set: function set(dirname) {
|
|
90
|
+
assertPath(this.path, 'dirname');
|
|
91
|
+
this.path = path.join(dirname || '', this.basename);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
/* Access basename (`index.min.js`). */
|
|
95
|
+
|
|
96
|
+
Object.defineProperty(proto, 'basename', {
|
|
97
|
+
get: function get() {
|
|
98
|
+
return typeof this.path === 'string' ? path.basename(this.path) : undefined;
|
|
99
|
+
},
|
|
100
|
+
set: function set(basename) {
|
|
101
|
+
assertNonEmpty(basename, 'basename');
|
|
102
|
+
assertPart(basename, 'basename');
|
|
103
|
+
this.path = path.join(this.dirname || '', basename);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
/* Access extname (`.js`). */
|
|
107
|
+
|
|
108
|
+
Object.defineProperty(proto, 'extname', {
|
|
109
|
+
get: function get() {
|
|
110
|
+
return typeof this.path === 'string' ? path.extname(this.path) : undefined;
|
|
111
|
+
},
|
|
112
|
+
set: function set(extname) {
|
|
113
|
+
var ext = extname || '';
|
|
114
|
+
assertPart(ext, 'extname');
|
|
115
|
+
assertPath(this.path, 'extname');
|
|
116
|
+
|
|
117
|
+
if (ext) {
|
|
118
|
+
if (ext.charAt(0) !== '.') {
|
|
119
|
+
throw new Error('`extname` must start with `.`');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (ext.indexOf('.', 1) !== -1) {
|
|
123
|
+
throw new Error('`extname` cannot contain multiple dots');
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
this.path = replace(this.path, ext);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
/* Access stem (`index.min`). */
|
|
131
|
+
|
|
132
|
+
Object.defineProperty(proto, 'stem', {
|
|
133
|
+
get: function get() {
|
|
134
|
+
return typeof this.path === 'string' ? path.basename(this.path, this.extname) : undefined;
|
|
135
|
+
},
|
|
136
|
+
set: function set(stem) {
|
|
137
|
+
assertNonEmpty(stem, 'stem');
|
|
138
|
+
assertPart(stem, 'stem');
|
|
139
|
+
this.path = path.join(this.dirname || '', stem + (this.extname || ''));
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
/* Get the value of the file. */
|
|
143
|
+
|
|
144
|
+
function toString(encoding) {
|
|
145
|
+
var value = this.contents || '';
|
|
146
|
+
return buffer(value) ? value.toString(encoding) : String(value);
|
|
147
|
+
}
|
|
148
|
+
/* Assert that `part` is not a path (i.e., does
|
|
149
|
+
* not contain `path.sep`). */
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
function assertPart(part, name) {
|
|
153
|
+
if (part.indexOf(path.sep) !== -1) {
|
|
154
|
+
throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`');
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/* Assert that `part` is not empty. */
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
function assertNonEmpty(part, name) {
|
|
161
|
+
if (!part) {
|
|
162
|
+
throw new Error('`' + name + '` cannot be empty');
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/* Assert `path` exists. */
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
function assertPath(path, name) {
|
|
169
|
+
if (!path) {
|
|
170
|
+
throw new Error('Setting `' + name + '` requires `path` to be set too');
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var VMessage = require('vfile-message');
|
|
4
|
+
|
|
5
|
+
var VFile = require('./core.js');
|
|
6
|
+
|
|
7
|
+
module.exports = VFile;
|
|
8
|
+
var proto = VFile.prototype;
|
|
9
|
+
proto.message = message;
|
|
10
|
+
proto.info = info;
|
|
11
|
+
proto.fail = fail;
|
|
12
|
+
/* Slight backwards compatibility. Remove in the future. */
|
|
13
|
+
|
|
14
|
+
proto.warn = message;
|
|
15
|
+
/* Create a message with `reason` at `position`.
|
|
16
|
+
* When an error is passed in as `reason`, copies the stack. */
|
|
17
|
+
|
|
18
|
+
function message(reason, position, origin) {
|
|
19
|
+
var filePath = this.path;
|
|
20
|
+
var message = new VMessage(reason, position, origin);
|
|
21
|
+
|
|
22
|
+
if (filePath) {
|
|
23
|
+
message.name = filePath + ':' + message.name;
|
|
24
|
+
message.file = filePath;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message.fatal = false;
|
|
28
|
+
this.messages.push(message);
|
|
29
|
+
return message;
|
|
30
|
+
}
|
|
31
|
+
/* Fail. Creates a vmessage, associates it with the file,
|
|
32
|
+
* and throws it. */
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
function fail() {
|
|
36
|
+
var message = this.message.apply(this, arguments);
|
|
37
|
+
message.fatal = true;
|
|
38
|
+
throw message;
|
|
39
|
+
}
|
|
40
|
+
/* Info. Creates a vmessage, associates it with the file,
|
|
41
|
+
* and marks the fatality as null. */
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
function info() {
|
|
45
|
+
var message = this.message.apply(this, arguments);
|
|
46
|
+
message.fatal = null;
|
|
47
|
+
return message;
|
|
48
|
+
}
|
|
@@ -1,36 +1,47 @@
|
|
|
1
|
-
|
|
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 cn from 'astro-classname';
|
|
7
|
-
import './index.css';
|
|
1
|
+
"use strict";
|
|
8
2
|
|
|
9
|
-
var
|
|
10
|
-
_inherits(AutoNumberFormatter, _React$Component);
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
11
4
|
|
|
12
|
-
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _astroClassname = _interopRequireDefault(require("astro-classname"));
|
|
15
|
+
|
|
16
|
+
require("./index.css");
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
var propTypes = {
|
|
19
|
+
value: _propTypes.default.string.isRequired,
|
|
20
|
+
containerClassName: _propTypes.default.string
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var AutoNumberFormatter = /*#__PURE__*/function (_React$Component) {
|
|
24
|
+
(0, _inheritsLoose2.default)(AutoNumberFormatter, _React$Component);
|
|
25
|
+
|
|
26
|
+
function AutoNumberFormatter() {
|
|
27
|
+
return _React$Component.apply(this, arguments) || this;
|
|
18
28
|
}
|
|
19
29
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}]);
|
|
30
|
+
var _proto = AutoNumberFormatter.prototype;
|
|
31
|
+
|
|
32
|
+
_proto.render = function render() {
|
|
33
|
+
var _this$props = this.props,
|
|
34
|
+
containerClassName = _this$props.containerClassName,
|
|
35
|
+
value = _this$props.value;
|
|
36
|
+
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container auto-number-formatter', containerClassName);
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
38
|
+
className: classname
|
|
39
|
+
}, value);
|
|
40
|
+
};
|
|
32
41
|
|
|
33
42
|
return AutoNumberFormatter;
|
|
34
|
-
}(
|
|
43
|
+
}(_react.default.Component);
|
|
35
44
|
|
|
36
|
-
|
|
45
|
+
AutoNumberFormatter.propTypes = propTypes;
|
|
46
|
+
var _default = AutoNumberFormatter;
|
|
47
|
+
exports.default = _default;
|
|
@@ -1,56 +1,68 @@
|
|
|
1
|
-
|
|
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 cn from 'astro-classname';
|
|
7
|
-
import './index.css';
|
|
1
|
+
"use strict";
|
|
8
2
|
|
|
9
|
-
var
|
|
10
|
-
_inherits(ButtonFormatter, _React$Component);
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
11
4
|
|
|
12
|
-
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _astroClassname = _interopRequireDefault(require("astro-classname"));
|
|
15
|
+
|
|
16
|
+
require("./index.css");
|
|
17
|
+
|
|
18
|
+
var propTypes = {
|
|
19
|
+
data: _propTypes.default.object,
|
|
20
|
+
containerClassName: _propTypes.default.string,
|
|
21
|
+
optionColors: _propTypes.default.array
|
|
22
|
+
};
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
var ButtonFormatter = /*#__PURE__*/function (_React$Component) {
|
|
25
|
+
(0, _inheritsLoose2.default)(ButtonFormatter, _React$Component);
|
|
26
|
+
|
|
27
|
+
function ButtonFormatter() {
|
|
28
|
+
return _React$Component.apply(this, arguments) || this;
|
|
18
29
|
}
|
|
19
30
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}]);
|
|
31
|
+
var _proto = ButtonFormatter.prototype;
|
|
32
|
+
|
|
33
|
+
_proto.render = function render() {
|
|
34
|
+
var _this$props = this.props,
|
|
35
|
+
data = _this$props.data,
|
|
36
|
+
containerClassName = _this$props.containerClassName,
|
|
37
|
+
optionColors = _this$props.optionColors;
|
|
38
|
+
|
|
39
|
+
var _ref = data || {},
|
|
40
|
+
button_color = _ref.button_color,
|
|
41
|
+
button_type = _ref.button_type,
|
|
42
|
+
button_name = _ref.button_name;
|
|
43
|
+
|
|
44
|
+
if (!button_type) return null;
|
|
45
|
+
var colorOption = Array.isArray(optionColors) ? optionColors.find(function (item) {
|
|
46
|
+
return item.COLOR === button_color;
|
|
47
|
+
}) || optionColors[0] : {
|
|
48
|
+
COLOR: '#FFFCB5',
|
|
49
|
+
BORDER_COLOR: '#E8E79D',
|
|
50
|
+
TEXT_COLOR: '#202428'
|
|
51
|
+
};
|
|
52
|
+
var btnStyle = {
|
|
53
|
+
backgroundColor: colorOption.COLOR,
|
|
54
|
+
borderColor: colorOption.BORDER_COLOR,
|
|
55
|
+
color: colorOption.TEXT_COLOR
|
|
56
|
+
};
|
|
57
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
+
className: (0, _astroClassname.default)('dtable-ui cell-formatter-container button-formatter', containerClassName),
|
|
59
|
+
style: btnStyle
|
|
60
|
+
}, button_name);
|
|
61
|
+
};
|
|
52
62
|
|
|
53
63
|
return ButtonFormatter;
|
|
54
|
-
}(
|
|
64
|
+
}(_react.default.Component);
|
|
55
65
|
|
|
56
|
-
|
|
66
|
+
ButtonFormatter.propTypes = propTypes;
|
|
67
|
+
var _default = ButtonFormatter;
|
|
68
|
+
exports.default = _default;
|
|
@@ -1,58 +1,72 @@
|
|
|
1
|
-
|
|
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 cn from 'astro-classname';
|
|
7
|
-
import moment from 'moment';
|
|
8
|
-
import './index.css';
|
|
1
|
+
"use strict";
|
|
9
2
|
|
|
10
|
-
var
|
|
11
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
9
|
+
|
|
10
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
|
|
18
|
+
var _astroClassname = _interopRequireDefault(require("astro-classname"));
|
|
19
|
+
|
|
20
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
21
|
+
|
|
22
|
+
require("./index.css");
|
|
12
23
|
|
|
13
|
-
|
|
24
|
+
var propTypes = {
|
|
25
|
+
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
26
|
+
containerClassName: _propTypes.default.string
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var CTimeFormatter = /*#__PURE__*/function (_React$Component) {
|
|
30
|
+
(0, _inheritsLoose2.default)(CTimeFormatter, _React$Component);
|
|
14
31
|
|
|
15
32
|
function CTimeFormatter() {
|
|
16
33
|
var _this;
|
|
17
34
|
|
|
18
|
-
_classCallCheck(this, CTimeFormatter);
|
|
19
|
-
|
|
20
35
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21
36
|
args[_key] = arguments[_key];
|
|
22
37
|
}
|
|
23
38
|
|
|
24
|
-
_this =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
|
|
39
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
40
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "formatDate", function (date) {
|
|
41
|
+
return (0, _moment.default)(date).format('YYYY-MM-DD HH:mm:ss');
|
|
42
|
+
});
|
|
30
43
|
return _this;
|
|
31
44
|
}
|
|
32
45
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
46
|
-
className: classname
|
|
47
|
-
}, date);
|
|
46
|
+
var _proto = CTimeFormatter.prototype;
|
|
47
|
+
|
|
48
|
+
_proto.render = function render() {
|
|
49
|
+
var _this$props = this.props,
|
|
50
|
+
date = _this$props.value,
|
|
51
|
+
containerClassName = _this$props.containerClassName;
|
|
52
|
+
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container ctime-formatter', containerClassName);
|
|
53
|
+
|
|
54
|
+
if (date !== '') {
|
|
55
|
+
date = this.formatDate(date);
|
|
48
56
|
}
|
|
49
|
-
|
|
57
|
+
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
59
|
+
className: classname
|
|
60
|
+
}, date);
|
|
61
|
+
};
|
|
50
62
|
|
|
51
63
|
return CTimeFormatter;
|
|
52
|
-
}(
|
|
64
|
+
}(_react.default.Component);
|
|
53
65
|
|
|
54
|
-
CTimeFormatter
|
|
66
|
+
(0, _defineProperty2.default)(CTimeFormatter, "defaultProps", {
|
|
55
67
|
value: '',
|
|
56
68
|
containerClassName: ''
|
|
57
|
-
};
|
|
58
|
-
|
|
69
|
+
});
|
|
70
|
+
CTimeFormatter.propTypes = propTypes;
|
|
71
|
+
var _default = CTimeFormatter;
|
|
72
|
+
exports.default = _default;
|
|
@@ -1,45 +1,58 @@
|
|
|
1
|
-
|
|
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 cn from 'astro-classname';
|
|
7
|
-
import './index.css';
|
|
1
|
+
"use strict";
|
|
8
2
|
|
|
9
|
-
var
|
|
10
|
-
_inherits(CheckboxFormatter, _React$PureComponent);
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
11
4
|
|
|
12
|
-
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var _astroClassname = _interopRequireDefault(require("astro-classname"));
|
|
17
|
+
|
|
18
|
+
require("./index.css");
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
var propTypes = {
|
|
21
|
+
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool]),
|
|
22
|
+
containerClassName: _propTypes.default.string
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var CheckboxFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
26
|
+
(0, _inheritsLoose2.default)(CheckboxFormatter, _React$PureComponent);
|
|
27
|
+
|
|
28
|
+
function CheckboxFormatter() {
|
|
29
|
+
return _React$PureComponent.apply(this, arguments) || this;
|
|
18
30
|
}
|
|
19
31
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}]);
|
|
32
|
+
var _proto = CheckboxFormatter.prototype;
|
|
33
|
+
|
|
34
|
+
_proto.render = function render() {
|
|
35
|
+
var _this$props = this.props,
|
|
36
|
+
value = _this$props.value,
|
|
37
|
+
containerClassName = _this$props.containerClassName;
|
|
38
|
+
value = value === true ? true : false;
|
|
39
|
+
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container checkbox-formatter', containerClassName);
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
41
|
+
className: classname
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
43
|
+
className: "checkbox",
|
|
44
|
+
type: "checkbox",
|
|
45
|
+
readOnly: true,
|
|
46
|
+
checked: value
|
|
47
|
+
}));
|
|
48
|
+
};
|
|
38
49
|
|
|
39
50
|
return CheckboxFormatter;
|
|
40
|
-
}(
|
|
51
|
+
}(_react.default.PureComponent);
|
|
41
52
|
|
|
42
|
-
CheckboxFormatter
|
|
53
|
+
(0, _defineProperty2.default)(CheckboxFormatter, "defaultProps", {
|
|
43
54
|
value: false
|
|
44
|
-
};
|
|
45
|
-
|
|
55
|
+
});
|
|
56
|
+
CheckboxFormatter.propTypes = propTypes;
|
|
57
|
+
var _default = CheckboxFormatter;
|
|
58
|
+
exports.default = _default;
|