Browse Source

Merge pull request #265764 in DEC/fineui from master to feature/x

* commit '6f76fa6893b26c60a87d96cd881314519351113e':
  BI-139784 fix: 【来源内测BUG】数据编辑过滤
master
superman 10 months ago
parent
commit
d3e8354dfb
  1. 22
      packages/fineui/src/widget/multiselect/trigger/editor.multiselect.js

22
packages/fineui/src/widget/multiselect/trigger/editor.multiselect.js

@ -1,4 +1,15 @@
import { shortcut, Widget, extend, i18nText, createWidget, Controller, isEmptyString, isEmptyArray, BlankSplitChar } from "@/core";
import {
shortcut,
Widget,
extend,
i18nText,
createWidget,
Controller,
isEmptyString,
isEmptyArray,
BlankSplitChar,
first, last, isNotEmptyString
} from "@/core";
import { StateEditor } from "@/case";
import { SelectPatchEditor } from "./editor/editor.patch";
@ -77,8 +88,13 @@ export class MultiSelectEditor extends Widget {
getKeywords() {
const val = this.editor.getValue();
let keywords = val.split(/\u200b\s\u200b/);
if (isEmptyString(keywords[keywords.length - 1])) {
keywords = keywords.slice(0, keywords.length - 1);
if (isEmptyString(first(keywords)) || isEmptyString(last(keywords))) {
keywords = keywords.filter((word, index) => {
if (index === 0 || index === keywords.length - 1) {
return isNotEmptyString(word);
}
return true;
});
}
if (/\u200b\s\u200b$/.test(val)) {
return keywords.concat([BlankSplitChar]);

Loading…
Cancel
Save