@seafile/sea-email-editor 0.0.1
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/README.md +1 -0
- package/dist/assets/icons/align-center.svg +1 -0
- package/dist/assets/icons/align-left.svg +1 -0
- package/dist/assets/icons/align-right.svg +1 -0
- package/dist/assets/icons/arrow-down.svg +1 -0
- package/dist/assets/icons/arrow-right.svg +1 -0
- package/dist/assets/icons/arrow-up.svg +1 -0
- package/dist/assets/icons/bold.svg +1 -0
- package/dist/assets/icons/callout-color.svg +1 -0
- package/dist/assets/icons/check-mark-option.svg +3 -0
- package/dist/assets/icons/check-square.svg +1 -0
- package/dist/assets/icons/clear-format.svg +1 -0
- package/dist/assets/icons/close.svg +3 -0
- package/dist/assets/icons/code-block.svg +1 -0
- package/dist/assets/icons/image.svg +1 -0
- package/dist/assets/icons/inline-code.svg +1 -0
- package/dist/assets/icons/insert.svg +1 -0
- package/dist/assets/icons/italic.svg +1 -0
- package/dist/assets/icons/link.svg +1 -0
- package/dist/assets/icons/more.svg +1 -0
- package/dist/assets/icons/ol.svg +1 -0
- package/dist/assets/icons/quote.svg +1 -0
- package/dist/assets/icons/rename.svg +4 -0
- package/dist/assets/icons/strikethrough.svg +1 -0
- package/dist/assets/icons/table.svg +1 -0
- package/dist/assets/icons/ul.svg +1 -0
- package/dist/assets/icons/underline.svg +1 -0
- package/dist/assets/icons/unlink.svg +1 -0
- package/dist/components/browser-tip/index.css +18 -0
- package/dist/components/browser-tip/index.js +28 -0
- package/dist/components/centered-loading.js +23 -0
- package/dist/components/icon/index.css +7 -0
- package/dist/components/icon/index.js +30 -0
- package/dist/components/icon-button/index.css +33 -0
- package/dist/components/icon-button/index.js +71 -0
- package/dist/components/index.js +92 -0
- package/dist/components/loading/index.css +54 -0
- package/dist/components/loading/index.js +15 -0
- package/dist/components/modal/index.css +0 -0
- package/dist/components/modal/index.js +27 -0
- package/dist/components/modal-header/index.css +22 -0
- package/dist/components/modal-header/index.js +36 -0
- package/dist/components/option/index.css +20 -0
- package/dist/components/option/index.js +39 -0
- package/dist/components/options-editor/container/index.css +49 -0
- package/dist/components/options-editor/container/index.js +122 -0
- package/dist/components/options-editor/index.css +26 -0
- package/dist/components/options-editor/index.js +70 -0
- package/dist/components/options-editor/options/index.css +5 -0
- package/dist/components/options-editor/options/index.js +138 -0
- package/dist/components/options-editor/options/option/index.css +54 -0
- package/dist/components/options-editor/options/option/index.js +138 -0
- package/dist/components/popover/index.js +85 -0
- package/dist/components/popover/utils.js +76 -0
- package/dist/components/search-input/index.css +52 -0
- package/dist/components/search-input/index.js +148 -0
- package/dist/components/selector-display/index.css +86 -0
- package/dist/components/selector-display/index.js +66 -0
- package/dist/components/toolbar/index.js +20 -0
- package/dist/components/toolbar/toolbar-group/index.css +13 -0
- package/dist/components/toolbar/toolbar-group/index.js +22 -0
- package/dist/components/toolbar/toolbar-item/index.css +3 -0
- package/dist/components/toolbar/toolbar-item/index.js +53 -0
- package/dist/components/tooltip/index.css +68 -0
- package/dist/components/tooltip/index.js +46 -0
- package/dist/components/tooltip/shortcut-key/index.css +7 -0
- package/dist/components/tooltip/shortcut-key/index.js +20 -0
- package/dist/constants/event-types.js +25 -0
- package/dist/constants/index.js +40 -0
- package/dist/constants/key-codes.js +104 -0
- package/dist/editor/index.css +44 -0
- package/dist/editor/index.js +50 -0
- package/dist/editor/main/index.css +19 -0
- package/dist/editor/main/index.js +166 -0
- package/dist/editor/with-props-editor.js +20 -0
- package/dist/extension/commons/dropdown-menu-item/index.css +52 -0
- package/dist/extension/commons/dropdown-menu-item/index.js +62 -0
- package/dist/extension/commons/index.js +5 -0
- package/dist/extension/commons/insert-element-dialog/index.js +91 -0
- package/dist/extension/commons/menu/index.js +3 -0
- package/dist/extension/commons/menu/menu-drop-down.js +98 -0
- package/dist/extension/commons/menu-shortcut-indicator/index.js +24 -0
- package/dist/extension/commons/menu-shortcut-indicator/style.css +18 -0
- package/dist/extension/constants/element-default-style.js +78 -0
- package/dist/extension/constants/element-types.js +33 -0
- package/dist/extension/constants/index.js +63 -0
- package/dist/extension/constants/keyboard.js +33 -0
- package/dist/extension/constants/menus-config.js +142 -0
- package/dist/extension/core/index.js +38 -0
- package/dist/extension/core/queries/index.js +507 -0
- package/dist/extension/core/transforms/focus-editor.js +18 -0
- package/dist/extension/core/transforms/index.js +49 -0
- package/dist/extension/core/transforms/move-children.js +35 -0
- package/dist/extension/core/transforms/remove-node-children.js +19 -0
- package/dist/extension/core/transforms/replace-node-children.js +24 -0
- package/dist/extension/core/utils/index.js +120 -0
- package/dist/extension/event-transfer/get-event-transfer.js +38 -0
- package/dist/extension/event-transfer/set-event-transfer.js +36 -0
- package/dist/extension/highlight/index.js +20 -0
- package/dist/extension/highlight/normalize-tokens.js +94 -0
- package/dist/extension/highlight/prismjs.js +27 -0
- package/dist/extension/highlight/set-node-decorations.js +81 -0
- package/dist/extension/highlight/use-highlight.js +20 -0
- package/dist/extension/index.js +67 -0
- package/dist/extension/plugins/blockquote/helpers.js +68 -0
- package/dist/extension/plugins/blockquote/index.js +18 -0
- package/dist/extension/plugins/blockquote/menu/index.js +35 -0
- package/dist/extension/plugins/blockquote/plugin.js +154 -0
- package/dist/extension/plugins/blockquote/render-elem.js +29 -0
- package/dist/extension/plugins/check-list/helper.js +34 -0
- package/dist/extension/plugins/check-list/index.js +19 -0
- package/dist/extension/plugins/check-list/menu/index.js +39 -0
- package/dist/extension/plugins/check-list/plugin.js +92 -0
- package/dist/extension/plugins/check-list/render-elem.js +61 -0
- package/dist/extension/plugins/clear-format/helpers.js +51 -0
- package/dist/extension/plugins/clear-format/menu/index.js +35 -0
- package/dist/extension/plugins/code-block/helpers.js +140 -0
- package/dist/extension/plugins/code-block/index.js +20 -0
- package/dist/extension/plugins/code-block/menu/index.js +59 -0
- package/dist/extension/plugins/code-block/plugin.js +288 -0
- package/dist/extension/plugins/code-block/render-elem/constant.js +22 -0
- package/dist/extension/plugins/code-block/render-elem/index.js +89 -0
- package/dist/extension/plugins/code-block/render-elem/language-selector/index.css +18 -0
- package/dist/extension/plugins/code-block/render-elem/language-selector/index.js +38 -0
- package/dist/extension/plugins/formula/formula.css +22 -0
- package/dist/extension/plugins/formula/helper.js +80 -0
- package/dist/extension/plugins/formula/index.js +19 -0
- package/dist/extension/plugins/formula/menu/formula-modal.js +98 -0
- package/dist/extension/plugins/formula/menu/index.js +35 -0
- package/dist/extension/plugins/formula/plugin.js +22 -0
- package/dist/extension/plugins/formula/render-elem.js +64 -0
- package/dist/extension/plugins/header/helper.js +55 -0
- package/dist/extension/plugins/header/index.js +19 -0
- package/dist/extension/plugins/header/menu/index.js +72 -0
- package/dist/extension/plugins/header/plugin.js +155 -0
- package/dist/extension/plugins/header/render-elem.js +39 -0
- package/dist/extension/plugins/html/index.js +13 -0
- package/dist/extension/plugins/html/plugin.js +69 -0
- package/dist/extension/plugins/image/helper.js +131 -0
- package/dist/extension/plugins/image/index.js +19 -0
- package/dist/extension/plugins/image/menu/image-menu-dialog.js +92 -0
- package/dist/extension/plugins/image/menu/index.css +3 -0
- package/dist/extension/plugins/image/menu/index.js +103 -0
- package/dist/extension/plugins/image/plugin.js +56 -0
- package/dist/extension/plugins/image/render-element/image-previewer.js +89 -0
- package/dist/extension/plugins/image/render-element/index.js +141 -0
- package/dist/extension/plugins/image/render-element/style.css +68 -0
- package/dist/extension/plugins/index.js +116 -0
- package/dist/extension/plugins/link/helper.js +258 -0
- package/dist/extension/plugins/link/index.js +19 -0
- package/dist/extension/plugins/link/menu/index.js +92 -0
- package/dist/extension/plugins/link/menu/link-modal.js +169 -0
- package/dist/extension/plugins/link/plugin.js +172 -0
- package/dist/extension/plugins/link/render-elem/index.css +12 -0
- package/dist/extension/plugins/link/render-elem/index.js +103 -0
- package/dist/extension/plugins/link/render-elem/link-op-menu/index.css +33 -0
- package/dist/extension/plugins/link/render-elem/link-op-menu/index.js +89 -0
- package/dist/extension/plugins/list/constant.js +8 -0
- package/dist/extension/plugins/list/helpers.js +102 -0
- package/dist/extension/plugins/list/index.js +19 -0
- package/dist/extension/plugins/list/menu/index.js +41 -0
- package/dist/extension/plugins/list/plugin/index.js +80 -0
- package/dist/extension/plugins/list/plugin/insert-break-list.js +29 -0
- package/dist/extension/plugins/list/plugin/insert-fragment-list.js +179 -0
- package/dist/extension/plugins/list/plugin/normalize-list.js +79 -0
- package/dist/extension/plugins/list/plugin/on-tab-handle.js +63 -0
- package/dist/extension/plugins/list/plugin/shortcut.js +69 -0
- package/dist/extension/plugins/list/queries/index.js +52 -0
- package/dist/extension/plugins/list/render-elem/index.js +68 -0
- package/dist/extension/plugins/list/transforms/index.js +75 -0
- package/dist/extension/plugins/list/transforms/insert-list-item.js +98 -0
- package/dist/extension/plugins/list/transforms/move-list-item-down.js +50 -0
- package/dist/extension/plugins/list/transforms/move-list-item-up.js +124 -0
- package/dist/extension/plugins/list/transforms/move-list-items-to-list.js +63 -0
- package/dist/extension/plugins/list/transforms/move-list-items.js +73 -0
- package/dist/extension/plugins/list/transforms/normalize-list-item.js +110 -0
- package/dist/extension/plugins/list/transforms/normalize-nested-list.js +38 -0
- package/dist/extension/plugins/list/transforms/remove-first-list-item.js +24 -0
- package/dist/extension/plugins/list/transforms/transforms-to-list.js +131 -0
- package/dist/extension/plugins/list/transforms/unwrap-list.js +48 -0
- package/dist/extension/plugins/markdown/index.js +12 -0
- package/dist/extension/plugins/markdown/plugin.js +257 -0
- package/dist/extension/plugins/node-id/constants.js +24 -0
- package/dist/extension/plugins/node-id/helpers.js +78 -0
- package/dist/extension/plugins/node-id/index.js +12 -0
- package/dist/extension/plugins/node-id/with-node-id.js +37 -0
- package/dist/extension/plugins/p/helper.js +17 -0
- package/dist/extension/plugins/p/index.js +17 -0
- package/dist/extension/plugins/p/plugin.js +141 -0
- package/dist/extension/plugins/p/render-elem.js +29 -0
- package/dist/extension/plugins/paragraph/helper.js +17 -0
- package/dist/extension/plugins/paragraph/index.js +17 -0
- package/dist/extension/plugins/paragraph/plugin.js +141 -0
- package/dist/extension/plugins/paragraph/render-elem.js +29 -0
- package/dist/extension/plugins/table/constant.js +24 -0
- package/dist/extension/plugins/table/context-menu/horizontal-align-popover/index.css +3 -0
- package/dist/extension/plugins/table/context-menu/horizontal-align-popover/index.js +64 -0
- package/dist/extension/plugins/table/context-menu/index.css +13 -0
- package/dist/extension/plugins/table/context-menu/index.js +152 -0
- package/dist/extension/plugins/table/context-menu/insert-table-element/index.css +27 -0
- package/dist/extension/plugins/table/context-menu/insert-table-element/index.js +113 -0
- package/dist/extension/plugins/table/helper.js +333 -0
- package/dist/extension/plugins/table/index.js +21 -0
- package/dist/extension/plugins/table/menu/index.js +61 -0
- package/dist/extension/plugins/table/menu/table-operator.js +97 -0
- package/dist/extension/plugins/table/menu/table-size-selector/index.css +27 -0
- package/dist/extension/plugins/table/menu/table-size-selector/index.js +98 -0
- package/dist/extension/plugins/table/model.js +102 -0
- package/dist/extension/plugins/table/plugin.js +351 -0
- package/dist/extension/plugins/table/render-elem/index.css +64 -0
- package/dist/extension/plugins/table/render-elem/index.js +252 -0
- package/dist/extension/plugins/table/table-operations.js +323 -0
- package/dist/extension/plugins/text-style/helpers.js +57 -0
- package/dist/extension/plugins/text-style/index.js +17 -0
- package/dist/extension/plugins/text-style/menu/index.js +37 -0
- package/dist/extension/plugins/text-style/plugin.js +38 -0
- package/dist/extension/plugins/text-style/render-elem.js +63 -0
- package/dist/extension/render/render-element.js +115 -0
- package/dist/extension/render/render-leaf.js +22 -0
- package/dist/extension/toolbar/index.css +16 -0
- package/dist/extension/toolbar/index.js +89 -0
- package/dist/extension/toolbar/insert-toolbar.js +78 -0
- package/dist/hooks/use-attachments.js +38 -0
- package/dist/hooks/use-container-style.js +50 -0
- package/dist/hooks/use-mathjax.js +46 -0
- package/dist/hooks/use-scroll-context.js +20 -0
- package/dist/hooks/use-selection-update.js +20 -0
- package/dist/hooks/user-link-click.js +52 -0
- package/dist/index.js +9 -0
- package/dist/intl/ReactIntlUniversal.js +310 -0
- package/dist/intl/constants.js +21 -0
- package/dist/intl/index.js +33 -0
- package/dist/locale/index.js +11 -0
- package/dist/locale/lang/en.json +83 -0
- package/dist/slate-convert/html-to-slate/constants.js +146 -0
- package/dist/slate-convert/html-to-slate/helper.js +106 -0
- package/dist/slate-convert/html-to-slate/index.js +138 -0
- package/dist/slate-convert/html-to-slate/rules/blockquote.js +26 -0
- package/dist/slate-convert/html-to-slate/rules/br.js +29 -0
- package/dist/slate-convert/html-to-slate/rules/check-list.js +29 -0
- package/dist/slate-convert/html-to-slate/rules/code-block.js +95 -0
- package/dist/slate-convert/html-to-slate/rules/header.js +26 -0
- package/dist/slate-convert/html-to-slate/rules/image.js +31 -0
- package/dist/slate-convert/html-to-slate/rules/index.js +20 -0
- package/dist/slate-convert/html-to-slate/rules/link.js +31 -0
- package/dist/slate-convert/html-to-slate/rules/list.js +74 -0
- package/dist/slate-convert/html-to-slate/rules/p.js +37 -0
- package/dist/slate-convert/html-to-slate/rules/paragraph.js +37 -0
- package/dist/slate-convert/html-to-slate/rules/table.js +64 -0
- package/dist/slate-convert/html-to-slate/rules/text.js +71 -0
- package/dist/slate-convert/index.js +20 -0
- package/dist/slate-convert/slate-to-html/index.js +143 -0
- package/dist/utils/common.js +46 -0
- package/dist/utils/deserialize-html.js +219 -0
- package/dist/utils/dom-utils.js +57 -0
- package/dist/utils/dom.js +133 -0
- package/dist/utils/event-bus.js +40 -0
- package/dist/utils/event-handler.js +44 -0
- package/dist/utils/get-browser-Info.js +35 -0
- package/dist/utils/hotkey.js +45 -0
- package/dist/utils/is-punctuation-mark.js +50 -0
- package/dist/utils/object-utils.js +56 -0
- package/dist/utils/search.js +20 -0
- package/dist/utils/translate.js +18 -0
- package/dist/utils/type-detection.js +42 -0
- package/package.json +177 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
require("./index.css");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
const Option = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
option,
|
|
15
|
+
className,
|
|
16
|
+
children
|
|
17
|
+
} = _ref;
|
|
18
|
+
if (!option) return null;
|
|
19
|
+
const {
|
|
20
|
+
color,
|
|
21
|
+
text_color,
|
|
22
|
+
border_color = 'transparent',
|
|
23
|
+
name,
|
|
24
|
+
display_name
|
|
25
|
+
} = option;
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
27
|
+
style: {
|
|
28
|
+
color: text_color,
|
|
29
|
+
borderColor: border_color,
|
|
30
|
+
backgroundColor: color
|
|
31
|
+
},
|
|
32
|
+
className: (0, _classnames.default)('sea-email-ui-option', className),
|
|
33
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
34
|
+
className: "sea-email-ui-option-name",
|
|
35
|
+
children: display_name || name
|
|
36
|
+
}), children]
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var _default = exports.default = Option;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.sea-email-option-editor-popover .sea-email-option-editor-container {
|
|
2
|
+
padding: 8px 0;
|
|
3
|
+
min-height: 40px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.sea-email-option-editor-popover .sea-email-option-editor-selected-value-wrapper {
|
|
7
|
+
background-color: var(--sea-email-body-secondary-bg);
|
|
8
|
+
border-radius: 4px 4px 0 0;
|
|
9
|
+
line-height: 1;
|
|
10
|
+
max-height: 150px;
|
|
11
|
+
min-height: 28px;
|
|
12
|
+
overflow-y: auto;
|
|
13
|
+
padding: 8px 12px;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-wrap: wrap;
|
|
16
|
+
gap: 4px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.sea-email-option-editor-popover .sea-email-option-editor-search-wrapper {
|
|
20
|
+
padding: 0 12px 8px 12px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.sea-email-option-editor-container.search-enabled {
|
|
24
|
+
padding: 12px 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.sea-email-option-editor-container.search-enabled.small-size-option .sea-email-option-editor-option {
|
|
28
|
+
padding: 0 8px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.sea-email-option-editor-container.selected-value-display.search-enabled {
|
|
32
|
+
padding-top: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.sea-email-option-editor-container.search-enabled.add-search-result-enabled {
|
|
36
|
+
padding-bottom: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.sea-email-option-editor-container.selected-value-display.search-enabled .sea-email-option-editor-search-wrapper {
|
|
40
|
+
padding-top: 12px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.sea-email-option-editor-container.selected-value-display.search-enabled.small-size-option .sea-email-option-editor-search-wrapper {
|
|
44
|
+
padding-top: 8px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.sea-email-option-editor-container:not(.search-enabled) .sea-email-option-editor-content {
|
|
48
|
+
padding: 0 8px;
|
|
49
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _searchInput = _interopRequireDefault(require("../../search-input"));
|
|
12
|
+
var _search = require("@/utils/search");
|
|
13
|
+
var _constants = require("@/constants");
|
|
14
|
+
var _options = _interopRequireDefault(require("../options"));
|
|
15
|
+
var _typeDetection = require("@/utils/type-detection");
|
|
16
|
+
require("./index.css");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
const SEARCH_SIZE = 30;
|
|
19
|
+
const OptionEditorContainer = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
20
|
+
let {
|
|
21
|
+
id,
|
|
22
|
+
isMultiple = false,
|
|
23
|
+
isSearchEnabled = true,
|
|
24
|
+
checkPlacement = 'right',
|
|
25
|
+
className,
|
|
26
|
+
optionClassName,
|
|
27
|
+
placeholder,
|
|
28
|
+
value: propsValue = '',
|
|
29
|
+
options = [],
|
|
30
|
+
maxHeight = 240,
|
|
31
|
+
optionHeight = 32,
|
|
32
|
+
children,
|
|
33
|
+
onChange,
|
|
34
|
+
onToggle,
|
|
35
|
+
onPressTab
|
|
36
|
+
} = _ref;
|
|
37
|
+
const [value, setValue] = (0, _react.useState)(propsValue || (isMultiple ? [] : ''));
|
|
38
|
+
const [searchValue, setSearchValue] = (0, _react.useState)('');
|
|
39
|
+
const [displayOptions, setDisplayOptions] = (0, _react.useState)(options);
|
|
40
|
+
const onSearchValueChange = (0, _react.useCallback)(newSearchValue => {
|
|
41
|
+
if (searchValue === newSearchValue) return;
|
|
42
|
+
setSearchValue(newSearchValue);
|
|
43
|
+
}, [searchValue]);
|
|
44
|
+
const toggleOption = (0, _react.useCallback)(optionValue => {
|
|
45
|
+
if (isMultiple) {
|
|
46
|
+
let newValue = Array.isArray(value) ? value.slice(0) : [];
|
|
47
|
+
const optionIndex = newValue.findIndex(v => v === optionValue);
|
|
48
|
+
if (optionIndex === -1) {
|
|
49
|
+
newValue.push(optionValue);
|
|
50
|
+
} else {
|
|
51
|
+
newValue.splice(optionIndex, 1);
|
|
52
|
+
}
|
|
53
|
+
setValue(newValue);
|
|
54
|
+
onChange && onChange(newValue);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const newValue = optionValue === value ? '' : optionValue;
|
|
58
|
+
setValue(newValue);
|
|
59
|
+
onChange && onChange(newValue);
|
|
60
|
+
onToggle && onToggle();
|
|
61
|
+
}, [isMultiple, value, onChange, onToggle]);
|
|
62
|
+
const onKeyDown = (0, _react.useCallback)(event => {
|
|
63
|
+
if (event.keyCode === _constants.KeyCodes.ChineseInputMethod || event.keyCode === _constants.KeyCodes.LeftArrow || event.keyCode === _constants.KeyCodes.RightArrow) {
|
|
64
|
+
event.stopPropagation();
|
|
65
|
+
}
|
|
66
|
+
}, []);
|
|
67
|
+
(0, _react.useEffect)(() => {
|
|
68
|
+
setDisplayOptions((0, _search.searchOptions)(options, searchValue));
|
|
69
|
+
}, [searchValue, options]);
|
|
70
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
71
|
+
getValue: () => {
|
|
72
|
+
return value;
|
|
73
|
+
},
|
|
74
|
+
setValue: value => {
|
|
75
|
+
setValue(value);
|
|
76
|
+
}
|
|
77
|
+
}), [value]);
|
|
78
|
+
let validMaxHeight = maxHeight - (isSearchEnabled ? 26 : 18); // 26: padding-top(12/8) + padding-bottom(12/8) + border(2)
|
|
79
|
+
if (displayOptions.length > 0) {
|
|
80
|
+
validMaxHeight = Math.min(validMaxHeight, displayOptions.length * ((0, _typeDetection.isNumber)(optionHeight) ? optionHeight : 32));
|
|
81
|
+
}
|
|
82
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
83
|
+
id: id,
|
|
84
|
+
className: (0, _classnames.default)('sea-email-option-editor-container', className, {
|
|
85
|
+
'search-enabled': isSearchEnabled,
|
|
86
|
+
'selected-value-display': children,
|
|
87
|
+
'small-size-option': SEARCH_SIZE <= 30
|
|
88
|
+
}),
|
|
89
|
+
children: [children && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
90
|
+
className: "sea-email-option-editor-selected-value-wrapper",
|
|
91
|
+
children: typeof children === 'function' ? children({
|
|
92
|
+
value,
|
|
93
|
+
onChange: toggleOption
|
|
94
|
+
}) : children
|
|
95
|
+
}), isSearchEnabled && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
96
|
+
className: "sea-email-option-editor-search-wrapper",
|
|
97
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_searchInput.default, {
|
|
98
|
+
isShowSearchIcon: false,
|
|
99
|
+
autoFocus: true,
|
|
100
|
+
value: searchValue,
|
|
101
|
+
size: SEARCH_SIZE,
|
|
102
|
+
placeholder: placeholder,
|
|
103
|
+
onKeyDown: onKeyDown,
|
|
104
|
+
onChange: onSearchValueChange
|
|
105
|
+
})
|
|
106
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_options.default, {
|
|
107
|
+
hasAvailableOptions: options.length > 0,
|
|
108
|
+
options: displayOptions,
|
|
109
|
+
maxHeight: validMaxHeight,
|
|
110
|
+
isSearchEnabled: isSearchEnabled,
|
|
111
|
+
searchValue: searchValue,
|
|
112
|
+
value: value,
|
|
113
|
+
checkPlacement: checkPlacement,
|
|
114
|
+
optionHeight: optionHeight,
|
|
115
|
+
optionClassName: optionClassName,
|
|
116
|
+
onToggleOption: toggleOption,
|
|
117
|
+
onPressTab: onPressTab,
|
|
118
|
+
onToggle: onToggle
|
|
119
|
+
})]
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
var _default = exports.default = OptionEditorContainer;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.sea-email-option-editor-popover .popover {
|
|
2
|
+
left: 0;
|
|
3
|
+
min-height: auto;
|
|
4
|
+
position: absolute;
|
|
5
|
+
min-width: 100px;
|
|
6
|
+
width: fit-content;
|
|
7
|
+
max-width: 300px;
|
|
8
|
+
z-index: 9999;
|
|
9
|
+
filter: none !important;
|
|
10
|
+
background-color: #fff !important;
|
|
11
|
+
border: 1px solid var(--sea-email-border-secondary-color) !important;
|
|
12
|
+
border-radius: 8px !important;
|
|
13
|
+
box-shadow: 0 6px 14px rgba(000, 000, 000, 0.1) !important;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.sea-email-option-editor-popover .popover .popover-inner {
|
|
17
|
+
max-width: 100%;
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.sea-email-option-editor-popover .popover.bs-popover-auto[data-popper-placement^=top],
|
|
23
|
+
.sea-email-option-editor-popover .popover.bs-popover-top {
|
|
24
|
+
bottom: -4px !important;
|
|
25
|
+
margin-bottom: 0;
|
|
26
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _popover = _interopRequireDefault(require("../popover"));
|
|
12
|
+
var _container = _interopRequireDefault(require("./container"));
|
|
13
|
+
require("./index.css");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
const OptionsEditor = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
id,
|
|
18
|
+
target,
|
|
19
|
+
isMultiple = false,
|
|
20
|
+
isSearchEnabled = true,
|
|
21
|
+
sameWidthWithTarget = false,
|
|
22
|
+
checkPlacement = 'right',
|
|
23
|
+
optionClassName = '',
|
|
24
|
+
contentClassName = '',
|
|
25
|
+
placeholder,
|
|
26
|
+
placement,
|
|
27
|
+
value,
|
|
28
|
+
className,
|
|
29
|
+
options = [],
|
|
30
|
+
optionHeight,
|
|
31
|
+
modifiers,
|
|
32
|
+
onChange,
|
|
33
|
+
onToggle,
|
|
34
|
+
onCreate
|
|
35
|
+
} = _ref;
|
|
36
|
+
const containerRef = (0, _react.useRef)(null);
|
|
37
|
+
const handleClose = (0, _react.useCallback)(() => {
|
|
38
|
+
if (isMultiple) {
|
|
39
|
+
const value = containerRef.current.getValue();
|
|
40
|
+
onChange(value);
|
|
41
|
+
}
|
|
42
|
+
onToggle && onToggle();
|
|
43
|
+
}, [isMultiple, onChange, onToggle]);
|
|
44
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_popover.default, {
|
|
45
|
+
target: target,
|
|
46
|
+
className: (0, _classnames.default)('sea-email-option-editor-popover', className),
|
|
47
|
+
placement: placement,
|
|
48
|
+
modifiers: modifiers,
|
|
49
|
+
sameWidthWithTarget: sameWidthWithTarget,
|
|
50
|
+
hidePopover: handleClose,
|
|
51
|
+
hidePopoverWithEsc: handleClose,
|
|
52
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_container.default, {
|
|
53
|
+
id: id,
|
|
54
|
+
ref: containerRef,
|
|
55
|
+
isMultiple: isMultiple,
|
|
56
|
+
placeholder: placeholder,
|
|
57
|
+
isSearchEnabled: isSearchEnabled,
|
|
58
|
+
checkPlacement: checkPlacement,
|
|
59
|
+
optionClassName: optionClassName,
|
|
60
|
+
className: contentClassName,
|
|
61
|
+
value: value,
|
|
62
|
+
options: options,
|
|
63
|
+
optionHeight: optionHeight,
|
|
64
|
+
onChange: onChange,
|
|
65
|
+
onToggle: onToggle,
|
|
66
|
+
onCreate: onCreate
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
var _default = exports.default = OptionsEditor;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _typeDetection = require("@/utils/type-detection");
|
|
12
|
+
var _hotkey = require("@/utils/hotkey");
|
|
13
|
+
var _centeredLoading = _interopRequireDefault(require("../../centered-loading"));
|
|
14
|
+
var _option = _interopRequireDefault(require("./option"));
|
|
15
|
+
require("./index.css");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
const Options = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
isLoading = false,
|
|
20
|
+
options,
|
|
21
|
+
maxHeight,
|
|
22
|
+
value,
|
|
23
|
+
checkPlacement,
|
|
24
|
+
optionHeight,
|
|
25
|
+
optionClassName,
|
|
26
|
+
onToggleOption,
|
|
27
|
+
onPressTab,
|
|
28
|
+
onToggle
|
|
29
|
+
} = _ref;
|
|
30
|
+
const maxItemNum = (0, _react.useMemo)(() => (0, _typeDetection.isNumber)(optionHeight) ? Math.floor(parseInt(maxHeight) / parseInt(optionHeight)) - 1 : 30, [maxHeight, optionHeight]);
|
|
31
|
+
const optionsRef = (0, _react.useRef)(null);
|
|
32
|
+
const [highlightIndex, setHighlightIndex] = (0, _react.useState)(-1);
|
|
33
|
+
const onOptionMouseEnter = (0, _react.useCallback)(highlightIndex => {
|
|
34
|
+
setHighlightIndex(highlightIndex);
|
|
35
|
+
}, []);
|
|
36
|
+
const onOptionMouseLeave = (0, _react.useCallback)(() => {
|
|
37
|
+
setHighlightIndex(-1);
|
|
38
|
+
}, []);
|
|
39
|
+
const onEnter = (0, _react.useCallback)(event => {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
let option;
|
|
42
|
+
if (options.length === 1) {
|
|
43
|
+
option = options[0];
|
|
44
|
+
} else if (highlightIndex > -1) {
|
|
45
|
+
option = options[highlightIndex];
|
|
46
|
+
}
|
|
47
|
+
if (!option) return;
|
|
48
|
+
onToggleOption(option.value);
|
|
49
|
+
}, [options, highlightIndex, onToggleOption]);
|
|
50
|
+
const onUpArrow = (0, _react.useCallback)(event => {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
event.stopPropagation();
|
|
53
|
+
if (highlightIndex > 0) {
|
|
54
|
+
setHighlightIndex(highlightIndex - 1);
|
|
55
|
+
if (highlightIndex < options.length - maxItemNum) {
|
|
56
|
+
optionsRef.current.scrollTop -= (0, _typeDetection.isNumber)(optionHeight) ? optionHeight : 30;
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
setHighlightIndex(options.length - 1);
|
|
60
|
+
optionsRef.current.scrollTop = optionsRef.current.scrollHeight;
|
|
61
|
+
}
|
|
62
|
+
}, [optionsRef, highlightIndex, maxItemNum, options, optionHeight]);
|
|
63
|
+
const onDownArrow = (0, _react.useCallback)(event => {
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
event.stopPropagation();
|
|
66
|
+
if (highlightIndex < options.length - 1) {
|
|
67
|
+
setHighlightIndex(highlightIndex + 1);
|
|
68
|
+
if (highlightIndex >= maxItemNum) {
|
|
69
|
+
optionsRef.current.scrollTop += (0, _typeDetection.isNumber)(optionHeight) ? optionHeight : 30;
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
setHighlightIndex(0);
|
|
73
|
+
optionsRef.current.scrollTop = 0;
|
|
74
|
+
}
|
|
75
|
+
}, [optionsRef, highlightIndex, maxItemNum, options, optionHeight]);
|
|
76
|
+
const onEsc = (0, _react.useCallback)(event => {
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
event.stopPropagation();
|
|
79
|
+
onToggle && onToggle();
|
|
80
|
+
}, [onToggle]);
|
|
81
|
+
const onHotKey = (0, _react.useCallback)(event => {
|
|
82
|
+
if ((0, _hotkey.isEnter)(event)) {
|
|
83
|
+
onEnter(event);
|
|
84
|
+
} else if ((0, _hotkey.isUpArrow)(event)) {
|
|
85
|
+
onUpArrow(event);
|
|
86
|
+
} else if ((0, _hotkey.isDownArrow)(event)) {
|
|
87
|
+
onDownArrow(event);
|
|
88
|
+
} else if ((0, _hotkey.isTab)(event)) {
|
|
89
|
+
if ((0, _typeDetection.isFunction)(onPressTab)) {
|
|
90
|
+
onPressTab(event);
|
|
91
|
+
}
|
|
92
|
+
} else if ((0, _hotkey.isEsc)(event)) {
|
|
93
|
+
onEsc(event);
|
|
94
|
+
}
|
|
95
|
+
}, [onEnter, onUpArrow, onDownArrow, onPressTab, onEsc]);
|
|
96
|
+
(0, _react.useEffect)(() => {
|
|
97
|
+
document.addEventListener('keydown', onHotKey, true);
|
|
98
|
+
return () => {
|
|
99
|
+
document.removeEventListener('keydown', onHotKey, true);
|
|
100
|
+
};
|
|
101
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
102
|
+
}, [onHotKey]);
|
|
103
|
+
(0, _react.useEffect)(() => {
|
|
104
|
+
setHighlightIndex(-1);
|
|
105
|
+
}, [options]);
|
|
106
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
107
|
+
className: (0, _classnames.default)('sea-email-option-editor-content', {
|
|
108
|
+
'empty': options.length === 0
|
|
109
|
+
}),
|
|
110
|
+
style: {
|
|
111
|
+
maxHeight,
|
|
112
|
+
minHeight: (0, _typeDetection.isNumber)(optionHeight) ? optionHeight : 20
|
|
113
|
+
},
|
|
114
|
+
ref: optionsRef,
|
|
115
|
+
children: [isLoading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_centeredLoading.default, {
|
|
116
|
+
style: {
|
|
117
|
+
minHeight: '100px'
|
|
118
|
+
}
|
|
119
|
+
}), !isLoading && options.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
120
|
+
children: options.map((option, i) => {
|
|
121
|
+
const isSelected = value && Array.isArray(value) ? value.includes(option.value) : value === option.value;
|
|
122
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_option.default, {
|
|
123
|
+
className: optionClassName,
|
|
124
|
+
checkPlacement: checkPlacement,
|
|
125
|
+
highlight: highlightIndex === i,
|
|
126
|
+
isSelected: isSelected,
|
|
127
|
+
option: option,
|
|
128
|
+
height: optionHeight,
|
|
129
|
+
index: i,
|
|
130
|
+
onChange: onToggleOption,
|
|
131
|
+
onMouseEnter: onOptionMouseEnter,
|
|
132
|
+
onMouseLeave: onOptionMouseLeave
|
|
133
|
+
}, option.value);
|
|
134
|
+
})
|
|
135
|
+
})]
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
var _default = exports.default = Options;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
.sea-email-option-editor-option {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
height: 32px;
|
|
7
|
+
width: 100%;
|
|
8
|
+
padding: 0 12px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.sea-email-option-editor-option:not(.disabled):hover,
|
|
12
|
+
.sea-email-option-editor-option:not(.disabled).active {
|
|
13
|
+
background-color: var(--sea-email-option-bg-color);
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
border-radius: 4px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.sea-email-option-editor-option.disabled * {
|
|
19
|
+
color: var(--sea-email-disabled-color);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.sea-email-option-editor-option .sea-email-option-editor-option-content {
|
|
23
|
+
flex: 1;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.sea-email-option-editor-option .sea-email-option-editor-option-content .sea-email-option-editor-option-icon,
|
|
30
|
+
.sea-email-option-editor-option .sea-email-option-editor-option-content .sea-email-option-editor-option-icon .sea-email-editor-icon-svg {
|
|
31
|
+
height: 16px;
|
|
32
|
+
width: 16px;
|
|
33
|
+
flex-shrink: 0;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.sea-email-option-editor-option .sea-email-option-editor-option-check-btn,
|
|
38
|
+
.sea-email-option-editor-option .sea-email-option-editor-option-check-btn .sea-email-editor-icon-svg {
|
|
39
|
+
height: 14px;
|
|
40
|
+
width: 14px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* check check-placement left */
|
|
44
|
+
.sea-email-option-editor-option.check-placement-left {
|
|
45
|
+
justify-content: flex-start;
|
|
46
|
+
padding: 0 8px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.sea-email-option-editor-option-divider {
|
|
50
|
+
height: 1px;
|
|
51
|
+
background-color: #eee;
|
|
52
|
+
margin: 8px 0;
|
|
53
|
+
width: 100%;
|
|
54
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _iconButton = _interopRequireDefault(require("../../../icon-button"));
|
|
12
|
+
var _option = _interopRequireDefault(require("../../../option"));
|
|
13
|
+
var _typeDetection = require("@/utils/type-detection");
|
|
14
|
+
var _tooltip = _interopRequireDefault(require("../../../tooltip"));
|
|
15
|
+
require("./index.css");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
const Option = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
disabled = false,
|
|
20
|
+
className,
|
|
21
|
+
checkPlacement,
|
|
22
|
+
highlight,
|
|
23
|
+
isSelected,
|
|
24
|
+
isShowSelectedStatus = true,
|
|
25
|
+
option,
|
|
26
|
+
height,
|
|
27
|
+
index,
|
|
28
|
+
onChange,
|
|
29
|
+
onMouseEnter,
|
|
30
|
+
onMouseLeave,
|
|
31
|
+
innerRef
|
|
32
|
+
} = _ref;
|
|
33
|
+
const optionRef = (0, _react.useRef)(null);
|
|
34
|
+
const validCheckPlacement = (0, _react.useMemo)(() => checkPlacement === 'left' ? 'left' : 'right', [checkPlacement]);
|
|
35
|
+
const {
|
|
36
|
+
icon,
|
|
37
|
+
img,
|
|
38
|
+
label,
|
|
39
|
+
value,
|
|
40
|
+
tooltip,
|
|
41
|
+
tooltipPlacement = 'right',
|
|
42
|
+
id,
|
|
43
|
+
selectedIcon
|
|
44
|
+
} = option;
|
|
45
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
46
|
+
id: id,
|
|
47
|
+
className: (0, _classnames.default)('sea-email-option-editor-option', className, {
|
|
48
|
+
'active': highlight,
|
|
49
|
+
'disabled': disabled,
|
|
50
|
+
[`check-placement-${validCheckPlacement}`]: validCheckPlacement
|
|
51
|
+
}),
|
|
52
|
+
ref: innerRef || optionRef,
|
|
53
|
+
style: {
|
|
54
|
+
minHeight: height
|
|
55
|
+
},
|
|
56
|
+
onClick: event => onChange(value, event),
|
|
57
|
+
onMouseEnter: onMouseEnter ? () => onMouseEnter(index) : () => {},
|
|
58
|
+
onMouseLeave: onMouseLeave ? () => onMouseLeave(index) : () => {},
|
|
59
|
+
children: [validCheckPlacement === 'right' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
60
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
61
|
+
className: "sea-email-option-editor-option-content",
|
|
62
|
+
children: [option.icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_iconButton.default, {
|
|
63
|
+
icon: icon,
|
|
64
|
+
className: "no-hover-bg sea-email-option-editor-option-icon",
|
|
65
|
+
style: {
|
|
66
|
+
marginLeft: 0,
|
|
67
|
+
marginRight: 8
|
|
68
|
+
}
|
|
69
|
+
}), option.img && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
70
|
+
src: img,
|
|
71
|
+
alt: "",
|
|
72
|
+
className: "sea-email-option-editor-option-icon",
|
|
73
|
+
style: {
|
|
74
|
+
marginLeft: 0,
|
|
75
|
+
marginRight: 8
|
|
76
|
+
}
|
|
77
|
+
}), option.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
78
|
+
children: (0, _typeDetection.isString)(label) ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
79
|
+
className: "text-truncate",
|
|
80
|
+
title: label,
|
|
81
|
+
children: label
|
|
82
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
83
|
+
children: label
|
|
84
|
+
})
|
|
85
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_option.default, {
|
|
86
|
+
option: option
|
|
87
|
+
})]
|
|
88
|
+
}), isShowSelectedStatus && /*#__PURE__*/(0, _jsxRuntime.jsx)(_iconButton.default, {
|
|
89
|
+
icon: selectedIcon || (isSelected ? 'check-mark-option' : ''),
|
|
90
|
+
className: "sea-email-option-editor-option-check-btn no-hover-bg",
|
|
91
|
+
style: {
|
|
92
|
+
marginLeft: 12
|
|
93
|
+
}
|
|
94
|
+
})]
|
|
95
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
96
|
+
children: [isShowSelectedStatus && /*#__PURE__*/(0, _jsxRuntime.jsx)(_iconButton.default, {
|
|
97
|
+
icon: selectedIcon || (isSelected ? 'check-mark-option' : ''),
|
|
98
|
+
className: "sea-email-option-editor-option-check-btn no-hover-bg",
|
|
99
|
+
style: {
|
|
100
|
+
marginRight: 8
|
|
101
|
+
}
|
|
102
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
103
|
+
className: "sea-email-option-editor-option-content",
|
|
104
|
+
children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_iconButton.default, {
|
|
105
|
+
icon: icon,
|
|
106
|
+
className: "no-hover-bg sea-email-option-editor-option-icon",
|
|
107
|
+
style: {
|
|
108
|
+
marginLeft: 0,
|
|
109
|
+
marginRight: 8
|
|
110
|
+
}
|
|
111
|
+
}), img && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
112
|
+
src: img,
|
|
113
|
+
alt: "",
|
|
114
|
+
className: "sea-email-option-editor-option-icon",
|
|
115
|
+
style: {
|
|
116
|
+
marginLeft: 0,
|
|
117
|
+
marginRight: 8
|
|
118
|
+
}
|
|
119
|
+
}), option.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
120
|
+
children: (0, _typeDetection.isString)(label) ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
121
|
+
className: "text-truncate",
|
|
122
|
+
title: label,
|
|
123
|
+
children: label
|
|
124
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
125
|
+
children: label
|
|
126
|
+
})
|
|
127
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_option.default, {
|
|
128
|
+
option: option
|
|
129
|
+
})]
|
|
130
|
+
})]
|
|
131
|
+
}), tooltip && /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.default, {
|
|
132
|
+
placement: tooltipPlacement,
|
|
133
|
+
target: optionRef,
|
|
134
|
+
children: tooltip
|
|
135
|
+
})]
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
var _default = exports.default = Option;
|