tenjin-ui-kit 0.3.72-dev-1 → 0.3.73
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/common/hooks/apiHooks.js +91 -199
- package/common/hooks/newApiHook.js +127 -258
- package/common/utils/security/index.js +2 -2
- package/common/utils/security/securityConfig.js +1 -2
- package/components/Canvas.js +172 -101
- package/components/DragBox/index.js +21 -31
- package/components/InputWithChip/index.js +178 -83
- package/components/RightContext/index.js +17 -41
- package/components/WorkFlow.js +19 -29
- package/components/WorkFlowBuilder.js +32 -56
- package/components/alert/Style.js +11 -14
- package/components/alert/index.js +8 -14
- package/components/attachment/index.js +26 -31
- package/components/authenticationProvider/AuthError.js +3 -4
- package/components/authenticationProvider/AuthLoader.js +3 -4
- package/components/authenticationProvider/index.js +58 -130
- package/components/avatar/index.js +24 -23
- package/components/avatar/styles.js +76 -77
- package/components/breadCrumbs/index.js +64 -89
- package/components/breadCrumbs/style.js +1 -4
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +7 -6
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +5 -8
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +7 -6
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +8 -7
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +8 -7
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +16 -19
- package/components/browsingTestCaseLayout/index.js +30 -46
- package/components/button/index.js +47 -58
- package/components/chatBotModal/index.js +40 -61
- package/components/checkBox/index.js +8 -10
- package/components/combobox/index.js +66 -100
- package/components/divider/index.js +9 -18
- package/components/editableField/index.js +19 -46
- package/components/error/index.js +6 -12
- package/components/errorBoundary/index.js +74 -98
- package/components/fileUploader/index.js +46 -58
- package/components/fileUploader/style.js +46 -49
- package/components/filter/ValueSelector.js +149 -245
- package/components/filter/index.js +45 -71
- package/components/iconButton/index.js +3 -4
- package/components/input/index.js +60 -74
- package/components/layout/index.js +36 -49
- package/components/layout/main/index.js +13 -14
- package/components/layout/main/style.js +11 -14
- package/components/layout/pageContent/index.js +8 -7
- package/components/layout/sidebar/FlatMenu.js +51 -47
- package/components/layout/sidebar/GroupedIconMenu.js +169 -194
- package/components/layout/sidebar/GroupedMenu.js +45 -50
- package/components/layout/sidebar/ProjectMenu.js +165 -185
- package/components/layout/sidebar/index.js +27 -26
- package/components/layout/sidebar/style.js +138 -143
- package/components/layout/topBar/ProjectTopbar.js +91 -208
- package/components/layout/topBar/UserAvatar.js +53 -69
- package/components/layout/topBar/index.js +23 -41
- package/components/loader/index.js +9 -12
- package/components/menu/index.js +23 -42
- package/components/modal/Modal.js +5 -6
- package/components/modal/index.js +16 -20
- package/components/modal/style.js +53 -56
- package/components/optionMenu/index.js +32 -47
- package/components/pagination/index.js +23 -43
- package/components/pagination/style.js +25 -28
- package/components/paginationUpdated/index.js +22 -29
- package/components/paper/index.js +20 -22
- package/components/paper/style.js +24 -27
- package/components/reactSelect/index.js +64 -97
- package/components/reactSelect/style.js +131 -151
- package/components/richTextEditor/index.js +24 -48
- package/components/select/GroupedSelect.js +96 -99
- package/components/select/SimpleSelect.js +61 -103
- package/components/select/index.js +56 -69
- package/components/simpleSelect/index.js +18 -22
- package/components/sort/index.js +23 -36
- package/components/switch/index.js +14 -15
- package/components/switch/style.js +29 -32
- package/components/switch/switch.js +30 -47
- package/components/table/ReactTable.js +59 -83
- package/components/table/SimpleTable.js +67 -91
- package/components/table/index.js +300 -206
- package/components/text/index.js +22 -30
- package/components/timeStamp/index.js +4 -9
- package/components/timeStamp/style.js +12 -15
- package/components/topBar/index.js +86 -102
- package/components/tree/index.js +30 -58
- package/components/tree/style.js +20 -23
- package/components/valuePicker/ValueSelector.js +78 -160
- package/components/valuePicker/index.js +30 -50
- package/components/wrapperLayout/layout/index.js +8 -7
- package/components/wrapperLayout/main/index.js +8 -7
- package/components/wrapperLayout/main/pageContainer/index.js +6 -5
- package/components/wrapperLayout/main/sideBar/index.js +171 -175
- package/components/wrapperLayout/main/sideBar/style.js +177 -183
- package/components/wrapperLayout/topBar/UserAvatar.js +6 -5
- package/components/wrapperLayout/topBar/avatar.js +15 -18
- package/components/wrapperLayout/topBar/index.js +115 -107
- package/components/wrapperLayout/topBar/menuIcon.js +6 -5
- package/components/wrapperLayout/topBar/style.js +63 -64
- package/http/index.js +92 -188
- package/index.js +53 -55
- package/package.json +3 -3
- package/templates/listPage/index.js +168 -196
- package/themes/default.js +5 -7
- package/themes/defaultSmall.js +2 -3
- package/themes/responsiveTheme.js +6 -8
|
@@ -6,158 +6,138 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useStyles = exports.getCustomStyles = void 0;
|
|
7
7
|
var _styles = require("@mui/styles");
|
|
8
8
|
var _responsiveTheme = _interopRequireDefault(require("../../themes/responsiveTheme"));
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const useStyles = exports.useStyles = (0, _styles.makeStyles)(() => ({
|
|
11
|
+
inputLabel: _ref => {
|
|
12
|
+
let {
|
|
13
|
+
colorTheme
|
|
14
|
+
} = _ref;
|
|
15
|
+
return {
|
|
16
|
+
color: colorTheme ? _responsiveTheme.default.palette.text.main : _responsiveTheme.default.palette.text.main,
|
|
17
|
+
fontSize: _responsiveTheme.default.typography.fontSize,
|
|
18
|
+
fontWeight: 500,
|
|
19
|
+
fontFamily: _responsiveTheme.default.typography.fontFamily,
|
|
20
|
+
display: "flex",
|
|
21
|
+
marginBottom: "12px"
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
star: {
|
|
25
|
+
lineHeight: "unset",
|
|
26
|
+
marginLeft: "4px"
|
|
27
|
+
},
|
|
28
|
+
helperText: {
|
|
29
|
+
color: "#f44336",
|
|
30
|
+
fontSize: "8.5px"
|
|
31
|
+
},
|
|
32
|
+
blueTheme: {
|
|
33
|
+
// width: "100%",
|
|
34
|
+
height: "200px",
|
|
35
|
+
backgroundColor: "#3D3981",
|
|
36
|
+
borderRadius: "7px",
|
|
37
|
+
padding: "16px",
|
|
38
|
+
width: "50%"
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
const getCustomStyles = _ref2 => {
|
|
42
|
+
let {
|
|
43
|
+
colorTheme,
|
|
44
|
+
error
|
|
45
|
+
} = _ref2;
|
|
17
46
|
return {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
});
|
|
113
|
-
},
|
|
114
|
-
dropdownIndicator: function dropdownIndicator(provided) {
|
|
115
|
-
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
116
|
-
color: colorTheme ? "#f4f7fc" : _responsiveTheme.default.palette.text.main,
|
|
117
|
-
opacity: 1,
|
|
118
|
-
padding: "0rem 0rem 0.1rem 0rem"
|
|
119
|
-
});
|
|
120
|
-
},
|
|
121
|
-
singleValue: function singleValue(provided) {
|
|
122
|
-
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
123
|
-
color: colorTheme ? "#F4F7FC" : _responsiveTheme.default.palette.text.main,
|
|
124
|
-
// fontWeight: 500,
|
|
125
|
-
fontSize: _responsiveTheme.default.typography.fontSize,
|
|
126
|
-
padding: "0rem 0rem 0.1rem 0rem"
|
|
127
|
-
});
|
|
128
|
-
},
|
|
129
|
-
valueContainer: function valueContainer(provided) {
|
|
130
|
-
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
131
|
-
// padding: 0,
|
|
132
|
-
color: colorTheme ? "#F4F7FC" : _responsiveTheme.default.palette.primary.tenjinLightBlack
|
|
133
|
-
});
|
|
134
|
-
},
|
|
135
|
-
clearIndicator: function clearIndicator(provided) {
|
|
136
|
-
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
137
|
-
color: colorTheme ? "#f4f7fc" : "#adb0bb"
|
|
138
|
-
});
|
|
139
|
-
},
|
|
140
|
-
multiValue: function multiValue(provided) {
|
|
141
|
-
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
142
|
-
backgroundColor: _responsiveTheme.default.palette.primary.tenjinMLight,
|
|
143
|
-
border: "1px solid #DAE0FF",
|
|
144
|
-
marginTop: "-0.15rem"
|
|
145
|
-
});
|
|
146
|
-
},
|
|
147
|
-
multiValueLabel: function multiValueLabel(provided) {
|
|
148
|
-
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
149
|
-
color: _responsiveTheme.default.palette.text.main,
|
|
150
|
-
fontWeight: 400,
|
|
151
|
-
fontSize: _responsiveTheme.default.typography.fontSize,
|
|
152
|
-
fontFamily: _responsiveTheme.default.typography.fontFamily
|
|
153
|
-
});
|
|
154
|
-
},
|
|
155
|
-
multiValueRemove: function multiValueRemove(provided) {
|
|
156
|
-
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
157
|
-
color: _responsiveTheme.default.palette.primary.tenjinFBlue,
|
|
158
|
-
cursor: "pointer"
|
|
159
|
-
});
|
|
160
|
-
}
|
|
47
|
+
option: provided => ({
|
|
48
|
+
...provided,
|
|
49
|
+
color: colorTheme ? "#f4f7fc" : _responsiveTheme.default.palette.text.main,
|
|
50
|
+
fontSize: "10px",
|
|
51
|
+
fontFamily: _responsiveTheme.default.typography.fontFamily,
|
|
52
|
+
backgroundColor: colorTheme ? "#6e6ba1" : _responsiveTheme.default.palette.white.main,
|
|
53
|
+
opacity: "100%",
|
|
54
|
+
"&:hover": {
|
|
55
|
+
backgroundColor: _responsiveTheme.default.palette.secondary_grey.main,
|
|
56
|
+
color: _responsiveTheme.default.palette.primary.main
|
|
57
|
+
}
|
|
58
|
+
}),
|
|
59
|
+
control: provided => ({
|
|
60
|
+
...provided,
|
|
61
|
+
backgroundColor: colorTheme ? "#6e6ba1" : _responsiveTheme.default.palette.primary.white,
|
|
62
|
+
boxShadow: "none",
|
|
63
|
+
fontSize: "10px",
|
|
64
|
+
fontFamily: _responsiveTheme.default.typography.fontFamily,
|
|
65
|
+
// marginTop: theme.spacing(1.25),
|
|
66
|
+
height: "2.4rem !important",
|
|
67
|
+
border: error ? `1px solid #be1515` : colorTheme ? "none" : "1px solid #CFD7DF",
|
|
68
|
+
"&:hover": {
|
|
69
|
+
border: error ? `1px solid #be1515` : colorTheme ? "none" : "1px solid #CFD7DF"
|
|
70
|
+
}
|
|
71
|
+
// minHeight: "31.83px !important",
|
|
72
|
+
//border: "1px solid #adbac9",
|
|
73
|
+
}),
|
|
74
|
+
placeholder: provided => ({
|
|
75
|
+
...provided,
|
|
76
|
+
color: colorTheme ? _responsiveTheme.default.palette.white.main : _responsiveTheme.default.palette.grey_dark.main,
|
|
77
|
+
fontFamily: _responsiveTheme.default.typography.fontFamily,
|
|
78
|
+
fontWeight: 400,
|
|
79
|
+
fontSize: _responsiveTheme.default.typography.fontSize,
|
|
80
|
+
padding: "0rem 0rem 0.1rem 0rem"
|
|
81
|
+
}),
|
|
82
|
+
indicatorSeparator: provided => ({
|
|
83
|
+
...provided,
|
|
84
|
+
background: "none"
|
|
85
|
+
}),
|
|
86
|
+
input: provided => ({
|
|
87
|
+
...provided,
|
|
88
|
+
color: colorTheme ? "#F4F7FC" : _responsiveTheme.default.palette.text.main,
|
|
89
|
+
padding: "0rem 0rem 0.1rem 0rem"
|
|
90
|
+
}),
|
|
91
|
+
menu: provided => ({
|
|
92
|
+
...provided,
|
|
93
|
+
padding: 0,
|
|
94
|
+
backgroundColor: colorTheme ? "#6e6ba1" : _responsiveTheme.default.palette.white.main,
|
|
95
|
+
zIndex: 9999
|
|
96
|
+
}),
|
|
97
|
+
menuPortal: provided => ({
|
|
98
|
+
...provided,
|
|
99
|
+
zIndex: 9999
|
|
100
|
+
}),
|
|
101
|
+
dropdownIndicator: provided => ({
|
|
102
|
+
...provided,
|
|
103
|
+
color: colorTheme ? "#f4f7fc" : _responsiveTheme.default.palette.text.main,
|
|
104
|
+
opacity: 1,
|
|
105
|
+
padding: "0rem 0rem 0.1rem 0rem"
|
|
106
|
+
}),
|
|
107
|
+
singleValue: provided => ({
|
|
108
|
+
...provided,
|
|
109
|
+
color: colorTheme ? "#F4F7FC" : _responsiveTheme.default.palette.text.main,
|
|
110
|
+
// fontWeight: 500,
|
|
111
|
+
fontSize: _responsiveTheme.default.typography.fontSize,
|
|
112
|
+
padding: "0rem 0rem 0.1rem 0rem"
|
|
113
|
+
}),
|
|
114
|
+
valueContainer: provided => ({
|
|
115
|
+
...provided,
|
|
116
|
+
// padding: 0,
|
|
117
|
+
color: colorTheme ? "#F4F7FC" : _responsiveTheme.default.palette.primary.tenjinLightBlack
|
|
118
|
+
}),
|
|
119
|
+
clearIndicator: provided => ({
|
|
120
|
+
...provided,
|
|
121
|
+
color: colorTheme ? "#f4f7fc" : "#adb0bb"
|
|
122
|
+
}),
|
|
123
|
+
multiValue: provided => ({
|
|
124
|
+
...provided,
|
|
125
|
+
backgroundColor: _responsiveTheme.default.palette.primary.tenjinMLight,
|
|
126
|
+
border: "1px solid #DAE0FF",
|
|
127
|
+
marginTop: "-0.15rem"
|
|
128
|
+
}),
|
|
129
|
+
multiValueLabel: provided => ({
|
|
130
|
+
...provided,
|
|
131
|
+
color: _responsiveTheme.default.palette.text.main,
|
|
132
|
+
fontWeight: 400,
|
|
133
|
+
fontSize: _responsiveTheme.default.typography.fontSize,
|
|
134
|
+
fontFamily: _responsiveTheme.default.typography.fontFamily
|
|
135
|
+
}),
|
|
136
|
+
multiValueRemove: provided => ({
|
|
137
|
+
...provided,
|
|
138
|
+
color: _responsiveTheme.default.palette.primary.tenjinFBlue,
|
|
139
|
+
cursor: "pointer"
|
|
140
|
+
})
|
|
161
141
|
};
|
|
162
142
|
};
|
|
163
143
|
exports.getCustomStyles = getCustomStyles;
|
|
@@ -1,30 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _rte = require("@mantine/rte");
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
|
-
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; }
|
|
19
|
-
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; }
|
|
20
|
-
var RichTextEditorTest = function RichTextEditorTest(_ref) {
|
|
21
|
-
var _ref$controls = _ref.controls,
|
|
22
|
-
controls = _ref$controls === void 0 ? {} : _ref$controls,
|
|
23
|
-
_ref$readOnly = _ref.readOnly,
|
|
24
|
-
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
|
|
25
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
10
|
+
const RichTextEditorTest = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
controls = {},
|
|
13
|
+
readOnly = false,
|
|
14
|
+
...props
|
|
15
|
+
} = _ref;
|
|
26
16
|
// By default everything is enabled
|
|
27
|
-
|
|
17
|
+
const defaultControls = {
|
|
28
18
|
bold: true,
|
|
29
19
|
italic: true,
|
|
30
20
|
underline: true,
|
|
@@ -39,38 +29,25 @@ var RichTextEditorTest = function RichTextEditorTest(_ref) {
|
|
|
39
29
|
alignCenter: true,
|
|
40
30
|
alignRight: true
|
|
41
31
|
};
|
|
42
|
-
|
|
32
|
+
const editorControls = (0, _react.useMemo)(() => {
|
|
43
33
|
if (readOnly) {
|
|
44
34
|
return [];
|
|
45
35
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}), ["link", "image"].filter(function (c) {
|
|
50
|
-
return finalControls[c];
|
|
51
|
-
}), ["unorderedList", "orderedList"].filter(function (c) {
|
|
52
|
-
return finalControls[c];
|
|
53
|
-
}), ["h1", "h2", "h3"].filter(function (c) {
|
|
54
|
-
return finalControls[c];
|
|
55
|
-
}), ["alignLeft", "alignCenter", "alignRight"].filter(function (c) {
|
|
56
|
-
return finalControls[c];
|
|
57
|
-
})].filter(function (group) {
|
|
58
|
-
return group.length > 0;
|
|
59
|
-
});
|
|
60
|
-
}, [controls, readOnly]);
|
|
61
|
-
var mentions = (0, _react.useMemo)(function () {
|
|
62
|
-
return {
|
|
63
|
-
allowedChars: /^[A-Za-z\sÅÄÖåäö]*$/,
|
|
64
|
-
mentionDenotationChars: ["@"],
|
|
65
|
-
source: function source(searchTerm, renderList, mentionChar) {
|
|
66
|
-
var list = mentionChar === "@" ? props.data : "";
|
|
67
|
-
var includesSearchTerm = list.filter(function (item) {
|
|
68
|
-
return item.value.toLowerCase().includes(searchTerm && searchTerm.toLowerCase());
|
|
69
|
-
});
|
|
70
|
-
renderList(includesSearchTerm);
|
|
71
|
-
}
|
|
36
|
+
const finalControls = {
|
|
37
|
+
...defaultControls,
|
|
38
|
+
...controls
|
|
72
39
|
};
|
|
73
|
-
|
|
40
|
+
return [["bold", "italic", "underline"].filter(c => finalControls[c]), ["link", "image"].filter(c => finalControls[c]), ["unorderedList", "orderedList"].filter(c => finalControls[c]), ["h1", "h2", "h3"].filter(c => finalControls[c]), ["alignLeft", "alignCenter", "alignRight"].filter(c => finalControls[c])].filter(group => group.length > 0);
|
|
41
|
+
}, [controls, readOnly]);
|
|
42
|
+
const mentions = (0, _react.useMemo)(() => ({
|
|
43
|
+
allowedChars: /^[A-Za-z\sÅÄÖåäö]*$/,
|
|
44
|
+
mentionDenotationChars: ["@"],
|
|
45
|
+
source: (searchTerm, renderList, mentionChar) => {
|
|
46
|
+
const list = mentionChar === "@" ? props.data : "";
|
|
47
|
+
const includesSearchTerm = list.filter(item => item.value.toLowerCase().includes(searchTerm && searchTerm.toLowerCase()));
|
|
48
|
+
renderList(includesSearchTerm);
|
|
49
|
+
}
|
|
50
|
+
}), [props.data]);
|
|
74
51
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_rte.RichTextEditor, {
|
|
75
52
|
controls: editorControls,
|
|
76
53
|
value: props.value,
|
|
@@ -79,5 +56,4 @@ var RichTextEditorTest = function RichTextEditorTest(_ref) {
|
|
|
79
56
|
readOnly: readOnly
|
|
80
57
|
}));
|
|
81
58
|
};
|
|
82
|
-
var _default = RichTextEditorTest;
|
|
83
|
-
exports.default = _default;
|
|
59
|
+
var _default = exports.default = RichTextEditorTest;
|