dtable-ui-component 0.1.74 → 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/{components/cell-formatter/auto-number-formatter.js → AutoNumberFormatter/index.js} +1 -0
- package/es/ButtonFormatter/index.css +13 -0
- package/es/{components/cell-formatter/button-formatter.js → ButtonFormatter/index.js} +1 -0
- package/es/CTimeFormatter/index.css +1 -0
- package/es/{components/cell-formatter/ctime-formatter.js → CTimeFormatter/index.js} +1 -0
- package/es/CheckboxFormatter/index.css +1 -0
- package/es/{components/cell-formatter/checkbox-formatter.js → CheckboxFormatter/index.js} +1 -0
- package/es/CollaboratorFormatter/index.css +1 -0
- package/es/{components/cell-formatter/collaborator-formatter.js → CollaboratorFormatter/index.js} +3 -2
- package/es/CollaboratorItem/index.css +49 -0
- package/es/CollaboratorItem/index.js +64 -0
- package/es/CreatorFormatter/index.css +1 -0
- package/es/{components/cell-formatter/creator-formatter.js → CreatorFormatter/index.js} +3 -2
- package/es/DateFormatter/index.css +1 -0
- package/es/{components/cell-formatter/date-formatter.js → DateFormatter/index.js} +2 -1
- package/es/DurationFormatter/index.css +1 -0
- package/es/{components/cell-formatter/duration-formatter.js → DurationFormatter/index.js} +2 -1
- package/es/EmailFormatter/index.css +5 -0
- package/es/{components/cell-formatter/email-formatter.js → EmailFormatter/index.js} +1 -0
- package/es/FileFormatter/index.css +29 -0
- package/es/{components/cell-formatter/file-formatter.js → FileFormatter/index.js} +2 -1
- package/es/{components/cell-formatter/widgets/file-item-formatter.js → FileItemFormatter/index.js} +2 -2
- package/es/{components/file-uploader → FileUploader}/index.js +0 -0
- package/es/FormulaFormatter/index.css +19 -0
- package/es/{components/cell-formatter/formula-formatter.js → FormulaFormatter/index.js} +8 -8
- package/es/GeolocationFormatter/index.css +1 -0
- package/es/{components/cell-formatter/geolocation-formatter.js → GeolocationFormatter/index.js} +2 -1
- package/es/{components/common → ImageFormatter}/images-lazy-load.js +2 -2
- package/es/ImageFormatter/index.css +34 -0
- package/es/{components/cell-formatter/image-formatter.js → ImageFormatter/index.js} +4 -3
- package/es/{css/image-previewer-ligntbox.css → ImagePreviewerLightbox/index.css} +0 -0
- package/es/{components/cell-formatter/widgets/image-previewer-lightbox.js → ImagePreviewerLightbox/index.js} +3 -3
- package/es/LastModifierFormatter/index.css +1 -0
- package/es/{components/cell-formatter/last-modifier-formatter.js → LastModifierFormatter/index.js} +5 -4
- package/es/LinkFormatter/index.css +27 -0
- package/es/{components/cell-formatter/link-formatter.js → LinkFormatter/index.js} +2 -2
- package/es/{css/loading.css → Loading/index.css} +0 -0
- package/es/{components/loading.js → Loading/index.js} +1 -1
- package/es/{components/cell-formatter/widgets/long-text-formatter → LongTextFormatter}/html-long-text-formatter.js +1 -1
- package/es/LongTextFormatter/index.css +63 -0
- package/es/{components/cell-formatter/long-text-formatter.js → LongTextFormatter/index.js} +3 -2
- package/es/{components/cell-formatter/widgets/long-text-formatter → LongTextFormatter}/simple-long-text-formatter.js +1 -1
- package/es/MTimeFormatter/index.css +1 -0
- package/es/{components/cell-formatter/mtime-formatter.js → MTimeFormatter/index.js} +1 -0
- package/es/{components/common/modal-portal.js → ModalPortal/index.js} +0 -0
- package/es/MultipleSelectFormatter/index.css +1 -0
- package/es/{components/cell-formatter/multiple-select-formatter.js → MultipleSelectFormatter/index.js} +2 -1
- package/es/NumberFormatter/index.css +1 -0
- package/es/{components/cell-formatter/number-formatter.js → NumberFormatter/index.js} +2 -1
- package/es/RateFormatter/index.css +1 -0
- package/es/{components/cell-formatter/rate-formatter.js → RateFormatter/index.js} +1 -0
- package/es/{components/common/select-item.js → SelectItem/index.js} +0 -0
- package/es/SingleSelectFormatter/index.css +1 -0
- package/es/{components/cell-formatter/single-select-formatter.js → SingleSelectFormatter/index.js} +2 -1
- package/es/TextFormatter/index.css +1 -0
- package/es/{components/cell-formatter/text-formatter.js → TextFormatter/index.js} +1 -0
- package/es/UrlFormatter/index.css +5 -0
- package/es/{components/cell-formatter/url-formatter.js → UrlFormatter/index.js} +1 -0
- package/es/app.js +1 -1
- package/es/{components/cell-factory/cell-formatter-factory.js → cellFormatterFactory/index.js} +3 -3
- 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/constants/index.js +15 -14
- package/es/css/cell-formatter.css +0 -243
- package/es/formatterConfig/index.js +31 -0
- package/es/index.js +29 -3
- package/es/{components/toast → toaster}/alert.js +0 -0
- package/es/{components/toast → toaster}/index.js +0 -0
- package/es/{components/toast → toaster}/toast.js +0 -0
- package/es/{components/toast → toaster}/toastManager.js +0 -0
- package/es/{components/toast → toaster}/toaster.js +0 -0
- package/es/utils/cell-value-validator.js +1 -2
- package/es/utils/editor-utils.js +71 -0
- package/es/utils/normalize-long-text-value.js +2 -2
- package/es/utils/number-precision.js +1 -0
- package/es/utils/value-format-utils.js +2 -0
- package/lib/AutoNumberFormatter/index.css +1 -0
- package/lib/AutoNumberFormatter/index.js +47 -0
- package/lib/ButtonFormatter/index.css +13 -0
- package/lib/ButtonFormatter/index.js +68 -0
- package/lib/CTimeFormatter/index.css +1 -0
- package/lib/CTimeFormatter/index.js +72 -0
- package/lib/CheckboxFormatter/index.css +1 -0
- package/lib/CheckboxFormatter/index.js +58 -0
- package/lib/CollaboratorFormatter/index.css +1 -0
- package/lib/CollaboratorFormatter/index.js +113 -0
- package/lib/CollaboratorItem/index.css +49 -0
- package/lib/CollaboratorItem/index.js +81 -0
- package/lib/CreatorFormatter/index.css +1 -0
- package/lib/CreatorFormatter/index.js +107 -0
- package/lib/DateFormatter/index.css +1 -0
- package/lib/DateFormatter/index.js +75 -0
- package/lib/DurationFormatter/index.css +1 -0
- package/lib/DurationFormatter/index.js +51 -0
- package/lib/EmailFormatter/index.css +5 -0
- package/lib/EmailFormatter/index.js +47 -0
- package/lib/FileFormatter/index.css +29 -0
- package/lib/FileFormatter/index.js +79 -0
- package/lib/FileItemFormatter/index.js +63 -0
- package/lib/FileUploader/index.js +63 -0
- package/lib/FormulaFormatter/index.css +19 -0
- package/lib/FormulaFormatter/index.js +185 -0
- package/lib/GeolocationFormatter/index.css +1 -0
- package/lib/GeolocationFormatter/index.js +68 -0
- package/lib/ImageFormatter/images-lazy-load.js +158 -0
- package/lib/ImageFormatter/index.css +34 -0
- package/lib/ImageFormatter/index.js +173 -0
- package/lib/ImagePreviewerLightbox/index.css +87 -0
- package/lib/ImagePreviewerLightbox/index.js +152 -0
- package/lib/LastModifierFormatter/index.css +1 -0
- package/lib/LastModifierFormatter/index.js +107 -0
- package/lib/LinkFormatter/index.css +27 -0
- package/lib/LinkFormatter/index.js +165 -0
- package/lib/Loading/index.css +54 -0
- package/lib/Loading/index.js +16 -0
- package/lib/LongTextFormatter/html-long-text-formatter.js +107 -0
- package/lib/LongTextFormatter/index.css +63 -0
- package/lib/LongTextFormatter/index.js +48 -0
- package/lib/LongTextFormatter/simple-long-text-formatter.js +110 -0
- package/lib/MTimeFormatter/index.css +1 -0
- package/lib/MTimeFormatter/index.js +72 -0
- package/lib/ModalPortal/index.js +51 -0
- package/lib/MultipleSelectFormatter/index.css +1 -0
- package/lib/MultipleSelectFormatter/index.js +86 -0
- package/lib/NumberFormatter/index.css +1 -0
- package/lib/NumberFormatter/index.js +62 -0
- package/lib/RateFormatter/index.css +1 -0
- package/lib/RateFormatter/index.js +95 -0
- package/lib/SelectItem/index.js +73 -0
- package/lib/SingleSelectFormatter/index.css +1 -0
- package/lib/SingleSelectFormatter/index.js +86 -0
- package/lib/TextFormatter/index.css +1 -0
- package/lib/TextFormatter/index.js +69 -0
- package/lib/UrlFormatter/index.css +5 -0
- package/lib/UrlFormatter/index.js +47 -0
- package/lib/app.css +20 -0
- package/lib/app.js +96 -0
- package/lib/assets/images/avatar/default_avatar.png +0 -0
- package/lib/assets/images/file/192/excel.png +0 -0
- package/lib/assets/images/file/192/file.png +0 -0
- package/lib/assets/images/file/192/music.png +0 -0
- package/lib/assets/images/file/192/pdf.png +0 -0
- package/lib/assets/images/file/192/pic.png +0 -0
- package/lib/assets/images/file/192/ppt.png +0 -0
- package/lib/assets/images/file/192/txt.png +0 -0
- package/lib/assets/images/file/192/video.png +0 -0
- package/lib/assets/images/file/192/word.png +0 -0
- package/lib/assets/images/file/24/excel.png +0 -0
- package/lib/assets/images/file/24/file.png +0 -0
- package/lib/assets/images/file/24/music.png +0 -0
- package/lib/assets/images/file/24/pdf.png +0 -0
- package/lib/assets/images/file/24/pic.png +0 -0
- package/lib/assets/images/file/24/ppt.png +0 -0
- package/lib/assets/images/file/24/txt.png +0 -0
- package/lib/assets/images/file/24/video.png +0 -0
- package/lib/assets/images/file/24/word.png +0 -0
- package/lib/assets/images/folder/folder-192.png +0 -0
- package/lib/assets/images/folder/folder-24.png +0 -0
- package/lib/cellFormatterFactory/index.js +28 -0
- package/lib/components/cell-editor/checkbox-editor.js +111 -0
- package/lib/components/cell-editor/collaborator-editor.js +249 -0
- package/lib/components/cell-editor/date-editor.js +171 -0
- package/lib/components/cell-editor/index.js +40 -0
- package/lib/components/cell-editor/link-editor.js +321 -0
- package/lib/components/cell-editor/multiple-select-editor.js +250 -0
- package/lib/components/cell-editor/number-editor.js +162 -0
- package/lib/components/cell-editor/single-select-editor.js +216 -0
- package/lib/components/cell-editor/text-editor.js +129 -0
- package/lib/components/cell-editor-dialog/pc-file-editor-dialog.js +66 -0
- 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 +183 -0
- package/lib/components/cell-editor-popover/mb-date-editor-popover.js +262 -0
- package/lib/components/cell-editor-popover/mb-link-editor-popover.js +176 -0
- package/lib/components/cell-editor-popover/mb-select-editor-popover.js +243 -0
- package/lib/components/cell-editor-popover/pc-collaborator-editor-popover.js +124 -0
- package/lib/components/cell-editor-popover/pc-date-editor-popover.js +156 -0
- package/lib/components/cell-editor-popover/pc-link-editor-popover.js +128 -0
- package/lib/components/cell-editor-popover/pc-select-editor-popover.js +157 -0
- package/lib/components/common/collaborator-item.js +79 -0
- package/lib/components/common/edit-editor-button.js +67 -0
- package/lib/components/common/link-editor-option.js +121 -0
- package/lib/components/common/mobile/mb-editor-header.js +61 -0
- package/lib/components/common/select-editor-option.js +122 -0
- package/lib/constants/cell-types.js +54 -0
- package/lib/constants/index.js +72 -0
- package/lib/css/cell-editor.css +614 -0
- package/lib/css/cell-formatter.css +4 -0
- package/lib/css/custom-rc-calendar.css +118 -0
- package/lib/formatterConfig/index.js +62 -0
- package/lib/index.js +139 -0
- package/lib/lang/index.js +66 -0
- package/lib/locals/de.js +7 -0
- package/lib/locals/en.js +22 -0
- package/lib/locals/fr.js +7 -0
- package/lib/locals/zh-CN.js +22 -0
- 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 +35 -0
- package/lib/utils/column-utils.js +15 -0
- package/lib/utils/editor-utils.js +81 -0
- package/lib/utils/markdown2html.js +68 -0
- package/lib/utils/normalize-long-text-value.js +74 -0
- package/lib/utils/number-precision.js +182 -0
- package/lib/utils/unified/index.js +470 -0
- package/lib/utils/utils.js +141 -0
- package/lib/utils/value-format-utils.js +547 -0
- package/lib/utils/vfile/core.js +172 -0
- package/lib/utils/vfile/index.js +48 -0
- package/package.json +5 -3
- package/es/components/cell-formatter/formatter-config.js +0 -31
- package/es/components/cell-formatter/index.js +0 -27
|
@@ -2,246 +2,3 @@
|
|
|
2
2
|
overflow: hidden;
|
|
3
3
|
line-height: 1;
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
/* collaborator */
|
|
7
|
-
.dtable-ui.collaborator-item {
|
|
8
|
-
display: inline-flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
margin-right: 10px;
|
|
11
|
-
padding: 0 8px 0 2px;
|
|
12
|
-
height: 20px;
|
|
13
|
-
font-size: 13px;
|
|
14
|
-
border-radius: 10px;
|
|
15
|
-
background: #eaeaea;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.dtable-ui.collaborator-item .collaborator-avatar,
|
|
19
|
-
.dtable-ui.collaborator-item .collaborator-name,
|
|
20
|
-
.dtable-ui.collaborator-item .collaborator-remove {
|
|
21
|
-
height: 20px;
|
|
22
|
-
line-height: 20px;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.dtable-ui.collaborator-item .collaborator-avatar {
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
margin: 0 4px 0 2px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.dtable-ui.collaborator-item .collaborator-avatar img {
|
|
33
|
-
width: 16px;
|
|
34
|
-
height: 16px;
|
|
35
|
-
border-radius: 50%;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.dtable-ui.collaborator-item .collaborator-remove {
|
|
39
|
-
display: inline-block;
|
|
40
|
-
width: 14px;
|
|
41
|
-
margin: 0 -2px 0 2px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.dtable-ui.collaborator-item .collaborator-remove .dtable-font {
|
|
45
|
-
display: inline-block;
|
|
46
|
-
font-size: 12px;
|
|
47
|
-
color: #909090;
|
|
48
|
-
transform: scale(.8);
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.dtable-ui.collaborator-item .collaborator-remove .dtable-font:hover {
|
|
53
|
-
color: #666666;
|
|
54
|
-
cursor: pointer;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/* long-text */
|
|
58
|
-
.dtable-ui.long-text-formatter {
|
|
59
|
-
display: flex;
|
|
60
|
-
align-items: center;
|
|
61
|
-
height: 28px;
|
|
62
|
-
overflow: hidden;
|
|
63
|
-
text-overflow: ellipsis;
|
|
64
|
-
white-space: nowrap;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.dtable-ui.long-text-formatter.article {
|
|
68
|
-
display: block;
|
|
69
|
-
height: auto;
|
|
70
|
-
overflow: auto;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.dtable-ui.long-text-formatter .long-text-links,
|
|
74
|
-
.dtable-ui.long-text-formatter .long-text-check-list {
|
|
75
|
-
display: inline-block;
|
|
76
|
-
height: 20px;
|
|
77
|
-
padding: 2px;
|
|
78
|
-
margin: 4px;
|
|
79
|
-
color: #9c9c9c;
|
|
80
|
-
background-color: #f0f0f0;
|
|
81
|
-
border-radius: 3px;
|
|
82
|
-
line-height: 16px;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.dtable-ui.long-text-formatter .long-text-check-list .dtable-font,
|
|
86
|
-
.dtable-ui.long-text-formatter .long-text-links .dtable-font {
|
|
87
|
-
margin-right: 4px;
|
|
88
|
-
font-size: 12px;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.dtable-ui.long-text-formatter .long-text-check-list .long-text-check-list-completed {
|
|
92
|
-
color: #61BD4F;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.dtable-ui.long-text-formatter .long-text-images {
|
|
96
|
-
margin-right: -10px;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.dtable-ui.long-text-formatter .long-text-images img {
|
|
100
|
-
max-width: 28px;
|
|
101
|
-
max-height: 28px;
|
|
102
|
-
border: 1px solid #f0f0f0;
|
|
103
|
-
box-sizing: border-box;
|
|
104
|
-
border-radius: 3px;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.dtable-ui.long-text-formatter .long-text-images .image-number {
|
|
108
|
-
display: inline-block;
|
|
109
|
-
min-width: 14px;
|
|
110
|
-
padding: 0 3px;
|
|
111
|
-
line-height: 14px;
|
|
112
|
-
font-style: normal;
|
|
113
|
-
font-size: 12px;
|
|
114
|
-
border-radius: 6px;
|
|
115
|
-
background-color: #999;
|
|
116
|
-
color: #fff;
|
|
117
|
-
transform: translate(-50%, 9px) scale(0.8);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.dtable-ui.file-formatter {
|
|
121
|
-
display: flex;
|
|
122
|
-
align-items: center;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.dtable-ui.file-formatter .file-item-icon {
|
|
126
|
-
display: inline-block;
|
|
127
|
-
height: 28px;
|
|
128
|
-
width: 28px;
|
|
129
|
-
border: 1px solid #f0f0f0;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.dtable-ui.file-formatter .file-item-count {
|
|
133
|
-
display: inline-block;
|
|
134
|
-
padding: 0 3px;
|
|
135
|
-
min-width: 14px;
|
|
136
|
-
line-height: 14px;
|
|
137
|
-
font-size: 12px;
|
|
138
|
-
border-radius: 6px;
|
|
139
|
-
text-align: center;
|
|
140
|
-
text-overflow: ellipsis;
|
|
141
|
-
white-space: nowrap;
|
|
142
|
-
color: #fff;
|
|
143
|
-
background-color: #999;
|
|
144
|
-
-webkit-transform: translate(-50%, 8px) scale(.8);
|
|
145
|
-
transform: translate(-50%, 8px) scale(.8);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
.dtable-ui.image-formatter {
|
|
150
|
-
display: flex;
|
|
151
|
-
align-items: center;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.dtable-ui.image-formatter .image-item {
|
|
155
|
-
display: inline-block;
|
|
156
|
-
height: 28px;
|
|
157
|
-
width: 28px;
|
|
158
|
-
margin-right: 4px;
|
|
159
|
-
border: 1px solid #f0f0f0;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.dtable-ui.image-formatter .image-item:hover {
|
|
163
|
-
border: 1px solid #c9c9c9;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.dtable-ui.image-formatter .image-item-count {
|
|
167
|
-
display: inline-block;
|
|
168
|
-
padding: 0 3px;
|
|
169
|
-
min-width: 14px;
|
|
170
|
-
line-height: 14px;
|
|
171
|
-
font-size: 12px;
|
|
172
|
-
border-radius: 6px;
|
|
173
|
-
text-align: center;
|
|
174
|
-
text-overflow: ellipsis;
|
|
175
|
-
white-space: nowrap;
|
|
176
|
-
color: #fff;
|
|
177
|
-
background-color: #999;
|
|
178
|
-
-webkit-transform: translate(-50%, 8px) scale(.8);
|
|
179
|
-
transform: translate(-50%, 8px) scale(.8);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.dtable-ui.link-formmatter {
|
|
183
|
-
display: inline-flex;
|
|
184
|
-
align-items: center;
|
|
185
|
-
overflow: hidden;
|
|
186
|
-
flex-wrap: nowrap;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.dtable-ui.link-formatter .link-item {
|
|
190
|
-
display: inline-flex;
|
|
191
|
-
height: 20px;
|
|
192
|
-
max-width: 230px;
|
|
193
|
-
padding: 0 8px 0 2px;
|
|
194
|
-
align-items: center;
|
|
195
|
-
font-size: 13px;
|
|
196
|
-
margin-right: 10px;
|
|
197
|
-
border-radius: 3px;
|
|
198
|
-
background: #eceff4;
|
|
199
|
-
cursor: pointer;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.dtable-ui.link-formatter .link-item .link-name {
|
|
203
|
-
overflow: hidden;
|
|
204
|
-
white-space: nowrap;
|
|
205
|
-
text-overflow: ellipsis;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/*
|
|
209
|
-
* url formatter
|
|
210
|
-
* email formatter
|
|
211
|
-
*/
|
|
212
|
-
|
|
213
|
-
.dtable-ui.url-formatter,
|
|
214
|
-
.dtable-ui.email-formatter {
|
|
215
|
-
text-decoration: underline;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.dtable-ui.formula-formatter.multiple .formula-formatter-content-item {
|
|
219
|
-
display: inline-flex;
|
|
220
|
-
margin-right: 10px;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
.dtable-ui.formula-formatter.multiple .formula-formatter-content-item.simple-cell-formatter {
|
|
225
|
-
height: 20px;
|
|
226
|
-
padding: 0 8px;
|
|
227
|
-
align-items: center;
|
|
228
|
-
background: #eceff4;
|
|
229
|
-
border-radius: 3px;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
.dtable-ui.formula-formatter.multiple .formula-formatter-content-item .collaborator {
|
|
233
|
-
margin-right: 0;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/* button */
|
|
237
|
-
.dtable-ui.button-formatter {
|
|
238
|
-
height: 26px;
|
|
239
|
-
width: 80px;
|
|
240
|
-
padding: 5px 8px;
|
|
241
|
-
border-width: 1px;
|
|
242
|
-
border-style: solid;
|
|
243
|
-
border-radius: 3px;
|
|
244
|
-
overflow: hidden;
|
|
245
|
-
white-space: nowrap;
|
|
246
|
-
text-overflow: ellipsis;
|
|
247
|
-
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
|
|
3
|
+
var _FormatterConfig;
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { CellType } from '../constants';
|
|
7
|
+
import CheckboxFormatter from '../CheckboxFormatter';
|
|
8
|
+
import ImageFormatter from '../ImageFormatter';
|
|
9
|
+
import LongTextFormatter from '../LongTextFormatter';
|
|
10
|
+
import TextCellFormatter from '../TextFormatter';
|
|
11
|
+
import SingleSelectFormatter from '../SingleSelectFormatter';
|
|
12
|
+
import MultipleSelectFormatter from '../MultipleSelectFormatter';
|
|
13
|
+
import FileFormatter from '../FileFormatter';
|
|
14
|
+
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
|
+
import FormulaFormatter from '../FormulaFormatter';
|
|
24
|
+
import AutoNumberFormatter from '../AutoNumberFormatter';
|
|
25
|
+
import UrlFormatter from '../UrlFormatter';
|
|
26
|
+
import EmailFormatter from '../EmailFormatter';
|
|
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(LongTextFormatter, 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
|
+
export default FormatterConfig;
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
|
-
export { default as toaster } from './
|
|
1
|
+
export { default as toaster } from './toaster';
|
|
2
2
|
export { setLocale } from './lang';
|
|
3
3
|
export { getDateDisplayString, getNumberDisplayString, formatStringToNumber, formatNumberString } from './utils/value-format-utils';
|
|
4
|
-
export { default as
|
|
5
|
-
export {
|
|
4
|
+
export { default as CheckboxFormatter } from './CheckboxFormatter';
|
|
5
|
+
export { default as ImageFormatter } from './ImageFormatter';
|
|
6
|
+
export { default as LongTextFormatter } from './LongTextFormatter';
|
|
7
|
+
export { default as TextFormatter } from './TextFormatter';
|
|
8
|
+
export { default as SingleSelectFormatter } from './SingleSelectFormatter';
|
|
9
|
+
export { default as MultipleSelectFormatter } from './MultipleSelectFormatter';
|
|
10
|
+
export { default as FileFormatter } from './FileFormatter';
|
|
11
|
+
export { default as LinkFormatter } from './LinkFormatter';
|
|
12
|
+
export { default as CollaboratorFormatter } from './CollaboratorFormatter';
|
|
13
|
+
export { default as NumberFormatter } from './NumberFormatter';
|
|
14
|
+
export { default as DateFormatter } from './DateFormatter';
|
|
15
|
+
export { default as CreatorFormatter } from './CreatorFormatter';
|
|
16
|
+
export { default as CTimeFormatter } from './CTimeFormatter';
|
|
17
|
+
export { default as LastModifierFormatter } from './LastModifierFormatter';
|
|
18
|
+
export { default as MTimeFormatter } from './MTimeFormatter';
|
|
19
|
+
export { default as GeolocationFormatter } from './GeolocationFormatter';
|
|
20
|
+
export { default as FormulaFormatter } from './FormulaFormatter';
|
|
21
|
+
export { default as AutoNumberFormatter } from './AutoNumberFormatter';
|
|
22
|
+
export { default as UrlFormatter } from './UrlFormatter';
|
|
23
|
+
export { default as EmailFormatter } from './EmailFormatter';
|
|
24
|
+
export { default as DurationFormatter } from './DurationFormatter';
|
|
25
|
+
export { default as RateFormatter } from './RateFormatter';
|
|
26
|
+
export { default as ButtonFormatter } from './ButtonFormatter';
|
|
27
|
+
export { default as ImagePreviewerLightbox } from './ImagePreviewerLightbox';
|
|
28
|
+
export { default as CollaboratorItem } from './CollaboratorItem';
|
|
29
|
+
export { default as FileItemFormatter } from './FileItemFormatter';
|
|
30
|
+
export { default as Loading } from './Loading';
|
|
31
|
+
export { TextEditor, NumberEditor, CheckboxEditor, SingleSelectEditor, CollaboratorEditor, DateEditor, LinkEditor } from './components/cell-editor';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,8 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
2
2
|
|
|
3
3
|
var _validators;
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { FORMULA_RESULT_TYPE } from '../constants';
|
|
5
|
+
import { FORMULA_RESULT_TYPE, CellType } from '../constants';
|
|
7
6
|
|
|
8
7
|
var numberValidator = function numberValidator(value) {
|
|
9
8
|
return (value || value === 0) && Object.prototype.toString.call(value) === '[object Number]';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var zhCN = require('@seafile/seafile-calendar/lib/locale/zh_CN');
|
|
2
|
+
|
|
3
|
+
var zhTW = require('@seafile/seafile-calendar/lib/locale/zh_TW');
|
|
4
|
+
|
|
5
|
+
var enUS = require('@seafile/seafile-calendar/lib/locale/en_US');
|
|
6
|
+
|
|
7
|
+
var frFR = require('@seafile/seafile-calendar/lib/locale/fr_FR');
|
|
8
|
+
|
|
9
|
+
var deDE = require('@seafile/seafile-calendar/lib/locale/de_DE');
|
|
10
|
+
|
|
11
|
+
var esES = require('@seafile/seafile-calendar/lib/locale/es_ES');
|
|
12
|
+
|
|
13
|
+
var plPL = require('@seafile/seafile-calendar/lib/locale/pl_PL');
|
|
14
|
+
|
|
15
|
+
var csCZ = require('@seafile/seafile-calendar/lib/locale/cs_CZ');
|
|
16
|
+
|
|
17
|
+
export var initDateEditorLanguage = function initDateEditorLanguage(lang) {
|
|
18
|
+
var language;
|
|
19
|
+
|
|
20
|
+
switch (lang) {
|
|
21
|
+
case 'zh-cn':
|
|
22
|
+
language = zhCN;
|
|
23
|
+
break;
|
|
24
|
+
|
|
25
|
+
case 'zh-tw':
|
|
26
|
+
language = zhTW;
|
|
27
|
+
break;
|
|
28
|
+
|
|
29
|
+
case 'en':
|
|
30
|
+
language = enUS;
|
|
31
|
+
break;
|
|
32
|
+
|
|
33
|
+
case 'fr':
|
|
34
|
+
language = frFR;
|
|
35
|
+
break;
|
|
36
|
+
|
|
37
|
+
case 'de':
|
|
38
|
+
language = deDE;
|
|
39
|
+
break;
|
|
40
|
+
|
|
41
|
+
case 'es':
|
|
42
|
+
language = esES;
|
|
43
|
+
break;
|
|
44
|
+
|
|
45
|
+
case 'es-ar':
|
|
46
|
+
language = esES;
|
|
47
|
+
break;
|
|
48
|
+
|
|
49
|
+
case 'es-mx':
|
|
50
|
+
language = esES;
|
|
51
|
+
break;
|
|
52
|
+
|
|
53
|
+
case 'pl':
|
|
54
|
+
language = plPL;
|
|
55
|
+
break;
|
|
56
|
+
|
|
57
|
+
case 'cs':
|
|
58
|
+
language = csCZ;
|
|
59
|
+
break;
|
|
60
|
+
|
|
61
|
+
default:
|
|
62
|
+
language = zhCN;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return language;
|
|
66
|
+
};
|
|
67
|
+
export var getSelectOptionItem = function getSelectOptionItem(options, optionId) {
|
|
68
|
+
return options.find(function (option) {
|
|
69
|
+
return option.id === optionId;
|
|
70
|
+
});
|
|
71
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var hrefReg = /\[.+\]\(\S+\)|<img src=(\S+).+\/>|!\[\]\(\S+\)|<\S+>/g;
|
|
2
|
-
var imageReg1 = /^<img src="(\S+)"
|
|
2
|
+
var imageReg1 = /^<img( width=[\\|/|"](\d)+[\\|/|"])? src="(\S+)" .?\/>/;
|
|
3
3
|
var imageReg2 = /^!\[\]\((\S+)\)/;
|
|
4
4
|
var linkReg1 = /^\[.+\]\(\S+\)/;
|
|
5
5
|
var linkReg2 = /^<\S+>$/;
|
|
@@ -39,7 +39,7 @@ var getPreviewContent = function getPreviewContent(markdownContent) {
|
|
|
39
39
|
preview += newMarkdownContent[index];
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
if (preview.length ===
|
|
42
|
+
if (preview.length === 150) {
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -48,6 +48,7 @@ function float2Fixed(num) {
|
|
|
48
48
|
function checkBoundary(num) {
|
|
49
49
|
if (_boundaryCheckingState) {
|
|
50
50
|
if (num > Number.MAX_SAFE_INTEGER || num < Number.MIN_SAFE_INTEGER) {
|
|
51
|
+
// eslint-disable-next-line no-console
|
|
51
52
|
console.warn("".concat(num, " is beyond boundary when transfer to integer, the results may not be accurate"));
|
|
52
53
|
}
|
|
53
54
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-case-declarations */
|
|
1
2
|
import moment from 'moment';
|
|
2
3
|
import NP from './number-precision';
|
|
3
4
|
import { NUMBER_TYPES, DEFAULT_NUMBER_FORMAT, DURATION_FORMATS_MAP, DURATION_FORMATS, DURATION_ZERO_DISPLAY, DURATION_DECIMAL_DIGITS, FORMULA_RESULT_TYPE, COLLABORATOR_COLUMN_TYPES, ARRAY_FORMAL_COLUMNS_TYPES, DEFAULT_DATE_FORMAT } from '../constants';
|
|
@@ -167,6 +168,7 @@ export var getDateDisplayString = function getDateDisplayString(value, format) {
|
|
|
167
168
|
switch (format) {
|
|
168
169
|
case 'D/M/YYYY':
|
|
169
170
|
case 'DD/MM/YYYY':
|
|
171
|
+
// no-case-declarations
|
|
170
172
|
var formatValue = date.format('YYYY-MM-DD');
|
|
171
173
|
var formatValueList = formatValue.split('-');
|
|
172
174
|
return "".concat(formatValueList[2], "/").concat(formatValueList[1], "/").concat(formatValueList[0]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import url('../css/cell-formatter.css');
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
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
|
+
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;
|
|
28
|
+
}
|
|
29
|
+
|
|
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
|
+
};
|
|
41
|
+
|
|
42
|
+
return AutoNumberFormatter;
|
|
43
|
+
}(_react.default.Component);
|
|
44
|
+
|
|
45
|
+
AutoNumberFormatter.propTypes = propTypes;
|
|
46
|
+
var _default = AutoNumberFormatter;
|
|
47
|
+
exports.default = _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@import url('../css/cell-formatter.css');
|
|
2
|
+
|
|
3
|
+
.dtable-ui.button-formatter {
|
|
4
|
+
height: 26px;
|
|
5
|
+
width: 80px;
|
|
6
|
+
padding: 5px 8px;
|
|
7
|
+
border-width: 1px;
|
|
8
|
+
border-style: solid;
|
|
9
|
+
border-radius: 3px;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
white-space: nowrap;
|
|
12
|
+
text-overflow: ellipsis;
|
|
13
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
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
|
+
};
|
|
23
|
+
|
|
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;
|
|
29
|
+
}
|
|
30
|
+
|
|
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
|
+
};
|
|
62
|
+
|
|
63
|
+
return ButtonFormatter;
|
|
64
|
+
}(_react.default.Component);
|
|
65
|
+
|
|
66
|
+
ButtonFormatter.propTypes = propTypes;
|
|
67
|
+
var _default = ButtonFormatter;
|
|
68
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import url('../css/cell-formatter.css');
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
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");
|
|
23
|
+
|
|
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);
|
|
31
|
+
|
|
32
|
+
function CTimeFormatter() {
|
|
33
|
+
var _this;
|
|
34
|
+
|
|
35
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
36
|
+
args[_key] = arguments[_key];
|
|
37
|
+
}
|
|
38
|
+
|
|
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
|
+
});
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
|
|
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);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
59
|
+
className: classname
|
|
60
|
+
}, date);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return CTimeFormatter;
|
|
64
|
+
}(_react.default.Component);
|
|
65
|
+
|
|
66
|
+
(0, _defineProperty2.default)(CTimeFormatter, "defaultProps", {
|
|
67
|
+
value: '',
|
|
68
|
+
containerClassName: ''
|
|
69
|
+
});
|
|
70
|
+
CTimeFormatter.propTypes = propTypes;
|
|
71
|
+
var _default = CTimeFormatter;
|
|
72
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import url('../css/cell-formatter.css');
|