UNPKG

@wufengteam/inputs

Version:

平台提供的右侧属性编辑器,需要在主工程中注册

37 lines 966 B
import { wufengController } from '@wufengteam/core'; export function getCustomFn() { return Object.values(wufengController.functions).map(function (fn) { return fn.spec; }); } export function getGroupedFunctions() { var grouped = {}; var addFn = function addFn(groupName, func) { var group = grouped[groupName]; if (!group) { group = { title: groupName, key: groupName, children: [], selectable: false }; grouped[groupName] = group; } group.children.push({ title: func.type, key: "".concat(groupName, "-").concat(func.type), value: func }); }; getCustomFn().forEach(function (fn) { var groupedName = fn.groupsName; if (typeof groupedName === 'string') { addFn(groupedName, fn); } else if (Array.isArray(groupedName)) { groupedName.forEach(function (name) { addFn(name, fn); }); } }); return Object.values(grouped); }