dtable-ui-component 0.1.75-beta1 → 0.1.75-beta5

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 (227) hide show
  1. package/lib/AutoNumberFormatter/index.css +1 -0
  2. package/{es/components/cell-formatter/auto-number-formatter.js → lib/AutoNumberFormatter/index.js} +1 -0
  3. package/lib/ButtonFormatter/index.css +13 -0
  4. package/{es/components/cell-formatter/button-formatter.js → lib/ButtonFormatter/index.js} +1 -0
  5. package/lib/CTimeFormatter/index.css +1 -0
  6. package/{es/components/cell-formatter/ctime-formatter.js → lib/CTimeFormatter/index.js} +1 -0
  7. package/lib/CheckboxFormatter/index.css +1 -0
  8. package/{es/components/cell-formatter/checkbox-formatter.js → lib/CheckboxFormatter/index.js} +1 -0
  9. package/lib/CollaboratorFormatter/index.css +1 -0
  10. package/{es/components/cell-formatter/collaborator-formatter.js → lib/CollaboratorFormatter/index.js} +3 -2
  11. package/lib/CollaboratorItem/index.css +49 -0
  12. package/{es/components/common/collaborator-item.js → lib/CollaboratorItem/index.js} +1 -0
  13. package/lib/CreatorFormatter/index.css +1 -0
  14. package/{es/components/cell-formatter/creator-formatter.js → lib/CreatorFormatter/index.js} +3 -2
  15. package/lib/DateFormatter/index.css +1 -0
  16. package/{es/components/cell-formatter/date-formatter.js → lib/DateFormatter/index.js} +2 -1
  17. package/lib/DurationFormatter/index.css +1 -0
  18. package/{es/components/cell-formatter/duration-formatter.js → lib/DurationFormatter/index.js} +2 -1
  19. package/lib/EmailFormatter/index.css +5 -0
  20. package/{es/components/cell-formatter/email-formatter.js → lib/EmailFormatter/index.js} +1 -0
  21. package/lib/FileFormatter/index.css +29 -0
  22. package/{es/components/cell-formatter/file-formatter.js → lib/FileFormatter/index.js} +2 -1
  23. package/{es/components/cell-formatter/widgets/file-item-formatter.js → lib/FileItemFormatter/index.js} +3 -2
  24. package/{es/components/file-uploader → lib/FileUploader}/index.js +0 -0
  25. package/lib/FormulaFormatter/index.css +19 -0
  26. package/{es/components/cell-formatter/formula-formatter.js → lib/FormulaFormatter/index.js} +8 -8
  27. package/lib/GeolocationFormatter/index.css +1 -0
  28. package/{es/components/cell-formatter/geolocation-formatter.js → lib/GeolocationFormatter/index.js} +2 -1
  29. package/{es/components/common → lib/ImageFormatter}/images-lazy-load.js +2 -2
  30. package/lib/ImageFormatter/index.css +34 -0
  31. package/{es/components/cell-formatter/image-formatter.js → lib/ImageFormatter/index.js} +4 -3
  32. package/{es/css/image-previewer-ligntbox.css → lib/ImagePreviewerLightbox/index.css} +0 -0
  33. package/{es/components/cell-formatter/widgets/image-previewer-lightbox.js → lib/ImagePreviewerLightbox/index.js} +3 -3
  34. package/lib/LastModifierFormatter/index.css +1 -0
  35. package/{es/components/cell-formatter/last-modifier-formatter.js → lib/LastModifierFormatter/index.js} +5 -4
  36. package/lib/LinkFormatter/index.css +27 -0
  37. package/{es/components/cell-formatter/link-formatter.js → lib/LinkFormatter/index.js} +2 -2
  38. package/{es/css/loading.css → lib/Loading/index.css} +0 -0
  39. package/{es/components/loading.js → lib/Loading/index.js} +1 -1
  40. package/{es/components/cell-formatter/widgets/long-text-formatter → lib/LongTextFormatter}/html-long-text-formatter.js +1 -1
  41. package/lib/LongTextFormatter/index.css +63 -0
  42. package/{es/components/cell-formatter/long-text-formatter.js → lib/LongTextFormatter/index.js} +3 -2
  43. package/{es/components/cell-formatter/widgets/long-text-formatter → lib/LongTextFormatter}/simple-long-text-formatter.js +1 -1
  44. package/lib/MTimeFormatter/index.css +1 -0
  45. package/{es/components/cell-formatter/mtime-formatter.js → lib/MTimeFormatter/index.js} +1 -0
  46. package/{es/components/common/modal-portal.js → lib/ModalPortal/index.js} +0 -0
  47. package/lib/MultipleSelectFormatter/index.css +1 -0
  48. package/{es/components/cell-formatter/multiple-select-formatter.js → lib/MultipleSelectFormatter/index.js} +2 -1
  49. package/lib/NumberFormatter/index.css +1 -0
  50. package/{es/components/cell-formatter/number-formatter.js → lib/NumberFormatter/index.js} +2 -1
  51. package/lib/RateFormatter/index.css +1 -0
  52. package/{es/components/cell-formatter/rate-formatter.js → lib/RateFormatter/index.js} +1 -0
  53. package/{es/components/common/select-item.js → lib/SelectItem/index.js} +0 -0
  54. package/lib/SingleSelectFormatter/index.css +1 -0
  55. package/{es/components/cell-formatter/single-select-formatter.js → lib/SingleSelectFormatter/index.js} +2 -1
  56. package/lib/TextFormatter/index.css +1 -0
  57. package/{es/components/cell-formatter/text-formatter.js → lib/TextFormatter/index.js} +1 -0
  58. package/lib/UrlFormatter/index.css +5 -0
  59. package/{es/components/cell-formatter/url-formatter.js → lib/UrlFormatter/index.js} +1 -0
  60. package/lib/app.js +75 -80
  61. package/{es/components/cell-factory/cell-formatter-factory.js → lib/cellFormatterFactory/index.js} +3 -3
  62. package/lib/components/cell-editor/checkbox-editor.js +59 -66
  63. package/lib/components/cell-editor/collaborator-editor.js +113 -126
  64. package/lib/components/cell-editor/date-editor.js +99 -119
  65. package/lib/components/cell-editor/index.js +9 -40
  66. package/lib/components/cell-editor/link-editor.js +122 -140
  67. package/lib/components/cell-editor/multiple-select-editor.js +114 -127
  68. package/lib/components/cell-editor/number-editor.js +78 -86
  69. package/lib/components/cell-editor/single-select-editor.js +106 -120
  70. package/lib/components/cell-editor/text-editor.js +65 -72
  71. package/lib/components/cell-editor-dialog/pc-file-editor-dialog.js +31 -51
  72. package/lib/components/cell-editor-dialog/pc-files-addition/index.js +0 -1
  73. package/lib/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -1
  74. package/lib/components/cell-editor-dialog/pc-files-preview/index.js +0 -1
  75. package/lib/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -1
  76. package/lib/components/cell-editor-popover/mb-collaborator-editor-popover.js +105 -111
  77. package/lib/components/cell-editor-popover/mb-date-editor-popover.js +140 -157
  78. package/lib/components/cell-editor-popover/mb-link-editor-popover.js +103 -109
  79. package/lib/components/cell-editor-popover/mb-select-editor-popover.js +142 -155
  80. package/lib/components/cell-editor-popover/pc-collaborator-editor-popover.js +74 -89
  81. package/lib/components/cell-editor-popover/pc-date-editor-popover.js +88 -102
  82. package/lib/components/cell-editor-popover/pc-link-editor-popover.js +77 -91
  83. package/lib/components/cell-editor-popover/pc-select-editor-popover.js +91 -105
  84. package/lib/components/common/collaborator-item.js +43 -59
  85. package/lib/components/common/edit-editor-button.js +28 -39
  86. package/lib/components/common/link-editor-option.js +63 -71
  87. package/lib/components/common/mobile/mb-editor-header.js +39 -52
  88. package/lib/components/common/select-editor-option.js +58 -74
  89. package/lib/constants/cell-types.js +25 -54
  90. package/lib/constants/index.js +5 -26
  91. package/lib/css/cell-formatter.css +0 -243
  92. package/lib/formatterConfig/index.js +31 -0
  93. package/lib/index.js +31 -64
  94. package/lib/lang/index.js +11 -27
  95. package/lib/locals/de.js +1 -6
  96. package/lib/locals/en.js +1 -6
  97. package/lib/locals/fr.js +1 -6
  98. package/lib/locals/zh-CN.js +1 -6
  99. package/{es/components/toast → lib/toaster}/alert.js +0 -0
  100. package/{es/components/toast → lib/toaster}/index.js +0 -0
  101. package/{es/components/toast → lib/toaster}/toast.js +0 -0
  102. package/{es/components/toast → lib/toaster}/toastManager.js +0 -0
  103. package/{es/components/toast → lib/toaster}/toaster.js +0 -0
  104. package/lib/utils/cell-value-validator.js +4 -14
  105. package/lib/utils/column-utils.js +5 -13
  106. package/lib/utils/editor-utils.js +3 -13
  107. package/lib/utils/markdown2html.js +1 -7
  108. package/lib/utils/normalize-long-text-value.js +1 -6
  109. package/lib/utils/number-precision.js +14 -31
  110. package/lib/utils/utils.js +8 -33
  111. package/lib/utils/value-format-utils.js +60 -108
  112. package/package.json +5 -5
  113. package/es/app.css +0 -20
  114. package/es/app.js +0 -91
  115. package/es/assets/images/avatar/default_avatar.png +0 -0
  116. package/es/assets/images/file/192/excel.png +0 -0
  117. package/es/assets/images/file/192/file.png +0 -0
  118. package/es/assets/images/file/192/music.png +0 -0
  119. package/es/assets/images/file/192/pdf.png +0 -0
  120. package/es/assets/images/file/192/pic.png +0 -0
  121. package/es/assets/images/file/192/ppt.png +0 -0
  122. package/es/assets/images/file/192/txt.png +0 -0
  123. package/es/assets/images/file/192/video.png +0 -0
  124. package/es/assets/images/file/192/word.png +0 -0
  125. package/es/assets/images/file/24/excel.png +0 -0
  126. package/es/assets/images/file/24/file.png +0 -0
  127. package/es/assets/images/file/24/music.png +0 -0
  128. package/es/assets/images/file/24/pdf.png +0 -0
  129. package/es/assets/images/file/24/pic.png +0 -0
  130. package/es/assets/images/file/24/ppt.png +0 -0
  131. package/es/assets/images/file/24/txt.png +0 -0
  132. package/es/assets/images/file/24/video.png +0 -0
  133. package/es/assets/images/file/24/word.png +0 -0
  134. package/es/assets/images/folder/folder-192.png +0 -0
  135. package/es/assets/images/folder/folder-24.png +0 -0
  136. package/es/components/cell-editor/checkbox-editor.js +0 -104
  137. package/es/components/cell-editor/collaborator-editor.js +0 -236
  138. package/es/components/cell-editor/date-editor.js +0 -151
  139. package/es/components/cell-editor/index.js +0 -9
  140. package/es/components/cell-editor/link-editor.js +0 -303
  141. package/es/components/cell-editor/multiple-select-editor.js +0 -237
  142. package/es/components/cell-editor/number-editor.js +0 -154
  143. package/es/components/cell-editor/single-select-editor.js +0 -202
  144. package/es/components/cell-editor/text-editor.js +0 -122
  145. package/es/components/cell-editor-dialog/pc-file-editor-dialog.js +0 -46
  146. package/es/components/cell-editor-dialog/pc-files-addition/index.js +0 -0
  147. package/es/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -0
  148. package/es/components/cell-editor-dialog/pc-files-preview/index.js +0 -0
  149. package/es/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -0
  150. package/es/components/cell-editor-popover/mb-collaborator-editor-popover.js +0 -177
  151. package/es/components/cell-editor-popover/mb-date-editor-popover.js +0 -245
  152. package/es/components/cell-editor-popover/mb-link-editor-popover.js +0 -170
  153. package/es/components/cell-editor-popover/mb-select-editor-popover.js +0 -230
  154. package/es/components/cell-editor-popover/pc-collaborator-editor-popover.js +0 -109
  155. package/es/components/cell-editor-popover/pc-date-editor-popover.js +0 -142
  156. package/es/components/cell-editor-popover/pc-link-editor-popover.js +0 -114
  157. package/es/components/cell-editor-popover/pc-select-editor-popover.js +0 -143
  158. package/es/components/cell-formatter/formatter-config.js +0 -31
  159. package/es/components/cell-formatter/index.js +0 -27
  160. package/es/components/common/edit-editor-button.js +0 -56
  161. package/es/components/common/link-editor-option.js +0 -113
  162. package/es/components/common/mobile/mb-editor-header.js +0 -48
  163. package/es/components/common/select-editor-option.js +0 -106
  164. package/es/constants/cell-types.js +0 -25
  165. package/es/constants/index.js +0 -48
  166. package/es/css/cell-editor.css +0 -614
  167. package/es/css/cell-formatter.css +0 -247
  168. package/es/css/custom-rc-calendar.css +0 -118
  169. package/es/index.js +0 -6
  170. package/es/lang/index.js +0 -50
  171. package/es/locals/de.js +0 -2
  172. package/es/locals/en.js +0 -17
  173. package/es/locals/fr.js +0 -2
  174. package/es/locals/zh-CN.js +0 -17
  175. package/es/utils/cell-value-validator.js +0 -32
  176. package/es/utils/column-utils.js +0 -7
  177. package/es/utils/editor-utils.js +0 -71
  178. package/es/utils/markdown2html.js +0 -62
  179. package/es/utils/normalize-long-text-value.js +0 -69
  180. package/es/utils/number-precision.js +0 -163
  181. package/es/utils/unified/index.js +0 -470
  182. package/es/utils/utils.js +0 -116
  183. package/es/utils/value-format-utils.js +0 -495
  184. package/es/utils/vfile/core.js +0 -172
  185. package/es/utils/vfile/index.js +0 -48
  186. package/lib/components/cell-factory/cell-formatter-factory.js +0 -28
  187. package/lib/components/cell-formatter/auto-number-formatter.js +0 -45
  188. package/lib/components/cell-formatter/button-formatter.js +0 -66
  189. package/lib/components/cell-formatter/checkbox-formatter.js +0 -56
  190. package/lib/components/cell-formatter/collaborator-formatter.js +0 -111
  191. package/lib/components/cell-formatter/creator-formatter.js +0 -105
  192. package/lib/components/cell-formatter/ctime-formatter.js +0 -70
  193. package/lib/components/cell-formatter/date-formatter.js +0 -73
  194. package/lib/components/cell-formatter/duration-formatter.js +0 -49
  195. package/lib/components/cell-formatter/email-formatter.js +0 -45
  196. package/lib/components/cell-formatter/file-formatter.js +0 -77
  197. package/lib/components/cell-formatter/formatter-config.js +0 -66
  198. package/lib/components/cell-formatter/formula-formatter.js +0 -189
  199. package/lib/components/cell-formatter/geolocation-formatter.js +0 -66
  200. package/lib/components/cell-formatter/image-formatter.js +0 -171
  201. package/lib/components/cell-formatter/index.js +0 -112
  202. package/lib/components/cell-formatter/last-modifier-formatter.js +0 -105
  203. package/lib/components/cell-formatter/link-formatter.js +0 -165
  204. package/lib/components/cell-formatter/long-text-formatter.js +0 -46
  205. package/lib/components/cell-formatter/mtime-formatter.js +0 -70
  206. package/lib/components/cell-formatter/multiple-select-formatter.js +0 -84
  207. package/lib/components/cell-formatter/number-formatter.js +0 -60
  208. package/lib/components/cell-formatter/rate-formatter.js +0 -93
  209. package/lib/components/cell-formatter/single-select-formatter.js +0 -84
  210. package/lib/components/cell-formatter/text-formatter.js +0 -67
  211. package/lib/components/cell-formatter/url-formatter.js +0 -45
  212. package/lib/components/cell-formatter/widgets/file-item-formatter.js +0 -63
  213. package/lib/components/cell-formatter/widgets/image-previewer-lightbox.js +0 -152
  214. package/lib/components/cell-formatter/widgets/long-text-formatter/html-long-text-formatter.js +0 -107
  215. package/lib/components/cell-formatter/widgets/long-text-formatter/simple-long-text-formatter.js +0 -110
  216. package/lib/components/common/images-lazy-load.js +0 -158
  217. package/lib/components/common/modal-portal.js +0 -51
  218. package/lib/components/common/select-item.js +0 -73
  219. package/lib/components/file-uploader/index.js +0 -63
  220. package/lib/components/loading.js +0 -16
  221. package/lib/components/toast/alert.js +0 -164
  222. package/lib/components/toast/index.js +0 -12
  223. package/lib/components/toast/toast.js +0 -223
  224. package/lib/components/toast/toastManager.js +0 -189
  225. package/lib/components/toast/toaster.js +0 -92
  226. package/lib/css/image-previewer-ligntbox.css +0 -87
  227. package/lib/css/loading.css +0 -54
