@onesy/ui-react 1.0.14 → 1.0.15
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.
@@ -492,14 +492,11 @@ const SmartTextField = react_1.default.forwardRef((props_, ref) => {
|
|
492
492
|
react_1.default.useEffect(() => {
|
493
493
|
// setError(error_);
|
494
494
|
}, [error_]);
|
495
|
-
const label = react_1.default.useCallback(() => {
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
return ((0, jsx_runtime_1.jsx)(ListItem, { start: ((0, jsx_runtime_1.jsx)(Avatar, Object.assign({ color: (0, utils_1.stringToColor)(item.name), size: 'small' }, { children: (_a = item.name) === null || _a === void 0 ? void 0 : _a.slice(0, 1) }))), primary: ((0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'l3' }, { children: item.name }))), onClick: () => addTag(item), button: true }, index));
|
501
|
-
}) })) })));
|
502
|
-
}, []);
|
495
|
+
const label = react_1.default.useCallback(() => ((0, utils_1.is)('function', mentionLabel) ? mentionLabel(optionsMention, { addTag }) :
|
496
|
+
(0, jsx_runtime_1.jsx)(Line, Object.assign({ className: classes.menu }, { children: (0, jsx_runtime_1.jsx)(List, Object.assign({ size: 'small', className: classes.list }, { children: optionsMention === null || optionsMention === void 0 ? void 0 : optionsMention.map((item, index) => {
|
497
|
+
var _a;
|
498
|
+
return ((0, jsx_runtime_1.jsx)(ListItem, { start: ((0, jsx_runtime_1.jsx)(Avatar, Object.assign({ color: (0, utils_1.stringToColor)(item.name), size: 'small' }, { children: (_a = item.name) === null || _a === void 0 ? void 0 : _a.slice(0, 1) }))), primary: ((0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'l3' }, { children: item.name }))), onClick: () => addTag(item), button: true }, index));
|
499
|
+
}) })) }))), [optionsMention]);
|
503
500
|
const paste = async () => {
|
504
501
|
const valueClipboard = await navigator.clipboard.read();
|
505
502
|
if (valueClipboard) {
|
@@ -727,7 +724,7 @@ const SmartTextField = react_1.default.forwardRef((props_, ref) => {
|
|
727
724
|
}, [open, textSelection, textSelected]);
|
728
725
|
const menu = react_1.default.useMemo(() => {
|
729
726
|
return ((0, jsx_runtime_1.jsx)(Menu, { open: openMenu, position: 'top', alignment: 'start', offset: offset, anchor: selectionMenu, onClose: onCloseSearch, label: label(), interactive: true }));
|
730
|
-
}, [openMenu, selectionMenu, label]);
|
727
|
+
}, [openMenu, optionsMention, selectionMenu, label]);
|
731
728
|
let main = ((0, jsx_runtime_1.jsx)(TextField, Object.assign({ ref: (item) => {
|
732
729
|
if (ref) {
|
733
730
|
if ((0, utils_1.is)('function', ref))
|
@@ -511,14 +511,14 @@ const SmartTextField = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
511
511
|
React.useEffect(() => {
|
512
512
|
// setError(error_);
|
513
513
|
}, [error_]);
|
514
|
-
const label = React.useCallback(() => is('function', mentionLabel) ? mentionLabel(
|
514
|
+
const label = React.useCallback(() => is('function', mentionLabel) ? mentionLabel(optionsMention, {
|
515
515
|
addTag
|
516
516
|
}) : /*#__PURE__*/React.createElement(Line, {
|
517
517
|
className: classes.menu
|
518
518
|
}, /*#__PURE__*/React.createElement(List, {
|
519
519
|
size: "small",
|
520
520
|
className: classes.list
|
521
|
-
},
|
521
|
+
}, optionsMention?.map((item, index) => /*#__PURE__*/React.createElement(ListItem, {
|
522
522
|
key: index,
|
523
523
|
start: /*#__PURE__*/React.createElement(Avatar, {
|
524
524
|
color: stringToColor(item.name),
|
@@ -529,7 +529,7 @@ const SmartTextField = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
529
529
|
}, item.name),
|
530
530
|
onClick: () => addTag(item),
|
531
531
|
button: true
|
532
|
-
})))), []);
|
532
|
+
})))), [optionsMention]);
|
533
533
|
const paste = async () => {
|
534
534
|
const valueClipboard = await navigator.clipboard.read();
|
535
535
|
if (valueClipboard) {
|
@@ -882,7 +882,7 @@ const SmartTextField = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
882
882
|
label: label(),
|
883
883
|
interactive: true
|
884
884
|
});
|
885
|
-
}, [openMenu, selectionMenu, label]);
|
885
|
+
}, [openMenu, optionsMention, selectionMenu, label]);
|
886
886
|
let main = /*#__PURE__*/React.createElement(TextField, _extends({
|
887
887
|
ref: item => {
|
888
888
|
if (ref) {
|
package/esm/index.js
CHANGED