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
package/lib/index.js
CHANGED
|
@@ -1,31 +1,139 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.toaster = exports.setLocale = exports.getNumberDisplayString = exports.getDateDisplayString = exports.formatStringToNumber = exports.formatNumberString = exports.UrlFormatter = exports.TextFormatter = exports.TextEditor = exports.SingleSelectFormatter = exports.SingleSelectEditor = exports.RateFormatter = exports.NumberFormatter = exports.NumberEditor = exports.MultipleSelectFormatter = exports.MTimeFormatter = exports.LongTextFormatter = exports.Loading = exports.LinkFormatter = exports.LinkEditor = exports.LastModifierFormatter = exports.ImagePreviewerLightbox = exports.ImageFormatter = exports.GeolocationFormatter = exports.FormulaFormatter = exports.FileItemFormatter = exports.FileFormatter = exports.EmailFormatter = exports.DurationFormatter = exports.DateFormatter = exports.DateEditor = exports.CreatorFormatter = exports.CollaboratorItem = exports.CollaboratorFormatter = exports.CollaboratorEditor = exports.CheckboxFormatter = exports.CheckboxEditor = exports.CTimeFormatter = exports.ButtonFormatter = exports.AutoNumberFormatter = void 0;
|
|
7
|
+
|
|
8
|
+
var _toaster = _interopRequireDefault(require("./toaster"));
|
|
9
|
+
|
|
10
|
+
exports.toaster = _toaster.default;
|
|
11
|
+
|
|
12
|
+
var _lang = require("./lang");
|
|
13
|
+
|
|
14
|
+
exports.setLocale = _lang.setLocale;
|
|
15
|
+
|
|
16
|
+
var _valueFormatUtils = require("./utils/value-format-utils");
|
|
17
|
+
|
|
18
|
+
exports.getDateDisplayString = _valueFormatUtils.getDateDisplayString;
|
|
19
|
+
exports.getNumberDisplayString = _valueFormatUtils.getNumberDisplayString;
|
|
20
|
+
exports.formatStringToNumber = _valueFormatUtils.formatStringToNumber;
|
|
21
|
+
exports.formatNumberString = _valueFormatUtils.formatNumberString;
|
|
22
|
+
|
|
23
|
+
var _CheckboxFormatter = _interopRequireDefault(require("./CheckboxFormatter"));
|
|
24
|
+
|
|
25
|
+
exports.CheckboxFormatter = _CheckboxFormatter.default;
|
|
26
|
+
|
|
27
|
+
var _ImageFormatter = _interopRequireDefault(require("./ImageFormatter"));
|
|
28
|
+
|
|
29
|
+
exports.ImageFormatter = _ImageFormatter.default;
|
|
30
|
+
|
|
31
|
+
var _LongTextFormatter = _interopRequireDefault(require("./LongTextFormatter"));
|
|
32
|
+
|
|
33
|
+
exports.LongTextFormatter = _LongTextFormatter.default;
|
|
34
|
+
|
|
35
|
+
var _TextFormatter = _interopRequireDefault(require("./TextFormatter"));
|
|
36
|
+
|
|
37
|
+
exports.TextFormatter = _TextFormatter.default;
|
|
38
|
+
|
|
39
|
+
var _SingleSelectFormatter = _interopRequireDefault(require("./SingleSelectFormatter"));
|
|
40
|
+
|
|
41
|
+
exports.SingleSelectFormatter = _SingleSelectFormatter.default;
|
|
42
|
+
|
|
43
|
+
var _MultipleSelectFormatter = _interopRequireDefault(require("./MultipleSelectFormatter"));
|
|
44
|
+
|
|
45
|
+
exports.MultipleSelectFormatter = _MultipleSelectFormatter.default;
|
|
46
|
+
|
|
47
|
+
var _FileFormatter = _interopRequireDefault(require("./FileFormatter"));
|
|
48
|
+
|
|
49
|
+
exports.FileFormatter = _FileFormatter.default;
|
|
50
|
+
|
|
51
|
+
var _LinkFormatter = _interopRequireDefault(require("./LinkFormatter"));
|
|
52
|
+
|
|
53
|
+
exports.LinkFormatter = _LinkFormatter.default;
|
|
54
|
+
|
|
55
|
+
var _CollaboratorFormatter = _interopRequireDefault(require("./CollaboratorFormatter"));
|
|
56
|
+
|
|
57
|
+
exports.CollaboratorFormatter = _CollaboratorFormatter.default;
|
|
58
|
+
|
|
59
|
+
var _NumberFormatter = _interopRequireDefault(require("./NumberFormatter"));
|
|
60
|
+
|
|
61
|
+
exports.NumberFormatter = _NumberFormatter.default;
|
|
62
|
+
|
|
63
|
+
var _DateFormatter = _interopRequireDefault(require("./DateFormatter"));
|
|
64
|
+
|
|
65
|
+
exports.DateFormatter = _DateFormatter.default;
|
|
66
|
+
|
|
67
|
+
var _CreatorFormatter = _interopRequireDefault(require("./CreatorFormatter"));
|
|
68
|
+
|
|
69
|
+
exports.CreatorFormatter = _CreatorFormatter.default;
|
|
70
|
+
|
|
71
|
+
var _CTimeFormatter = _interopRequireDefault(require("./CTimeFormatter"));
|
|
72
|
+
|
|
73
|
+
exports.CTimeFormatter = _CTimeFormatter.default;
|
|
74
|
+
|
|
75
|
+
var _LastModifierFormatter = _interopRequireDefault(require("./LastModifierFormatter"));
|
|
76
|
+
|
|
77
|
+
exports.LastModifierFormatter = _LastModifierFormatter.default;
|
|
78
|
+
|
|
79
|
+
var _MTimeFormatter = _interopRequireDefault(require("./MTimeFormatter"));
|
|
80
|
+
|
|
81
|
+
exports.MTimeFormatter = _MTimeFormatter.default;
|
|
82
|
+
|
|
83
|
+
var _GeolocationFormatter = _interopRequireDefault(require("./GeolocationFormatter"));
|
|
84
|
+
|
|
85
|
+
exports.GeolocationFormatter = _GeolocationFormatter.default;
|
|
86
|
+
|
|
87
|
+
var _FormulaFormatter = _interopRequireDefault(require("./FormulaFormatter"));
|
|
88
|
+
|
|
89
|
+
exports.FormulaFormatter = _FormulaFormatter.default;
|
|
90
|
+
|
|
91
|
+
var _AutoNumberFormatter = _interopRequireDefault(require("./AutoNumberFormatter"));
|
|
92
|
+
|
|
93
|
+
exports.AutoNumberFormatter = _AutoNumberFormatter.default;
|
|
94
|
+
|
|
95
|
+
var _UrlFormatter = _interopRequireDefault(require("./UrlFormatter"));
|
|
96
|
+
|
|
97
|
+
exports.UrlFormatter = _UrlFormatter.default;
|
|
98
|
+
|
|
99
|
+
var _EmailFormatter = _interopRequireDefault(require("./EmailFormatter"));
|
|
100
|
+
|
|
101
|
+
exports.EmailFormatter = _EmailFormatter.default;
|
|
102
|
+
|
|
103
|
+
var _DurationFormatter = _interopRequireDefault(require("./DurationFormatter"));
|
|
104
|
+
|
|
105
|
+
exports.DurationFormatter = _DurationFormatter.default;
|
|
106
|
+
|
|
107
|
+
var _RateFormatter = _interopRequireDefault(require("./RateFormatter"));
|
|
108
|
+
|
|
109
|
+
exports.RateFormatter = _RateFormatter.default;
|
|
110
|
+
|
|
111
|
+
var _ButtonFormatter = _interopRequireDefault(require("./ButtonFormatter"));
|
|
112
|
+
|
|
113
|
+
exports.ButtonFormatter = _ButtonFormatter.default;
|
|
114
|
+
|
|
115
|
+
var _ImagePreviewerLightbox = _interopRequireDefault(require("./ImagePreviewerLightbox"));
|
|
116
|
+
|
|
117
|
+
exports.ImagePreviewerLightbox = _ImagePreviewerLightbox.default;
|
|
118
|
+
|
|
119
|
+
var _CollaboratorItem = _interopRequireDefault(require("./CollaboratorItem"));
|
|
120
|
+
|
|
121
|
+
exports.CollaboratorItem = _CollaboratorItem.default;
|
|
122
|
+
|
|
123
|
+
var _FileItemFormatter = _interopRequireDefault(require("./FileItemFormatter"));
|
|
124
|
+
|
|
125
|
+
exports.FileItemFormatter = _FileItemFormatter.default;
|
|
126
|
+
|
|
127
|
+
var _Loading = _interopRequireDefault(require("./Loading"));
|
|
128
|
+
|
|
129
|
+
exports.Loading = _Loading.default;
|
|
130
|
+
|
|
131
|
+
var _cellEditor = require("./components/cell-editor");
|
|
132
|
+
|
|
133
|
+
exports.TextEditor = _cellEditor.TextEditor;
|
|
134
|
+
exports.NumberEditor = _cellEditor.NumberEditor;
|
|
135
|
+
exports.CheckboxEditor = _cellEditor.CheckboxEditor;
|
|
136
|
+
exports.SingleSelectEditor = _cellEditor.SingleSelectEditor;
|
|
137
|
+
exports.CollaboratorEditor = _cellEditor.CollaboratorEditor;
|
|
138
|
+
exports.DateEditor = _cellEditor.DateEditor;
|
|
139
|
+
exports.LinkEditor = _cellEditor.LinkEditor;
|
package/lib/lang/index.js
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.getLocale = getLocale;
|
|
7
|
+
exports.setLocale = setLocale;
|
|
8
|
+
exports.substitute = substitute;
|
|
9
|
+
|
|
10
|
+
var _de = _interopRequireDefault(require("../locals/de"));
|
|
11
|
+
|
|
12
|
+
var _en = _interopRequireDefault(require("../locals/en"));
|
|
13
|
+
|
|
14
|
+
var _fr = _interopRequireDefault(require("../locals/fr"));
|
|
15
|
+
|
|
16
|
+
var _zhCN = _interopRequireDefault(require("../locals/zh-CN"));
|
|
17
|
+
|
|
5
18
|
var langData = {
|
|
6
|
-
'de':
|
|
7
|
-
'en':
|
|
8
|
-
'fr':
|
|
9
|
-
'zh-cn':
|
|
19
|
+
'de': _de.default,
|
|
20
|
+
'en': _en.default,
|
|
21
|
+
'fr': _fr.default,
|
|
22
|
+
'zh-cn': _zhCN.default
|
|
10
23
|
};
|
|
11
24
|
var LANGUAGE = 'en';
|
|
12
25
|
var LANGUAGE_MAP = {};
|
|
13
|
-
|
|
26
|
+
|
|
27
|
+
function setLocale(args) {
|
|
14
28
|
var lang = typeof args === 'string' ? args : LANGUAGE;
|
|
15
29
|
LANGUAGE_MAP = langData[lang] || langData[LANGUAGE];
|
|
16
30
|
}
|
|
17
|
-
|
|
31
|
+
|
|
32
|
+
function getLocale(key, def) {
|
|
18
33
|
if (!key) return def;
|
|
19
34
|
|
|
20
35
|
if (!LANGUAGE_MAP[key]) {
|
|
@@ -23,7 +38,8 @@ export function getLocale(key, def) {
|
|
|
23
38
|
|
|
24
39
|
return LANGUAGE_MAP[key];
|
|
25
40
|
}
|
|
26
|
-
|
|
41
|
+
|
|
42
|
+
function substitute(str, obj) {
|
|
27
43
|
if (typeof str === 'string') {
|
|
28
44
|
if (str.indexOf('{') < 0) {
|
|
29
45
|
return str;
|
package/lib/locals/de.js
CHANGED
package/lib/locals/en.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
1
5
|
var en = {
|
|
2
6
|
Add_an_option: "Add an option",
|
|
3
7
|
Find_an_option: "Find a option",
|
|
@@ -14,4 +18,5 @@ var en = {
|
|
|
14
18
|
Please_select: "Please select",
|
|
15
19
|
Clear: "Clear"
|
|
16
20
|
};
|
|
17
|
-
|
|
21
|
+
var _default = en;
|
|
22
|
+
exports.default = _default;
|
package/lib/locals/fr.js
CHANGED
package/lib/locals/zh-CN.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
1
5
|
var zh_CN = {
|
|
2
6
|
Add_an_option: '添加一个选项',
|
|
3
7
|
Find_an_option: "查找标签",
|
|
@@ -14,4 +18,5 @@ var zh_CN = {
|
|
|
14
18
|
Please_select: "请选择",
|
|
15
19
|
Clear: "清空"
|
|
16
20
|
};
|
|
17
|
-
|
|
21
|
+
var _default = zh_CN;
|
|
22
|
+
exports.default = _default;
|
|
@@ -0,0 +1,164 @@
|
|
|
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 _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
|
|
10
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var _glamor = require("glamor");
|
|
17
|
+
|
|
18
|
+
var propTypes = {
|
|
19
|
+
intent: _propTypes.default.string.isRequired,
|
|
20
|
+
title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]).isRequired,
|
|
21
|
+
onRemove: _propTypes.default.func.isRequired,
|
|
22
|
+
children: _propTypes.default.string,
|
|
23
|
+
isRemoveable: _propTypes.default.bool
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var Alert = /*#__PURE__*/function (_React$PureComponent) {
|
|
27
|
+
(0, _inheritsLoose2.default)(Alert, _React$PureComponent);
|
|
28
|
+
|
|
29
|
+
function Alert(props) {
|
|
30
|
+
var _this;
|
|
31
|
+
|
|
32
|
+
_this = _React$PureComponent.call(this, props) || this;
|
|
33
|
+
_this.containerStyle = (0, _glamor.css)({
|
|
34
|
+
borderRadius: '3px',
|
|
35
|
+
backgroundColor: '#fff',
|
|
36
|
+
padding: '10px 16px',
|
|
37
|
+
display: 'flex',
|
|
38
|
+
boxSizing: 'border-box',
|
|
39
|
+
boxShadow: 'rgba(67, 90, 111, 0.3) 0px 0px 1px, rgba(67, 90, 111, 0.47) 0px 8px 10px -4px',
|
|
40
|
+
justifyContent: 'space-between',
|
|
41
|
+
flexDirection: 'row'
|
|
42
|
+
});
|
|
43
|
+
_this.containerBorderSuccess = (0, _glamor.css)({
|
|
44
|
+
borderLeft: '3px solid rgb(71, 184, 129)'
|
|
45
|
+
});
|
|
46
|
+
_this.containerBorderWarn = (0, _glamor.css)({
|
|
47
|
+
borderLeft: '3px solid rgb(217, 130, 43)'
|
|
48
|
+
});
|
|
49
|
+
_this.containerBorderDanger = (0, _glamor.css)({
|
|
50
|
+
borderLeft: '3px solid rgb(236, 76, 71)'
|
|
51
|
+
});
|
|
52
|
+
_this.containerBorderNotify = (0, _glamor.css)({
|
|
53
|
+
borderLeft: '3px solid rgb(16, 112, 202)'
|
|
54
|
+
});
|
|
55
|
+
_this.toastTextTitle = (0, _glamor.css)({
|
|
56
|
+
fontWeight: '600',
|
|
57
|
+
fontSize: '14px',
|
|
58
|
+
color: '#435a6f',
|
|
59
|
+
margin: '0'
|
|
60
|
+
});
|
|
61
|
+
_this.toastTextChild = (0, _glamor.css)({
|
|
62
|
+
fontSize: '14px',
|
|
63
|
+
color: '#999',
|
|
64
|
+
margin: '0'
|
|
65
|
+
});
|
|
66
|
+
_this.toastClose = (0, _glamor.css)({
|
|
67
|
+
marginLeft: '15px',
|
|
68
|
+
height: '24px',
|
|
69
|
+
width: '24px',
|
|
70
|
+
lineHeight: '22px',
|
|
71
|
+
fontWeight: '700',
|
|
72
|
+
textAlign: 'center',
|
|
73
|
+
fontSize: '20px',
|
|
74
|
+
color: '#000',
|
|
75
|
+
cursor: 'pointer',
|
|
76
|
+
opacity: '0.5',
|
|
77
|
+
':hover': {
|
|
78
|
+
opacity: 1
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
_this.toastIcon = (0, _glamor.css)({
|
|
82
|
+
marginRight: '10px',
|
|
83
|
+
width: '14px',
|
|
84
|
+
height: '20px',
|
|
85
|
+
lineHeight: '20px'
|
|
86
|
+
});
|
|
87
|
+
return _this;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
var _proto = Alert.prototype;
|
|
91
|
+
|
|
92
|
+
_proto.getContainerStyle = function getContainerStyle(intent) {
|
|
93
|
+
switch (intent) {
|
|
94
|
+
case 'success':
|
|
95
|
+
return {
|
|
96
|
+
borderStyle: this.containerBorderSuccess,
|
|
97
|
+
iconColor: (0, _glamor.css)({
|
|
98
|
+
color: 'rgb(71, 184, 129)'
|
|
99
|
+
}),
|
|
100
|
+
iconClass: 'dtable-font dtable-icon-check-circle'
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
case 'warning':
|
|
104
|
+
return {
|
|
105
|
+
borderStyle: this.containerBorderWarn,
|
|
106
|
+
iconColor: (0, _glamor.css)({
|
|
107
|
+
color: 'rgb(217, 130, 43)'
|
|
108
|
+
}),
|
|
109
|
+
iconClass: 'dtable-font dtable-icon-exclamation-triangle'
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
case 'none':
|
|
113
|
+
return {
|
|
114
|
+
borderStyle: this.containerBorderNotify,
|
|
115
|
+
iconColor: (0, _glamor.css)({
|
|
116
|
+
color: 'rgb(16, 112, 202)'
|
|
117
|
+
}),
|
|
118
|
+
iconClass: 'dtable-font dtable-icon-exclamation-circle'
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
case 'danger':
|
|
122
|
+
return {
|
|
123
|
+
borderStyle: this.containerBorderDanger,
|
|
124
|
+
iconColor: (0, _glamor.css)({
|
|
125
|
+
color: 'rgb(236, 76, 71)'
|
|
126
|
+
}),
|
|
127
|
+
iconClass: 'dtable-font dtable-icon-exclamation-circle'
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
default:
|
|
131
|
+
return {
|
|
132
|
+
borderStyle: this.containerBorderSuccess,
|
|
133
|
+
iconColor: (0, _glamor.css)({
|
|
134
|
+
color: 'rgb(71, 184, 129)'
|
|
135
|
+
}),
|
|
136
|
+
iconClass: 'dtable-font dtable-icon-check-circle'
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
_proto.render = function render() {
|
|
142
|
+
var toastStyle = this.getContainerStyle(this.props.intent);
|
|
143
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _glamor.css)(toastStyle.borderStyle, this.containerStyle), /*#__PURE__*/_react.default.createElement("div", {
|
|
144
|
+
className: this.toastIcon
|
|
145
|
+
}, /*#__PURE__*/_react.default.createElement("i", (0, _extends2.default)({
|
|
146
|
+
className: toastStyle.iconClass
|
|
147
|
+
}, toastStyle.iconColor))), /*#__PURE__*/_react.default.createElement("div", {
|
|
148
|
+
className: this.toastTextContainer
|
|
149
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
150
|
+
className: this.toastTextTitle
|
|
151
|
+
}, this.props.title), this.props.children ? /*#__PURE__*/_react.default.createElement("p", {
|
|
152
|
+
className: this.toastTextChild
|
|
153
|
+
}, this.props.children) : null), this.props.isRemoveable && /*#__PURE__*/_react.default.createElement("div", {
|
|
154
|
+
onClick: this.props.onRemove,
|
|
155
|
+
className: this.toastClose
|
|
156
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, "\xD7")));
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
return Alert;
|
|
160
|
+
}(_react.default.PureComponent);
|
|
161
|
+
|
|
162
|
+
Alert.propTypes = propTypes;
|
|
163
|
+
var _default = Alert;
|
|
164
|
+
exports.default = _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
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 _toaster = _interopRequireDefault(require("./toaster"));
|
|
9
|
+
|
|
10
|
+
var toaster = new _toaster.default();
|
|
11
|
+
var _default = toaster;
|
|
12
|
+
exports.default = _default;
|
|
@@ -0,0 +1,223 @@
|
|
|
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 _glamor = require("glamor");
|
|
17
|
+
|
|
18
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
+
|
|
20
|
+
var _Transition = _interopRequireDefault(require("react-transition-group/Transition"));
|
|
21
|
+
|
|
22
|
+
var _alert = _interopRequireDefault(require("./alert"));
|
|
23
|
+
|
|
24
|
+
var animationEasing = {
|
|
25
|
+
deceleration: 'cubic-bezier(0.0, 0.0, 0.2, 1)',
|
|
26
|
+
acceleration: 'cubic-bezier(0.4, 0.0, 1, 1)',
|
|
27
|
+
spring: 'cubic-bezier(0.175, 0.885, 0.320, 1.175)'
|
|
28
|
+
};
|
|
29
|
+
var ANIMATION_DURATION = 240;
|
|
30
|
+
|
|
31
|
+
var openAnimation = _glamor.css.keyframes('openAnimation', {
|
|
32
|
+
from: {
|
|
33
|
+
opacity: 0,
|
|
34
|
+
transform: 'translateY(-120%)'
|
|
35
|
+
},
|
|
36
|
+
to: {
|
|
37
|
+
transform: 'translateY(0)'
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
var closeAnimation = _glamor.css.keyframes('closeAnimation', {
|
|
42
|
+
from: {
|
|
43
|
+
transform: 'scale(1)',
|
|
44
|
+
opacity: 1
|
|
45
|
+
},
|
|
46
|
+
to: {
|
|
47
|
+
transform: 'scale(0.9)',
|
|
48
|
+
opacity: 0
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
var animationStyles = (0, _glamor.css)({
|
|
53
|
+
display: 'flex',
|
|
54
|
+
flexDirection: 'column',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
height: 0,
|
|
57
|
+
transition: "all " + ANIMATION_DURATION + "ms " + animationEasing.deceleration,
|
|
58
|
+
'&[data-state="entering"], &[data-state="entered"]': {
|
|
59
|
+
animation: openAnimation + " " + ANIMATION_DURATION + "ms " + animationEasing.spring + " both"
|
|
60
|
+
},
|
|
61
|
+
'&[data-state="exiting"]': {
|
|
62
|
+
animation: closeAnimation + " 120ms " + animationEasing.acceleration + " both"
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
var Toast = /*#__PURE__*/function (_React$PureComponent) {
|
|
67
|
+
(0, _inheritsLoose2.default)(Toast, _React$PureComponent);
|
|
68
|
+
|
|
69
|
+
function Toast() {
|
|
70
|
+
var _this;
|
|
71
|
+
|
|
72
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
73
|
+
args[_key] = arguments[_key];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
_this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;
|
|
77
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
78
|
+
isShown: true,
|
|
79
|
+
height: 0
|
|
80
|
+
});
|
|
81
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "close", function () {
|
|
82
|
+
_this.clearCloseTimer();
|
|
83
|
+
|
|
84
|
+
_this.setState({
|
|
85
|
+
isShown: false
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "startCloseTimer", function () {
|
|
89
|
+
if (_this.props.duration) {
|
|
90
|
+
_this.closeTimer = setTimeout(function () {
|
|
91
|
+
_this.close();
|
|
92
|
+
}, _this.props.duration * 1000);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "clearCloseTimer", function () {
|
|
96
|
+
if (_this.closeTimer) {
|
|
97
|
+
clearTimeout(_this.closeTimer);
|
|
98
|
+
_this.closeTimer = null;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleMouseEnter", function () {
|
|
102
|
+
_this.clearCloseTimer();
|
|
103
|
+
});
|
|
104
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleMouseLeave", function () {
|
|
105
|
+
_this.startCloseTimer();
|
|
106
|
+
});
|
|
107
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onRef", function (ref) {
|
|
108
|
+
if (ref === null) return;
|
|
109
|
+
|
|
110
|
+
var _ref$getBoundingClien = ref.getBoundingClientRect(),
|
|
111
|
+
height = _ref$getBoundingClien.height;
|
|
112
|
+
|
|
113
|
+
_this.setState({
|
|
114
|
+
height: height
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
return _this;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
var _proto = Toast.prototype;
|
|
121
|
+
|
|
122
|
+
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
|
123
|
+
if (prevProps.isShown !== this.props.isShown) {
|
|
124
|
+
// eslint-disable-next-line react/no-did-update-set-state
|
|
125
|
+
this.setState({
|
|
126
|
+
isShown: this.props.isShown
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
132
|
+
this.startCloseTimer();
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
136
|
+
this.clearCloseTimer();
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
_proto.render = function render() {
|
|
140
|
+
var _this2 = this;
|
|
141
|
+
|
|
142
|
+
return /*#__PURE__*/_react.default.createElement(_Transition.default, {
|
|
143
|
+
appear: true,
|
|
144
|
+
unmountOnExit: true,
|
|
145
|
+
timeout: ANIMATION_DURATION,
|
|
146
|
+
in: this.state.isShown,
|
|
147
|
+
onExited: this.props.onRemove
|
|
148
|
+
}, function (state) {
|
|
149
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
150
|
+
"data-state": state,
|
|
151
|
+
className: animationStyles,
|
|
152
|
+
onMouseEnter: _this2.handleMouseEnter,
|
|
153
|
+
onMouseLeave: _this2.handleMouseLeave,
|
|
154
|
+
style: {
|
|
155
|
+
height: _this2.state.height,
|
|
156
|
+
zIndex: _this2.props.zIndex,
|
|
157
|
+
marginBottom: _this2.state.isShown ? 0 : -_this2.state.height
|
|
158
|
+
}
|
|
159
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
160
|
+
ref: _this2.onRef,
|
|
161
|
+
style: {
|
|
162
|
+
padding: 8
|
|
163
|
+
}
|
|
164
|
+
}, /*#__PURE__*/_react.default.createElement(_alert.default, {
|
|
165
|
+
intent: _this2.props.intent,
|
|
166
|
+
title: _this2.props.title,
|
|
167
|
+
children: _this2.props.children || '',
|
|
168
|
+
isRemoveable: _this2.props.hasCloseButton,
|
|
169
|
+
onRemove: function onRemove() {
|
|
170
|
+
return _this2.close();
|
|
171
|
+
}
|
|
172
|
+
})));
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
return Toast;
|
|
177
|
+
}(_react.default.PureComponent);
|
|
178
|
+
|
|
179
|
+
exports.default = Toast;
|
|
180
|
+
(0, _defineProperty2.default)(Toast, "propTypes", {
|
|
181
|
+
/**
|
|
182
|
+
* The z-index of the toast.
|
|
183
|
+
*/
|
|
184
|
+
zIndex: _propTypes.default.number,
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Duration of the toast.
|
|
188
|
+
*/
|
|
189
|
+
duration: _propTypes.default.number,
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Function called when the toast is all the way closed.
|
|
193
|
+
*/
|
|
194
|
+
onRemove: _propTypes.default.func,
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* The type of the alert.
|
|
198
|
+
*/
|
|
199
|
+
intent: _propTypes.default.oneOf(['none', 'success', 'warning', 'danger']).isRequired,
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The title of the alert.
|
|
203
|
+
*/
|
|
204
|
+
title: _propTypes.default.node,
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Description of the alert.
|
|
208
|
+
*/
|
|
209
|
+
children: _propTypes.default.node,
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* When true, show a close icon button inside of the toast.
|
|
213
|
+
*/
|
|
214
|
+
hasCloseButton: _propTypes.default.bool,
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* When false, will close the Toast and call onRemove when finished.
|
|
218
|
+
*/
|
|
219
|
+
isShown: _propTypes.default.bool
|
|
220
|
+
});
|
|
221
|
+
(0, _defineProperty2.default)(Toast, "defaultProps", {
|
|
222
|
+
intent: 'none'
|
|
223
|
+
});
|