@@ -1,172 +0,0 @@
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
- }
@@ -1,48 +0,0 @@
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,28 +0,0 @@
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 _formatterConfig = _interopRequireDefault(require("../cell-formatter/formatter-config"));
9
-
10
- var CellFormatterFactory = /*#__PURE__*/function () {
11
- function CellFormatterFactory() {}
12
-
13
- var _proto = CellFormatterFactory.prototype;
14
-
15
- _proto.createFormatter = function createFormatter(formatterType) {
16
- if (_formatterConfig.default[formatterType]) {
17
- return _formatterConfig.default[formatterType];
18
- }
19
-
20
- return null;
21
- };
22
-
23
- return CellFormatterFactory;
24
- }();
25
-
26
- var cellFormatterFactory = new CellFormatterFactory();
27
- var _default = cellFormatterFactory;
28
- exports.default = _default;
@@ -1,45 +0,0 @@
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
- var propTypes = {
17
- value: _propTypes.default.string.isRequired,
18
- containerClassName: _propTypes.default.string
19
- };
20
-
21
- var AutoNumberFormatter = /*#__PURE__*/function (_React$Component) {
22
- (0, _inheritsLoose2.default)(AutoNumberFormatter, _React$Component);
23
-
24
- function AutoNumberFormatter() {
25
- return _React$Component.apply(this, arguments) || this;
26
- }
27
-
28
- var _proto = AutoNumberFormatter.prototype;
29
-
30
- _proto.render = function render() {
31
- var _this$props = this.props,
32
- containerClassName = _this$props.containerClassName,
33
- value = _this$props.value;
34
- var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container auto-number-formatter', containerClassName);
35
- return /*#__PURE__*/_react.default.createElement("div", {
36
- className: classname
37
- }, value);
38
- };
39
-
40
- return AutoNumberFormatter;
41
- }(_react.default.Component);
42
-
43
- AutoNumberFormatter.propTypes = propTypes;
44
- var _default = AutoNumberFormatter;
45
- exports.default = _default;
@@ -1,66 +0,0 @@
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
- var propTypes = {
17
- data: _propTypes.default.object,
18
- containerClassName: _propTypes.default.string,
19
- optionColors: _propTypes.default.array
20
- };
21
-
22
- var ButtonFormatter = /*#__PURE__*/function (_React$Component) {
23
- (0, _inheritsLoose2.default)(ButtonFormatter, _React$Component);
24
-
25
- function ButtonFormatter() {
26
- return _React$Component.apply(this, arguments) || this;
27
- }
28
-
29
- var _proto = ButtonFormatter.prototype;
30
-
31
- _proto.render = function render() {
32
- var _this$props = this.props,
33
- data = _this$props.data,
34
- containerClassName = _this$props.containerClassName,
35
- optionColors = _this$props.optionColors;
36
-
37
- var _ref = data || {},
38
- button_color = _ref.button_color,
39
- button_type = _ref.button_type,
40
- button_name = _ref.button_name;
41
-
42
- if (!button_type) return null;
43
- var colorOption = Array.isArray(optionColors) ? optionColors.find(function (item) {
44
- return item.COLOR === button_color;
45
- }) || optionColors[0] : {
46
- COLOR: '#FFFCB5',
47
- BORDER_COLOR: '#E8E79D',
48
- TEXT_COLOR: '#202428'
49
- };
50
- var btnStyle = {
51
- backgroundColor: colorOption.COLOR,
52
- borderColor: colorOption.BORDER_COLOR,
53
- color: colorOption.TEXT_COLOR
54
- };
55
- return /*#__PURE__*/_react.default.createElement("div", {
56
- className: (0, _astroClassname.default)('dtable-ui cell-formatter-container button-formatter', containerClassName),
57
- style: btnStyle
58
- }, button_name);
59
- };
60
-
61
- return ButtonFormatter;
62
- }(_react.default.Component);
63
-
64
- ButtonFormatter.propTypes = propTypes;
65
- var _default = ButtonFormatter;
66
- exports.default = _default;
@@ -1,56 +0,0 @@
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 _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
- var propTypes = {
19
- value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool]),
20
- containerClassName: _propTypes.default.string
21
- };
22
-
23
- var CheckboxFormatter = /*#__PURE__*/function (_React$PureComponent) {
24
- (0, _inheritsLoose2.default)(CheckboxFormatter, _React$PureComponent);
25
-
26
- function CheckboxFormatter() {
27
- return _React$PureComponent.apply(this, arguments) || this;
28
- }
29
-
30
- var _proto = CheckboxFormatter.prototype;
31
-
32
- _proto.render = function render() {
33
- var _this$props = this.props,
34
- value = _this$props.value,
35
- containerClassName = _this$props.containerClassName;
36
- value = value === true ? true : false;
37
- var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container checkbox-formatter', containerClassName);
38
- return /*#__PURE__*/_react.default.createElement("div", {
39
- className: classname
40
- }, /*#__PURE__*/_react.default.createElement("input", {
41
- className: "checkbox",
42
- type: "checkbox",
43
- readOnly: true,
44
- checked: value
45
- }));
46
- };
47
-
48
- return CheckboxFormatter;
49
- }(_react.default.PureComponent);
50
-
51
- (0, _defineProperty2.default)(CheckboxFormatter, "defaultProps", {
52
- value: false
53
- });
54
- CheckboxFormatter.propTypes = propTypes;
55
- var _default = CheckboxFormatter;
56
- exports.default = _default;
@@ -1,111 +0,0 @@
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 _collaboratorItem = _interopRequireDefault(require("../common/collaborator-item"));
21
-
22
- var _default_avatar = _interopRequireDefault(require("../../assets/images/avatar/default_avatar.png"));
23
-
24
- var propTypes = {
25
- containerClassName: _propTypes.default.string,
26
- value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array]).isRequired,
27
- collaborators: _propTypes.default.arrayOf(_propTypes.default.exact({
28
- email: _propTypes.default.string.isRequired,
29
- name: _propTypes.default.string.isRequired,
30
- contact_email: _propTypes.default.string.isRequired,
31
- avatar_url: _propTypes.default.string.isRequired
32
- })),
33
- enableDeleteCollaborator: _propTypes.default.bool,
34
- onDeleteCollaborator: _propTypes.default.func
35
- }; // there will be there conditions
36
- // 1 value is not exist, typeof value is array, but it's length is 0
37
- // 2 value is exist, but can't find in collaborators
38
- // 3 value is exist, typeof value is a string
39
- // 4 value is exist, typeof value is array
40
-
41
- var CollaboratorFormatter = /*#__PURE__*/function (_React$PureComponent) {
42
- (0, _inheritsLoose2.default)(CollaboratorFormatter, _React$PureComponent);
43
-
44
- function CollaboratorFormatter() {
45
- var _this;
46
-
47
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
48
- args[_key] = arguments[_key];
49
- }
50
-
51
- _this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;
52
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCollaborators", function () {
53
- var _this$props = _this.props,
54
- value = _this$props.value,
55
- collaborators = _this$props.collaborators,
56
- enableDeleteCollaborator = _this$props.enableDeleteCollaborator,
57
- onDeleteCollaborator = _this$props.onDeleteCollaborator;
58
-
59
- if (!Array.isArray(value)) {
60
- value = [value];
61
- }
62
-
63
- return value.map(function (item, index) {
64
- var collaborator = collaborators.find(function (collaborator) {
65
- return collaborator.email === item;
66
- });
67
-
68
- if (!collaborator) {
69
- collaborator = {
70
- name: item,
71
- avatar_url: _default_avatar.default
72
- };
73
- }
74
-
75
- return /*#__PURE__*/_react.default.createElement(_collaboratorItem.default, {
76
- key: index,
77
- collaborator: collaborator,
78
- enableDeleteCollaborator: enableDeleteCollaborator,
79
- onDeleteCollaborator: onDeleteCollaborator
80
- });
81
- });
82
- });
83
- return _this;
84
- }
85
-
86
- var _proto = CollaboratorFormatter.prototype;
87
-
88
- _proto.render = function render() {
89
- var _this$props2 = this.props,
90
- containerClassName = _this$props2.containerClassName,
91
- value = _this$props2.value;
92
- var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container collaborator-formatter', containerClassName);
93
-
94
- if (!value || Array.isArray(value) && value.length === 0) {
95
- return /*#__PURE__*/_react.default.createElement("div", {
96
- className: classname
97
- });
98
- }
99
-
100
- var collaborators = this.getCollaborators();
101
- return /*#__PURE__*/_react.default.createElement("div", {
102
- className: classname
103
- }, collaborators);
104
- };
105
-
106
- return CollaboratorFormatter;
107
- }(_react.default.PureComponent);
108
-
109
- CollaboratorFormatter.propTypes = propTypes;
110
- var _default = CollaboratorFormatter;
111
- exports.default = _default;
@@ -1,105 +0,0 @@
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 _collaboratorItem = _interopRequireDefault(require("../common/collaborator-item"));
21
-
22
- var _default_avatar = _interopRequireDefault(require("../../assets/images/avatar/default_avatar.png"));
23
-
24
- var propTypes = {
25
- containerClassName: _propTypes.default.string,
26
- value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array]).isRequired,
27
- collaborators: _propTypes.default.arrayOf(_propTypes.default.exact({
28
- email: _propTypes.default.string.isRequired,
29
- name: _propTypes.default.string.isRequired,
30
- contact_email: _propTypes.default.string.isRequired,
31
- avatar_url: _propTypes.default.string.isRequired
32
- }))
33
- }; // there will be there conditions
34
- // 1 value is not exist, typeof value is array, but it's length is 0
35
- // 2 value is exist, but can't find in collaborators
36
- // 3 value is exist, typeof value is a string
37
- // 4 value is exist, typeof value is array
38
-
39
- var CreatorFormatter = /*#__PURE__*/function (_React$PureComponent) {
40
- (0, _inheritsLoose2.default)(CreatorFormatter, _React$PureComponent);
41
-
42
- function CreatorFormatter() {
43
- var _this;
44
-
45
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
46
- args[_key] = arguments[_key];
47
- }
48
-
49
- _this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;
50
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCollaborators", function () {
51
- var _this$props = _this.props,
52
- value = _this$props.value,
53
- collaborators = _this$props.collaborators;
54
-
55
- if (!Array.isArray(value)) {
56
- value = [value];
57
- }
58
-
59
- return value.map(function (item, index) {
60
- var collaborator = collaborators.find(function (collaborator) {
61
- return collaborator.email === item;
62
- }); // the collaborator can be not exist, because the row created by third app
63
-
64
- if (!collaborator) {
65
- collaborator = {
66
- name: item,
67
- avatar_url: _default_avatar.default
68
- };
69
- }
70
-
71
- return /*#__PURE__*/_react.default.createElement(_collaboratorItem.default, {
72
- key: index,
73
- collaborator: collaborator
74
- });
75
- });
76
- });
77
- return _this;
78
- }
79
-
80
- var _proto = CreatorFormatter.prototype;
81
-
82
- _proto.render = function render() {
83
- var _this$props2 = this.props,
84
- containerClassName = _this$props2.containerClassName,
85
- value = _this$props2.value;
86
- var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container creator-formatter', containerClassName);
87
-
88
- if (!value || Array.isArray(value) && value.length === 0) {
89
- return /*#__PURE__*/_react.default.createElement("div", {
90
- className: classname
91
- });
92
- }
93
-
94
- var collaborators = this.getCollaborators();
95
- return /*#__PURE__*/_react.default.createElement("div", {
96
- className: classname
97
- }, collaborators);
98
- };
99
-
100
- return CreatorFormatter;
101
- }(_react.default.PureComponent);
102
-
103
- CreatorFormatter.propTypes = propTypes;
104
- var _default = CreatorFormatter;
105
- exports.default = _default;