@ccs-ui/rc-pro 1.1.25-beta-17 → 1.1.25-beta-19
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/es/auth/index.d.ts +1 -0
- package/es/auth/index.js +6 -1
- package/es/auth/index.less +10 -0
- package/es/dialog/DialogSelfOkButton.d.ts +1 -1
- package/es/editor/index.d.ts +22 -0
- package/es/editor/index.js +15 -0
- package/es/editor/index.less +18 -0
- package/es/editor/javascript.d.ts +2 -0
- package/es/editor/javascript.js +55 -0
- package/es/editor/json.d.ts +7 -0
- package/es/editor/json.js +81 -0
- package/es/editor/sql.d.ts +2 -0
- package/es/editor/sql.js +53 -0
- package/es/ellipsis/index.d.ts +6 -0
- package/es/ellipsis/index.js +38 -0
- package/es/index.d.ts +3 -1
- package/es/index.js +3 -1
- package/package.json +9 -1
package/es/auth/index.d.ts
CHANGED
package/es/auth/index.js
CHANGED
|
@@ -15,12 +15,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
15
15
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
17
|
import { EllipsisOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
|
18
|
-
import { Button, Dropdown, Modal, Space } from 'antd';
|
|
18
|
+
import { Button, Divider, Dropdown, Modal, Space } from 'antd';
|
|
19
19
|
import { useContext, useEffect, useRef } from 'react';
|
|
20
20
|
import { useCcsPage } from '..';
|
|
21
21
|
import { TableSelectionContext } from "../pro-table/table";
|
|
22
22
|
import AuthButton from "./auth-button";
|
|
23
23
|
import AuthDropdown from "./auth-dropdown";
|
|
24
|
+
import "./index.less";
|
|
24
25
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
25
26
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -106,6 +107,10 @@ function AuthGroup(_ref4) {
|
|
|
106
107
|
if (isLink) {
|
|
107
108
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
108
109
|
children: [/*#__PURE__*/_jsx(Space, {
|
|
110
|
+
split: /*#__PURE__*/_jsx(Divider, {
|
|
111
|
+
type: "vertical"
|
|
112
|
+
}),
|
|
113
|
+
className: "ccs-group-link",
|
|
109
114
|
children: showBtns === null || showBtns === void 0 ? void 0 : showBtns.map(function (_ref7) {
|
|
110
115
|
var key = _ref7.key,
|
|
111
116
|
label = _ref7.label,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormProps } from 'antd';
|
|
2
2
|
import { DialogFormRef } from './form';
|
|
3
3
|
import { CcsDialogModalProps } from './hook';
|
|
4
|
-
declare const DialogSelfOkButton: ({ auth, formRef, formInitialValues, onCancel, onOk, }: Pick<CcsDialogModalProps, "auth" | "
|
|
4
|
+
declare const DialogSelfOkButton: ({ auth, formRef, formInitialValues, onCancel, onOk, }: Pick<CcsDialogModalProps, "auth" | "onOk" | "onCancel"> & {
|
|
5
5
|
formRef: React.RefObject<DialogFormRef>;
|
|
6
6
|
formInitialValues: FormProps['initialValues'];
|
|
7
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactCodeMirrorProps } from '@uiw/react-codemirror';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
import './index.less';
|
|
4
|
+
import JavaScriptEditor from './javascript';
|
|
5
|
+
import JsonEditor from './json';
|
|
6
|
+
import SqlEditor from './sql';
|
|
7
|
+
export type EditorPropsType = ReactCodeMirrorProps & {
|
|
8
|
+
value?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
bordered?: boolean;
|
|
13
|
+
isPreview?: boolean;
|
|
14
|
+
onChange?: (e: string) => void;
|
|
15
|
+
};
|
|
16
|
+
declare function Editor({}: {}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare namespace Editor {
|
|
18
|
+
var Json: typeof JsonEditor;
|
|
19
|
+
var Js: typeof JavaScriptEditor;
|
|
20
|
+
var Sql: typeof SqlEditor;
|
|
21
|
+
}
|
|
22
|
+
export default Editor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
2
|
+
import "./index.less";
|
|
3
|
+
import JavaScriptEditor from "./javascript";
|
|
4
|
+
import JsonEditor from "./json";
|
|
5
|
+
import SqlEditor from "./sql";
|
|
6
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
function Editor(_ref) {
|
|
9
|
+
_objectDestructuringEmpty(_ref);
|
|
10
|
+
return /*#__PURE__*/_jsx(_Fragment, {});
|
|
11
|
+
}
|
|
12
|
+
Editor.Json = JsonEditor;
|
|
13
|
+
Editor.Js = JavaScriptEditor;
|
|
14
|
+
Editor.Sql = SqlEditor;
|
|
15
|
+
export default Editor;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.ccs-editor {
|
|
2
|
+
.cm-editor {
|
|
3
|
+
outline: none !important;
|
|
4
|
+
|
|
5
|
+
&:hover {
|
|
6
|
+
outline: 1px solid rgb(200, 200, 200) !important;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ccs-editor-preview {
|
|
12
|
+
.cm-gutters {
|
|
13
|
+
display: none;
|
|
14
|
+
}
|
|
15
|
+
.cm-activeLine {
|
|
16
|
+
background: transparent;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var _excluded = ["placeholder", "height", "bordered", "isPreview", "style", "className"];
|
|
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
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
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; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import { javascript } from '@codemirror/lang-javascript';
|
|
11
|
+
import CodeMirror from '@uiw/react-codemirror';
|
|
12
|
+
import { theme } from 'antd';
|
|
13
|
+
import classNames from 'classnames';
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
export default function JavaScriptEditor(_ref) {
|
|
16
|
+
var _ref$placeholder = _ref.placeholder,
|
|
17
|
+
placeholder = _ref$placeholder === void 0 ? '请输入' : _ref$placeholder,
|
|
18
|
+
_ref$height = _ref.height,
|
|
19
|
+
height = _ref$height === void 0 ? '200px' : _ref$height,
|
|
20
|
+
bordered = _ref.bordered,
|
|
21
|
+
isPreview = _ref.isPreview,
|
|
22
|
+
style = _ref.style,
|
|
23
|
+
className = _ref.className,
|
|
24
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
var _theme$useToken = theme.useToken(),
|
|
26
|
+
token = _theme$useToken.token;
|
|
27
|
+
var isDark = token._appTheme === 'dark';
|
|
28
|
+
var styles = style || {};
|
|
29
|
+
var previewProps = {};
|
|
30
|
+
if (bordered !== false) {
|
|
31
|
+
styles.border = '1px solid #d9d9d9';
|
|
32
|
+
styles.borderRadius = 3;
|
|
33
|
+
}
|
|
34
|
+
if (isPreview) {
|
|
35
|
+
styles.border = 0;
|
|
36
|
+
previewProps.editable = false;
|
|
37
|
+
previewProps.readOnly = true;
|
|
38
|
+
previewProps.height = 'auto';
|
|
39
|
+
previewProps.basicSetup = _objectSpread(_objectSpread({}, _typeof(restProps.basicSetup) === 'object' ? restProps.basicSetup : {}), {}, {
|
|
40
|
+
lineNumbers: false
|
|
41
|
+
});
|
|
42
|
+
previewProps.className = "".concat(classNames(className, 'ccs-editor', 'ccs-editor-preview'));
|
|
43
|
+
}
|
|
44
|
+
return /*#__PURE__*/_jsx(CodeMirror, _objectSpread(_objectSpread({
|
|
45
|
+
height: height,
|
|
46
|
+
extensions: [javascript({
|
|
47
|
+
jsx: true
|
|
48
|
+
})],
|
|
49
|
+
placeholder: placeholder,
|
|
50
|
+
theme: isDark ? 'dark' : 'light'
|
|
51
|
+
}, restProps), {}, {
|
|
52
|
+
style: styles,
|
|
53
|
+
className: classNames('ccs-editor', className)
|
|
54
|
+
}, previewProps));
|
|
55
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EditorPropsType } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* JSON编辑器
|
|
4
|
+
* @param {number} height - 高度
|
|
5
|
+
* @param {string} placeholder - 占位
|
|
6
|
+
*/
|
|
7
|
+
export default function JsonEditor({ value, placeholder, height, bordered, onChange, style, className, isPreview, ...restProps }: EditorPropsType): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var _excluded = ["value", "placeholder", "height", "bordered", "onChange", "style", "className", "isPreview"];
|
|
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
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
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; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import { json } from '@codemirror/lang-json';
|
|
11
|
+
import { syntaxTree } from '@codemirror/language';
|
|
12
|
+
import { linter } from '@codemirror/lint';
|
|
13
|
+
import CodeMirror from '@uiw/react-codemirror';
|
|
14
|
+
import { theme } from 'antd';
|
|
15
|
+
import classNames from 'classnames';
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
var regexpLinter = linter(function (view) {
|
|
18
|
+
var diagnostics = [];
|
|
19
|
+
syntaxTree(view.state).cursor().iterate(function (node) {
|
|
20
|
+
if (node.name === '⚠') {
|
|
21
|
+
diagnostics.push({
|
|
22
|
+
from: node.from,
|
|
23
|
+
to: node.to,
|
|
24
|
+
severity: 'error',
|
|
25
|
+
message: 'JSON错误'
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return diagnostics;
|
|
30
|
+
});
|
|
31
|
+
var defaultPlaceholder = "JSON\u8F93\u5165\u793A\u4F8B\n{\n \"key\": 1,\n \"value\": \"..\"\n}";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* JSON编辑器
|
|
35
|
+
* @param {number} height - 高度
|
|
36
|
+
* @param {string} placeholder - 占位
|
|
37
|
+
*/
|
|
38
|
+
export default function JsonEditor(_ref) {
|
|
39
|
+
var value = _ref.value,
|
|
40
|
+
placeholder = _ref.placeholder,
|
|
41
|
+
_ref$height = _ref.height,
|
|
42
|
+
height = _ref$height === void 0 ? '200px' : _ref$height,
|
|
43
|
+
bordered = _ref.bordered,
|
|
44
|
+
_onChange = _ref.onChange,
|
|
45
|
+
style = _ref.style,
|
|
46
|
+
className = _ref.className,
|
|
47
|
+
isPreview = _ref.isPreview,
|
|
48
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
49
|
+
var _theme$useToken = theme.useToken(),
|
|
50
|
+
token = _theme$useToken.token;
|
|
51
|
+
var isDark = token._appTheme === 'dark';
|
|
52
|
+
var styles = style || {};
|
|
53
|
+
var previewProps = {};
|
|
54
|
+
if (bordered !== false) {
|
|
55
|
+
styles.border = '1px solid #d9d9d9';
|
|
56
|
+
styles.borderRadius = 3;
|
|
57
|
+
}
|
|
58
|
+
if (isPreview) {
|
|
59
|
+
styles.border = 0;
|
|
60
|
+
previewProps.editable = false;
|
|
61
|
+
previewProps.readOnly = true;
|
|
62
|
+
previewProps.height = 'auto';
|
|
63
|
+
previewProps.basicSetup = _objectSpread(_objectSpread({}, _typeof(restProps.basicSetup) === 'object' ? restProps.basicSetup : {}), {}, {
|
|
64
|
+
lineNumbers: false
|
|
65
|
+
});
|
|
66
|
+
previewProps.className = "".concat(classNames(className, 'ccs-editor', 'ccs-editor-preview'));
|
|
67
|
+
}
|
|
68
|
+
return /*#__PURE__*/_jsx(CodeMirror, _objectSpread(_objectSpread({
|
|
69
|
+
value: value,
|
|
70
|
+
height: height,
|
|
71
|
+
placeholder: placeholder || defaultPlaceholder,
|
|
72
|
+
extensions: [json(), regexpLinter],
|
|
73
|
+
onChange: function onChange(e) {
|
|
74
|
+
if (_onChange) _onChange(e);
|
|
75
|
+
},
|
|
76
|
+
theme: isDark ? 'dark' : 'light'
|
|
77
|
+
}, restProps), {}, {
|
|
78
|
+
style: styles,
|
|
79
|
+
className: classNames('ccs-editor', className)
|
|
80
|
+
}, previewProps));
|
|
81
|
+
}
|
package/es/editor/sql.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var _excluded = ["placeholder", "height", "bordered", "isPreview", "style", "className"];
|
|
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
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
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; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import { sql } from '@codemirror/lang-sql';
|
|
11
|
+
import CodeMirror from '@uiw/react-codemirror';
|
|
12
|
+
import { theme } from 'antd';
|
|
13
|
+
import classNames from 'classnames';
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
export default function SqlEditor(_ref) {
|
|
16
|
+
var _ref$placeholder = _ref.placeholder,
|
|
17
|
+
placeholder = _ref$placeholder === void 0 ? '请输入' : _ref$placeholder,
|
|
18
|
+
_ref$height = _ref.height,
|
|
19
|
+
height = _ref$height === void 0 ? '200px' : _ref$height,
|
|
20
|
+
bordered = _ref.bordered,
|
|
21
|
+
isPreview = _ref.isPreview,
|
|
22
|
+
style = _ref.style,
|
|
23
|
+
className = _ref.className,
|
|
24
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
var _theme$useToken = theme.useToken(),
|
|
26
|
+
token = _theme$useToken.token;
|
|
27
|
+
var isDark = token._appTheme === 'dark';
|
|
28
|
+
var styles = style || {};
|
|
29
|
+
var previewProps = {};
|
|
30
|
+
if (bordered !== false) {
|
|
31
|
+
styles.border = '1px solid #d9d9d9';
|
|
32
|
+
styles.borderRadius = 3;
|
|
33
|
+
}
|
|
34
|
+
if (isPreview) {
|
|
35
|
+
styles.border = 0;
|
|
36
|
+
previewProps.editable = false;
|
|
37
|
+
previewProps.readOnly = true;
|
|
38
|
+
previewProps.height = 'auto';
|
|
39
|
+
previewProps.basicSetup = _objectSpread(_objectSpread({}, _typeof(restProps.basicSetup) === 'object' ? restProps.basicSetup : {}), {}, {
|
|
40
|
+
lineNumbers: false
|
|
41
|
+
});
|
|
42
|
+
previewProps.className = "".concat(classNames(className, 'ccs-editor', 'ccs-editor-preview'));
|
|
43
|
+
}
|
|
44
|
+
return /*#__PURE__*/_jsx(CodeMirror, _objectSpread(_objectSpread({
|
|
45
|
+
height: height,
|
|
46
|
+
extensions: [sql()],
|
|
47
|
+
placeholder: placeholder,
|
|
48
|
+
theme: isDark ? 'dark' : 'light'
|
|
49
|
+
}, restProps), {}, {
|
|
50
|
+
style: styles,
|
|
51
|
+
className: classNames('ccs-editor', className)
|
|
52
|
+
}, previewProps));
|
|
53
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
import LinesEllipsis from 'react-lines-ellipsis';
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
export default function CcsLinesEllipsis(_ref) {
|
|
13
|
+
var text = _ref.text,
|
|
14
|
+
maxLine = _ref.maxLine;
|
|
15
|
+
var _useState = useState(false),
|
|
16
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
+
isShowMore = _useState2[0],
|
|
18
|
+
setIsShowMore = _useState2[1];
|
|
19
|
+
return isShowMore ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
20
|
+
children: [text, /*#__PURE__*/_jsx("a", {
|
|
21
|
+
onClick: function onClick() {
|
|
22
|
+
return setIsShowMore(false);
|
|
23
|
+
},
|
|
24
|
+
children: "... \u6536\u8D77"
|
|
25
|
+
})]
|
|
26
|
+
}) : /*#__PURE__*/_jsx(LinesEllipsis, {
|
|
27
|
+
text: text,
|
|
28
|
+
maxLine: maxLine,
|
|
29
|
+
ellipsis: /*#__PURE__*/_jsx("a", {
|
|
30
|
+
onClick: function onClick() {
|
|
31
|
+
return setIsShowMore(true);
|
|
32
|
+
},
|
|
33
|
+
children: "... \u5C55\u5F00"
|
|
34
|
+
}),
|
|
35
|
+
trimRight: true,
|
|
36
|
+
basedOn: "letters"
|
|
37
|
+
});
|
|
38
|
+
}
|
package/es/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { default as CcsColorPicker } from './color-picker';
|
|
|
5
5
|
export { default as CcsConfigProvider } from './config';
|
|
6
6
|
export { default as CcsDatePicker } from './date-picker';
|
|
7
7
|
export { default as CcsDialog } from './dialog';
|
|
8
|
+
export { default as CcsEditor } from './editor';
|
|
9
|
+
export { default as CcsLinesEllipsis } from './ellipsis';
|
|
8
10
|
export { default as CcsFullScreenButton } from './full-screen';
|
|
9
11
|
export { default as useCcsGlobal } from './hooks/use-global';
|
|
10
12
|
export { default as useCcsOnceEvent } from './hooks/use-once-event';
|
|
@@ -18,6 +20,7 @@ export { default as CcsLoading } from './loading';
|
|
|
18
20
|
export { default as CcsProGrid } from './pro-grid';
|
|
19
21
|
export { default as CcsProTable } from './pro-table';
|
|
20
22
|
export { default as CcsProTabs } from './pro-tabs';
|
|
23
|
+
export { default as CcsResizeObserver } from './resize-observer';
|
|
21
24
|
export { default as CcsResult } from './result';
|
|
22
25
|
export { default as CcsApiSelect } from './select';
|
|
23
26
|
export { default as CcsStatusTag } from './status-tag';
|
|
@@ -29,6 +32,5 @@ export { default as CcsUpload } from './upload';
|
|
|
29
32
|
export { default as CcsUtils } from './utils';
|
|
30
33
|
export { default as CcsVirtualList } from './virtual-list';
|
|
31
34
|
export { default as CcsWaterMark } from './water-mark';
|
|
32
|
-
export { default as CcsResizeObserver } from './resize-observer';
|
|
33
35
|
import * as CCS from './ccs';
|
|
34
36
|
export default CCS;
|
package/es/index.js
CHANGED
|
@@ -5,6 +5,8 @@ export { default as CcsColorPicker } from "./color-picker";
|
|
|
5
5
|
export { default as CcsConfigProvider } from "./config";
|
|
6
6
|
export { default as CcsDatePicker } from "./date-picker";
|
|
7
7
|
export { default as CcsDialog } from "./dialog";
|
|
8
|
+
export { default as CcsEditor } from "./editor";
|
|
9
|
+
export { default as CcsLinesEllipsis } from "./ellipsis";
|
|
8
10
|
export { default as CcsFullScreenButton } from "./full-screen";
|
|
9
11
|
export { default as useCcsGlobal } from "./hooks/use-global";
|
|
10
12
|
export { default as useCcsOnceEvent } from "./hooks/use-once-event";
|
|
@@ -18,6 +20,7 @@ export { default as CcsLoading } from "./loading";
|
|
|
18
20
|
export { default as CcsProGrid } from "./pro-grid";
|
|
19
21
|
export { default as CcsProTable } from "./pro-table";
|
|
20
22
|
export { default as CcsProTabs } from "./pro-tabs";
|
|
23
|
+
export { default as CcsResizeObserver } from "./resize-observer";
|
|
21
24
|
export { default as CcsResult } from "./result";
|
|
22
25
|
export { default as CcsApiSelect } from "./select";
|
|
23
26
|
export { default as CcsStatusTag } from "./status-tag";
|
|
@@ -29,6 +32,5 @@ export { default as CcsUpload } from "./upload";
|
|
|
29
32
|
export { default as CcsUtils } from "./utils";
|
|
30
33
|
export { default as CcsVirtualList } from "./virtual-list";
|
|
31
34
|
export { default as CcsWaterMark } from "./water-mark";
|
|
32
|
-
export { default as CcsResizeObserver } from "./resize-observer";
|
|
33
35
|
import * as CCS from "./ccs";
|
|
34
36
|
export default CCS;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ccs-ui/rc-pro",
|
|
3
|
-
"version": "1.1.25-beta-
|
|
3
|
+
"version": "1.1.25-beta-19",
|
|
4
4
|
"description": "验证码组件兼容暗黑模式;proTable封装rowselection代码;proTable添加自适应布局模式;",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -53,6 +53,12 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@ant-design/compatible": "^5.1.2",
|
|
55
55
|
"@ant-design/icons": "^5.1.4",
|
|
56
|
+
"@codemirror/lang-javascript": "^6.2.2",
|
|
57
|
+
"@codemirror/lang-json": "^6.0.1",
|
|
58
|
+
"@codemirror/lang-sql": "^6.7.0",
|
|
59
|
+
"@codemirror/language": "^6.10.2",
|
|
60
|
+
"@codemirror/lint": "^6.8.1",
|
|
61
|
+
"@uiw/react-codemirror": "^4.23.0",
|
|
56
62
|
"ahooks": "^3.7.7",
|
|
57
63
|
"antd": "^5.19.2",
|
|
58
64
|
"antd-img-crop": "^4.12.2",
|
|
@@ -68,6 +74,7 @@
|
|
|
68
74
|
"react-custom-scrollbars": "^4.2.1",
|
|
69
75
|
"react-draggable": "^4.4.5",
|
|
70
76
|
"react-error-overlay": "^6.0.11",
|
|
77
|
+
"react-lines-ellipsis": "^0.15.4",
|
|
71
78
|
"react-resizable": "^3.0.5",
|
|
72
79
|
"react-router": "^6.11.2",
|
|
73
80
|
"react-router-dom": "^6.11.2",
|
|
@@ -81,6 +88,7 @@
|
|
|
81
88
|
"@types/react-color": "^3.0.6",
|
|
82
89
|
"@types/react-custom-scrollbars": "^4.0.10",
|
|
83
90
|
"@types/react-dom": "^18.0.0",
|
|
91
|
+
"@types/react-lines-ellipsis": "^0.15.6",
|
|
84
92
|
"@types/react-resizable": "^3.0.7",
|
|
85
93
|
"@types/shortid": "^0.0.29",
|
|
86
94
|
"@types/throttle-debounce": "^5.0.2",
|