Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Custom Tags for Multiselect#1801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,7 +14,7 @@ import { SelectInputInvalidConfig, useSelectInputValidate } from "./selectInputC

import { PaddingControl } from "../../controls/paddingControl";
import { MarginControl } from "../../controls/marginControl";
import { migrateOldData, withDefault } from "comps/generators/simpleGenerators";
import { migrateOldData } from "comps/generators/simpleGenerators";
import { fixOldInputCompData } from "../textInputComp/textInputConstants";

let MultiSelectBasicComp = (function () {
Expand All@@ -35,6 +35,10 @@ let MultiSelectBasicComp = (function () {
validateState,
handleChange,
] = useSelectInputValidate(props);

const removeIllegalEntries = () => {
return props.value.value.filter?.((v) => valueSet.has(v))
}

return props.label({
required: props.required,
Expand All@@ -45,8 +49,8 @@ let MultiSelectBasicComp = (function () {
children: (
<SelectUIView
{...props}
mode={"multiple"}
value={props.value.value.filter?.((v) => valueSet.has(v))}
mode={props.allowCustomTags ? "tags" :"multiple"}
value={props.allowCustomTags ? props.value.value : removeIllegalEntries()}
onChange={handleChange}
dispatch={dispatch}
/>
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,7 +76,8 @@ export const getStyle = (
padding: ${style.padding};
height: auto;
}
.ant-select-selection-search {
.ant-select-selection-search {
min-width: 50px;
padding: ${style.padding};
}
.ant-select-selection-search-input,
Expand DownExpand Up@@ -268,9 +269,10 @@ export const SelectUIView = (
placeholder={props.placeholder}
value={props.value}
showSearch={props.showSearch}
filterOption={(input, option) =>
option?.label.toLowerCase().includes(input.toLowerCase())
}
filterOption={(input, option) => {
if (!option) return false;
return String(option.label ?? option.value ?? "").toLowerCase().includes(input.toLowerCase());
}}
popupRender={(originNode: ReactNode) => (
<DropdownStyled $style={props.childrenInputFieldStyle as ChildrenMultiSelectStyleType}>
{originNode}
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,7 @@ import { blurMethod, focusWithOptions } from "comps/utils/methodUtils";
export const SelectInputValidationChildren = {
required: BoolControl,
showValidationWhenEmpty: BoolControl,
allowCustomTags: BoolControl,
customRule: CustomRuleControl,
};
type ValidationComp = RecordConstructorToComp<typeof SelectInputValidationChildren>;
Expand DownExpand Up@@ -126,6 +127,9 @@ export const SelectInputValidationSection = (children: ValidationComp) => (
{children.showValidationWhenEmpty.propertyView({
label: trans("prop.showEmptyValidation"),
})}
{children.allowCustomTags.propertyView({
label: trans("prop.customTags")
})}
{children.customRule.propertyView({})}
</Section>
);
Expand Down
1 change: 1 addition & 0 deletionsclient/packages/lowcoder/src/i18n/locales/en.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -234,6 +234,7 @@ export const en = {
"verticalGridCells": "Vertical Grid Cells",
"timeZone": "TimeZone",
"pickerMode": "Picker Mode",
"customTags": "Custom Tags"
},
"autoHeightProp": {
"auto": "Auto",
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp