@chaoswise/business 1.0.5 → 2.1.0
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/I18nInput/index.d.ts +31 -0
- package/lib/I18nInput/index.js +379 -0
- package/lib/I18nInput/index.less +7 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -4
- package/lib/locales/en_US.json +1 -1
- package/lib/locales/index.d.ts +7 -0
- package/lib/locales/index.js +28 -13
- package/lib/locales/intl.d.ts +11 -0
- package/lib/locales/intl.js +39 -24
- package/lib/locales/ja_JP.json +1 -0
- package/lib/locales/normalizeLocale.d.ts +2 -0
- package/lib/locales/normalizeLocale.js +27 -0
- package/lib/locales/withLocale.d.ts +28 -0
- package/lib/locales/withLocale.js +2 -2
- package/lib/locales/zh_CN.json +1 -1
- package/lib/locales/zh_HK.json +1 -0
- package/lib/locales/zh_TW.json +1 -1
- package/package.json +10 -5
- package/lib/AggregateSearch/CLSPL/CLQLLexer.js +0 -78
- package/lib/AggregateSearch/CLSPL/CLQLParser.js +0 -2724
- package/lib/AggregateSearch/CLSPL/CLQLParserListener.js +0 -347
- package/lib/AggregateSearch/CLSPL/CLQLParserVisitor.js +0 -251
- package/lib/AggregateSearch/CLSPL/SPLStagy.js +0 -197
- package/lib/AggregateSearch/CLSPL/index.js +0 -196
- package/lib/AggregateSearch/CLSPL/makeTokenizeFn.js +0 -18
- package/lib/AggregateSearch/CLSPL/token.js +0 -7
- package/lib/AggregateSearch/components/CloseAllIcon/index.js +0 -13
- package/lib/AggregateSearch/components/CloseAllIcon/index.less +0 -11
- package/lib/AggregateSearch/components/DropDown/assets/combined.svg +0 -22
- package/lib/AggregateSearch/components/DropDown/assets/copy.svg +0 -22
- package/lib/AggregateSearch/components/DropDown/assets/delete.svg +0 -24
- package/lib/AggregateSearch/components/DropDown/assets/home.svg +0 -20
- package/lib/AggregateSearch/components/DropDown/assets/key.svg +0 -21
- package/lib/AggregateSearch/components/DropDown/assets/star.svg +0 -22
- package/lib/AggregateSearch/components/DropDown/assets/time-circle.svg +0 -20
- package/lib/AggregateSearch/components/DropDown/assets/value.svg +0 -23
- package/lib/AggregateSearch/components/DropDown/config.js +0 -54
- package/lib/AggregateSearch/components/DropDown/index.js +0 -584
- package/lib/AggregateSearch/components/DropDown/index.less +0 -118
- package/lib/AggregateSearch/components/SwitchBtn/assets/tag-icon.svg +0 -17
- package/lib/AggregateSearch/components/SwitchBtn/assets/text-icon.svg +0 -18
- package/lib/AggregateSearch/components/SwitchBtn/index.js +0 -27
- package/lib/AggregateSearch/components/SwitchBtn/index.less +0 -31
- package/lib/AggregateSearch/hooks/useDropDown.js +0 -428
- package/lib/AggregateSearch/index.js +0 -520
- package/lib/AggregateSearch/index.less +0 -225
- package/lib/AggregateSearch/utils/index.js +0 -391
- package/lib/ContentEditableSearch/components/CloseAllIcon/index.js +0 -13
- package/lib/ContentEditableSearch/components/CloseAllIcon/index.less +0 -11
- package/lib/ContentEditableSearch/index.js +0 -157
- package/lib/ContentEditableSearch/index.less +0 -65
- package/lib/ContentEditableSearch/utils/index.js +0 -98
- package/lib/PropertyControlViewer/assets/doCommon.less +0 -75
- package/lib/PropertyControlViewer/assets/doSelect.less +0 -74
- package/lib/PropertyControlViewer/assets/index.less +0 -189
- package/lib/PropertyControlViewer/components/DoAppIcon/CustomIcon/iconfont.js +0 -1
- package/lib/PropertyControlViewer/components/DoAppIcon/CustomIcon/index.js +0 -29
- package/lib/PropertyControlViewer/components/DoAppIcon/iconData/IconJson.js +0 -0
- package/lib/PropertyControlViewer/components/DoAppIcon/index.js +0 -41
- package/lib/PropertyControlViewer/components/DoCiUnitBitmap.js +0 -50
- package/lib/PropertyControlViewer/components/DoCommon.js +0 -36
- package/lib/PropertyControlViewer/components/DoDefaultPlaceholder.js +0 -9
- package/lib/PropertyControlViewer/components/DoImage.js +0 -107
- package/lib/PropertyControlViewer/components/DoQuote/components/QuoteView.js +0 -63
- package/lib/PropertyControlViewer/components/DoQuote/components/TableQuoteView.js +0 -18
- package/lib/PropertyControlViewer/components/DoQuote/index.js +0 -16
- package/lib/PropertyControlViewer/components/DoSelect.js +0 -80
- package/lib/PropertyControlViewer/components/DoTable.js +0 -44
- package/lib/PropertyControlViewer/components/DoUser.js +0 -61
- package/lib/PropertyControlViewer/components/TagShowMoreList/index.js +0 -132
- package/lib/PropertyControlViewer/components/TagShowMoreList/index.less +0 -106
- package/lib/PropertyControlViewer/config/constants.js +0 -84
- package/lib/PropertyControlViewer/config/utils.js +0 -353
- package/lib/PropertyControlViewer/index.js +0 -195
- package/lib/PropertyControlViewer/index.less +0 -107
- package/lib/Watermark/index.js +0 -187
- package/lib/Watermark/index.less +0 -17
- package/lib/demo.js +0 -0
- package/lib/locale/en_US.js +0 -9
- package/lib/locale/index.js +0 -12
- package/lib/locale/zh_CN.js +0 -9
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import intl from '../../../locales';
|
|
2
|
-
|
|
3
|
-
// 匹配方式
|
|
4
|
-
export var DEFAULT_MATCH_OPTION_LIST = [{
|
|
5
|
-
value: ':',
|
|
6
|
-
get des() {
|
|
7
|
-
return intl.get('df7b8ec5-840a-4fc7-aa8c-806d470ec97c').d('等于');
|
|
8
|
-
}
|
|
9
|
-
}, {
|
|
10
|
-
value: 'NOT:',
|
|
11
|
-
get des() {
|
|
12
|
-
return intl.get('47e5459f-882c-4395-a8f1-d49e89b0a263').d('不等于');
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
// { value: "*", get des() { return "模糊匹配/包含" },
|
|
16
|
-
// { value: "NOT*", get des() { return "反向模糊匹配/不包含" },
|
|
17
|
-
// { value: "~", get des() { return "存在" },
|
|
18
|
-
// { value: "NOT~", get des() { return "不存在" },
|
|
19
|
-
{
|
|
20
|
-
value: '>',
|
|
21
|
-
get des() {
|
|
22
|
-
return intl.get('719234f9-de71-4fc6-ab3f-59287ff20570').d('大于');
|
|
23
|
-
}
|
|
24
|
-
}, {
|
|
25
|
-
value: '>=',
|
|
26
|
-
get des() {
|
|
27
|
-
return intl.get('e633ed68-a12e-4af5-9a7a-d2eb476f4cef').d('大于等于');
|
|
28
|
-
}
|
|
29
|
-
}, {
|
|
30
|
-
value: '<',
|
|
31
|
-
get des() {
|
|
32
|
-
return intl.get('7058c2d9-91f3-4fe6-8a38-2c145a627959').d('小于');
|
|
33
|
-
}
|
|
34
|
-
}, {
|
|
35
|
-
value: '<=',
|
|
36
|
-
get des() {
|
|
37
|
-
return intl.get('914a6df4-9561-4345-a98c-0559e3f787ff').d('小于等于');
|
|
38
|
-
}
|
|
39
|
-
}];
|
|
40
|
-
|
|
41
|
-
// 组合符号
|
|
42
|
-
export var DEFAULT_COMBINED_OPTION_LIST = [{
|
|
43
|
-
value: '()',
|
|
44
|
-
get des() {
|
|
45
|
-
return intl.get('48b09da1-28bf-497d-a327-0ad6e3ef9af1').d('括号');
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
// { value: '""', get des() { return "双引号" },
|
|
49
|
-
{
|
|
50
|
-
value: '[]',
|
|
51
|
-
get des() {
|
|
52
|
-
return intl.get('bdfe4b04-efd7-4f93-a6ba-3954aca3b0eb').d('数值区间');
|
|
53
|
-
}
|
|
54
|
-
}];
|
|
@@ -1,584 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
import _Dropdown from "@chaoswise/ui/lib/Dropdown";
|
|
3
|
-
import _Button from "@chaoswise/ui/lib/Button";
|
|
4
|
-
import _message from "@chaoswise/ui/lib/message";
|
|
5
|
-
import _Spin from "@chaoswise/ui/lib/Spin";
|
|
6
|
-
import _TooltipText from "@chaoswise/ui/lib/TooltipText";
|
|
7
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
8
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
9
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
15
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
16
|
-
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
17
|
-
import React, { useEffect, useState, useMemo, useRef, useCallback } from "react";
|
|
18
|
-
import { CopyToClipboard } from "react-copy-to-clipboard";
|
|
19
|
-
import ResizeObserver from "resize-observer-polyfill";
|
|
20
|
-
import keyIcon from "./assets/key.svg";
|
|
21
|
-
import valueIcon from "./assets/value.svg";
|
|
22
|
-
import timeCircleIcon from "./assets/time-circle.svg";
|
|
23
|
-
import copyIcon from "./assets/copy.svg";
|
|
24
|
-
import deleteIcon from "./assets/delete.svg";
|
|
25
|
-
import combinedIcon from "./assets/combined.svg";
|
|
26
|
-
import { useIntl } from "../../../locales";
|
|
27
|
-
import { debounce } from "@chaoswise/utils";
|
|
28
|
-
import { DEFAULT_MATCH_OPTION_LIST, DEFAULT_COMBINED_OPTION_LIST } from "./config";
|
|
29
|
-
import "./index.less";
|
|
30
|
-
function judgeNotEmpty(val) {
|
|
31
|
-
return val !== null && typeof val !== "undefined";
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// 搜索高亮
|
|
35
|
-
function highLight() {
|
|
36
|
-
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
37
|
-
var keyword = arguments.length > 1 ? arguments[1] : undefined;
|
|
38
|
-
var caseSensitive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
39
|
-
if (!caseSensitive) {
|
|
40
|
-
text = text.toLowerCase();
|
|
41
|
-
keyword = keyword.toLowerCase();
|
|
42
|
-
}
|
|
43
|
-
return text.split(keyword).flatMap(function (str, index) {
|
|
44
|
-
return [/*#__PURE__*/React.createElement("span", {
|
|
45
|
-
key: index,
|
|
46
|
-
style: {
|
|
47
|
-
color: "#FF4D4F"
|
|
48
|
-
}
|
|
49
|
-
}, keyword), str];
|
|
50
|
-
}).slice(1);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* 异步加载对应数据
|
|
55
|
-
* 高亮显示对应搜索关键字
|
|
56
|
-
* 选择后的回调(字符串)
|
|
57
|
-
*/
|
|
58
|
-
var DropDown = function DropDown(props) {
|
|
59
|
-
var _props$onHelpClick = props.onHelpClick,
|
|
60
|
-
onHelpClick = _props$onHelpClick === void 0 ? function () {} : _props$onHelpClick,
|
|
61
|
-
children = props.children,
|
|
62
|
-
_props$visible = props.visible,
|
|
63
|
-
visible = _props$visible === void 0 ? false : _props$visible,
|
|
64
|
-
_props$keyOption = props.keyOption,
|
|
65
|
-
keyOption = _props$keyOption === void 0 ? {
|
|
66
|
-
value: null,
|
|
67
|
-
fetchFuc: function () {
|
|
68
|
-
var _fetchFuc = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
|
|
69
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
70
|
-
while (1) switch (_context.prev = _context.next) {
|
|
71
|
-
case 0:
|
|
72
|
-
case "end":
|
|
73
|
-
return _context.stop();
|
|
74
|
-
}
|
|
75
|
-
}, _callee);
|
|
76
|
-
}));
|
|
77
|
-
function fetchFuc(_x) {
|
|
78
|
-
return _fetchFuc.apply(this, arguments);
|
|
79
|
-
}
|
|
80
|
-
return fetchFuc;
|
|
81
|
-
}(),
|
|
82
|
-
onSelect: function onSelect(value) {}
|
|
83
|
-
} : _props$keyOption,
|
|
84
|
-
_props$valueOption = props.valueOption,
|
|
85
|
-
valueOption = _props$valueOption === void 0 ? {
|
|
86
|
-
value: {
|
|
87
|
-
key: null,
|
|
88
|
-
value: null
|
|
89
|
-
},
|
|
90
|
-
fetchFuc: function () {
|
|
91
|
-
var _fetchFuc2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
92
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
93
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
94
|
-
case 0:
|
|
95
|
-
case "end":
|
|
96
|
-
return _context2.stop();
|
|
97
|
-
}
|
|
98
|
-
}, _callee2);
|
|
99
|
-
}));
|
|
100
|
-
function fetchFuc() {
|
|
101
|
-
return _fetchFuc2.apply(this, arguments);
|
|
102
|
-
}
|
|
103
|
-
return fetchFuc;
|
|
104
|
-
}(),
|
|
105
|
-
onSelect: function onSelect() {}
|
|
106
|
-
} : _props$valueOption,
|
|
107
|
-
_props$historyOption = props.historyOption,
|
|
108
|
-
historyOption = _props$historyOption === void 0 ? {
|
|
109
|
-
value: null,
|
|
110
|
-
fetchFuc: function () {
|
|
111
|
-
var _fetchFuc3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
112
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
113
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
114
|
-
case 0:
|
|
115
|
-
case "end":
|
|
116
|
-
return _context3.stop();
|
|
117
|
-
}
|
|
118
|
-
}, _callee3);
|
|
119
|
-
}));
|
|
120
|
-
function fetchFuc() {
|
|
121
|
-
return _fetchFuc3.apply(this, arguments);
|
|
122
|
-
}
|
|
123
|
-
return fetchFuc;
|
|
124
|
-
}(),
|
|
125
|
-
onSelect: function onSelect() {},
|
|
126
|
-
onCopy: function onCopy() {},
|
|
127
|
-
onDelete: function () {
|
|
128
|
-
var _onDelete = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(id) {
|
|
129
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
130
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
131
|
-
case 0:
|
|
132
|
-
case "end":
|
|
133
|
-
return _context4.stop();
|
|
134
|
-
}
|
|
135
|
-
}, _callee4);
|
|
136
|
-
}));
|
|
137
|
-
function onDelete(_x2) {
|
|
138
|
-
return _onDelete.apply(this, arguments);
|
|
139
|
-
}
|
|
140
|
-
return onDelete;
|
|
141
|
-
}()
|
|
142
|
-
} : _props$historyOption,
|
|
143
|
-
_props$matchOption = props.matchOption,
|
|
144
|
-
matchOption = _props$matchOption === void 0 ? {
|
|
145
|
-
isShow: false,
|
|
146
|
-
list: list,
|
|
147
|
-
// 内置 // : >= NOT <=
|
|
148
|
-
onSelect: function onSelect() {}
|
|
149
|
-
} : _props$matchOption,
|
|
150
|
-
_props$combinedOption = props.combinedOption,
|
|
151
|
-
combinedOption = _props$combinedOption === void 0 ? {
|
|
152
|
-
isShow: false,
|
|
153
|
-
list: list,
|
|
154
|
-
onSelect: function onSelect() {}
|
|
155
|
-
} : _props$combinedOption,
|
|
156
|
-
containerWrapperRef = props.containerWrapperRef,
|
|
157
|
-
debounceWait = props.debounceWait;
|
|
158
|
-
var intl = useIntl();
|
|
159
|
-
// 输入值
|
|
160
|
-
var keyOptionValue = keyOption.value;
|
|
161
|
-
var valueOptionValue = valueOption.value;
|
|
162
|
-
var historyOptionValue = historyOption.value;
|
|
163
|
-
var _useState = useState(false),
|
|
164
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
165
|
-
keyLoading = _useState2[0],
|
|
166
|
-
setKeyLoading = _useState2[1];
|
|
167
|
-
var _useState3 = useState(false),
|
|
168
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
169
|
-
valueLoading = _useState4[0],
|
|
170
|
-
setValueLoading = _useState4[1];
|
|
171
|
-
var _useState5 = useState(false),
|
|
172
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
173
|
-
historyLoading = _useState6[0],
|
|
174
|
-
setHistoryLoading = _useState6[1];
|
|
175
|
-
var _useState7 = useState([]),
|
|
176
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
177
|
-
keyList = _useState8[0],
|
|
178
|
-
setKeyList = _useState8[1];
|
|
179
|
-
var _useState9 = useState([]),
|
|
180
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
181
|
-
valueList = _useState10[0],
|
|
182
|
-
setValueList = _useState10[1];
|
|
183
|
-
var _useState11 = useState([]),
|
|
184
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
185
|
-
historyList = _useState12[0],
|
|
186
|
-
setHistoryList = _useState12[1];
|
|
187
|
-
var _useState13 = useState(0),
|
|
188
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
189
|
-
width = _useState14[0],
|
|
190
|
-
setWidth = _useState14[1];
|
|
191
|
-
var _useState15 = useState(0),
|
|
192
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
193
|
-
height = _useState16[0],
|
|
194
|
-
setHeight = _useState16[1];
|
|
195
|
-
var watcher = useRef(null);
|
|
196
|
-
useEffect(function () {
|
|
197
|
-
// 监听外壳容器变化
|
|
198
|
-
watcher.current = new ResizeObserver(function (entries) {
|
|
199
|
-
var _iterator = _createForOfIteratorHelper(entries),
|
|
200
|
-
_step;
|
|
201
|
-
try {
|
|
202
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
203
|
-
var entry = _step.value;
|
|
204
|
-
var target = entry.target,
|
|
205
|
-
_entry$contentRect = entry.contentRect,
|
|
206
|
-
_entry$contentRect2 = _entry$contentRect === void 0 ? {} : _entry$contentRect,
|
|
207
|
-
_width = _entry$contentRect2.width,
|
|
208
|
-
_height = _entry$contentRect2.height;
|
|
209
|
-
if (target === containerWrapperRef.current) {
|
|
210
|
-
setWidth(_width);
|
|
211
|
-
setHeight(_height);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
} catch (err) {
|
|
215
|
-
_iterator.e(err);
|
|
216
|
-
} finally {
|
|
217
|
-
_iterator.f();
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
watcher.current.observe(containerWrapperRef.current);
|
|
221
|
-
return function () {
|
|
222
|
-
if (containerWrapperRef.current) {
|
|
223
|
-
var _watcher$current;
|
|
224
|
-
(_watcher$current = watcher.current) === null || _watcher$current === void 0 || _watcher$current.unobserve(containerWrapperRef.current);
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
}, []);
|
|
228
|
-
// key
|
|
229
|
-
var fetchKey = /*#__PURE__*/function () {
|
|
230
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(keyOptionValue) {
|
|
231
|
-
var res;
|
|
232
|
-
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
233
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
234
|
-
case 0:
|
|
235
|
-
setKeyLoading(true);
|
|
236
|
-
_context5.next = 3;
|
|
237
|
-
return keyOption === null || keyOption === void 0 ? void 0 : keyOption.fetchFuc(keyOptionValue);
|
|
238
|
-
case 3:
|
|
239
|
-
_context5.t0 = _context5.sent;
|
|
240
|
-
if (_context5.t0) {
|
|
241
|
-
_context5.next = 6;
|
|
242
|
-
break;
|
|
243
|
-
}
|
|
244
|
-
_context5.t0 = [];
|
|
245
|
-
case 6:
|
|
246
|
-
res = _context5.t0;
|
|
247
|
-
setKeyList(res);
|
|
248
|
-
setKeyLoading(false);
|
|
249
|
-
case 9:
|
|
250
|
-
case "end":
|
|
251
|
-
return _context5.stop();
|
|
252
|
-
}
|
|
253
|
-
}, _callee5);
|
|
254
|
-
}));
|
|
255
|
-
return function fetchKey(_x3) {
|
|
256
|
-
return _ref.apply(this, arguments);
|
|
257
|
-
};
|
|
258
|
-
}();
|
|
259
|
-
var fetchValue = /*#__PURE__*/function () {
|
|
260
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(valueOptionValue) {
|
|
261
|
-
var res;
|
|
262
|
-
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
263
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
264
|
-
case 0:
|
|
265
|
-
setValueLoading(true);
|
|
266
|
-
_context6.next = 3;
|
|
267
|
-
return valueOption === null || valueOption === void 0 ? void 0 : valueOption.fetchFuc(valueOptionValue);
|
|
268
|
-
case 3:
|
|
269
|
-
_context6.t0 = _context6.sent;
|
|
270
|
-
if (_context6.t0) {
|
|
271
|
-
_context6.next = 6;
|
|
272
|
-
break;
|
|
273
|
-
}
|
|
274
|
-
_context6.t0 = [];
|
|
275
|
-
case 6:
|
|
276
|
-
res = _context6.t0;
|
|
277
|
-
setValueList(res);
|
|
278
|
-
setValueLoading(false);
|
|
279
|
-
case 9:
|
|
280
|
-
case "end":
|
|
281
|
-
return _context6.stop();
|
|
282
|
-
}
|
|
283
|
-
}, _callee6);
|
|
284
|
-
}));
|
|
285
|
-
return function fetchValue(_x4) {
|
|
286
|
-
return _ref2.apply(this, arguments);
|
|
287
|
-
};
|
|
288
|
-
}();
|
|
289
|
-
var fetchHistory = /*#__PURE__*/function () {
|
|
290
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(historyOptionValue) {
|
|
291
|
-
var res;
|
|
292
|
-
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
293
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
294
|
-
case 0:
|
|
295
|
-
setHistoryLoading(true);
|
|
296
|
-
_context7.next = 3;
|
|
297
|
-
return historyOption === null || historyOption === void 0 ? void 0 : historyOption.fetchFuc(historyOptionValue);
|
|
298
|
-
case 3:
|
|
299
|
-
_context7.t0 = _context7.sent;
|
|
300
|
-
if (_context7.t0) {
|
|
301
|
-
_context7.next = 6;
|
|
302
|
-
break;
|
|
303
|
-
}
|
|
304
|
-
_context7.t0 = [];
|
|
305
|
-
case 6:
|
|
306
|
-
res = _context7.t0;
|
|
307
|
-
setHistoryList(res);
|
|
308
|
-
setHistoryLoading(false);
|
|
309
|
-
case 9:
|
|
310
|
-
case "end":
|
|
311
|
-
return _context7.stop();
|
|
312
|
-
}
|
|
313
|
-
}, _callee7);
|
|
314
|
-
}));
|
|
315
|
-
return function fetchHistory(_x5) {
|
|
316
|
-
return _ref3.apply(this, arguments);
|
|
317
|
-
};
|
|
318
|
-
}();
|
|
319
|
-
var fetchKeyDebounce = useCallback(debounce(fetchKey, debounceWait), []);
|
|
320
|
-
var fetchValueDebounce = useCallback(debounce(fetchValue, debounceWait), []);
|
|
321
|
-
var fetchHistoryDebounce = useCallback(debounce(fetchHistory, debounceWait), []);
|
|
322
|
-
useEffect(function () {
|
|
323
|
-
if (visible && judgeNotEmpty(keyOptionValue)) {
|
|
324
|
-
fetchKeyDebounce(keyOptionValue);
|
|
325
|
-
}
|
|
326
|
-
}, [visible, keyOptionValue]);
|
|
327
|
-
// value
|
|
328
|
-
useEffect(function () {
|
|
329
|
-
if (visible && judgeNotEmpty(valueOptionValue)) {
|
|
330
|
-
fetchValueDebounce(valueOptionValue);
|
|
331
|
-
}
|
|
332
|
-
}, [visible, valueOptionValue]);
|
|
333
|
-
|
|
334
|
-
// history
|
|
335
|
-
useEffect(function () {
|
|
336
|
-
if (visible && judgeNotEmpty(historyOptionValue)) {
|
|
337
|
-
fetchHistoryDebounce(historyOptionValue);
|
|
338
|
-
}
|
|
339
|
-
}, [visible, historyOptionValue]);
|
|
340
|
-
|
|
341
|
-
// key
|
|
342
|
-
var keyOptionValueNotEmpty = useMemo(function () {
|
|
343
|
-
return judgeNotEmpty(keyOptionValue);
|
|
344
|
-
}, [keyOptionValue]);
|
|
345
|
-
// key列表为空
|
|
346
|
-
var dropDownKeyListEmpty = useMemo(function () {
|
|
347
|
-
return keyList.length === 0;
|
|
348
|
-
}, [keyList]);
|
|
349
|
-
|
|
350
|
-
// value
|
|
351
|
-
var valueOptionValueNotEmpty = useMemo(function () {
|
|
352
|
-
return judgeNotEmpty(valueOptionValue);
|
|
353
|
-
}, [valueOptionValue]);
|
|
354
|
-
// value列表为空
|
|
355
|
-
var dropDownValueListEmpty = useMemo(function () {
|
|
356
|
-
return valueList.length === 0;
|
|
357
|
-
}, [valueList]);
|
|
358
|
-
// history
|
|
359
|
-
var historyOptionValueNotEmpty = useMemo(function () {
|
|
360
|
-
return judgeNotEmpty(historyOptionValue);
|
|
361
|
-
}, [historyOptionValue]);
|
|
362
|
-
// 搜索历史列表为空
|
|
363
|
-
var dropDownListHistoryEmpty = useMemo(function () {
|
|
364
|
-
return historyList.length === 0;
|
|
365
|
-
}, [historyList]);
|
|
366
|
-
|
|
367
|
-
// 搜索历史列表删除
|
|
368
|
-
function historyDelete(_x6, _x7) {
|
|
369
|
-
return _historyDelete.apply(this, arguments);
|
|
370
|
-
}
|
|
371
|
-
function _historyDelete() {
|
|
372
|
-
_historyDelete = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(id, record) {
|
|
373
|
-
var success;
|
|
374
|
-
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
375
|
-
while (1) switch (_context8.prev = _context8.next) {
|
|
376
|
-
case 0:
|
|
377
|
-
_context8.next = 2;
|
|
378
|
-
return historyOption === null || historyOption === void 0 ? void 0 : historyOption.onDelete(id, record);
|
|
379
|
-
case 2:
|
|
380
|
-
success = _context8.sent;
|
|
381
|
-
if (success) {
|
|
382
|
-
setHistoryList(historyList.filter(function (item) {
|
|
383
|
-
return item.id !== id;
|
|
384
|
-
}));
|
|
385
|
-
}
|
|
386
|
-
case 4:
|
|
387
|
-
case "end":
|
|
388
|
-
return _context8.stop();
|
|
389
|
-
}
|
|
390
|
-
}, _callee8);
|
|
391
|
-
}));
|
|
392
|
-
return _historyDelete.apply(this, arguments);
|
|
393
|
-
}
|
|
394
|
-
var onPreventTooltipEvent = function onPreventTooltipEvent(e) {
|
|
395
|
-
e.stopPropagation();
|
|
396
|
-
};
|
|
397
|
-
var TooltipTextDom = function TooltipTextDom(children) {
|
|
398
|
-
return /*#__PURE__*/React.createElement(_TooltipText, {
|
|
399
|
-
title: /*#__PURE__*/React.createElement("span", {
|
|
400
|
-
onClick: onPreventTooltipEvent
|
|
401
|
-
}, children)
|
|
402
|
-
}, children);
|
|
403
|
-
};
|
|
404
|
-
var menu = /*#__PURE__*/React.createElement("div", {
|
|
405
|
-
className: "aggregate-drop-down-wrap",
|
|
406
|
-
onClick: function onClick(e) {
|
|
407
|
-
var _e$nativeEvent, _e$nativeEvent$stopIm;
|
|
408
|
-
e.stopPropagation();
|
|
409
|
-
e === null || e === void 0 || (_e$nativeEvent = e.nativeEvent) === null || _e$nativeEvent === void 0 || (_e$nativeEvent$stopIm = _e$nativeEvent.stopImmediatePropagation) === null || _e$nativeEvent$stopIm === void 0 || _e$nativeEvent$stopIm.call(_e$nativeEvent);
|
|
410
|
-
}
|
|
411
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
412
|
-
className: "aggregate-drop-down"
|
|
413
|
-
}, keyOptionValueNotEmpty && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
414
|
-
className: "list-title"
|
|
415
|
-
}, intl.get("4412a02d-d11d-4231-bf91-fd65afd9ea77").d("标签搜索")), /*#__PURE__*/React.createElement(_Spin, {
|
|
416
|
-
spinning: keyLoading,
|
|
417
|
-
tip: intl.get("51b43939-ce6a-4a41-9038-832b8ab4a175").d("加载中..."),
|
|
418
|
-
size: "small"
|
|
419
|
-
}, !dropDownKeyListEmpty ? keyList.map(function (record, index) {
|
|
420
|
-
var value = record.value,
|
|
421
|
-
des = record.des;
|
|
422
|
-
var highLightText = highLight(value, keyOptionValue);
|
|
423
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
424
|
-
key: index,
|
|
425
|
-
className: "list",
|
|
426
|
-
onClick: function onClick() {
|
|
427
|
-
keyOption === null || keyOption === void 0 || keyOption.onSelect(value, record);
|
|
428
|
-
}
|
|
429
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
430
|
-
className: "pre-icon",
|
|
431
|
-
src: keyIcon,
|
|
432
|
-
alt: ""
|
|
433
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
434
|
-
className: "list-title-value-wrapper"
|
|
435
|
-
}, TooltipTextDom(highLightText)), /*#__PURE__*/React.createElement("span", {
|
|
436
|
-
className: "list-title-des-wrapper"
|
|
437
|
-
}, TooltipTextDom(des)));
|
|
438
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
439
|
-
className: "empty"
|
|
440
|
-
}, intl.get("1cd159c8-2a4d-4208-a170-55a34b91f671").d("暂无数据,提交搜索后搜索关键字")))), valueOptionValueNotEmpty && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
441
|
-
className: "list-title"
|
|
442
|
-
}, "Value"), /*#__PURE__*/React.createElement(_Spin, {
|
|
443
|
-
spinning: valueLoading,
|
|
444
|
-
tip: intl.get("51b43939-ce6a-4a41-9038-832b8ab4a175").d("加载中..."),
|
|
445
|
-
size: "small"
|
|
446
|
-
}, !dropDownValueListEmpty ? valueList.map(function (record, index) {
|
|
447
|
-
var value = record.value,
|
|
448
|
-
des = record.des;
|
|
449
|
-
var highLightText = highLight(value, valueOptionValue === null || valueOptionValue === void 0 ? void 0 : valueOptionValue.value);
|
|
450
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
451
|
-
key: index,
|
|
452
|
-
className: "list",
|
|
453
|
-
onClick: function onClick() {
|
|
454
|
-
valueOption === null || valueOption === void 0 || valueOption.onSelect(value, record);
|
|
455
|
-
}
|
|
456
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
457
|
-
className: "pre-icon",
|
|
458
|
-
src: valueIcon,
|
|
459
|
-
alt: ""
|
|
460
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
461
|
-
className: "list-title-value-wrapper"
|
|
462
|
-
}, TooltipTextDom(highLightText)), /*#__PURE__*/React.createElement("span", {
|
|
463
|
-
className: "list-title-des-wrapper"
|
|
464
|
-
}, TooltipTextDom(des)));
|
|
465
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
466
|
-
className: "empty"
|
|
467
|
-
}, intl.get("1cd159c8-2a4d-4208-a170-55a34b91f671").d("暂无数据,提交搜索后搜索关键字")))), matchOption.isShow && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
468
|
-
className: "list-title"
|
|
469
|
-
}, intl.get("f2447d25-e81c-4656-9e4c-f66741dd8a52").d("匹配方式")), (matchOption.list || DEFAULT_MATCH_OPTION_LIST).map(function (record, index) {
|
|
470
|
-
var value = record.value,
|
|
471
|
-
des = record.des;
|
|
472
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
473
|
-
key: index,
|
|
474
|
-
className: "list",
|
|
475
|
-
onClick: function onClick() {
|
|
476
|
-
matchOption === null || matchOption === void 0 || matchOption.onSelect(value, record);
|
|
477
|
-
}
|
|
478
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
479
|
-
className: "pre-icon",
|
|
480
|
-
src: combinedIcon,
|
|
481
|
-
alt: ""
|
|
482
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
483
|
-
className: "list-title-value-wrapper"
|
|
484
|
-
}, TooltipTextDom(value)), /*#__PURE__*/React.createElement("span", {
|
|
485
|
-
className: "list-title-des-wrapper"
|
|
486
|
-
}, TooltipTextDom(des)));
|
|
487
|
-
})), combinedOption.isShow && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
488
|
-
className: "list-title"
|
|
489
|
-
}, intl.get("2e8bd2b4-57bf-4778-a254-3b577d0241c5").d("组合符号")), (combinedOption.list || DEFAULT_COMBINED_OPTION_LIST).map(function (record, index) {
|
|
490
|
-
var value = record.value,
|
|
491
|
-
des = record.des;
|
|
492
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
493
|
-
key: index,
|
|
494
|
-
className: "list",
|
|
495
|
-
onClick: function onClick() {
|
|
496
|
-
combinedOption === null || combinedOption === void 0 || combinedOption.onSelect(value, record);
|
|
497
|
-
}
|
|
498
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
499
|
-
className: "pre-icon",
|
|
500
|
-
src: combinedIcon,
|
|
501
|
-
alt: ""
|
|
502
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
503
|
-
className: "list-title-value-wrapper"
|
|
504
|
-
}, TooltipTextDom(value)), /*#__PURE__*/React.createElement("span", {
|
|
505
|
-
className: "list-title-des-wrapper"
|
|
506
|
-
}, TooltipTextDom(des)));
|
|
507
|
-
})), historyOptionValueNotEmpty && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
508
|
-
className: "list-title"
|
|
509
|
-
}, intl.get("354fbc6d-1abb-4510-81a9-9aa2efa6f482").d("搜索历史")), /*#__PURE__*/React.createElement(_Spin, {
|
|
510
|
-
spinning: historyLoading,
|
|
511
|
-
tip: intl.get("51b43939-ce6a-4a41-9038-832b8ab4a175").d("加载中..."),
|
|
512
|
-
size: "small"
|
|
513
|
-
}, !dropDownListHistoryEmpty ? historyList.map(function (record, index) {
|
|
514
|
-
var id = record.id,
|
|
515
|
-
value = record.value,
|
|
516
|
-
des = record.des;
|
|
517
|
-
var highLightText = highLight(value, historyOptionValue, false);
|
|
518
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
519
|
-
key: index,
|
|
520
|
-
className: "list",
|
|
521
|
-
onClick: function onClick() {
|
|
522
|
-
historyOption === null || historyOption === void 0 || historyOption.onSelect(value, record);
|
|
523
|
-
}
|
|
524
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
525
|
-
className: "pre-icon",
|
|
526
|
-
src: timeCircleIcon,
|
|
527
|
-
alt: ""
|
|
528
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
529
|
-
className: "list-title-value-wrapper"
|
|
530
|
-
}, TooltipTextDom(highLightText)), /*#__PURE__*/React.createElement("span", {
|
|
531
|
-
className: "list-title-des-wrapper des"
|
|
532
|
-
}, TooltipTextDom(des)), /*#__PURE__*/React.createElement("span", {
|
|
533
|
-
className: "action"
|
|
534
|
-
}, /*#__PURE__*/React.createElement(CopyToClipboard, {
|
|
535
|
-
text: value,
|
|
536
|
-
onCopy: function onCopy(text) {
|
|
537
|
-
historyOption === null || historyOption === void 0 || historyOption.onCopy(text);
|
|
538
|
-
_message.success(intl.get("15444b85-9196-4bb6-97bd-eb5cd4186cb9").d("搜索条件已复制"));
|
|
539
|
-
}
|
|
540
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
541
|
-
onClick: function onClick(e) {
|
|
542
|
-
return e.stopPropagation();
|
|
543
|
-
},
|
|
544
|
-
className: "pre-icon",
|
|
545
|
-
src: copyIcon,
|
|
546
|
-
alt: ""
|
|
547
|
-
})), /*#__PURE__*/React.createElement("img", {
|
|
548
|
-
className: "pre-icon",
|
|
549
|
-
src: deleteIcon,
|
|
550
|
-
alt: "",
|
|
551
|
-
onClick: function onClick(e) {
|
|
552
|
-
e.stopPropagation();
|
|
553
|
-
historyDelete(id, record);
|
|
554
|
-
}
|
|
555
|
-
})));
|
|
556
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
557
|
-
className: "empty"
|
|
558
|
-
}, intl.get("1cd159c8-2a4d-4208-a170-55a34b91f671").d("暂无数据,提交搜索后搜索关键字"))))), /*#__PURE__*/React.createElement("div", {
|
|
559
|
-
className: "desc"
|
|
560
|
-
}, /*#__PURE__*/React.createElement(_TooltipText, null, /*#__PURE__*/React.createElement("span", null, intl.get("be953f09-653f-4715-a3b9-9e0faef199b3").d("全文检索:hello world")), /*#__PURE__*/React.createElement("span", {
|
|
561
|
-
className: "desc-margin-32"
|
|
562
|
-
}, intl.get("ff777cfe-21b4-4eb0-bf80-ebd92081fdf5").d('完全匹配:"hello world"')), /*#__PURE__*/React.createElement("span", {
|
|
563
|
-
className: "desc-margin-32"
|
|
564
|
-
}, intl.get("229e8f35-ce6c-403a-b52e-05346dd8eb0b").d("通配符:*?")), /*#__PURE__*/React.createElement("span", {
|
|
565
|
-
className: "desc-margin-32"
|
|
566
|
-
}, intl.get("e7413527-a5ee-4057-b765-3595cd26c09b").d("关联搜索:status:(error OR warning) AND NOT service:“service_a”"))), /*#__PURE__*/React.createElement(_Button, {
|
|
567
|
-
type: "link",
|
|
568
|
-
onClick: onHelpClick
|
|
569
|
-
}, intl.get("3431b29b-5fb7-411f-8a1d-8d7676b03264").d("帮助文档"))));
|
|
570
|
-
return /*#__PURE__*/React.createElement(_Dropdown, {
|
|
571
|
-
overlay: menu,
|
|
572
|
-
visible: visible,
|
|
573
|
-
getPopupContainer: function getPopupContainer(node) {
|
|
574
|
-
return node;
|
|
575
|
-
},
|
|
576
|
-
overlayStyle: {
|
|
577
|
-
top: Number(height + 2),
|
|
578
|
-
left: 0,
|
|
579
|
-
minWidth: Number(width + 2),
|
|
580
|
-
maxWidth: Number(width + 2)
|
|
581
|
-
} // 2是边框高度
|
|
582
|
-
}, children);
|
|
583
|
-
};
|
|
584
|
-
export default DropDown;
|