For vue2 projects, use @94ai/common-ui
LLMs.md

nf-conditions ​

Condition groups use OR between groups and AND between their rules. Supports add/remove, condition/rule limits, nested validation paths and all nf-rules options.

Examples ​

Add conditions ​

Loading example…
Add conditions

Restore conditions ​

Loading example…
Restore conditions

Custom external form ​

Loading example…
Custom external form

Props ​

Text props follow the library language when omitted; defaults below use this language.

ParameterDescriptionTypeOptionsDefault
conditionsCondition data for display and retrieval; each entry contains a rules array.{ key?: string; rules?: RuleItem[] }[]—undefined
conditionLimitMaximum number of entries; 0 means unlimited.number—0
hiddenConditionAddHide the add action.boolean—false
hiddenConditionReduceHide the remove action.boolean—false
conditionsKeyCustom data field name.string—'conditions'
initAddRuleDataInitialize a rule when a condition group is added.boolean—true
conditionDescCustomize the “Condition” text.string—Condition
addConditionDescCustomize the “+ Add condition” text.string—+ Add condition
deleteConditionDescCustomize the “- Delete condition” text.string—- Delete condition
outLogicMergeDescCustomize the “or” text.string—or
rulesCompatibility prop; place each group’s rules in its rulesKey field under conditions.RuleItem[]—undefined
showRuleTypesAllowed rule types: enum values, original Chinese names or localized labels; an empty array allows all.(string | number)[]—[]
defaultAddDataDefault data object when adding a rule.RuleItem—undefined
defaultAddTypeDefault rule type when adding a rule.string | number—undefined
initAddDataInitialize an entry when data is absent or empty.boolean—true
sizeControl size; mini maps to small and medium to default.stringmini / small / medium / default / large'mini'
tagCustom form container tag; use div inside an external form to avoid nested forms.string—'el-form'
validPrefixCustom prefix for form validation paths.string—''
rulesKeyCustom data field name.string—'rules'
limitMaximum number of entries; 0 means unlimited.number—0
disabledWhether to disable the component.boolean—false
conditionDisabledDisable the rule-type selector.boolean—false
hiddenAddHide the add action.boolean—false
hiddenReduceHide the remove action.boolean—false
disablesDisable controls by rule type; array entries follow the controls in that rule.Record<string, boolean[]>—undefined
showMessageWhether to show validation error messages.boolean—true
inlineMessageDisplay validation messages inline.boolean—false
statusIconWhether to show validation status icons.boolean—false
规则类型Customize enum values for 规则类型; defaults to the exported enum with the same name.Record<string, string | number>—规则类型
规则类型下拉Customize 规则类型下拉 data for localization or custom dropdown options.DropDownItem[]—undefined
规则类型下拉合并策略Merge strategy for 规则类型下拉: income uses incoming items; incomePatch patches matching incoming values with defaults; defaultPatch patches matching defaults with incoming values.MergeStrategyincome / incomePatch / defaultPatch'defaultPatch'
操作类型Customize enum values for 操作类型; defaults to the exported enum with the same name.Record<string, string | number>—操作类型
操作类型下拉Customize 操作类型下拉 data for localization or custom dropdown options.DropDownItem[]—undefined
操作类型下拉合并策略Merge strategy for 操作类型下拉: income uses incoming items; incomePatch patches matching incoming values with defaults; defaultPatch patches matching defaults with incoming values.MergeStrategyincome / incomePatch / defaultPatch'defaultPatch'
计算类型Customize enum values for 计算类型; defaults to the exported enum with the same name.Record<string, string | number>—计算类型
计算类型下拉Customize 计算类型下拉 data for localization or custom dropdown options.DropDownItem[]—undefined
计算类型下拉合并策略Merge strategy for 计算类型下拉: income uses incoming items; incomePatch patches matching incoming values with defaults; defaultPatch patches matching defaults with incoming values.MergeStrategyincome / incomePatch / defaultPatch'defaultPatch'
日期类型Customize enum values for 日期类型; defaults to the exported enum with the same name.Record<string, string | number>—日期类型
日期类型下拉Customize 日期类型下拉 data for localization or custom dropdown options.DropDownItem[]—undefined
日期类型下拉合并策略Merge strategy for 日期类型下拉: income uses incoming items; incomePatch patches matching incoming values with defaults; defaultPatch patches matching defaults with incoming values.MergeStrategyincome / incomePatch / defaultPatch'defaultPatch'
外呼状态Customize enum values for 外呼状态; defaults to the exported enum with the same name.Record<string, string | number>—外呼状态
外呼状态下拉Customize 外呼状态下拉 data for localization or custom dropdown options.DropDownItem[]—undefined
外呼状态下拉合并策略Merge strategy for 外呼状态下拉: income uses incoming items; incomePatch patches matching incoming values with defaults; defaultPatch patches matching defaults with incoming values.MergeStrategyincome / incomePatch / defaultPatch'defaultPatch'
意向标签集合Customize 意向标签集合 data for localization or custom dropdown options.DropDownItem[]—undefined
意向标签集合合并策略Merge strategy for 意向标签集合: income uses incoming items; incomePatch patches matching incoming values with defaults; defaultPatch patches matching defaults with incoming values.MergeStrategyincome / incomePatch / defaultPatch'defaultPatch'
logicMergeDescCustomize the “and” text.string—and
placeholderCustomize the “Please select” text.string—Please select
numberRequireDescCustomize the “Please enter a number” text.string—Please enter a number
commonLenLimitDescCustomize the “Total length cannot exceed 2000 Chinese characters” text.string—Total length cannot exceed 2000 Chinese characters
placeEnterCustomize the “Please enter” text.string—Please enter
prohibitEmptyDescCustomize the “Cannot be empty” text.string—Cannot be empty
paramsLenLimitDescCustomize the “Up to 50 English characters” text.string—Up to 50 English characters
splitDescCustomize the “Separate multiple entries with #” text.string—Separate multiple entries with #
timesCustomize the “times” text.string—times
secondCustomize the “s” text.string—s
startPlaceholderDateCustomize the “Start date” text.string—Start date
endPlaceholderDateCustomize the “End date” text.string—End date
startPlaceholderTimeCustomize the “Start time” text.string—Start time
endPlaceholderTimeCustomize the “End time” text.string—End time
timePickerPlaceholderCustomize the “Select time range” text.string—Select time range
datePickerPlaceholderCustomize the “Select date range” text.string—Select date range
rangeSeparatorDescCustomize the “→” text.string—→

Events ​

EventDescriptionPayload
onRuleChangeFires when collected condition data changes.(conditions: ConditionItem[])
ruleChangeFires when collected condition data changes.(conditions: ConditionItem[])
addRuleFires when a rule is added; returns the added object.(rule: RuleItem)
reduceRuleFires when a rule is removed; returns the removed object.(rule: RuleItem)
addConditionFires when a condition is added; returns the added object.(condition: ConditionItem)
reduceConditionFires when a condition is removed; returns the removed object.(condition: ConditionItem)

Slots ​

No custom slots.

Exposed methods and state ​

  • plan
  • nfConditionsForm
  • conditionContainer
  • nfRules
  • addCondition()
  • removeCondition(index)
  • initPlan()
  • getCondition()

Migration notes ​

Vue 3 uses modelValue / update:modelValue; legacy value, update:value and input remain available on selection components. The implementation uses public Element Plus APIs, not Element UI internals. mini maps to small; medium maps to default.