dtable-ui-component 4.4.2 → 4.4.3-2
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/lib/AutoNumberFormatter/index.js +14 -7
- package/lib/ButtonFormatter/index.js +16 -9
- package/lib/CTimeFormatter/index.js +16 -9
- package/lib/CheckboxEditor/index.js +15 -8
- package/lib/CheckboxFormatter/index.js +15 -8
- package/lib/CollaboratorEditor/index.js +29 -21
- package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +32 -25
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +25 -18
- package/lib/CollaboratorFormatter/index.js +19 -12
- package/lib/CollaboratorItem/index.js +17 -10
- package/lib/CreatorFormatter/index.js +19 -12
- package/lib/DTableCommonAddTool/index.js +13 -6
- package/lib/DTableCustomizeCollaboratorSelect/index.js +26 -18
- package/lib/DTableCustomizeSelect/index.js +23 -15
- package/lib/DTableFiltersPopover/constants/index.js +38 -33
- package/lib/DTableFiltersPopover/index.js +38 -31
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +53 -46
- package/lib/DTableFiltersPopover/utils/index.js +128 -99
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +34 -26
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +33 -25
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +34 -26
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +34 -26
- package/lib/DTableFiltersPopover/widgets/filter-item.js +128 -120
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +21 -0
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +26 -18
- package/lib/DTableFiltersPopover/widgets/rate-item.js +15 -8
- package/lib/DTablePopover/index.js +15 -8
- package/lib/DTablePopover/utils.js +9 -2
- package/lib/DTableRadio/index.js +17 -10
- package/lib/DTableSearchInput/index.js +21 -13
- package/lib/DTableSearchInput/utils.js +9 -2
- package/lib/DTableSelect/dtable-select-label.js +13 -6
- package/lib/DTableSelect/index.js +18 -10
- package/lib/DTableSelect/utils.js +20 -10
- package/lib/DTableSwitch/index.js +14 -7
- package/lib/DateEditor/index.js +30 -22
- package/lib/DateEditor/mb-date-editor-popover/index.js +55 -47
- package/lib/DateEditor/pc-date-editor-popover.js +27 -20
- package/lib/DateFormatter/index.js +16 -9
- package/lib/Department-editor/constants.js +7 -1
- package/lib/Department-editor/department-multiple-select/index.js +32 -24
- package/lib/Department-editor/department-single-select.js +41 -33
- package/lib/Department-editor/index.js +22 -14
- package/lib/Department-editor/selected-departments/index.js +32 -25
- package/lib/Department-editor/utils.js +11 -3
- package/lib/DepartmentSingleSelectFormatter/index.js +16 -9
- package/lib/DigitalSignFormatter/index.js +23 -15
- package/lib/DigitalSignFormatter/utils.js +11 -3
- package/lib/DurationFormatter/index.js +16 -9
- package/lib/EditEditorButton/index.js +12 -5
- package/lib/EmailFormatter/index.js +14 -7
- package/lib/FieldDisplaySetting/field-item.js +21 -14
- package/lib/FieldDisplaySetting/index.js +27 -19
- package/lib/FileEditor/index.js +15 -8
- package/lib/FileEditor/pc-files-addition/index.js +1 -0
- package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +1 -0
- package/lib/FileEditor/pc-files-preview/index.js +1 -0
- package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +1 -0
- package/lib/FileFormatter/index.js +19 -11
- package/lib/FileItemFormatter/index.js +14 -6
- package/lib/FileItemFormatter/utils.js +9 -2
- package/lib/FileUploader/index.js +11 -4
- package/lib/FormulaFormatter/cell-value-validator.js +24 -18
- package/lib/FormulaFormatter/index.js +39 -32
- package/lib/FormulaFormatter/utils.js +29 -13
- package/lib/GeolocationFormatter/index.js +16 -9
- package/lib/HtmlLongTextFormatter/index.js +17 -9
- package/lib/ImageFormatter/images-lazy-load.js +16 -9
- package/lib/ImageFormatter/index.js +24 -16
- package/lib/ImageFormatter/utils.js +9 -2
- package/lib/ImagePreviewerLightbox/index.js +19 -12
- package/lib/ImagePreviewerLightbox/utils.js +11 -3
- package/lib/LastModifierFormatter/index.js +19 -12
- package/lib/LinkEditor/index.js +33 -25
- package/lib/LinkEditor/link-editor-option.js +15 -8
- package/lib/LinkEditor/mb-link-editor-popover/index.js +30 -23
- package/lib/LinkEditor/pc-link-editor-popover/index.js +24 -17
- package/lib/LinkFormatter/index.js +20 -13
- package/lib/Loading/index.js +11 -4
- package/lib/LongTextFormatter/index.js +13 -6
- package/lib/MBEditorHeader/index.js +14 -7
- package/lib/MTimeFormatter/index.js +16 -9
- package/lib/ModalPortal/index.js +12 -5
- package/lib/MultipleSelectEditor/index.js +25 -17
- package/lib/MultipleSelectFormatter/index.js +17 -10
- package/lib/NotificationPopover/index.js +24 -16
- package/lib/NumberEditor/index.js +25 -18
- package/lib/NumberFormatter/index.js +16 -9
- package/lib/RateFormatter/index.js +15 -8
- package/lib/RoleStatusEditor/index.js +22 -14
- package/lib/RowExpandEmailFormatter/index.js +17 -10
- package/lib/RowExpandFileFormatter/index.js +16 -8
- package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +27 -18
- package/lib/RowExpandFormatter/index.js +86 -78
- package/lib/RowExpandFormulaFormatter/index.js +42 -34
- package/lib/RowExpandImageFormatter/index.js +19 -10
- package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +27 -18
- package/lib/RowExpandImageFormatter/utils.js +9 -2
- package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +16 -7
- package/lib/RowExpandLinkFormatter/index.js +46 -37
- package/lib/RowExpandLinkFormatter/utils.js +17 -6
- package/lib/RowExpandLinkFormatter/value-display-utils.js +12 -5
- package/lib/RowExpandRateFormatter/index.js +15 -8
- package/lib/RowExpandUrlFormatter/index.js +21 -14
- package/lib/SelectItem/index.js +12 -4
- package/lib/SelectOptionGroup/KeyCodes.js +7 -1
- package/lib/SelectOptionGroup/index.js +28 -20
- package/lib/SelectOptionGroup/option.js +11 -4
- package/lib/SimpleLongTextFormatter/index.js +27 -20
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +7 -1
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +15 -8
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +14 -7
- package/lib/SingleSelectEditor/index.js +26 -18
- package/lib/SingleSelectFormatter/index.js +16 -9
- package/lib/TextEditor/index.js +14 -7
- package/lib/TextFormatter/index.js +14 -7
- package/lib/UrlFormatter/index.js +14 -7
- package/lib/cellFormatterFactory/index.js +11 -4
- package/lib/common/ClickOutside.js +12 -4
- package/lib/common/delete-tip.js +20 -12
- package/lib/common/modal-portal.js +13 -5
- package/lib/constants/index.js +28 -9
- package/lib/data/dtable-value.js +11 -6
- package/lib/formatterConfig/base-formatter-config.js +53 -46
- package/lib/formatterConfig/index.js +16 -9
- package/lib/hooks/common-hooks.js +11 -4
- package/lib/index.js +432 -75
- package/lib/lang/index.js +24 -13
- package/lib/locals/de.js +7 -1
- package/lib/locals/en.js +7 -1
- package/lib/locals/fr.js +7 -1
- package/lib/locals/zh-CN.js +7 -1
- package/lib/select-editor/index.js +27 -4
- package/lib/select-editor/mb-select-editor-popover/index.js +41 -33
- package/lib/select-editor/pc-select-editor-popover/index.js +26 -19
- package/lib/select-editor/select-editor-option.js +15 -8
- package/lib/toaster/alert.js +18 -11
- package/lib/toaster/index.js +10 -3
- package/lib/toaster/toast.js +16 -8
- package/lib/toaster/toastManager.js +13 -5
- package/lib/toaster/toaster.js +15 -7
- package/lib/utils/dayjs.js +11 -4
- package/lib/utils/editor-utils.js +15 -5
- package/lib/utils/event-bus.js +7 -1
- package/lib/utils/utils.js +17 -6
- package/package.json +63 -77
- package/lib/HtmlLongTextFormatter/markdown2html.js +0 -47
- package/lib/HtmlLongTextFormatter/unified/index.js +0 -400
- package/lib/HtmlLongTextFormatter/vfile/core.js +0 -155
- package/lib/HtmlLongTextFormatter/vfile/index.js +0 -40
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var path = require('path');
|
|
5
|
-
var replace = require('replace-ext');
|
|
6
|
-
var buffer = require('is-buffer');
|
|
7
|
-
var own = {}.hasOwnProperty;
|
|
8
|
-
var proto = VFile.prototype;
|
|
9
|
-
proto.toString = toString;
|
|
10
|
-
|
|
11
|
-
/* Order of setting (least specific to most), we need this because
|
|
12
|
-
* otherwise `{stem: 'a', path: '~/b.js'}` would throw, as a path
|
|
13
|
-
* is needed before a stem can be set. */
|
|
14
|
-
var order = ['history', 'path', 'basename', 'stem', 'extname', 'dirname'];
|
|
15
|
-
|
|
16
|
-
/* Construct a new file. */
|
|
17
|
-
function VFile(options) {
|
|
18
|
-
var prop;
|
|
19
|
-
var index;
|
|
20
|
-
var length;
|
|
21
|
-
if (typeof options === 'number') {
|
|
22
|
-
options = options.toString();
|
|
23
|
-
}
|
|
24
|
-
if (!options) {
|
|
25
|
-
options = {};
|
|
26
|
-
} else if (typeof options === 'string' || buffer(options)) {
|
|
27
|
-
options = {
|
|
28
|
-
contents: options
|
|
29
|
-
};
|
|
30
|
-
} else if ('message' in options && 'messages' in options) {
|
|
31
|
-
return options;
|
|
32
|
-
}
|
|
33
|
-
if (!(this instanceof VFile)) {
|
|
34
|
-
return new VFile(options);
|
|
35
|
-
}
|
|
36
|
-
this.data = {};
|
|
37
|
-
this.messages = [];
|
|
38
|
-
this.history = [];
|
|
39
|
-
this.cwd = process.cwd();
|
|
40
|
-
|
|
41
|
-
/* Set path related properties in the correct order. */
|
|
42
|
-
index = -1;
|
|
43
|
-
length = order.length;
|
|
44
|
-
while (++index < length) {
|
|
45
|
-
prop = order[index];
|
|
46
|
-
if (own.call(options, prop)) {
|
|
47
|
-
this[prop] = options[prop];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/* Set non-path related properties. */
|
|
52
|
-
for (prop in options) {
|
|
53
|
-
if (order.indexOf(prop) === -1) {
|
|
54
|
-
this[prop] = options[prop];
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* Access full path (`~/index.min.js`). */
|
|
60
|
-
Object.defineProperty(proto, 'path', {
|
|
61
|
-
get: function () {
|
|
62
|
-
return this.history[this.history.length - 1];
|
|
63
|
-
},
|
|
64
|
-
set: function (path) {
|
|
65
|
-
assertNonEmpty(path, 'path');
|
|
66
|
-
if (path !== this.path) {
|
|
67
|
-
this.history.push(path);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
/* Access parent path (`~`). */
|
|
73
|
-
Object.defineProperty(proto, 'dirname', {
|
|
74
|
-
get: function () {
|
|
75
|
-
return typeof this.path === 'string' ? path.dirname(this.path) : undefined;
|
|
76
|
-
},
|
|
77
|
-
set: function (dirname) {
|
|
78
|
-
assertPath(this.path, 'dirname');
|
|
79
|
-
this.path = path.join(dirname || '', this.basename);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
/* Access basename (`index.min.js`). */
|
|
84
|
-
Object.defineProperty(proto, 'basename', {
|
|
85
|
-
get: function () {
|
|
86
|
-
return typeof this.path === 'string' ? path.basename(this.path) : undefined;
|
|
87
|
-
},
|
|
88
|
-
set: function (basename) {
|
|
89
|
-
assertNonEmpty(basename, 'basename');
|
|
90
|
-
assertPart(basename, 'basename');
|
|
91
|
-
this.path = path.join(this.dirname || '', basename);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
/* Access extname (`.js`). */
|
|
96
|
-
Object.defineProperty(proto, 'extname', {
|
|
97
|
-
get: function () {
|
|
98
|
-
return typeof this.path === 'string' ? path.extname(this.path) : undefined;
|
|
99
|
-
},
|
|
100
|
-
set: function (extname) {
|
|
101
|
-
var ext = extname || '';
|
|
102
|
-
assertPart(ext, 'extname');
|
|
103
|
-
assertPath(this.path, 'extname');
|
|
104
|
-
if (ext) {
|
|
105
|
-
if (ext.charAt(0) !== '.') {
|
|
106
|
-
throw new Error('`extname` must start with `.`');
|
|
107
|
-
}
|
|
108
|
-
if (ext.indexOf('.', 1) !== -1) {
|
|
109
|
-
throw new Error('`extname` cannot contain multiple dots');
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
this.path = replace(this.path, ext);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
/* Access stem (`index.min`). */
|
|
117
|
-
Object.defineProperty(proto, 'stem', {
|
|
118
|
-
get: function () {
|
|
119
|
-
return typeof this.path === 'string' ? path.basename(this.path, this.extname) : undefined;
|
|
120
|
-
},
|
|
121
|
-
set: function (stem) {
|
|
122
|
-
assertNonEmpty(stem, 'stem');
|
|
123
|
-
assertPart(stem, 'stem');
|
|
124
|
-
this.path = path.join(this.dirname || '', stem + (this.extname || ''));
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
/* Get the value of the file. */
|
|
129
|
-
function toString(encoding) {
|
|
130
|
-
var value = this.contents || '';
|
|
131
|
-
return buffer(value) ? value.toString(encoding) : String(value);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/* Assert that `part` is not a path (i.e., does
|
|
135
|
-
* not contain `path.sep`). */
|
|
136
|
-
function assertPart(part, name) {
|
|
137
|
-
if (part.indexOf(path.sep) !== -1) {
|
|
138
|
-
throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`');
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/* Assert that `part` is not empty. */
|
|
143
|
-
function assertNonEmpty(part, name) {
|
|
144
|
-
if (!part) {
|
|
145
|
-
throw new Error('`' + name + '` cannot be empty');
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/* Assert `path` exists. */
|
|
150
|
-
function assertPath(path, name) {
|
|
151
|
-
if (!path) {
|
|
152
|
-
throw new Error('Setting `' + name + '` requires `path` to be set too');
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
export default VFile;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var VMessage = require('vfile-message');
|
|
2
|
-
var VFile = require('./core.js').default;
|
|
3
|
-
var proto = VFile.prototype;
|
|
4
|
-
proto.message = message;
|
|
5
|
-
proto.info = info;
|
|
6
|
-
proto.fail = fail;
|
|
7
|
-
|
|
8
|
-
/* Slight backwards compatibility. Remove in the future. */
|
|
9
|
-
proto.warn = message;
|
|
10
|
-
|
|
11
|
-
/* Create a message with `reason` at `position`.
|
|
12
|
-
* When an error is passed in as `reason`, copies the stack. */
|
|
13
|
-
function message(reason, position, origin) {
|
|
14
|
-
var filePath = this.path;
|
|
15
|
-
var message = new VMessage(reason, position, origin);
|
|
16
|
-
if (filePath) {
|
|
17
|
-
message.name = filePath + ':' + message.name;
|
|
18
|
-
message.file = filePath;
|
|
19
|
-
}
|
|
20
|
-
message.fatal = false;
|
|
21
|
-
this.messages.push(message);
|
|
22
|
-
return message;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* Fail. Creates a vmessage, associates it with the file,
|
|
26
|
-
* and throws it. */
|
|
27
|
-
function fail() {
|
|
28
|
-
var message = this.message.apply(this, arguments);
|
|
29
|
-
message.fatal = true;
|
|
30
|
-
throw message;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/* Info. Creates a vmessage, associates it with the file,
|
|
34
|
-
* and marks the fatality as null. */
|
|
35
|
-
function info() {
|
|
36
|
-
var message = this.message.apply(this, arguments);
|
|
37
|
-
message.fatal = null;
|
|
38
|
-
return message;
|
|
39
|
-
}
|
|
40
|
-
export default VFile;
|