@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,157 +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
|
-
var _excluded = ["onChange", "value", "onPressEnter", "placeholder", "className", "render"];
|
|
3
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
-
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; }
|
|
5
|
-
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); }
|
|
6
|
-
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); }); }; }
|
|
7
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
8
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
9
|
-
import React, { useEffect, useRef, forwardRef, useImperativeHandle } from "react";
|
|
10
|
-
import PropTypes from "prop-types";
|
|
11
|
-
import { textInit, getCursorPosition, getCursorNodeAndIndex, setCursorPosition } from "./utils";
|
|
12
|
-
import "./index.less";
|
|
13
|
-
import CloseAllIcon from "./components/CloseAllIcon";
|
|
14
|
-
import classnames from "classnames";
|
|
15
|
-
var ContentEditableSearch = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
16
|
-
var _props$onChange = props.onChange,
|
|
17
|
-
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
18
|
-
value = props.value,
|
|
19
|
-
_props$onPressEnter = props.onPressEnter,
|
|
20
|
-
onPressEnter = _props$onPressEnter === void 0 ? function () {} : _props$onPressEnter,
|
|
21
|
-
placeholder = props.placeholder,
|
|
22
|
-
className = props.className,
|
|
23
|
-
_props$render = props.render,
|
|
24
|
-
render = _props$render === void 0 ? function () {} : _props$render,
|
|
25
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
26
|
-
var container = useRef(null);
|
|
27
|
-
var containerWrapperRef = useRef(null);
|
|
28
|
-
// 是否正在输入中文
|
|
29
|
-
var isComposing = useRef(false);
|
|
30
|
-
useImperativeHandle(ref, function () {
|
|
31
|
-
return {
|
|
32
|
-
getContainerWrapper: function getContainerWrapper() {
|
|
33
|
-
return containerWrapperRef.current;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
var handleValueChange = /*#__PURE__*/function () {
|
|
38
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(inputStr) {
|
|
39
|
-
var planeTextPosition, htmlString, _getCursorNodeAndInde, targetNode, targetIndex;
|
|
40
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
41
|
-
while (1) switch (_context.prev = _context.next) {
|
|
42
|
-
case 0:
|
|
43
|
-
// 计算当前光标位置(纯文本模式)
|
|
44
|
-
planeTextPosition = getCursorPosition(container.current); // 将纯文本模式转为html模式(语法解析器)
|
|
45
|
-
htmlString = render(inputStr);
|
|
46
|
-
if (!htmlString.trim()) {
|
|
47
|
-
// 修复空状态placeholder
|
|
48
|
-
container.current.innerHTML = "";
|
|
49
|
-
} else {
|
|
50
|
-
container.current.innerHTML = htmlString;
|
|
51
|
-
}
|
|
52
|
-
// // 找到格式化后的光标位置
|
|
53
|
-
if (planeTextPosition !== null) {
|
|
54
|
-
_getCursorNodeAndInde = getCursorNodeAndIndex(container.current, planeTextPosition), targetNode = _getCursorNodeAndInde.targetNode, targetIndex = _getCursorNodeAndInde.targetIndex; // 设置光标位置
|
|
55
|
-
setCursorPosition(targetNode, targetIndex);
|
|
56
|
-
}
|
|
57
|
-
case 4:
|
|
58
|
-
case "end":
|
|
59
|
-
return _context.stop();
|
|
60
|
-
}
|
|
61
|
-
}, _callee);
|
|
62
|
-
}));
|
|
63
|
-
return function handleValueChange(_x) {
|
|
64
|
-
return _ref.apply(this, arguments);
|
|
65
|
-
};
|
|
66
|
-
}();
|
|
67
|
-
var onInput = /*#__PURE__*/function () {
|
|
68
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
69
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
70
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
71
|
-
case 0:
|
|
72
|
-
if (!isComposing.current) {
|
|
73
|
-
_context2.next = 2;
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
return _context2.abrupt("return");
|
|
77
|
-
case 2:
|
|
78
|
-
handleValueChange(e.target.innerText);
|
|
79
|
-
onChange(e.target.innerText);
|
|
80
|
-
case 4:
|
|
81
|
-
case "end":
|
|
82
|
-
return _context2.stop();
|
|
83
|
-
}
|
|
84
|
-
}, _callee2);
|
|
85
|
-
}));
|
|
86
|
-
return function onInput(_x2) {
|
|
87
|
-
return _ref2.apply(this, arguments);
|
|
88
|
-
};
|
|
89
|
-
}();
|
|
90
|
-
useEffect(function () {
|
|
91
|
-
if ("value" in props) {
|
|
92
|
-
handleValueChange(value);
|
|
93
|
-
}
|
|
94
|
-
}, [value]);
|
|
95
|
-
var onKeyDown = function onKeyDown(e) {
|
|
96
|
-
var keyCode = e.keyCode;
|
|
97
|
-
if (keyCode === 13) {
|
|
98
|
-
// 回车阻止默认的换行行为
|
|
99
|
-
e.preventDefault();
|
|
100
|
-
onPressEnter(e.target.innerText);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
104
|
-
className: classnames("content-editable-search-wrapper", className, {}),
|
|
105
|
-
ref: containerWrapperRef
|
|
106
|
-
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
107
|
-
spellCheck: false,
|
|
108
|
-
onCompositionEnd: function onCompositionEnd(e) {
|
|
109
|
-
isComposing.current = false;
|
|
110
|
-
// 输入中文结束再触发一次,保证文本框对应内容与当前返回值一致,选项效果不会丢失
|
|
111
|
-
handleValueChange(e.target.innerText);
|
|
112
|
-
onChange(e.target.innerText);
|
|
113
|
-
},
|
|
114
|
-
onCompositionStart: function onCompositionStart() {
|
|
115
|
-
return isComposing.current = true;
|
|
116
|
-
},
|
|
117
|
-
className: "content-editable-search-input",
|
|
118
|
-
ref: container,
|
|
119
|
-
"data-attr": "container",
|
|
120
|
-
"data-placeholder": placeholder,
|
|
121
|
-
contentEditable: true,
|
|
122
|
-
suppressContentEditableWarning: true,
|
|
123
|
-
onPaste: textInit // 只粘贴纯文本 去除html标签
|
|
124
|
-
,
|
|
125
|
-
onInput: onInput,
|
|
126
|
-
onKeyDown: onKeyDown
|
|
127
|
-
}), /*#__PURE__*/React.createElement(CloseAllIcon, {
|
|
128
|
-
onClickCloseAll: function onClickCloseAll() {
|
|
129
|
-
container.current.innerText = "";
|
|
130
|
-
handleValueChange("");
|
|
131
|
-
onChange("");
|
|
132
|
-
}
|
|
133
|
-
}));
|
|
134
|
-
});
|
|
135
|
-
ContentEditableSearch.propTypes = {
|
|
136
|
-
/**
|
|
137
|
-
* 受控value
|
|
138
|
-
*/
|
|
139
|
-
value: PropTypes.string,
|
|
140
|
-
/**
|
|
141
|
-
* 文本内容变化的回调,(value) => {}
|
|
142
|
-
*/
|
|
143
|
-
onChange: PropTypes.func,
|
|
144
|
-
/**
|
|
145
|
-
* 文本内容回车变化的回调,(value) => {}
|
|
146
|
-
*/
|
|
147
|
-
onPressEnter: PropTypes.func,
|
|
148
|
-
/**
|
|
149
|
-
* 内容为空提示
|
|
150
|
-
*/
|
|
151
|
-
placeholder: PropTypes.string,
|
|
152
|
-
/**
|
|
153
|
-
* 聚合搜索框外层容器的类名
|
|
154
|
-
*/
|
|
155
|
-
className: PropTypes.string
|
|
156
|
-
};
|
|
157
|
-
export default ContentEditableSearch;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// == when hoverd
|
|
2
|
-
.hover(@color: @input-hover-border-color) {
|
|
3
|
-
border-color: @color;
|
|
4
|
-
border-right-width: @border-width-base !important;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
// input status
|
|
8
|
-
// == when focus or actived
|
|
9
|
-
.active(@color: @outline-color) {
|
|
10
|
-
border-color:~`colorPalette('@{color}', 5) `;
|
|
11
|
-
border-right-width: @border-width-base !important;
|
|
12
|
-
outline: 0;
|
|
13
|
-
box-shadow: @input-outline-offset @outline-blur-size @outline-width fade(@color, 20%);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.content-editable-search-wrapper {
|
|
17
|
-
background: #FFFFFF;
|
|
18
|
-
border-radius: 2px;
|
|
19
|
-
font-size: 12px;
|
|
20
|
-
display: flex;
|
|
21
|
-
align-items: flex-start;
|
|
22
|
-
white-space: pre-wrap;
|
|
23
|
-
position: relative;
|
|
24
|
-
border: @border-width-base @border-style-base @input-border-color;
|
|
25
|
-
border-radius: @border-radius-base;
|
|
26
|
-
width: 100%;
|
|
27
|
-
// 聚焦样式修改
|
|
28
|
-
&:focus-within {
|
|
29
|
-
.active();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&:hover {
|
|
33
|
-
.hover();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// 取消默认聚焦样式
|
|
37
|
-
&:focus-visible {
|
|
38
|
-
outline: none;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.content-editable-search-input {
|
|
42
|
-
position: relative;
|
|
43
|
-
padding: 0 10px;
|
|
44
|
-
flex: 1;
|
|
45
|
-
height: 100%;
|
|
46
|
-
min-height: 26px;
|
|
47
|
-
line-height: 26px;
|
|
48
|
-
outline: none;
|
|
49
|
-
|
|
50
|
-
&:empty:before {
|
|
51
|
-
content: attr(data-placeholder);
|
|
52
|
-
font-size: 12px;
|
|
53
|
-
color: @text-color-secondary;
|
|
54
|
-
line-height: 20px;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&:empty+.content-editable-close-all-icon {
|
|
58
|
-
display: none;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
&:focus:before {
|
|
62
|
-
content: ""; // 不能为none,否则placeholder不显示
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
// 粘贴去除格式
|
|
2
|
-
export function textInit(e) {
|
|
3
|
-
// cancel paste
|
|
4
|
-
e.preventDefault();
|
|
5
|
-
// get text representation of clipboard
|
|
6
|
-
var text = (e.originalEvent || e).clipboardData.getData("text/plain");
|
|
7
|
-
// insert text manually
|
|
8
|
-
document.execCommand("insertText", false, text);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// 获取当前输入的光标位置(纯文本模式)
|
|
12
|
-
export var getCursorPosition = function getCursorPosition(node) {
|
|
13
|
-
var _endContainer$dataset;
|
|
14
|
-
var selection = window.getSelection();
|
|
15
|
-
if (selection.type !== 'Caret') {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
var range = selection.getRangeAt(0);
|
|
19
|
-
var endContainer = range.endContainer;
|
|
20
|
-
if (((_endContainer$dataset = endContainer.dataset) === null || _endContainer$dataset === void 0 ? void 0 : _endContainer$dataset['attr']) === 'container') {
|
|
21
|
-
return 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// 计算纯文本模式下,当前光标所处的位置
|
|
25
|
-
var positionIndex = 0;
|
|
26
|
-
var isBreak = false;
|
|
27
|
-
var _loop = function loop(node) {
|
|
28
|
-
var nodes = node.childNodes;
|
|
29
|
-
for (var index = 0; index < nodes.length; index++) {
|
|
30
|
-
if (isBreak) {
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
var element = nodes[index];
|
|
34
|
-
if (element.nodeType === 3) {
|
|
35
|
-
if (element === endContainer) {
|
|
36
|
-
positionIndex += range.endOffset;
|
|
37
|
-
isBreak = true;
|
|
38
|
-
break;
|
|
39
|
-
} else {
|
|
40
|
-
positionIndex += element.data.length;
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
_loop(element);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
_loop(node);
|
|
48
|
-
return positionIndex;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// 根据纯文本模式下的光标位置,设置html模式下的光标位置
|
|
52
|
-
export var getCursorNodeAndIndex = function getCursorNodeAndIndex(node, positionIndex) {
|
|
53
|
-
var targetNode;
|
|
54
|
-
var targetIndex;
|
|
55
|
-
var sum = 0;
|
|
56
|
-
var isBreak = false;
|
|
57
|
-
var _loop2 = function loop(node) {
|
|
58
|
-
var nodes = node.childNodes;
|
|
59
|
-
for (var index = 0; index < nodes.length; index++) {
|
|
60
|
-
if (isBreak) {
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
var element = nodes[index];
|
|
64
|
-
if (element.nodeType === 3) {
|
|
65
|
-
var _element$data;
|
|
66
|
-
var elementLength = ((_element$data = element.data) === null || _element$data === void 0 ? void 0 : _element$data.length) || 0;
|
|
67
|
-
if (sum <= positionIndex && sum + elementLength >= positionIndex) {
|
|
68
|
-
targetNode = element;
|
|
69
|
-
targetIndex = positionIndex - sum;
|
|
70
|
-
isBreak = true;
|
|
71
|
-
break;
|
|
72
|
-
} else {
|
|
73
|
-
sum += elementLength;
|
|
74
|
-
}
|
|
75
|
-
} else {
|
|
76
|
-
_loop2(element);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
_loop2(node);
|
|
81
|
-
return {
|
|
82
|
-
targetNode: targetNode,
|
|
83
|
-
targetIndex: targetIndex
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
// 光标跳转到指定位置
|
|
88
|
-
export var setCursorPosition = function setCursorPosition(targetNode, targetIndex) {
|
|
89
|
-
if (!targetNode) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
var selection = window.getSelection();
|
|
93
|
-
var range = new Range();
|
|
94
|
-
range.setStart(targetNode, targetIndex);
|
|
95
|
-
range.collapse(true);
|
|
96
|
-
selection.removeAllRanges();
|
|
97
|
-
selection.addRange(range);
|
|
98
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
.form-properties-box {
|
|
2
|
-
.wrapper {
|
|
3
|
-
height: 20px;
|
|
4
|
-
font-size: 12px;
|
|
5
|
-
|
|
6
|
-
.wrapper-inner {
|
|
7
|
-
float: left;
|
|
8
|
-
max-width: 85px;
|
|
9
|
-
height: 20px;
|
|
10
|
-
line-height: 18px;
|
|
11
|
-
margin-right: 2px;
|
|
12
|
-
margin-bottom: 4px;
|
|
13
|
-
padding: 0 5px;
|
|
14
|
-
background: #fafafa;
|
|
15
|
-
border: 1px solid #d9d9d9;
|
|
16
|
-
border-radius: 2px;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
text-overflow: ellipsis;
|
|
20
|
-
white-space: nowrap;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.wrapper-inner:last-child {
|
|
24
|
-
margin-right: 0;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.wrapper-inner-fixed {
|
|
28
|
-
float: left;
|
|
29
|
-
height: 20px;
|
|
30
|
-
line-height: 18px;
|
|
31
|
-
margin-right: 2px;
|
|
32
|
-
padding: 0 6px;
|
|
33
|
-
background: #fafafa;
|
|
34
|
-
border: 1px solid #d9d9d9;
|
|
35
|
-
border-radius: 2px;
|
|
36
|
-
cursor: pointer;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.@{ant-prefix}-popover-inner-content:nth-child(4n) {
|
|
41
|
-
margin-right: 0px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.inner {
|
|
45
|
-
max-width: 450px;
|
|
46
|
-
font-size: 12px;
|
|
47
|
-
|
|
48
|
-
.@{ant-prefix}-popover-inner-content {
|
|
49
|
-
float: left;
|
|
50
|
-
height: 20px;
|
|
51
|
-
line-height: 18px;
|
|
52
|
-
background: #fafafa;
|
|
53
|
-
border: 1px solid #d9d9d9;
|
|
54
|
-
border-radius: 2px;
|
|
55
|
-
padding: 0 6px;
|
|
56
|
-
margin: 0 2px 4px 0;
|
|
57
|
-
cursor: pointer;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.inner:after {
|
|
62
|
-
/*伪元素是行内元素 正常浏览器清除浮动方法*/
|
|
63
|
-
content: "";
|
|
64
|
-
display: block;
|
|
65
|
-
height: 0;
|
|
66
|
-
clear: both;
|
|
67
|
-
visibility: hidden;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.tag-wrapper-inner {
|
|
71
|
-
.@{ant-prefix}-popover-inner-content {
|
|
72
|
-
padding: 8px !important;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
.form-properties-box {
|
|
2
|
-
.ciWrapper {
|
|
3
|
-
height: 28px;
|
|
4
|
-
font-size: 12px;
|
|
5
|
-
display: flex;
|
|
6
|
-
|
|
7
|
-
.wrapper-inner {
|
|
8
|
-
float: left;
|
|
9
|
-
max-width: 85px;
|
|
10
|
-
height: 20px;
|
|
11
|
-
line-height: 18px;
|
|
12
|
-
margin-right: 2px;
|
|
13
|
-
background: #fafafa;
|
|
14
|
-
border: 1px solid #d9d9d9;
|
|
15
|
-
border-radius: 2px;
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
overflow: hidden;
|
|
18
|
-
text-overflow: ellipsis;
|
|
19
|
-
white-space: nowrap;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.wrapper-inner:last-child {
|
|
23
|
-
margin-right: 0;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.wrapper-inner-fixed {
|
|
27
|
-
float: left;
|
|
28
|
-
height: 20px;
|
|
29
|
-
line-height: 18px;
|
|
30
|
-
margin-right: 2px;
|
|
31
|
-
padding: 0 6px;
|
|
32
|
-
background: #fafafa;
|
|
33
|
-
border: 1px solid #d9d9d9;
|
|
34
|
-
border-radius: 2px;
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.@{ant-prefix}-popover-inner-content:nth-child(4n) {
|
|
40
|
-
margin-right: 0px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.inner {
|
|
44
|
-
max-width: 450px;
|
|
45
|
-
font-size: 12px;
|
|
46
|
-
|
|
47
|
-
.@{ant-prefix}-popover-inner-content {
|
|
48
|
-
float: left;
|
|
49
|
-
height: 20px;
|
|
50
|
-
line-height: 18px;
|
|
51
|
-
background: #fafafa;
|
|
52
|
-
border: 1px solid #d9d9d9;
|
|
53
|
-
border-radius: 2px;
|
|
54
|
-
padding: 0 6px;
|
|
55
|
-
margin: 0 2px 4px 0;
|
|
56
|
-
cursor: pointer;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.inner:after {
|
|
61
|
-
/*伪元素是行内元素 正常浏览器清除浮动方法*/
|
|
62
|
-
content: "";
|
|
63
|
-
display: block;
|
|
64
|
-
height: 0;
|
|
65
|
-
clear: both;
|
|
66
|
-
visibility: hidden;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.tag-wrapper-inner {
|
|
70
|
-
.@{ant-prefix}-popover-inner-content {
|
|
71
|
-
padding: 8px !important;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
@uploda-card-width : 88px;
|
|
2
|
-
@uploda-card-height : 88px;
|
|
3
|
-
|
|
4
|
-
.form-properties-box {
|
|
5
|
-
.ci-detail-user {
|
|
6
|
-
width: 100%;
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-wrap: wrap;
|
|
9
|
-
|
|
10
|
-
.ci-detail-user-item {
|
|
11
|
-
display: flex;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.ci-detail-user-name {
|
|
15
|
-
width: calc(100% - 32px);
|
|
16
|
-
white-space: nowrap;
|
|
17
|
-
overflow: hidden;
|
|
18
|
-
text-overflow: ellipsis;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.ci-detail-avatar {
|
|
22
|
-
color: #fff;
|
|
23
|
-
background-color: #008dff;
|
|
24
|
-
margin-right: 8px;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.ci-detail-user-group {
|
|
29
|
-
width: 100%;
|
|
30
|
-
|
|
31
|
-
.user-group-item {
|
|
32
|
-
font-weight: 600;
|
|
33
|
-
background: #008dff;
|
|
34
|
-
color: #fff;
|
|
35
|
-
display: inline-block;
|
|
36
|
-
height: 25px;
|
|
37
|
-
padding: 0 5px;
|
|
38
|
-
border-radius: 10px;
|
|
39
|
-
margin-right: 5px;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.desBox {
|
|
44
|
-
width: 100%;
|
|
45
|
-
height: 100%;
|
|
46
|
-
white-space: nowrap;
|
|
47
|
-
overflow: hidden;
|
|
48
|
-
text-overflow: ellipsis;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.doTextArea {
|
|
52
|
-
width: 100%;
|
|
53
|
-
line-height: 20px;
|
|
54
|
-
min-height: 50;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
.ci-detail-image {
|
|
59
|
-
|
|
60
|
-
.@{ant-prefix}-upload-list-item-uploading-text {
|
|
61
|
-
text-align: center;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.@{ant-prefix}-upload.@{ant-prefix}-upload-select-picture-card {
|
|
65
|
-
width: @uploda-card-width !important;
|
|
66
|
-
height: @uploda-card-height !important;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.@{ant-prefix}-upload-list-picture-card .@{ant-prefix}-upload-list-item {
|
|
70
|
-
width: @uploda-card-width !important;
|
|
71
|
-
height: @uploda-card-height !important;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.@{ant-prefix}-upload-list-picture-card-container {
|
|
75
|
-
width: @uploda-card-width !important;
|
|
76
|
-
height: @uploda-card-height !important;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.@{ant-prefix}-upload-list {
|
|
80
|
-
padding: 0 !important;
|
|
81
|
-
background-color: #fff !important;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
.ci-detail-file {
|
|
87
|
-
|
|
88
|
-
.cw-upload-drag_ {
|
|
89
|
-
margin-top: 0 !important;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.@{ant-prefix}-upload-list {
|
|
93
|
-
background-color: white;
|
|
94
|
-
padding: 0;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.@{ant-prefix}-upload-list-item {
|
|
98
|
-
margin-top: 4px !important;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.ci-detail-quote-card {
|
|
104
|
-
|
|
105
|
-
.@{ant-prefix}-card-body {
|
|
106
|
-
padding: 3px;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.@{ant-prefix}-card-meta {
|
|
110
|
-
display: flex;
|
|
111
|
-
align-items: center;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.@{ant-prefix}-card-meta-detail {
|
|
115
|
-
flex: 1;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.@{ant-prefix}-card-meta-title {
|
|
119
|
-
font-weight: normal;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.ci-detail-quote-card-title {
|
|
123
|
-
width: 100%;
|
|
124
|
-
height: 28px;
|
|
125
|
-
display: flex;
|
|
126
|
-
align-items: center;
|
|
127
|
-
justify-content: space-between;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.ci-detail-quote-card-title-span {
|
|
131
|
-
overflow: hidden;
|
|
132
|
-
white-space: nowrap;
|
|
133
|
-
text-overflow: ellipsis;
|
|
134
|
-
font-size: 12px;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.ci-detail-quote-list {
|
|
140
|
-
.@{ant-prefix}-list-item {
|
|
141
|
-
margin-bottom: 12px !important;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.ci-table-view {
|
|
146
|
-
width: 100%;
|
|
147
|
-
overflow: hidden;
|
|
148
|
-
white-space: nowrap;
|
|
149
|
-
text-overflow: ellipsis;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
//u为范围-点阵图
|
|
153
|
-
.unit-bitmap-box {
|
|
154
|
-
|
|
155
|
-
.lattice {
|
|
156
|
-
cursor: pointer;
|
|
157
|
-
float: left;
|
|
158
|
-
display: block;
|
|
159
|
-
width: 26px;
|
|
160
|
-
height: 26px;
|
|
161
|
-
margin: 2px 4px 2px 0px;
|
|
162
|
-
padding: 0;
|
|
163
|
-
color: rgba(0, 0, 0, .65);
|
|
164
|
-
line-height: 26px;
|
|
165
|
-
text-align: center;
|
|
166
|
-
background: #E8E8E8;
|
|
167
|
-
border: 1px solid transparent;
|
|
168
|
-
border-radius: 2px;
|
|
169
|
-
-webkit-transition: background .3s ease;
|
|
170
|
-
transition: background .3s ease;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.locked_lattice {
|
|
174
|
-
color: rgba(0, 0, 0, .25);
|
|
175
|
-
background: #f5f5f5;
|
|
176
|
-
border: 1px solid transparent;
|
|
177
|
-
border-radius: 0;
|
|
178
|
-
cursor: not-allowed;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.usaged_lattice {
|
|
182
|
-
color: #fff;
|
|
183
|
-
background: #1890FF;
|
|
184
|
-
border: 1px solid transparent;
|
|
185
|
-
border-radius: 0;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
}
|