複数チェック追加

This commit is contained in:
2025-01-31 17:09:21 +09:00
parent c585013611
commit a3595b1368
7 changed files with 121 additions and 25 deletions

View File

@@ -30,8 +30,8 @@ export const conditionList: ConditionItem[] = [
{ value: '>', label: '> (より後)', type: (field) => dateTimeComponent[field.type] || 'input' },
{ value: 'like', label: '次のキーワードを含む', type: 'input' },
{ value: 'not like', label: '次のキーワードを含まない', type: 'input' },
{ value: 'in', label: '次のいずれかを含む', type: 'input' },
{ value: 'not in', label: '次のいずれも含まない', type: 'input' },
{ value: 'in', label: '次のいずれかを含む', type: (field)=>MultiChoiceComponent[field.type] || 'input' },
{ value: 'not in', label: '次のいずれも含まない', type: (field)=>MultiChoiceComponent[field.type] || 'input' },
];
// search from conditionList
@@ -95,6 +95,7 @@ const component = {
time: 'kuc-time',
date: 'date',
datetime: 'datetime',
multiChoice:'kuc-multichoice'
};
export const isDateTimeType = (field: OneOf) => {
@@ -109,6 +110,13 @@ const dateTimeComponent: Partial<Record<FieldType, ComponentType>> = {
UPDATED_TIME: 'datetime',
};
const MultiChoiceComponent:Partial<Record<FieldType, ComponentType>> = {
CHECK_BOX: 'multiChoice',
DROP_DOWN: 'multiChoice',
RADIO_BUTTON: 'multiChoice',
MULTI_SELECT: 'multiChoice'
};
export type ComponentType = keyof typeof component;
export const getComponent = (value: ConditionValue, fieldObj: OneOf) => {
if (!value || !fieldObj) return;