@chaoswise/business 1.0.1 → 1.0.3
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/AggregateSearch/CLSPL/CLQLLexer.js +2 -2
- package/lib/AggregateSearch/CLSPL/index.js +16 -4
- package/lib/AggregateSearch/components/CloseAllIcon/index.js +1 -1
- package/lib/AggregateSearch/components/DropDown/index.js +112 -102
- package/lib/AggregateSearch/components/SwitchBtn/index.js +8 -8
- package/lib/AggregateSearch/hooks/useDropDown.js +9 -4
- package/lib/AggregateSearch/index.js +40 -22
- package/lib/AggregateSearch/index.less +7 -5
- package/lib/ContentEditableSearch/components/CloseAllIcon/index.js +1 -1
- package/lib/PropertyControlViewer/components/DoAppIcon/CustomIcon/index.js +1 -1
- package/lib/PropertyControlViewer/components/DoCiUnitBitmap.js +1 -1
- package/lib/PropertyControlViewer/components/DoCommon.js +1 -1
- package/lib/PropertyControlViewer/components/DoQuote/components/QuoteView.js +3 -3
- package/lib/PropertyControlViewer/components/DoSelect.js +1 -1
- package/lib/PropertyControlViewer/components/DoUser.js +1 -1
- package/lib/PropertyControlViewer/components/TagShowMoreList/index.js +2 -2
- package/package.json +3 -2
|
@@ -15,7 +15,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
15
15
|
// Generated from /Users/changle/Documents/code/doop/cql/src/main/resources/antlr/cql/CLQLLexer.g4 by ANTLR 4.9.2
|
|
16
16
|
// jshint ignore: start
|
|
17
17
|
import antlr4 from 'antlr4';
|
|
18
|
-
var serializedATN = ["\x03\u608B\uA72A\u8133\uB9ED\u417C\u3BE7\u7786", "\u5964\x02\"\
|
|
18
|
+
var serializedATN = ["\x03\u608B\uA72A\u8133\uB9ED\u417C\u3BE7\u7786", "\u5964\x02\"\u0112\b\x01\x04\x02\t\x02\x04\x03\t\x03", "\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07", "\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\x0B\t\x0B\x04", "\f\t\f\x04\r\t\r\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10", "\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04\x13\t\x13", "\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17", "\t\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A", "\x04\x1B\t\x1B\x04\x1C\t\x1C\x04\x1D\t\x1D\x04\x1E", "\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04\"\t\"\x04#", "\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x03\x02\x03\x02", "\x03\x03\x03\x03\x03\x03\x03\x03\x07\x03V\n\x03", "\f\x03\x0E\x03Y\x0B\x03\x03\x03\x03\x03\x03\x04", "\x03\x04\x07\x04_\n\x04\f\x04\x0E\x04b\x0B\x04\x03", "\x04\x03\x04\x03\x05\x03\x05\x03\x05\x03\x05\x07", "\x05j\n\x05\f\x05\x0E\x05m\x0B\x05\x03\x05\x03\x05", "\x03\x06\x03\x06\x03\x06\x03\x06\x03\x07\x03\x07", "\x03\b\x03\b\x03\t\x03\t\x03\n\x03\n\x03\x0B\x03\x0B", "\x03\f\x03\f\x03\f\x03\r\x03\r\x03\r\x03\x0E\x03\x0E", "\x03\x0F\x03\x0F\x03\x10\x03\x10\x03\x11\x03\x11", "\x03\x12\x03\x12\x03\x13\x03\x13\x03\x14\x03\x14", "\x03\x15\x03\x15\x03\x16\x03\x16\x03\x17\x03\x17", "\x03\x17\x03\x17\x03\x18\x03\x18\x03\x18\x03\x18", "\x03\x19\x03\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A", "\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x07\x1B\xA9\n", "\x1B\f\x1B\x0E\x1B\xAC\x0B\x1B\x03\x1B\x03\x1B", "\x03\x1C\x06\x1C\xB1\n\x1C\r\x1C\x0E\x1C\xB2\x03", "\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03", "\x1F\x06\x1F\xBC\n\x1F\r\x1F\x0E\x1F\xBD\x03\x1F", "\x03\x1F\x05\x1F\xC2\n\x1F\x03\x1F\x06\x1F\xC5", "\n\x1F\r\x1F\x0E\x1F\xC6\x05\x1F\xC9\n\x1F\x03 ", "\x06 \xCC\n \r \x0E \xCD\x03 \x05 \xD1\n \x03 \x06", " \xD4\n \r \x0E \xD5\x05 \xD8\n \x03 \x03 \x05 \xDC", "\n \x03 \x06 \xDF\n \r \x0E \xE0\x05 \xE3\n \x03 \x05", " \xE6\n \x03!\x03!\x03\"\x03\"\x03#\x03#\x03#\x06", "#\xEF\n#\r#\x0E#\xF0\x03$\x03$\x03%\x03%\x03&\x03", "&\x05&\xF9\n&\x03&\x03&\x03&\x05&\xFE\n&\x03&\x03", "&\x05&\u0102\n&\x03&\x03&\x05&\u0106\n&\x03'\x03'\x03", "'\x03'\x03'\x03'\x03'\x03'\x03'\x05'\u0111\n'", "\x02\x02(\x03\x03\x05\x04\x07\x05\t\x06\x0B\x07", "\r\b\x0F\t\x11\n\x13\x0B\x15\f\x17\r\x19\x0E\x1B\x0F", "\x1D\x10\x1F\x11!\x12#\x13%\x14'\x15)\x16+\x17", "-\x18/\x191\x1A3\x1B5\x1C7\x1D9\x1E;\x1F=\x02?\x02", "A\x02C\x02E G!I\"K\x02M\x02\x03\x02\x17\x03\x0211", "\x03\x02bb\x04\x02\f\f\x0F\x0F\x05\x02\x0B\r\x0F", "\x0F\"\"\x04\x02CCcc\x04\x02PPpp\x04\x02FFff\x04\x02", "QQqq\x04\x02VVvv\x04\x02TTtt\x03\x02$$\x04\x02ZZzz\x05", "\x022;CHch\x04\x02GGgg\x04\x02--//\x03\x022;\x03\x02", "00\x06\x02FFHHffhh\x05\x02C\\aac|\x06\x02&&00BB\x82\0", "\x04\x02,,AA\x02\u012B\x02\x03\x03\x02\x02\x02\x02", "\x05\x03\x02\x02\x02\x02\x07\x03\x02\x02\x02\x02", "\t\x03\x02\x02\x02\x02\x0B\x03\x02\x02\x02\x02", "\r\x03\x02\x02\x02\x02\x0F\x03\x02\x02\x02\x02", "\x11\x03\x02\x02\x02\x02\x13\x03\x02\x02\x02\x02", "\x15\x03\x02\x02\x02\x02\x17\x03\x02\x02\x02\x02", "\x19\x03\x02\x02\x02\x02\x1B\x03\x02\x02\x02\x02", "\x1D\x03\x02\x02\x02\x02\x1F\x03\x02\x02\x02\x02", "!\x03\x02\x02\x02\x02#\x03\x02\x02\x02\x02%\x03", "\x02\x02\x02\x02'\x03\x02\x02\x02\x02)\x03\x02", "\x02\x02\x02+\x03\x02\x02\x02\x02-\x03\x02\x02", "\x02\x02/\x03\x02\x02\x02\x021\x03\x02\x02\x02", "\x023\x03\x02\x02\x02\x025\x03\x02\x02\x02\x02", "7\x03\x02\x02\x02\x029\x03\x02\x02\x02\x02;\x03", "\x02\x02\x02\x02E\x03\x02\x02\x02\x02G\x03\x02", "\x02\x02\x02I\x03\x02\x02\x02\x03O\x03\x02\x02", "\x02\x05Q\x03\x02\x02\x02\x07\\\x03\x02\x02\x02", "\te\x03\x02\x02\x02\x0Bp\x03\x02\x02\x02\rt\x03", "\x02\x02\x02\x0Fv\x03\x02\x02\x02\x11x\x03\x02", "\x02\x02\x13z\x03\x02\x02\x02\x15|\x03\x02\x02", "\x02\x17~\x03\x02\x02\x02\x19\x81\x03\x02\x02", "\x02\x1B\x84\x03\x02\x02\x02\x1D\x86\x03\x02\x02", "\x02\x1F\x88\x03\x02\x02\x02!\x8A\x03\x02\x02", "\x02#\x8C\x03\x02\x02\x02%\x8E\x03\x02\x02\x02", "'\x90\x03\x02\x02\x02)\x92\x03\x02\x02\x02+\x94", "\x03\x02\x02\x02-\x96\x03\x02\x02\x02/\x9A\x03", "\x02\x02\x021\x9E\x03\x02\x02\x023\xA1\x03\x02", "\x02\x025\xA4\x03\x02\x02\x027\xB0\x03\x02\x02", "\x029\xB4\x03\x02\x02\x02;\xB6\x03\x02\x02\x02", "=\xB8\x03\x02\x02\x02?\xCB\x03\x02\x02\x02A\xE7", "\x03\x02\x02\x02C\xE9\x03\x02\x02\x02E\xEE\x03", "\x02\x02\x02G\xF2\x03\x02\x02\x02I\xF4\x03\x02", "\x02\x02K\u0105\x03\x02\x02\x02M\u0110\x03\x02\x02", "\x02OP\x07%\x02\x02P\x04\x03\x02\x02\x02QW\x071", "\x02\x02RV\n\x02\x02\x02ST\x07^\x02\x02TV\x071\x02", "\x02UR\x03\x02\x02\x02US\x03\x02\x02\x02VY\x03\x02", "\x02\x02WU\x03\x02\x02\x02WX\x03\x02\x02\x02XZ\x03", "\x02\x02\x02YW\x03\x02\x02\x02Z[\x071\x02\x02[\x06", "\x03\x02\x02\x02\\`\x07b\x02\x02]_\n\x03\x02\x02", "^]\x03\x02\x02\x02_b\x03\x02\x02\x02`^\x03\x02\x02", "\x02`a\x03\x02\x02\x02ac\x03\x02\x02\x02b`\x03\x02", "\x02\x02cd\x07b\x02\x02d\b\x03\x02\x02\x02ef\x07", "/\x02\x02fg\x07/\x02\x02gk\x03\x02\x02\x02hj\n\x04", "\x02\x02ih\x03\x02\x02\x02jm\x03\x02\x02\x02ki\x03", "\x02\x02\x02kl\x03\x02\x02\x02ln\x03\x02\x02\x02", "mk\x03\x02\x02\x02no\b\x05\x02\x02o\n\x03\x02\x02", "\x02pq\t\x05\x02\x02qr\x03\x02\x02\x02rs\b\x06\x02", "\x02s\f\x03\x02\x02\x02tu\x07<\x02\x02u\x0E\x03", "\x02\x02\x02vw\x07*\x02\x02w\x10\x03\x02\x02\x02", "xy\x07+\x02\x02y\x12\x03\x02\x02\x02z{\x07>\x02", "\x02{\x14\x03\x02\x02\x02|}\x07@\x02\x02}\x16\x03", "\x02\x02\x02~\x7F\x07>\x02\x02\x7F\x80\x07?\x02", "\x02\x80\x18\x03\x02\x02\x02\x81\x82\x07@\x02", "\x02\x82\x83\x07?\x02\x02\x83\x1A\x03\x02\x02", "\x02\x84\x85\x07A\x02\x02\x85\x1C\x03\x02\x02", "\x02\x86\x87\x07,\x02\x02\x87\x1E\x03\x02\x02", "\x02\x88\x89\x07]\x02\x02\x89 \x03\x02\x02\x02", "\x8A\x8B\x07_\x02\x02\x8B\"\x03\x02\x02\x02\x8C", "\x8D\x07}\x02\x02\x8D$\x03\x02\x02\x02\x8E\x8F", "\x07\x7F\x02\x02\x8F&\x03\x02\x02\x02\x90\x91", "\x07\x80\x02\x02\x91(\x03\x02\x02\x02\x92\x93", "\x07-\x02\x02\x93*\x03\x02\x02\x02\x94\x95\x07", "/\x02\x02\x95,\x03\x02\x02\x02\x96\x97\t\x06\x02", "\x02\x97\x98\t\x07\x02\x02\x98\x99\t\b\x02\x02\x99", ".\x03\x02\x02\x02\x9A\x9B\t\x07\x02\x02\x9B\x9C", "\t\t\x02\x02\x9C\x9D\t\n\x02\x02\x9D0\x03\x02\x02", "\x02\x9E\x9F\t\t\x02\x02\x9F\xA0\t\x0B\x02\x02\xA0", "2\x03\x02\x02\x02\xA1\xA2\t\n\x02\x02\xA2\xA3\t", "\t\x02\x02\xA34\x03\x02\x02\x02\xA4\xAA\x07$\x02", "\x02\xA5\xA9\n\f\x02\x02\xA6\xA7\x07^\x02\x02\xA7", "\xA9\x07$\x02\x02\xA8\xA5\x03\x02\x02\x02\xA8", "\xA6\x03\x02\x02\x02\xA9\xAC\x03\x02\x02\x02\xAA", "\xA8\x03\x02\x02\x02\xAA\xAB\x03\x02\x02\x02\xAB", "\xAD\x03\x02\x02\x02\xAC\xAA\x03\x02\x02\x02\xAD", "\xAE\x07$\x02\x02\xAE6\x03\x02\x02\x02\xAF\xB1", "\x05A!\x02\xB0\xAF\x03\x02\x02\x02\xB1\xB2\x03", "\x02\x02\x02\xB2\xB0\x03\x02\x02\x02\xB2\xB3\x03", "\x02\x02\x02\xB38\x03\x02\x02\x02\xB4\xB5\x05", "? \x02\xB5:\x03\x02\x02\x02\xB6\xB7\x05=\x1F\x02", "\xB7<\x03\x02\x02\x02\xB8\xB9\x072\x02\x02\xB9", "\xBB\t\r\x02\x02\xBA\xBC\t\x0E\x02\x02\xBB\xBA\x03", "\x02\x02\x02\xBC\xBD\x03\x02\x02\x02\xBD\xBB\x03", "\x02\x02\x02\xBD\xBE\x03\x02\x02\x02\xBE\xC8\x03", "\x02\x02\x02\xBF\xC1\t\x0F\x02\x02\xC0\xC2\t\x10", "\x02\x02\xC1\xC0\x03\x02\x02\x02\xC1\xC2\x03\x02", "\x02\x02\xC2\xC4\x03\x02\x02\x02\xC3\xC5\t\x11", "\x02\x02\xC4\xC3\x03\x02\x02\x02\xC5\xC6\x03\x02", "\x02\x02\xC6\xC4\x03\x02\x02\x02\xC6\xC7\x03\x02", "\x02\x02\xC7\xC9\x03\x02\x02\x02\xC8\xBF\x03\x02", "\x02\x02\xC8\xC9\x03\x02\x02\x02\xC9>\x03\x02", "\x02\x02\xCA\xCC\t\x11\x02\x02\xCB\xCA\x03\x02", "\x02\x02\xCC\xCD\x03\x02\x02\x02\xCD\xCB\x03\x02", "\x02\x02\xCD\xCE\x03\x02\x02\x02\xCE\xD0\x03\x02", "\x02\x02\xCF\xD1\t\x12\x02\x02\xD0\xCF\x03\x02", "\x02\x02\xD0\xD1\x03\x02\x02\x02\xD1\xD7\x03\x02", "\x02\x02\xD2\xD4\t\x11\x02\x02\xD3\xD2\x03\x02", "\x02\x02\xD4\xD5\x03\x02\x02\x02\xD5\xD3\x03\x02", "\x02\x02\xD5\xD6\x03\x02\x02\x02\xD6\xD8\x03\x02", "\x02\x02\xD7\xD3\x03\x02\x02\x02\xD7\xD8\x03\x02", "\x02\x02\xD8\xE2\x03\x02\x02\x02\xD9\xDB\t\x0F", "\x02\x02\xDA\xDC\t\x10\x02\x02\xDB\xDA\x03\x02", "\x02\x02\xDB\xDC\x03\x02\x02\x02\xDC\xDE\x03\x02", "\x02\x02\xDD\xDF\t\x11\x02\x02\xDE\xDD\x03\x02", "\x02\x02\xDF\xE0\x03\x02\x02\x02\xE0\xDE\x03\x02", "\x02\x02\xE0\xE1\x03\x02\x02\x02\xE1\xE3\x03\x02", "\x02\x02\xE2\xD9\x03\x02\x02\x02\xE2\xE3\x03\x02", "\x02\x02\xE3\xE5\x03\x02\x02\x02\xE4\xE6\t\x13", "\x02\x02\xE5\xE4\x03\x02\x02\x02\xE5\xE6\x03\x02", "\x02\x02\xE6@\x03\x02\x02\x02\xE7\xE8\t\x11\x02", "\x02\xE8B\x03\x02\x02\x02\xE9\xEA\t\x14\x02\x02", "\xEAD\x03\x02\x02\x02\xEB\xEF\x05C\"\x02\xEC\xEF", "\x05A!\x02\xED\xEF\t\x15\x02\x02\xEE\xEB\x03\x02", "\x02\x02\xEE\xEC\x03\x02\x02\x02\xEE\xED\x03\x02", "\x02\x02\xEF\xF0\x03\x02\x02\x02\xF0\xEE\x03\x02", "\x02\x02\xF0\xF1\x03\x02\x02\x02\xF1F\x03\x02", "\x02\x02\xF2\xF3\x0B\x02\x02\x02\xF3H\x03\x02", "\x02\x02\xF4\xF5\x05M'\x02\xF5J\x03\x02\x02\x02", "\xF6\xF9\x05)\x15\x02\xF7\xF9\x05+\x16\x02\xF8", "\xF6\x03\x02\x02\x02\xF8\xF7\x03\x02\x02\x02\xF8", "\xF9\x03\x02\x02\x02\xF9\xFA\x03\x02\x02\x02\xFA", "\u0106\x057\x1C\x02\xFB\xFE\x05)\x15\x02\xFC\xFE", "\x05+\x16\x02\xFD\xFB\x03\x02\x02\x02\xFD\xFC", "\x03\x02\x02\x02\xFD\xFE\x03\x02\x02\x02\xFE\u0101", "\x03\x02\x02\x02\xFF\u0102\x059\x1D\x02\u0100\u0102", "\x05;\x1E\x02\u0101\xFF\x03\x02\x02\x02\u0101\u0100", "\x03\x02\x02\x02\u0102\u0106\x03\x02\x02\x02\u0103\u0106", "\x05E#\x02\u0104\u0106\x055\x1B\x02\u0105\xF8\x03\x02", "\x02\x02\u0105\xFD\x03\x02\x02\x02\u0105\u0103\x03\x02", "\x02\x02\u0105\u0104\x03\x02\x02\x02\u0106L\x03\x02", "\x02\x02\u0107\u0108\t\x16\x02\x02\u0108\u0109\x05K&\x02", "\u0109\u010A\t\x16\x02\x02\u010A\u0111\x03\x02\x02\x02", "\u010B\u010C\x05K&\x02\u010C\u010D\t\x16\x02\x02\u010D\u0111", "\x03\x02\x02\x02\u010E\u010F\t\x16\x02\x02\u010F\u0111", "\x05K&\x02\u0110\u0107\x03\x02\x02\x02\u0110\u010B\x03", "\x02\x02\x02\u0110\u010E\x03\x02\x02\x02\u0111N\x03", "\x02\x02\x02\x1D\x02UW`k\xA8\xAA\xB2\xBD\xC1\xC6", "\xC8\xCD\xD0\xD5\xD7\xDB\xE0\xE2\xE5\xEE\xF0\xF8", "\xFD\u0101\u0105\u0110\x03\x02\x03\x02"].join('');
|
|
19
19
|
var atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);
|
|
20
20
|
var decisionsToDFA = atn.decisionToState.map(function (ds, index) {
|
|
21
21
|
return new antlr4.dfa.DFA(ds, index);
|
|
@@ -43,7 +43,7 @@ _defineProperty(CLQLLexer, "channelNames", ['DEFAULT_TOKEN_CHANNEL', 'HIDDEN']);
|
|
|
43
43
|
_defineProperty(CLQLLexer, "modeNames", ['DEFAULT_MODE']);
|
|
44
44
|
_defineProperty(CLQLLexer, "literalNames", [null, "'#'", null, null, null, null, "':'", "'('", "')'", "'<'", "'>'", "'<='", "'>='", "'?'", "'*'", "'['", "']'", "'{'", "'}'", "'~'", "'+'", "'-'"]);
|
|
45
45
|
_defineProperty(CLQLLexer, "symbolicNames", [null, 'WEI', 'REGEX', 'BQUOTA_STRING', 'LINE_COMMENT', 'SPACES', 'COLON', 'LPAREN', 'RPAREN', 'LT', 'GT', 'LE', 'GE', 'QUESTION', 'STAR', 'LBRAKET', 'RBRAKET', 'LCURLY', 'RCURLY', 'WAVE', 'PLUS', 'MINUS', 'K_AND', 'K_NOT', 'K_OR', 'K_TO', 'DQUOTA_STRING', 'INTEGER_LITERAL', 'DECIMAL_LITERAL', 'HEXADECIMAL_LITERAL', 'UNQUOTA_STRING', 'UNEXPECTED_CHAR', 'FUZZY_LITERAL']);
|
|
46
|
-
_defineProperty(CLQLLexer, "ruleNames", ['WEI', 'REGEX', 'BQUOTA_STRING', 'LINE_COMMENT', 'SPACES', 'COLON', 'LPAREN', 'RPAREN', 'LT', 'GT', 'LE', 'GE', 'QUESTION', 'STAR', 'LBRAKET', 'RBRAKET', 'LCURLY', 'RCURLY', 'WAVE', 'PLUS', 'MINUS', 'K_AND', 'K_NOT', 'K_OR', 'K_TO', 'DQUOTA_STRING', 'INTEGER_LITERAL', 'DECIMAL_LITERAL', 'HEXADECIMAL_LITERAL', 'HEXADECIMAL', 'DECIMAL', 'DIGIT', 'LETTER', 'UNQUOTA_STRING', 'UNEXPECTED_CHAR', 'FUZZY_LITERAL']);
|
|
46
|
+
_defineProperty(CLQLLexer, "ruleNames", ['WEI', 'REGEX', 'BQUOTA_STRING', 'LINE_COMMENT', 'SPACES', 'COLON', 'LPAREN', 'RPAREN', 'LT', 'GT', 'LE', 'GE', 'QUESTION', 'STAR', 'LBRAKET', 'RBRAKET', 'LCURLY', 'RCURLY', 'WAVE', 'PLUS', 'MINUS', 'K_AND', 'K_NOT', 'K_OR', 'K_TO', 'DQUOTA_STRING', 'INTEGER_LITERAL', 'DECIMAL_LITERAL', 'HEXADECIMAL_LITERAL', 'HEXADECIMAL', 'DECIMAL', 'DIGIT', 'LETTER', 'UNQUOTA_STRING', 'UNEXPECTED_CHAR', 'FUZZY_LITERAL', 'TEXT', 'FUZZY']);
|
|
47
47
|
export { CLQLLexer as default };
|
|
48
48
|
CLQLLexer.EOF = antlr4.Token.EOF;
|
|
49
49
|
CLQLLexer.WEI = 1;
|
|
@@ -22,7 +22,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
22
22
|
* @Author: rookie.ou rookie.ou@cloudwise.com
|
|
23
23
|
* @Date: 2022-11-21 10:54:41
|
|
24
24
|
* @LastEditors: rookie.ou rookie.ou@cloudwise.com
|
|
25
|
-
* @LastEditTime:
|
|
25
|
+
* @LastEditTime: 2023-06-14 16:01:25
|
|
26
26
|
* @FilePath: /DOLAWeb/src/components/SPLInput/CLSPL/index.js
|
|
27
27
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
28
28
|
*/
|
|
@@ -30,7 +30,7 @@ import antlr4 from 'antlr4';
|
|
|
30
30
|
import MyGrammarLexer from './CLQLLexer.js';
|
|
31
31
|
import MyGrammarParser from './CLQLParser.js';
|
|
32
32
|
import visitor from './CLQLParserVisitor.js';
|
|
33
|
-
import stragy from './SPLStagy';
|
|
33
|
+
import stragy from './SPLStagy.js';
|
|
34
34
|
import intl from '../../locales';
|
|
35
35
|
var customErr = /*#__PURE__*/function (_antlr4$error$ErrorLi) {
|
|
36
36
|
_inherits(customErr, _antlr4$error$ErrorLi);
|
|
@@ -137,6 +137,17 @@ var customVisitor = /*#__PURE__*/function (_visitor) {
|
|
|
137
137
|
this.state = 2; //正则
|
|
138
138
|
return this.visitChildren(ctx);
|
|
139
139
|
}
|
|
140
|
+
}, {
|
|
141
|
+
key: "replaceQuotes",
|
|
142
|
+
value: function replaceQuotes(str) {
|
|
143
|
+
var regex = /^"(.*)"$/; // 匹配以双引号开头和结尾的字符串
|
|
144
|
+
var match = regex.exec(str);
|
|
145
|
+
if (match) {
|
|
146
|
+
return match[1]; // 返回匹配到的第一个捕获组,即双引号中间的部分
|
|
147
|
+
} else {
|
|
148
|
+
return str;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
140
151
|
}, {
|
|
141
152
|
key: "visitTextSearchExpr",
|
|
142
153
|
value: function visitTextSearchExpr(ctx) {
|
|
@@ -160,7 +171,8 @@ var customVisitor = /*#__PURE__*/function (_visitor) {
|
|
|
160
171
|
if (literalValueCtx.string_literal() != null) {
|
|
161
172
|
if (literalValueCtx.string_literal().DQUOTA_STRING() != null) {
|
|
162
173
|
// 文本
|
|
163
|
-
text = text.substring(1, text.length - 1).replace(
|
|
174
|
+
// text = text.substring(1, text.length - 1).replace(/\\\\"/g, '"');
|
|
175
|
+
text = this.replaceQuotes(text);
|
|
164
176
|
}
|
|
165
177
|
}
|
|
166
178
|
var tokenSearchLimit = 300; //logCoreContext.getNacosService().getTokenSearchLimit();
|
|
@@ -178,7 +190,7 @@ var customVisitor = /*#__PURE__*/function (_visitor) {
|
|
|
178
190
|
}
|
|
179
191
|
} else {
|
|
180
192
|
//不分词, 整体高亮
|
|
181
|
-
this.words.push(text);
|
|
193
|
+
this.words.push(text.replace(/\\/g, ''));
|
|
182
194
|
}
|
|
183
195
|
}
|
|
184
196
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
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";
|
|
2
|
+
import _Dropdown from "@chaoswise/ui/lib/Antd/Dropdown";
|
|
3
3
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
4
4
|
import _message from "@chaoswise/ui/lib/message";
|
|
5
|
-
import _Spin from "@chaoswise/ui/lib/Spin";
|
|
5
|
+
import _Spin from "@chaoswise/ui/lib/Antd/Spin";
|
|
6
6
|
import _TooltipText from "@chaoswise/ui/lib/TooltipText";
|
|
7
7
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
8
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -14,7 +14,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
14
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 new 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 new 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 new 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
15
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
16
16
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
17
|
-
import React, { useEffect, useState, useMemo, useRef } from "react";
|
|
17
|
+
import React, { useEffect, useState, useMemo, useRef, useCallback } from "react";
|
|
18
18
|
import { CopyToClipboard } from "react-copy-to-clipboard";
|
|
19
19
|
import ResizeObserver from "resize-observer-polyfill";
|
|
20
20
|
import keyIcon from "./assets/key.svg";
|
|
@@ -24,6 +24,7 @@ import copyIcon from "./assets/copy.svg";
|
|
|
24
24
|
import deleteIcon from "./assets/delete.svg";
|
|
25
25
|
import combinedIcon from "./assets/combined.svg";
|
|
26
26
|
import { useIntl } from "../../../locales";
|
|
27
|
+
import { debounce } from "@chaoswise/utils";
|
|
27
28
|
import { DEFAULT_MATCH_OPTION_LIST, DEFAULT_COMBINED_OPTION_LIST } from "./config";
|
|
28
29
|
import "./index.less";
|
|
29
30
|
function judgeNotEmpty(val) {
|
|
@@ -31,7 +32,14 @@ function judgeNotEmpty(val) {
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
// 搜索高亮
|
|
34
|
-
function highLight(
|
|
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
|
+
}
|
|
35
43
|
return text.split(keyword).flatMap(function (str, index) {
|
|
36
44
|
return [/*#__PURE__*/React.createElement("span", {
|
|
37
45
|
key: index,
|
|
@@ -146,9 +154,9 @@ var DropDown = function DropDown(props) {
|
|
|
146
154
|
// 内置 ()
|
|
147
155
|
onSelect: function onSelect() {}
|
|
148
156
|
} : _props$combinedOption,
|
|
149
|
-
containerWrapperRef = props.containerWrapperRef
|
|
157
|
+
containerWrapperRef = props.containerWrapperRef,
|
|
158
|
+
debounceWait = props.debounceWait;
|
|
150
159
|
var intl = useIntl();
|
|
151
|
-
|
|
152
160
|
// 输入值
|
|
153
161
|
var keyOptionValue = keyOption.value;
|
|
154
162
|
var valueOptionValue = valueOption.value;
|
|
@@ -219,113 +227,115 @@ var DropDown = function DropDown(props) {
|
|
|
219
227
|
};
|
|
220
228
|
}, []);
|
|
221
229
|
// key
|
|
230
|
+
var fetchKey = /*#__PURE__*/function () {
|
|
231
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(keyOptionValue) {
|
|
232
|
+
var res;
|
|
233
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
234
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
235
|
+
case 0:
|
|
236
|
+
setKeyLoading(true);
|
|
237
|
+
_context5.next = 3;
|
|
238
|
+
return keyOption === null || keyOption === void 0 ? void 0 : keyOption.fetchFuc(keyOptionValue);
|
|
239
|
+
case 3:
|
|
240
|
+
_context5.t0 = _context5.sent;
|
|
241
|
+
if (_context5.t0) {
|
|
242
|
+
_context5.next = 6;
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
_context5.t0 = [];
|
|
246
|
+
case 6:
|
|
247
|
+
res = _context5.t0;
|
|
248
|
+
setKeyList(res);
|
|
249
|
+
setKeyLoading(false);
|
|
250
|
+
case 9:
|
|
251
|
+
case "end":
|
|
252
|
+
return _context5.stop();
|
|
253
|
+
}
|
|
254
|
+
}, _callee5);
|
|
255
|
+
}));
|
|
256
|
+
return function fetchKey(_x3) {
|
|
257
|
+
return _ref.apply(this, arguments);
|
|
258
|
+
};
|
|
259
|
+
}();
|
|
260
|
+
var fetchValue = /*#__PURE__*/function () {
|
|
261
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(valueOptionValue) {
|
|
262
|
+
var res;
|
|
263
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
264
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
265
|
+
case 0:
|
|
266
|
+
setValueLoading(true);
|
|
267
|
+
_context6.next = 3;
|
|
268
|
+
return valueOption === null || valueOption === void 0 ? void 0 : valueOption.fetchFuc(valueOptionValue);
|
|
269
|
+
case 3:
|
|
270
|
+
_context6.t0 = _context6.sent;
|
|
271
|
+
if (_context6.t0) {
|
|
272
|
+
_context6.next = 6;
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
_context6.t0 = [];
|
|
276
|
+
case 6:
|
|
277
|
+
res = _context6.t0;
|
|
278
|
+
setValueList(res);
|
|
279
|
+
setValueLoading(false);
|
|
280
|
+
case 9:
|
|
281
|
+
case "end":
|
|
282
|
+
return _context6.stop();
|
|
283
|
+
}
|
|
284
|
+
}, _callee6);
|
|
285
|
+
}));
|
|
286
|
+
return function fetchValue(_x4) {
|
|
287
|
+
return _ref2.apply(this, arguments);
|
|
288
|
+
};
|
|
289
|
+
}();
|
|
290
|
+
var fetchHistory = /*#__PURE__*/function () {
|
|
291
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(historyOptionValue) {
|
|
292
|
+
var res;
|
|
293
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
294
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
295
|
+
case 0:
|
|
296
|
+
setHistoryLoading(true);
|
|
297
|
+
_context7.next = 3;
|
|
298
|
+
return historyOption === null || historyOption === void 0 ? void 0 : historyOption.fetchFuc(historyOptionValue);
|
|
299
|
+
case 3:
|
|
300
|
+
_context7.t0 = _context7.sent;
|
|
301
|
+
if (_context7.t0) {
|
|
302
|
+
_context7.next = 6;
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
_context7.t0 = [];
|
|
306
|
+
case 6:
|
|
307
|
+
res = _context7.t0;
|
|
308
|
+
setHistoryList(res);
|
|
309
|
+
setHistoryLoading(false);
|
|
310
|
+
case 9:
|
|
311
|
+
case "end":
|
|
312
|
+
return _context7.stop();
|
|
313
|
+
}
|
|
314
|
+
}, _callee7);
|
|
315
|
+
}));
|
|
316
|
+
return function fetchHistory(_x5) {
|
|
317
|
+
return _ref3.apply(this, arguments);
|
|
318
|
+
};
|
|
319
|
+
}();
|
|
320
|
+
var fetchKeyDebounce = useCallback(debounce(fetchKey, debounceWait), []);
|
|
321
|
+
var fetchValueDebounce = useCallback(debounce(fetchValue, debounceWait), []);
|
|
322
|
+
var fetchHistoryDebounce = useCallback(debounce(fetchHistory, debounceWait), []);
|
|
222
323
|
useEffect(function () {
|
|
223
|
-
var fetchValue = /*#__PURE__*/function () {
|
|
224
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
225
|
-
var res;
|
|
226
|
-
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
227
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
228
|
-
case 0:
|
|
229
|
-
setKeyLoading(true);
|
|
230
|
-
_context5.next = 3;
|
|
231
|
-
return keyOption === null || keyOption === void 0 ? void 0 : keyOption.fetchFuc(keyOptionValue);
|
|
232
|
-
case 3:
|
|
233
|
-
_context5.t0 = _context5.sent;
|
|
234
|
-
if (_context5.t0) {
|
|
235
|
-
_context5.next = 6;
|
|
236
|
-
break;
|
|
237
|
-
}
|
|
238
|
-
_context5.t0 = [];
|
|
239
|
-
case 6:
|
|
240
|
-
res = _context5.t0;
|
|
241
|
-
setKeyList(res);
|
|
242
|
-
setKeyLoading(false);
|
|
243
|
-
case 9:
|
|
244
|
-
case "end":
|
|
245
|
-
return _context5.stop();
|
|
246
|
-
}
|
|
247
|
-
}, _callee5);
|
|
248
|
-
}));
|
|
249
|
-
return function fetchValue() {
|
|
250
|
-
return _ref.apply(this, arguments);
|
|
251
|
-
};
|
|
252
|
-
}();
|
|
253
324
|
if (visible && judgeNotEmpty(keyOptionValue)) {
|
|
254
|
-
|
|
325
|
+
fetchKeyDebounce(keyOptionValue);
|
|
255
326
|
}
|
|
256
327
|
}, [visible, keyOptionValue]);
|
|
257
|
-
|
|
258
328
|
// value
|
|
259
329
|
useEffect(function () {
|
|
260
|
-
var fetchValue = /*#__PURE__*/function () {
|
|
261
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
262
|
-
var res;
|
|
263
|
-
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
264
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
265
|
-
case 0:
|
|
266
|
-
setValueLoading(true);
|
|
267
|
-
_context6.next = 3;
|
|
268
|
-
return valueOption === null || valueOption === void 0 ? void 0 : valueOption.fetchFuc(valueOptionValue);
|
|
269
|
-
case 3:
|
|
270
|
-
_context6.t0 = _context6.sent;
|
|
271
|
-
if (_context6.t0) {
|
|
272
|
-
_context6.next = 6;
|
|
273
|
-
break;
|
|
274
|
-
}
|
|
275
|
-
_context6.t0 = [];
|
|
276
|
-
case 6:
|
|
277
|
-
res = _context6.t0;
|
|
278
|
-
setValueList(res);
|
|
279
|
-
setValueLoading(false);
|
|
280
|
-
case 9:
|
|
281
|
-
case "end":
|
|
282
|
-
return _context6.stop();
|
|
283
|
-
}
|
|
284
|
-
}, _callee6);
|
|
285
|
-
}));
|
|
286
|
-
return function fetchValue() {
|
|
287
|
-
return _ref2.apply(this, arguments);
|
|
288
|
-
};
|
|
289
|
-
}();
|
|
290
330
|
if (visible && judgeNotEmpty(valueOptionValue)) {
|
|
291
|
-
|
|
331
|
+
fetchValueDebounce(valueOptionValue);
|
|
292
332
|
}
|
|
293
333
|
}, [visible, valueOptionValue]);
|
|
294
334
|
|
|
295
335
|
// history
|
|
296
336
|
useEffect(function () {
|
|
297
|
-
var fetchValue = /*#__PURE__*/function () {
|
|
298
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
299
|
-
var res;
|
|
300
|
-
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
301
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
302
|
-
case 0:
|
|
303
|
-
setHistoryLoading(true);
|
|
304
|
-
_context7.next = 3;
|
|
305
|
-
return historyOption === null || historyOption === void 0 ? void 0 : historyOption.fetchFuc(historyOptionValue);
|
|
306
|
-
case 3:
|
|
307
|
-
_context7.t0 = _context7.sent;
|
|
308
|
-
if (_context7.t0) {
|
|
309
|
-
_context7.next = 6;
|
|
310
|
-
break;
|
|
311
|
-
}
|
|
312
|
-
_context7.t0 = [];
|
|
313
|
-
case 6:
|
|
314
|
-
res = _context7.t0;
|
|
315
|
-
setHistoryList(res);
|
|
316
|
-
setHistoryLoading(false);
|
|
317
|
-
case 9:
|
|
318
|
-
case "end":
|
|
319
|
-
return _context7.stop();
|
|
320
|
-
}
|
|
321
|
-
}, _callee7);
|
|
322
|
-
}));
|
|
323
|
-
return function fetchValue() {
|
|
324
|
-
return _ref3.apply(this, arguments);
|
|
325
|
-
};
|
|
326
|
-
}();
|
|
327
337
|
if (visible && judgeNotEmpty(historyOptionValue)) {
|
|
328
|
-
|
|
338
|
+
fetchHistoryDebounce(historyOptionValue);
|
|
329
339
|
}
|
|
330
340
|
}, [visible, historyOptionValue]);
|
|
331
341
|
|
|
@@ -356,7 +366,7 @@ var DropDown = function DropDown(props) {
|
|
|
356
366
|
}, [historyList]);
|
|
357
367
|
|
|
358
368
|
// 搜索历史列表删除
|
|
359
|
-
function historyDelete(
|
|
369
|
+
function historyDelete(_x6, _x7) {
|
|
360
370
|
return _historyDelete.apply(this, arguments);
|
|
361
371
|
}
|
|
362
372
|
function _historyDelete() {
|
|
@@ -505,7 +515,7 @@ var DropDown = function DropDown(props) {
|
|
|
505
515
|
var id = record.id,
|
|
506
516
|
value = record.value,
|
|
507
517
|
des = record.des;
|
|
508
|
-
var highLightText = highLight(value, historyOptionValue);
|
|
518
|
+
var highLightText = highLight(value, historyOptionValue, false);
|
|
509
519
|
return /*#__PURE__*/React.createElement("div", {
|
|
510
520
|
key: index,
|
|
511
521
|
className: "list",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
2
|
-
import React from
|
|
3
|
-
import textIcon from
|
|
4
|
-
import tagIcon from
|
|
5
|
-
import { useIntl } from
|
|
6
|
-
import
|
|
2
|
+
import React from "react";
|
|
3
|
+
import textIcon from "./assets/text-icon.svg";
|
|
4
|
+
import tagIcon from "./assets/tag-icon.svg";
|
|
5
|
+
import { useIntl } from "../../../locales";
|
|
6
|
+
import "./index.less";
|
|
7
7
|
var SwitchBtn = function SwitchBtn(_ref) {
|
|
8
8
|
var mode = _ref.mode,
|
|
9
9
|
onChange = _ref.onChange;
|
|
10
10
|
var intl = useIntl();
|
|
11
|
-
var icon = mode ===
|
|
12
|
-
var title = mode ===
|
|
11
|
+
var icon = mode === "text" ? textIcon : tagIcon;
|
|
12
|
+
var title = mode === "text" ? intl.get("1e9cc6b2-f761-4aaa-a216-9f842c6f8fce").d("切换为筛选模式") : intl.get("5faa90fc-6455-499a-a0d5-c7ff9c9867df").d("切换为手写CQL语法模式");
|
|
13
13
|
var onClick = function onClick() {
|
|
14
|
-
onChange(mode ===
|
|
14
|
+
onChange(mode === "text" ? "tag" : "text");
|
|
15
15
|
};
|
|
16
16
|
return /*#__PURE__*/React.createElement(_Tooltip, {
|
|
17
17
|
title: title
|
|
@@ -13,7 +13,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
13
13
|
import React, { useRef, useEffect, useState } from "react";
|
|
14
14
|
import { getCursorPosition, getCursorNodeAndIndex, setCursorPosition, isObjectEqual } from "../utils";
|
|
15
15
|
var MATCH_LIST = [">=", "<=", ">", "<", ":"];
|
|
16
|
-
var useDropDown = function useDropDown(container, handleValueChange) {
|
|
16
|
+
var useDropDown = function useDropDown(container, handleValueChange, onChange) {
|
|
17
17
|
// 记录上一次的tag光标所处的type和value
|
|
18
18
|
var preTagInfo = useRef({});
|
|
19
19
|
|
|
@@ -149,6 +149,7 @@ var useDropDown = function useDropDown(container, handleValueChange) {
|
|
|
149
149
|
// 插入字符串下标位置内容
|
|
150
150
|
if (currentPositionIndex.current !== null) {
|
|
151
151
|
handleValueChange(newStr);
|
|
152
|
+
onChange(newStr);
|
|
152
153
|
// 光标移动到插入字符串后面
|
|
153
154
|
var _getCursorNodeAndInde2 = getCursorNodeAndIndex(container.current, newIndex),
|
|
154
155
|
targetNode = _getCursorNodeAndInde2.targetNode,
|
|
@@ -214,6 +215,7 @@ var useDropDown = function useDropDown(container, handleValueChange) {
|
|
|
214
215
|
};
|
|
215
216
|
var onHistorySelect = function onHistorySelect(value) {
|
|
216
217
|
handleValueChange(value);
|
|
218
|
+
onChange(value);
|
|
217
219
|
// 光标移动到插入字符串后面
|
|
218
220
|
var _getCursorNodeAndInde3 = getCursorNodeAndIndex(container.current, value.length),
|
|
219
221
|
targetNode = _getCursorNodeAndInde3.targetNode,
|
|
@@ -325,8 +327,10 @@ var useDropDown = function useDropDown(container, handleValueChange) {
|
|
|
325
327
|
},
|
|
326
328
|
value: {
|
|
327
329
|
isShow: true,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
+
value: {
|
|
331
|
+
key: key,
|
|
332
|
+
value: node.innerText
|
|
333
|
+
}
|
|
330
334
|
},
|
|
331
335
|
match: {
|
|
332
336
|
isShow: false
|
|
@@ -393,7 +397,8 @@ var useDropDown = function useDropDown(container, handleValueChange) {
|
|
|
393
397
|
visible: visible,
|
|
394
398
|
quickSelect: quickSelect,
|
|
395
399
|
onHistorySelect: onHistorySelect,
|
|
396
|
-
setVisible: setVisible
|
|
400
|
+
setVisible: setVisible,
|
|
401
|
+
currentPositionIndex: currentPositionIndex
|
|
397
402
|
};
|
|
398
403
|
};
|
|
399
404
|
export default useDropDown;
|
|
@@ -8,16 +8,16 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
8
8
|
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 new 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 new 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 new 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; }
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
10
10
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
11
|
-
import React, { useEffect, useRef, useState,
|
|
11
|
+
import React, { useEffect, useRef, useState, forwardRef, useImperativeHandle } from "react";
|
|
12
12
|
import PropTypes from "prop-types";
|
|
13
13
|
import { textInit, getCursorPosition, getCursorNodeAndIndex, setCursorPosition, genHtmlAndSyntaxCheckResByString, checkSyntax, cloneDomRemoveCloseBtn } from "./utils";
|
|
14
14
|
import SwitchBtn from "./components/SwitchBtn";
|
|
15
15
|
import DropDown from "./components/DropDown";
|
|
16
|
-
import "./index.less";
|
|
17
16
|
import useDropDown from "./hooks/useDropDown";
|
|
18
17
|
import CloseAllIcon from "./components/CloseAllIcon";
|
|
19
18
|
import classnames from "classnames";
|
|
20
|
-
|
|
19
|
+
import "./index.less";
|
|
20
|
+
var AggregateSearch = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
21
21
|
var _props$onChange = props.onChange,
|
|
22
22
|
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
23
23
|
value = props.value,
|
|
@@ -79,7 +79,10 @@ var AggregateSearch = function AggregateSearch(props) {
|
|
|
79
79
|
placeholder = props.placeholder,
|
|
80
80
|
className = props.className,
|
|
81
81
|
_props$style = props.style,
|
|
82
|
-
style = _props$style === void 0 ? {} : _props$style
|
|
82
|
+
style = _props$style === void 0 ? {} : _props$style,
|
|
83
|
+
_props$debounceWait = props.debounceWait,
|
|
84
|
+
debounceWait = _props$debounceWait === void 0 ? 300 : _props$debounceWait;
|
|
85
|
+
|
|
83
86
|
// 输入模式
|
|
84
87
|
var _useState = useState(defaultMode),
|
|
85
88
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -102,6 +105,13 @@ var AggregateSearch = function AggregateSearch(props) {
|
|
|
102
105
|
setContentEditable = _useState6[1];
|
|
103
106
|
// 是否正在输入中文
|
|
104
107
|
var isComposing = useRef(false);
|
|
108
|
+
useImperativeHandle(ref, function () {
|
|
109
|
+
return {
|
|
110
|
+
getContainerWrapper: function getContainerWrapper() {
|
|
111
|
+
return containerWrapperRef.current;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
});
|
|
105
115
|
var handleSyntaxCheck = /*#__PURE__*/function () {
|
|
106
116
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(inputStr) {
|
|
107
117
|
var checkRes, column, msg, _getCursorNodeAndInde, errorNode, findParent, errorTag;
|
|
@@ -161,13 +171,17 @@ var AggregateSearch = function AggregateSearch(props) {
|
|
|
161
171
|
while (1) switch (_context6.prev = _context6.next) {
|
|
162
172
|
case 0:
|
|
163
173
|
if (!((mode || curMode) === "text")) {
|
|
164
|
-
_context6.next =
|
|
174
|
+
_context6.next = 7;
|
|
165
175
|
break;
|
|
166
176
|
}
|
|
167
177
|
_context6.next = 3;
|
|
168
178
|
return checkSyntax(inputStr);
|
|
169
179
|
case 3:
|
|
170
180
|
checkRes = _context6.sent;
|
|
181
|
+
if (container.current.innerText !== inputStr) {
|
|
182
|
+
// 重复触发container.current.innerText赋值会影响光标位置
|
|
183
|
+
container.current.innerText = inputStr;
|
|
184
|
+
}
|
|
171
185
|
if (checkRes) {
|
|
172
186
|
containerWrapperRef.current.classList.add("syntax-error");
|
|
173
187
|
containerWrapperRef.current.setAttribute("data-error", checkRes.msg);
|
|
@@ -176,7 +190,7 @@ var AggregateSearch = function AggregateSearch(props) {
|
|
|
176
190
|
containerWrapperRef.current.removeAttribute("data-error");
|
|
177
191
|
}
|
|
178
192
|
return _context6.abrupt("return");
|
|
179
|
-
case
|
|
193
|
+
case 7:
|
|
180
194
|
// 计算当前光标位置(纯文本模式)
|
|
181
195
|
planeTextPosition = getCursorPosition(container.current); // 将纯文本模式转为html模式(语法解析器)
|
|
182
196
|
htmlString = genHtmlAndSyntaxCheckResByString(inputStr);
|
|
@@ -191,13 +205,12 @@ var AggregateSearch = function AggregateSearch(props) {
|
|
|
191
205
|
_getCursorNodeAndInde3 = getCursorNodeAndIndex(container.current, planeTextPosition), targetNode = _getCursorNodeAndInde3.targetNode, targetIndex = _getCursorNodeAndInde3.targetIndex; // 设置光标位置
|
|
192
206
|
setCursorPosition(targetNode, targetIndex);
|
|
193
207
|
}
|
|
194
|
-
|
|
195
208
|
// 检测语法
|
|
196
|
-
_context6.next =
|
|
209
|
+
_context6.next = 13;
|
|
197
210
|
return handleSyntaxCheck(inputStr);
|
|
198
|
-
case 12:
|
|
199
|
-
setSelValue(container.current.innerText);
|
|
200
211
|
case 13:
|
|
212
|
+
setSelValue(container.current.innerText.replace(/\s{1}$/g, ""));
|
|
213
|
+
case 14:
|
|
201
214
|
case "end":
|
|
202
215
|
return _context6.stop();
|
|
203
216
|
}
|
|
@@ -207,12 +220,13 @@ var AggregateSearch = function AggregateSearch(props) {
|
|
|
207
220
|
return _ref6.apply(this, arguments);
|
|
208
221
|
};
|
|
209
222
|
}();
|
|
210
|
-
var _useDropDown = useDropDown(container, handleValueChange),
|
|
223
|
+
var _useDropDown = useDropDown(container, handleValueChange, onChange),
|
|
211
224
|
dropStatus = _useDropDown.dropStatus,
|
|
212
225
|
visible = _useDropDown.visible,
|
|
213
226
|
quickSelect = _useDropDown.quickSelect,
|
|
214
227
|
onHistorySelect = _useDropDown.onHistorySelect,
|
|
215
|
-
setVisible = _useDropDown.setVisible
|
|
228
|
+
setVisible = _useDropDown.setVisible,
|
|
229
|
+
currentPositionIndex = _useDropDown.currentPositionIndex;
|
|
216
230
|
var onInput = /*#__PURE__*/function () {
|
|
217
231
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(e) {
|
|
218
232
|
var cloneDomRemoveCloseBtnDom;
|
|
@@ -266,6 +280,7 @@ var AggregateSearch = function AggregateSearch(props) {
|
|
|
266
280
|
nextSiblingWrappr.nodeValue = nextSiblingWrappr.nodeValue.replace(/(^\s{1})/, "");
|
|
267
281
|
}
|
|
268
282
|
container.current.removeChild(CloseTagWrapper);
|
|
283
|
+
currentPositionIndex.current = 0; // 点击关闭按钮重置当前光标位置
|
|
269
284
|
handleValueChange(container.current.innerText);
|
|
270
285
|
onChange(container.current.innerText);
|
|
271
286
|
}
|
|
@@ -281,7 +296,8 @@ var AggregateSearch = function AggregateSearch(props) {
|
|
|
281
296
|
var onModeChange = function onModeChange(mode) {
|
|
282
297
|
setSelMode(mode);
|
|
283
298
|
if (mode === "text") {
|
|
284
|
-
container.current.innerText = container.current.innerText;
|
|
299
|
+
// container.current.innerText = container.current.innerText; old sonar扫描过不去
|
|
300
|
+
container.current.innerHTML = container.current.innerText;
|
|
285
301
|
} else {
|
|
286
302
|
// 移除错误提示
|
|
287
303
|
containerWrapperRef.current.classList.remove("syntax-error");
|
|
@@ -311,10 +327,7 @@ var AggregateSearch = function AggregateSearch(props) {
|
|
|
311
327
|
}
|
|
312
328
|
},
|
|
313
329
|
valueOption: {
|
|
314
|
-
value: dropStatus.value.isShow ?
|
|
315
|
-
key: dropStatus.value.key,
|
|
316
|
-
value: dropStatus.value.value
|
|
317
|
-
} : null,
|
|
330
|
+
value: dropStatus.value.isShow ? dropStatus.value.value : null,
|
|
318
331
|
fetchFuc: fetchValueList,
|
|
319
332
|
onSelect: function onSelect(value) {
|
|
320
333
|
quickSelect(value, "value");
|
|
@@ -341,7 +354,8 @@ var AggregateSearch = function AggregateSearch(props) {
|
|
|
341
354
|
quickSelect(value, "combined");
|
|
342
355
|
}
|
|
343
356
|
},
|
|
344
|
-
containerWrapperRef: containerWrapperRef
|
|
357
|
+
containerWrapperRef: containerWrapperRef,
|
|
358
|
+
debounceWait: debounceWait
|
|
345
359
|
}, /*#__PURE__*/React.createElement("div", {
|
|
346
360
|
className: classnames("aggregate-search-wrapper", className, {
|
|
347
361
|
"aggregate-search-text-wrapper": curMode === "text"
|
|
@@ -381,7 +395,7 @@ var AggregateSearch = function AggregateSearch(props) {
|
|
|
381
395
|
onChange: onModeChange,
|
|
382
396
|
mode: mode || selMode
|
|
383
397
|
})));
|
|
384
|
-
};
|
|
398
|
+
});
|
|
385
399
|
AggregateSearch.propTypes = {
|
|
386
400
|
/**
|
|
387
401
|
* 受控value
|
|
@@ -396,11 +410,11 @@ AggregateSearch.propTypes = {
|
|
|
396
410
|
*/
|
|
397
411
|
onPressEnter: PropTypes.func,
|
|
398
412
|
/**
|
|
399
|
-
* 可生成标签对模式下触发搜索标签key的回调,需要返回promise,async(
|
|
413
|
+
* 可生成标签对模式下触发搜索标签key的回调,需要返回promise,async(key)=>[],参数为当前光标所在标签的key值:需要该值请求下拉列表key值数据
|
|
400
414
|
*/
|
|
401
415
|
fetchKeyList: PropTypes.func,
|
|
402
416
|
/**
|
|
403
|
-
* 可生成标签对模式下触发搜索标签value的回调,需要返回promise,async(value)=>[],参数为当前光标所在标签的value值:需要该值请求下拉列表value值数据
|
|
417
|
+
* 可生成标签对模式下触发搜索标签value的回调,需要返回promise,async({key,value})=>[],参数为当前光标所在标签的key和value值:需要该值请求下拉列表value值数据
|
|
404
418
|
*/
|
|
405
419
|
fetchValueList: PropTypes.func,
|
|
406
420
|
/**
|
|
@@ -426,6 +440,10 @@ AggregateSearch.propTypes = {
|
|
|
426
440
|
/**
|
|
427
441
|
* 用于设置容器外壳的样式
|
|
428
442
|
*/
|
|
429
|
-
style: PropTypes.object
|
|
443
|
+
style: PropTypes.object,
|
|
444
|
+
/**
|
|
445
|
+
* 防抖时间默认为300ms
|
|
446
|
+
*/
|
|
447
|
+
debounceWait: PropTypes.number
|
|
430
448
|
};
|
|
431
449
|
export default AggregateSearch;
|
|
@@ -70,19 +70,19 @@
|
|
|
70
70
|
background: #FFFFFF;
|
|
71
71
|
border: @border-width-base @border-style-base #E3E3E3;
|
|
72
72
|
border-radius: 2px;
|
|
73
|
-
height: 20px;
|
|
73
|
+
min-height: 20px;
|
|
74
74
|
line-height: 18px;
|
|
75
75
|
display: inline-block;
|
|
76
76
|
margin-right: 2px;
|
|
77
77
|
padding-right: 5px;
|
|
78
|
-
|
|
78
|
+
word-break: break-word;
|
|
79
79
|
.tag-box-item-close {
|
|
80
80
|
position: absolute;
|
|
81
81
|
height: 20px;
|
|
82
82
|
line-height: 20px;
|
|
83
83
|
display: none;
|
|
84
84
|
top: -1px;
|
|
85
|
-
right: -
|
|
85
|
+
right: -12px;
|
|
86
86
|
width: 12px;
|
|
87
87
|
border: @border-width-base @border-style-base #E3E3E3;
|
|
88
88
|
border-left: none;
|
|
@@ -112,6 +112,8 @@
|
|
|
112
112
|
}
|
|
113
113
|
&:hover {
|
|
114
114
|
border-color: @primary-5;
|
|
115
|
+
border-top-right-radius: 0;
|
|
116
|
+
border-bottom-right-radius: 0;
|
|
115
117
|
.tag-box-item-close {
|
|
116
118
|
display: inline-block;
|
|
117
119
|
border-color: @primary-5;
|
|
@@ -131,7 +133,7 @@
|
|
|
131
133
|
|
|
132
134
|
.tag-con {
|
|
133
135
|
display: inline-block;
|
|
134
|
-
height: 18px;
|
|
136
|
+
min-height: 18px;
|
|
135
137
|
line-height: 18px;
|
|
136
138
|
|
|
137
139
|
&:first-child {
|
|
@@ -184,7 +186,7 @@
|
|
|
184
186
|
content: attr(data-error);
|
|
185
187
|
position: absolute;
|
|
186
188
|
white-space: nowrap;
|
|
187
|
-
|
|
189
|
+
top: -28px;
|
|
188
190
|
left: -1px;
|
|
189
191
|
height: 20px;
|
|
190
192
|
line-height: 20px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _Icon from "@chaoswise/ui/lib/Icon";
|
|
1
|
+
import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
2
2
|
var _excluded = ["type"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _Popover from "@chaoswise/ui/lib/Popover";
|
|
1
|
+
import _Popover from "@chaoswise/ui/lib/Antd/Popover";
|
|
2
2
|
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); }
|
|
3
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
2
|
-
import _Typography from "@chaoswise/ui/lib/Typography";
|
|
2
|
+
import _Typography from "@chaoswise/ui/lib/Antd/Typography";
|
|
3
3
|
import React, { Fragment } from "react";
|
|
4
4
|
var Paragraph = _Typography.Paragraph;
|
|
5
5
|
var DoCommon = function DoCommon(_ref) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _List from "@chaoswise/ui/lib/List";
|
|
1
|
+
import _List from "@chaoswise/ui/lib/Antd/List";
|
|
2
2
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
3
|
-
import _Avatar from "@chaoswise/ui/lib/Avatar";
|
|
4
|
-
import _Card from "@chaoswise/ui/lib/Card";
|
|
3
|
+
import _Avatar from "@chaoswise/ui/lib/Antd/Avatar";
|
|
4
|
+
import _Card from "@chaoswise/ui/lib/Antd/Card";
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import DoAppIcon from '../../DoAppIcon';
|
|
7
7
|
import '../../../assets/index.less';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _Popover from "@chaoswise/ui/lib/Popover";
|
|
1
|
+
import _Popover from "@chaoswise/ui/lib/Antd/Popover";
|
|
2
2
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
3
3
|
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); }
|
|
4
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
2
|
-
import _Avatar from "@chaoswise/ui/lib/Avatar";
|
|
2
|
+
import _Avatar from "@chaoswise/ui/lib/Antd/Avatar";
|
|
3
3
|
import React, { Fragment } from 'react';
|
|
4
4
|
import '../assets/index.less';
|
|
5
5
|
import TagShowMoreList from './TagShowMoreList';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _Popover from "@chaoswise/ui/lib/Popover";
|
|
1
|
+
import _Popover from "@chaoswise/ui/lib/Antd/Popover";
|
|
2
2
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
3
|
-
import _Avatar from "@chaoswise/ui/lib/Avatar";
|
|
3
|
+
import _Avatar from "@chaoswise/ui/lib/Antd/Avatar";
|
|
4
4
|
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); }
|
|
5
5
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
6
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chaoswise/business",
|
|
3
3
|
"packageName": "chaoswiseBusiness",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"description": "业务组件库",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"ui",
|
|
@@ -111,5 +111,6 @@
|
|
|
111
111
|
"publishConfig": {
|
|
112
112
|
"access": "public"
|
|
113
113
|
},
|
|
114
|
-
"license": "MIT"
|
|
114
|
+
"license": "MIT",
|
|
115
|
+
"gitHead": "a40f0c7abb1409464f97cd5de28518b8535ebc43"
|
|
115
116
|
}
|