dtable-ui-component 6.0.110 → 6.0.111-aao.18
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/ActionSheet/index.js +42 -35
- package/lib/ActivityIndicator/index.js +9 -9
- package/lib/AsyncUserSelect/index.js +3 -3
- package/lib/Badge/index.js +27 -31
- package/lib/CheckboxEditor/index.js +15 -14
- package/lib/CollaboratorEditor/index.js +16 -15
- package/lib/CollaboratorEditor/pc-editor/index.js +1 -1
- package/lib/CollapsibleSettingLayout/index.js +1 -1
- package/lib/Comment/body/comment.js +1 -1
- package/lib/Comment/body/index.js +7 -9
- package/lib/Comment/footer/index.js +1 -1
- package/lib/Comment/footer/input/index.js +5 -5
- package/lib/Comment/footer/input/participant/index.js +1 -1
- package/lib/Comment/footer/participants/participant-select/index.js +2 -2
- package/lib/Comment/utils/utilities.js +1 -1
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +8 -6
- package/lib/DTableColorPicker/index.js +13 -12
- package/lib/DTableColorPicker/utils.js +1 -1
- package/lib/DTableCommonAddTool/index.js +2 -2
- package/lib/DTableFiltersPopover/index.js +1 -1
- package/lib/DTableFiltersPopover/utils/index.js +1 -1
- package/lib/DTableFiltersPopover/widgets/filter-group.js +2 -2
- package/lib/DTableFiltersPopover/widgets/filter-item.js +1 -1
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +1 -1
- package/lib/DTableFiltersPopover/widgets/rate-item.js +5 -5
- package/lib/DTableGroupSelect/select-option-group.js +1 -1
- package/lib/DTableIcon/index.js +4 -4
- package/lib/DTableIcon/svg-icon.js +4 -4
- package/lib/DTableModalHeader/index.js +6 -8
- package/lib/DTableRadioGroup/index.js +3 -3
- package/lib/DTableSelect/dtable-select-label.js +1 -1
- package/lib/DTableSelect/utils.js +55 -36
- package/lib/DateEditor/index.js +13 -10
- package/lib/DateEditor/pc-editor.js +1 -1
- package/lib/DatePicker/utils.js +4 -4
- package/lib/DepartmentMultipleSelectEditor/index.js +3 -3
- package/lib/DepartmentSelectFilter/index.js +5 -2
- package/lib/DepartmentSingleSelectEditor/index.js +15 -14
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +2 -2
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +6 -6
- package/lib/DigitalSignEditor/index.js +15 -14
- package/lib/DigitalSignEditor/mb-editor/index.js +4 -4
- package/lib/DigitalSignEditor/pc-editor/index.js +7 -6
- package/lib/DigitalSignEditor/service.js +1 -1
- package/lib/DigitalSignEditor/signature-board/index.js +2 -2
- package/lib/DigitalSignFormatter/utils.js +1 -1
- package/lib/Drawer/index.js +3 -2
- package/lib/FieldDisplaySetting/field-item.js +1 -1
- package/lib/FieldDisplaySetting/index.js +11 -9
- package/lib/FileEditor/files-previewer/index.js +15 -14
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +2 -2
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +3 -3
- package/lib/FileEditor/index.js +15 -14
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +1 -1
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +6 -6
- package/lib/FileEditor/pc-editor/index.js +3 -3
- package/lib/FileFormatter/index.js +5 -3
- package/lib/FileItemFormatter/index.js +1 -1
- package/lib/FileUploader/index.js +1 -1
- package/lib/FormulaFormatter/index.js +15 -9
- package/lib/GeolocationEditor/index.js +23 -19
- package/lib/GeolocationEditor/map-editor-utils.js +10 -6
- package/lib/GeolocationEditor/mb-editor/index.js +27 -23
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +9 -6
- package/lib/GeolocationEditor/pc-editor/country-editor.js +2 -2
- package/lib/GeolocationEditor/pc-editor/index.js +21 -15
- package/lib/GeolocationEditor/pc-editor/location-editor.js +2 -2
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +13 -9
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +9 -6
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +24 -7
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +20 -3
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +1 -1
- package/lib/GeolocationEditor/pc-editor/province-editor.js +2 -2
- package/lib/GeolocationEditor/pc-editor/selector-list.js +1 -1
- package/lib/HtmlLongTextFormatter/index.js +1 -1
- package/lib/Icon/index.js +13 -17
- package/lib/Icon/load-sprite.js +13 -2
- package/lib/IconButton/index.js +11 -14
- package/lib/ImageEditor/images-previewer/image-preview/index.js +1 -1
- package/lib/ImageEditor/index.js +15 -14
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +2 -2
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +5 -5
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +1 -1
- package/lib/ImageFormatter/index.js +1 -1
- package/lib/ImagePreviewerLightbox/index.js +21 -17
- package/lib/ImageThumbnail/index.js +2 -2
- package/lib/InputItem/custom-input.js +9 -9
- package/lib/InputItem/custom-keyboard.js +34 -37
- package/lib/InputItem/index.js +52 -49
- package/lib/InputItem/input.js +9 -13
- package/lib/LinkEditor/pc-popover/index.js +3 -2
- package/lib/List/index.js +17 -21
- package/lib/List/list-item.js +50 -52
- package/lib/MBEditorHeader/index.js +1 -1
- package/lib/MobileFullScreenPage/body/index.js +1 -1
- package/lib/MobileFullScreenPage/header/index.js +4 -4
- package/lib/MobileFullScreenPage/index.js +1 -1
- package/lib/MobileModal/index.js +7 -10
- package/lib/Modal/alert.js +2 -2
- package/lib/Modal/modal.js +28 -31
- package/lib/Modal/prompt.js +10 -10
- package/lib/MultipleSelectEditor/index.js +6 -8
- package/lib/MultipleSelectFormatter/index.js +1 -1
- package/lib/PhoneNumberLink/index.js +1 -1
- package/lib/Picker/AbstractPicker.js +26 -28
- package/lib/Popover/index.js +9 -12
- package/lib/Popover/item.js +22 -26
- package/lib/Progress/index.js +10 -8
- package/lib/Radio/Radio.js +13 -15
- package/lib/Radio/RadioItem.js +18 -18
- package/lib/RateFormatter/index.js +2 -2
- package/lib/RoleStatusEditor/index.js +1 -1
- package/lib/RowExpand/index.js +7 -6
- package/lib/RowExpandDialog/body/index.js +14 -14
- package/lib/RowExpandDialog/column-content/index.js +1 -1
- package/lib/RowExpandDialog/header/index.js +4 -3
- package/lib/RowExpandDialog/index.js +43 -32
- package/lib/RowExpandEditor/add-btn/index.js +7 -6
- package/lib/RowExpandEditor/checkbox-editor/index.js +7 -6
- package/lib/RowExpandEditor/collaborator-editor/index.js +7 -6
- package/lib/RowExpandEditor/date-editor/index.js +7 -6
- package/lib/RowExpandEditor/department-editor/index.js +7 -6
- package/lib/RowExpandEditor/digital-sign-editor/index.js +7 -6
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +4 -4
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +4 -4
- package/lib/RowExpandEditor/duration-editor/index.js +7 -6
- package/lib/RowExpandEditor/email-editor/index.js +7 -6
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +1 -1
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +1 -1
- package/lib/RowExpandEditor/file-editor/index.js +7 -6
- package/lib/RowExpandEditor/geolocation-editor/index.js +7 -6
- package/lib/RowExpandEditor/image-editor/index.js +7 -6
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +1 -1
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +1 -1
- package/lib/RowExpandEditor/index.js +11 -10
- package/lib/RowExpandEditor/long-text-editor/index.js +7 -6
- package/lib/RowExpandEditor/multiple-select-editor/index.js +7 -6
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +1 -1
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +5 -5
- package/lib/RowExpandEditor/number-editor/index.js +7 -6
- package/lib/RowExpandEditor/rate-editor/index.js +7 -6
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +1 -1
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +5 -5
- package/lib/RowExpandEditor/single-select-editor/index.js +7 -6
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +4 -4
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +3 -3
- package/lib/RowExpandEditor/text-editor/index.js +7 -6
- package/lib/RowExpandEditor/url-editor/index.js +7 -6
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +2 -2
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +2 -2
- package/lib/RowExpandFormatter/department-formatter/index.js +6 -3
- package/lib/RowExpandFormatter/email-formatter/index.js +1 -1
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +2 -2
- package/lib/RowExpandFormatter/formula-formatter/index.js +17 -11
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +2 -2
- package/lib/RowExpandFormatter/index.js +11 -7
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +1 -1
- package/lib/RowExpandFormatter/link-formatter/index.js +6 -6
- package/lib/RowExpandFormatter/rate-formatter/index.js +2 -2
- package/lib/RowExpandFormatter/url-formatter/index.js +2 -2
- package/lib/RowExpandView/body/index.js +13 -15
- package/lib/RowExpandView/index.js +39 -28
- package/lib/SelectOptionGroup/index.js +1 -1
- package/lib/SelectedDepartments/index.js +3 -3
- package/lib/SimpleLongTextFormatter/index.js +2 -2
- package/lib/SingleSelectEditor/index.js +6 -8
- package/lib/TabBar/Tab.js +10 -10
- package/lib/TabBar/index.js +7 -6
- package/lib/Tabs/index.js +10 -9
- package/lib/TextareaItem/index.js +43 -45
- package/lib/Toast/index.js +5 -5
- package/lib/formatterConfig/index.js +3 -3
- package/lib/select-editor/index.js +15 -14
- package/lib/select-editor/pc-editor/index.js +5 -5
- package/lib/toaster/alert.js +1 -1
- package/lib/toaster/toast.js +1 -1
- package/lib/toaster/toastManager.js +12 -14
- package/lib/toaster/toaster.js +12 -9
- package/lib/utils/class.js +3 -3
- package/lib/utils/departments.js +3 -4
- package/lib/utils/getLocale.js +11 -5
- package/lib/utils/object-utils.js +5 -4
- package/lib/utils/url.js +4 -4
- package/package.json +3 -3
package/lib/ActionSheet/index.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
10
|
var React = _interopRequireWildcard(require("react"));
|
|
12
11
|
var _client = require("react-dom/client");
|
|
@@ -24,10 +23,11 @@ const SHARE = 'SHARE';
|
|
|
24
23
|
function noop() {}
|
|
25
24
|
const queue = [];
|
|
26
25
|
function createActionSheet(flag, config, callback) {
|
|
27
|
-
const props =
|
|
26
|
+
const props = {
|
|
28
27
|
prefixCls: 'am-action-sheet',
|
|
29
|
-
cancelButtonText: '取消'
|
|
30
|
-
|
|
28
|
+
cancelButtonText: '取消',
|
|
29
|
+
...config
|
|
30
|
+
};
|
|
31
31
|
const {
|
|
32
32
|
prefixCls,
|
|
33
33
|
className,
|
|
@@ -72,10 +72,10 @@ function createActionSheet(flag, config, callback) {
|
|
|
72
72
|
badges = []
|
|
73
73
|
} = props;
|
|
74
74
|
const titleMsg = [title ? /*#__PURE__*/(0, _jsxRuntime.jsx)("h3", {
|
|
75
|
-
className:
|
|
75
|
+
className: `${prefixCls}-title`,
|
|
76
76
|
children: title
|
|
77
77
|
}, "0") : null, message ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
78
|
-
className:
|
|
78
|
+
className: `${prefixCls}-message`,
|
|
79
79
|
children: message
|
|
80
80
|
}, "1") : null];
|
|
81
81
|
let children = null;
|
|
@@ -88,54 +88,60 @@ function createActionSheet(flag, config, callback) {
|
|
|
88
88
|
if (badges && badges.length > 0) {
|
|
89
89
|
badges.forEach(element => {
|
|
90
90
|
if (element.index >= 0) {
|
|
91
|
-
badgesMap[element.index] = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge.default,
|
|
91
|
+
badgesMap[element.index] = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge.default, {
|
|
92
|
+
...element
|
|
93
|
+
});
|
|
92
94
|
}
|
|
93
95
|
});
|
|
94
96
|
}
|
|
95
|
-
children = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div",
|
|
97
|
+
children = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
98
|
+
...(0, _getDataAttr.default)(props),
|
|
96
99
|
children: [titleMsg, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
97
|
-
className:
|
|
100
|
+
className: `${prefixCls}-button-list`,
|
|
98
101
|
role: "group",
|
|
99
102
|
children: normalOptions.map((item, index) => {
|
|
100
103
|
const itemProps = {
|
|
101
|
-
className: (0, _classnames.default)(
|
|
102
|
-
[
|
|
103
|
-
[
|
|
104
|
+
className: (0, _classnames.default)(`${prefixCls}-button-list-item`, {
|
|
105
|
+
[`${prefixCls}-destructive-button`]: destructiveButtonIndex === index,
|
|
106
|
+
[`${prefixCls}-cancel-button`]: cancelButtonIndex === index
|
|
104
107
|
}),
|
|
105
108
|
onClick: () => cb(index),
|
|
106
109
|
role: 'button'
|
|
107
110
|
};
|
|
108
|
-
let bContent = /*#__PURE__*/(0, _jsxRuntime.jsx)("div",
|
|
111
|
+
let bContent = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
112
|
+
...itemProps,
|
|
109
113
|
children: item
|
|
110
|
-
})
|
|
114
|
+
});
|
|
111
115
|
// 仅在设置徽标的情况下修改dom结构
|
|
112
116
|
if (badgesMap[index]) {
|
|
113
|
-
bContent = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div",
|
|
114
|
-
|
|
117
|
+
bContent = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
118
|
+
...itemProps,
|
|
119
|
+
className: `${itemProps.className} ${prefixCls}-button-list-badge`,
|
|
115
120
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
116
|
-
className:
|
|
121
|
+
className: `${prefixCls}-button-list-item-content`,
|
|
117
122
|
children: item
|
|
118
123
|
}), badgesMap[index]]
|
|
119
|
-
})
|
|
124
|
+
});
|
|
120
125
|
}
|
|
121
126
|
let bItem = /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcFeedback.default, {
|
|
122
|
-
activeClassName:
|
|
127
|
+
activeClassName: `${prefixCls}-button-list-item-active`,
|
|
123
128
|
children: bContent
|
|
124
129
|
}, index);
|
|
125
130
|
if (cancelButtonIndex === index || destructiveButtonIndex === index) {
|
|
126
131
|
bItem = /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcFeedback.default, {
|
|
127
|
-
activeClassName:
|
|
128
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div",
|
|
132
|
+
activeClassName: `${prefixCls}-button-list-item-active`,
|
|
133
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
134
|
+
...itemProps,
|
|
129
135
|
children: [item, cancelButtonIndex === index ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
130
|
-
className:
|
|
136
|
+
className: `${prefixCls}-cancel-button-mask`
|
|
131
137
|
}) : null]
|
|
132
|
-
})
|
|
138
|
+
})
|
|
133
139
|
}, index);
|
|
134
140
|
}
|
|
135
141
|
return bItem;
|
|
136
142
|
})
|
|
137
143
|
})]
|
|
138
|
-
})
|
|
144
|
+
});
|
|
139
145
|
break;
|
|
140
146
|
case SHARE:
|
|
141
147
|
mode = 'share';
|
|
@@ -143,43 +149,44 @@ function createActionSheet(flag, config, callback) {
|
|
|
143
149
|
const createList = function (item, index) {
|
|
144
150
|
let rowIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
145
151
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
146
|
-
className:
|
|
152
|
+
className: `${prefixCls}-share-list-item`,
|
|
147
153
|
role: "button",
|
|
148
154
|
onClick: () => cb(index, rowIndex),
|
|
149
155
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
150
|
-
className:
|
|
156
|
+
className: `${prefixCls}-share-list-item-icon`,
|
|
151
157
|
children: item.icon
|
|
152
158
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
153
|
-
className:
|
|
159
|
+
className: `${prefixCls}-share-list-item-title`,
|
|
154
160
|
children: item.title
|
|
155
161
|
})]
|
|
156
162
|
}, index);
|
|
157
163
|
};
|
|
158
|
-
children = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div",
|
|
164
|
+
children = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
165
|
+
...(0, _getDataAttr.default)(props),
|
|
159
166
|
children: [titleMsg, /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
160
|
-
className:
|
|
167
|
+
className: `${prefixCls}-share`,
|
|
161
168
|
children: [multipleLine ? options.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
162
|
-
className:
|
|
169
|
+
className: `${prefixCls}-share-list`,
|
|
163
170
|
children: item.map((ii, ind) => createList(ii, ind, index))
|
|
164
171
|
}, index)) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
165
|
-
className:
|
|
172
|
+
className: `${prefixCls}-share-list`,
|
|
166
173
|
children: options.map((item, index) => createList(item, index))
|
|
167
174
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcFeedback.default, {
|
|
168
|
-
activeClassName:
|
|
175
|
+
activeClassName: `${prefixCls}-share-cancel-button-active`,
|
|
169
176
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
170
|
-
className:
|
|
177
|
+
className: `${prefixCls}-share-cancel-button`,
|
|
171
178
|
role: "button",
|
|
172
179
|
onClick: () => cb(-1),
|
|
173
180
|
children: cancelButtonText
|
|
174
181
|
})
|
|
175
182
|
})]
|
|
176
183
|
})]
|
|
177
|
-
})
|
|
184
|
+
});
|
|
178
185
|
break;
|
|
179
186
|
default:
|
|
180
187
|
break;
|
|
181
188
|
}
|
|
182
|
-
const rootCls = (0, _classnames.default)(
|
|
189
|
+
const rootCls = (0, _classnames.default)(`${prefixCls}-${mode}`, className);
|
|
183
190
|
root.render(/*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcDialog.default, {
|
|
184
191
|
visible: true,
|
|
185
192
|
title: "",
|
|
@@ -23,28 +23,28 @@ class ActivityIndicator extends React.Component {
|
|
|
23
23
|
text
|
|
24
24
|
} = this.props;
|
|
25
25
|
const wrapClass = (0, _classnames.default)(prefixCls, className, {
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
26
|
+
[`${prefixCls}-lg`]: size === 'large',
|
|
27
|
+
[`${prefixCls}-sm`]: size === 'small',
|
|
28
|
+
[`${prefixCls}-toast`]: !!toast
|
|
29
29
|
});
|
|
30
|
-
const spinnerClass = (0, _classnames.default)(
|
|
31
|
-
[
|
|
30
|
+
const spinnerClass = (0, _classnames.default)(`${prefixCls}-spinner`, {
|
|
31
|
+
[`${prefixCls}-spinner-lg`]: !!toast || size === 'large'
|
|
32
32
|
});
|
|
33
33
|
if (animating) {
|
|
34
34
|
if (toast) {
|
|
35
35
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
36
36
|
className: wrapClass,
|
|
37
37
|
children: text ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
38
|
-
className:
|
|
38
|
+
className: `${prefixCls}-content`,
|
|
39
39
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
40
40
|
className: spinnerClass,
|
|
41
41
|
"aria-hidden": "true"
|
|
42
42
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
43
|
-
className:
|
|
43
|
+
className: `${prefixCls}-toast`,
|
|
44
44
|
children: text
|
|
45
45
|
})]
|
|
46
46
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
47
|
-
className:
|
|
47
|
+
className: `${prefixCls}-content`,
|
|
48
48
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
49
49
|
className: spinnerClass,
|
|
50
50
|
"aria-label": "Loading"
|
|
@@ -58,7 +58,7 @@ class ActivityIndicator extends React.Component {
|
|
|
58
58
|
className: spinnerClass,
|
|
59
59
|
"aria-hidden": "true"
|
|
60
60
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
61
|
-
className:
|
|
61
|
+
className: `${prefixCls}-tip`,
|
|
62
62
|
children: text
|
|
63
63
|
})]
|
|
64
64
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -169,7 +169,7 @@ const AsyncUserSelect = _ref => {
|
|
|
169
169
|
bottom
|
|
170
170
|
} = userSelectContainerRef.current.getBoundingClientRect();
|
|
171
171
|
if (bottom > window.innerHeight) {
|
|
172
|
-
userSelectContainerRef.current.style.top =
|
|
172
|
+
userSelectContainerRef.current.style.top = `${window.innerHeight - bottom}px`;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
if (userListContainerRef.current && userItemContainerRef.current) {
|
|
@@ -200,7 +200,7 @@ const AsyncUserSelect = _ref => {
|
|
|
200
200
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_userItem.default, {
|
|
201
201
|
user: user,
|
|
202
202
|
deleteUser: deselectUser
|
|
203
|
-
},
|
|
203
|
+
}, `dtable-ui-user-selector-selected-user-${index}`);
|
|
204
204
|
}), selectedUsers.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
205
205
|
className: "dtable-ui-user-select-placeholder",
|
|
206
206
|
children: emptyPlaceholder || (0, _lang.getLocale)('Search_users')
|
|
@@ -239,7 +239,7 @@ const AsyncUserSelect = _ref => {
|
|
|
239
239
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_userItem.default, {
|
|
240
240
|
user: user,
|
|
241
241
|
enableShowIDInOrgWhenSearchUser: enableShowIDInOrgWhenSearchUser
|
|
242
|
-
},
|
|
242
|
+
}, `dtable-ui-user-selector-searched-user-${index}`), selectedUsers.find(u => u.email === user.email) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
243
243
|
className: "dtable-ui-collaborator-check-icon",
|
|
244
244
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
245
245
|
className: "dtable-font dtable-icon-check-mark",
|
package/lib/Badge/index.js
CHANGED
|
@@ -1,65 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
10
|
var React = _interopRequireWildcard(require("react"));
|
|
13
11
|
require("./index.css");
|
|
14
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
const _excluded = ["className", "prefixCls", "children", "text", "size", "overflowCount", "dot", "corner", "hot"];
|
|
16
13
|
class Badge extends React.Component {
|
|
17
14
|
render() {
|
|
18
15
|
// tslint:disable:prefer-const
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
restProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
16
|
+
let {
|
|
17
|
+
className,
|
|
18
|
+
prefixCls,
|
|
19
|
+
children,
|
|
20
|
+
text,
|
|
21
|
+
size,
|
|
22
|
+
overflowCount,
|
|
23
|
+
dot,
|
|
24
|
+
corner,
|
|
25
|
+
hot,
|
|
26
|
+
...restProps
|
|
27
|
+
} = this.props;
|
|
32
28
|
// eslint-disable-next-line no-self-assign
|
|
33
29
|
overflowCount = overflowCount;
|
|
34
|
-
text = typeof text === 'number' && text > overflowCount ?
|
|
30
|
+
text = typeof text === 'number' && text > overflowCount ? `${overflowCount}+` : text;
|
|
35
31
|
|
|
36
32
|
// dot mode don't need text
|
|
37
33
|
if (dot) {
|
|
38
34
|
text = '';
|
|
39
35
|
}
|
|
40
36
|
const scrollNumberCls = (0, _classnames.default)({
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
37
|
+
[`${prefixCls}-dot`]: dot,
|
|
38
|
+
[`${prefixCls}-dot-large`]: dot && size === 'large',
|
|
39
|
+
[`${prefixCls}-text`]: !dot && !corner,
|
|
40
|
+
[`${prefixCls}-corner`]: corner,
|
|
41
|
+
[`${prefixCls}-corner-large`]: corner && size === 'large'
|
|
46
42
|
});
|
|
47
43
|
const badgeCls = (0, _classnames.default)(prefixCls, className, {
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
44
|
+
[`${prefixCls}-not-a-wrapper`]: !children,
|
|
45
|
+
[`${prefixCls}-corner-wrapper`]: corner,
|
|
46
|
+
[`${prefixCls}-hot`]: !!hot,
|
|
47
|
+
[`${prefixCls}-corner-wrapper-large`]: corner && size === 'large'
|
|
52
48
|
});
|
|
53
49
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
54
50
|
className: badgeCls,
|
|
55
51
|
children: [children, (text || dot) &&
|
|
56
52
|
/*#__PURE__*/
|
|
57
53
|
// tslint:disable-next-line:jsx-no-multiline-js
|
|
58
|
-
(0, _jsxRuntime.jsx)("sup",
|
|
59
|
-
className: scrollNumberCls
|
|
60
|
-
|
|
54
|
+
(0, _jsxRuntime.jsx)("sup", {
|
|
55
|
+
className: scrollNumberCls,
|
|
56
|
+
...restProps,
|
|
61
57
|
children: text
|
|
62
|
-
})
|
|
58
|
+
})]
|
|
63
59
|
});
|
|
64
60
|
}
|
|
65
61
|
}
|
|
@@ -6,37 +6,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
10
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
13
11
|
var _pcEditor = _interopRequireDefault(require("./pc-editor"));
|
|
14
12
|
var _mbEditor = _interopRequireDefault(require("./mb-editor"));
|
|
15
13
|
require("./index.css");
|
|
16
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
const _excluded = ["isMobile"];
|
|
18
15
|
const CheckboxEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
19
16
|
let {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
17
|
+
isMobile,
|
|
18
|
+
...props
|
|
19
|
+
} = _ref;
|
|
20
|
+
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
21
|
+
...props,
|
|
24
22
|
ref: ref
|
|
25
|
-
})
|
|
26
|
-
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
23
|
+
});
|
|
24
|
+
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
25
|
+
...props,
|
|
27
26
|
ref: ref
|
|
28
|
-
})
|
|
27
|
+
});
|
|
29
28
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
30
29
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
31
30
|
query: "(min-width: 768px)",
|
|
32
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
31
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
32
|
+
...props,
|
|
33
33
|
ref: ref
|
|
34
|
-
})
|
|
34
|
+
})
|
|
35
35
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
36
36
|
query: "(max-width: 768px)",
|
|
37
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
37
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
38
|
+
...props,
|
|
38
39
|
ref: ref
|
|
39
|
-
})
|
|
40
|
+
})
|
|
40
41
|
})]
|
|
41
42
|
});
|
|
42
43
|
});
|
|
@@ -6,43 +6,44 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
10
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
13
11
|
var _pcEditor = _interopRequireDefault(require("./pc-editor"));
|
|
14
12
|
var _mbEditor = _interopRequireDefault(require("./mb-editor"));
|
|
15
13
|
require("./index.css");
|
|
16
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
const _excluded = ["isMobile", "value"];
|
|
18
15
|
const CollaboratorEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
19
16
|
let {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
isMobile,
|
|
18
|
+
value: oldValue,
|
|
19
|
+
...props
|
|
20
|
+
} = _ref;
|
|
24
21
|
const value = Array.isArray(oldValue) ? oldValue : [];
|
|
25
|
-
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
22
|
+
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
23
|
+
...props,
|
|
26
24
|
value: value,
|
|
27
25
|
ref: ref
|
|
28
|
-
})
|
|
29
|
-
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
26
|
+
});
|
|
27
|
+
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
28
|
+
...props,
|
|
30
29
|
value: value,
|
|
31
30
|
ref: ref
|
|
32
|
-
})
|
|
31
|
+
});
|
|
33
32
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
34
33
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
35
34
|
query: "(min-width: 768px)",
|
|
36
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
35
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
36
|
+
...props,
|
|
37
37
|
value: value,
|
|
38
38
|
ref: ref
|
|
39
|
-
})
|
|
39
|
+
})
|
|
40
40
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
41
41
|
query: "(max-width: 768px)",
|
|
42
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
42
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
43
|
+
...props,
|
|
43
44
|
value: value,
|
|
44
45
|
ref: ref
|
|
45
|
-
})
|
|
46
|
+
})
|
|
46
47
|
})]
|
|
47
48
|
});
|
|
48
49
|
});
|
|
@@ -176,7 +176,7 @@ class PCCollaboratorEditor extends _react.default.Component {
|
|
|
176
176
|
bottom
|
|
177
177
|
} = this.ref.getBoundingClientRect();
|
|
178
178
|
if (bottom > window.innerHeight) {
|
|
179
|
-
this.ref.style.top =
|
|
179
|
+
this.ref.style.top = `${window.innerHeight - bottom}px`;
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
if (this.container && this.collaboratorItem) {
|
|
@@ -26,7 +26,7 @@ const CollapsibleSettingLayout = props => {
|
|
|
26
26
|
className: "collapsible-setting-layout-title",
|
|
27
27
|
children: title
|
|
28
28
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
29
|
-
className:
|
|
29
|
+
className: `dtable-font dtable-icon-right${isShowSettings ? ' dtable-icon-spin' : ''}`
|
|
30
30
|
})]
|
|
31
31
|
}), isShowSettings && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
32
32
|
className: "collapsible-setting-layout-body mt-3 pl-2",
|
|
@@ -140,7 +140,7 @@ class Comment extends _react.PureComponent {
|
|
|
140
140
|
if (!this.isCommentUserExist(comment)) return null;
|
|
141
141
|
const isShowDropdownMenu = comment.author === username || !comment.resolved;
|
|
142
142
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
143
|
-
className:
|
|
143
|
+
className: `dtable-ui-comment-container ${comment.resolved ? 'dtable-ui-comment-container-resolved' : ''}`,
|
|
144
144
|
id: comment.id,
|
|
145
145
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
146
146
|
className: "dtable-ui-comment-info",
|
|
@@ -5,20 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
var _lang = require("../../lang");
|
|
12
10
|
var _comment = _interopRequireDefault(require("./comment"));
|
|
13
11
|
require("./index.css");
|
|
14
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
const _excluded = ["comments", "isFirstLoading"];
|
|
16
13
|
const Body = _ref => {
|
|
17
14
|
let {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
comments,
|
|
16
|
+
isFirstLoading,
|
|
17
|
+
...props
|
|
18
|
+
} = _ref;
|
|
22
19
|
if (comments.length === 0) {
|
|
23
20
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
24
21
|
className: "dtable-ui-comments-empty",
|
|
@@ -27,10 +24,11 @@ const Body = _ref => {
|
|
|
27
24
|
}
|
|
28
25
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
29
26
|
children: comments.map((comment, index) => {
|
|
30
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_comment.default,
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_comment.default, {
|
|
28
|
+
...props,
|
|
31
29
|
comment: comment,
|
|
32
30
|
isScrollBottom: index === comments.length - 1 && isFirstLoading
|
|
33
|
-
}
|
|
31
|
+
}, comment.id);
|
|
34
32
|
})
|
|
35
33
|
});
|
|
36
34
|
};
|
|
@@ -64,7 +64,7 @@ class Footer extends _react.default.Component {
|
|
|
64
64
|
let start = 0;
|
|
65
65
|
let newValue = '';
|
|
66
66
|
while ((match = regex.exec(value)) !== null) {
|
|
67
|
-
let notificationName =
|
|
67
|
+
let notificationName = `${match[1]}`;
|
|
68
68
|
let substr = value.substring(start, match.index);
|
|
69
69
|
start = regex.lastIndex;
|
|
70
70
|
newValue += substr + notificationName;
|
|
@@ -49,12 +49,12 @@ class Input extends _react.default.Component {
|
|
|
49
49
|
right,
|
|
50
50
|
left
|
|
51
51
|
} = this.commentRef.getBoundingClientRect();
|
|
52
|
-
this.commentPopoverRef.style.left =
|
|
53
|
-
this.commentPopoverRef.style.top =
|
|
52
|
+
this.commentPopoverRef.style.left = `${caretPosition.x + FONT_SIZE_WIDTH}px`;
|
|
53
|
+
this.commentPopoverRef.style.top = `${caretPosition.y - this.commentPopoverRef.offsetHeight}px`;
|
|
54
54
|
if (caretPosition.x + FONT_SIZE_WIDTH > right - PADDING_WIDTH) {
|
|
55
55
|
// is last code
|
|
56
|
-
this.commentPopoverRef.style.left =
|
|
57
|
-
this.commentPopoverRef.style.top =
|
|
56
|
+
this.commentPopoverRef.style.left = `${left + PADDING_WIDTH + FONT_SIZE_WIDTH}px`;
|
|
57
|
+
this.commentPopoverRef.style.top = `${caretPosition.y - this.commentPopoverRef.offsetHeight + LINE_HEIGHT}px`;
|
|
58
58
|
}
|
|
59
59
|
if (caretPosition.x + FONT_SIZE_WIDTH + this.commentPopoverRef.offsetWidth > document.body.clientWidth) {
|
|
60
60
|
this.commentPopoverRef.style.right = 0;
|
|
@@ -166,7 +166,7 @@ class Input extends _react.default.Component {
|
|
|
166
166
|
spanNode2 = document.createElement('span');
|
|
167
167
|
spanNode1.className = 'at-text';
|
|
168
168
|
spanNode1.contentEditable = 'false';
|
|
169
|
-
spanNode1.innerHTML =
|
|
169
|
+
spanNode1.innerHTML = `@${content.name}`;
|
|
170
170
|
spanNode2.innerHTML = ' ';
|
|
171
171
|
}
|
|
172
172
|
let frag = document.createDocumentFragment();
|
|
@@ -35,7 +35,7 @@ class Participant extends _react.default.Component {
|
|
|
35
35
|
} = this.props;
|
|
36
36
|
const active = index === activeIndex;
|
|
37
37
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
38
|
-
className:
|
|
38
|
+
className: `comment-participant-item ${active ? 'active' : ''}`,
|
|
39
39
|
ref: ref => this.participantItem = ref,
|
|
40
40
|
onClick: this.onSelect,
|
|
41
41
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -127,12 +127,12 @@ class ParticipantSelect extends _react.Component {
|
|
|
127
127
|
}
|
|
128
128
|
componentDidMount() {
|
|
129
129
|
let collaboratorListHeight = this.participantsRef.offsetHeight;
|
|
130
|
-
this.participantsRef.style.top =
|
|
130
|
+
this.participantsRef.style.top = `${-collaboratorListHeight + 10}px`;
|
|
131
131
|
this.registerHandlers();
|
|
132
132
|
}
|
|
133
133
|
componentDidUpdate() {
|
|
134
134
|
let collaboratorListHeight = this.participantsRef.offsetHeight;
|
|
135
|
-
this.participantsRef.style.top =
|
|
135
|
+
this.participantsRef.style.top = `${-collaboratorListHeight + 10}px`;
|
|
136
136
|
}
|
|
137
137
|
componentWillUnmount() {
|
|
138
138
|
this.unregisterHandlers();
|
|
@@ -74,7 +74,7 @@ class Utilities {
|
|
|
74
74
|
spanNode2 = document.createElement('span');
|
|
75
75
|
spanNode1.className = 'at-text';
|
|
76
76
|
spanNode1.contentEditable = 'true';
|
|
77
|
-
spanNode1.innerHTML =
|
|
77
|
+
spanNode1.innerHTML = `@${content.name}`;
|
|
78
78
|
spanNode2.innerHTML = ' ';
|
|
79
79
|
}
|
|
80
80
|
let frag = document.createDocumentFragment();
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = ColorPickerPortal;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
12
11
|
var _utils = require("../../utils/utils");
|
|
@@ -36,15 +35,18 @@ function ColorPickerPortal(_ref) {
|
|
|
36
35
|
} = targetRect;
|
|
37
36
|
const portalRectHeight = containerRef.current.clientHeight;
|
|
38
37
|
const newPosition = {
|
|
39
|
-
left:
|
|
38
|
+
left: `${left + 1}px`,
|
|
40
39
|
visibility: 'visible'
|
|
41
40
|
};
|
|
42
41
|
if (spaceAbove < portalRectHeight) {
|
|
43
|
-
newPosition.top =
|
|
42
|
+
newPosition.top = `calc(${spaceAbove}px + 2.375rem)`;
|
|
44
43
|
} else {
|
|
45
|
-
newPosition.top =
|
|
44
|
+
newPosition.top = `calc(${spaceAbove - portalRectHeight}px)`;
|
|
46
45
|
}
|
|
47
|
-
setPosition(prev => (
|
|
46
|
+
setPosition(prev => ({
|
|
47
|
+
...prev,
|
|
48
|
+
...newPosition
|
|
49
|
+
}));
|
|
48
50
|
if (!isPositioned) {
|
|
49
51
|
setIsPositioned(true);
|
|
50
52
|
}
|