@cloudbase/cals 1.0.80 → 1.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/lib/parser/cals/index.js +1 -1
  2. package/lib/parser/cals/utils/getUsedResources.d.ts.map +1 -1
  3. package/lib/parser/cals/utils/getUsedResources.js +19 -9
  4. package/lib/schema/basic_application.json +1 -0
  5. package/lib/schema/lcds_action.json +1 -0
  6. package/lib/schema/lcds_component.json +1 -0
  7. package/lib/schema/platform_application.json +1 -0
  8. package/lib/schema/platform_data_source.json +1 -0
  9. package/lib/schema/platform_template.json +1 -0
  10. package/lib/types/basic/app.d.ts +11 -8
  11. package/lib/types/basic/app.d.ts.map +1 -1
  12. package/lib/types/basic/common.d.ts +18 -4
  13. package/lib/types/basic/common.d.ts.map +1 -1
  14. package/lib/types/basic/component.d.ts +20 -19
  15. package/lib/types/basic/component.d.ts.map +1 -1
  16. package/lib/types/index.d.ts.map +1 -1
  17. package/lib/types/lcds.d.ts +113 -39
  18. package/lib/types/lcds.d.ts.map +1 -1
  19. package/lib/types/platform/app.d.ts +36 -31
  20. package/lib/types/platform/app.d.ts.map +1 -1
  21. package/lib/types/platform/common.d.ts +16 -7
  22. package/lib/types/platform/common.d.ts.map +1 -1
  23. package/lib/types/platform/common.js +1 -1
  24. package/lib/types/platform/component.d.ts +21 -19
  25. package/lib/types/platform/component.d.ts.map +1 -1
  26. package/lib/types/platform/datasource.d.ts +56 -37
  27. package/lib/types/platform/datasource.d.ts.map +1 -1
  28. package/lib/types/platform/eventFlow.d.ts +2 -2
  29. package/lib/types/platform/eventFlow.d.ts.map +1 -1
  30. package/lib/types/platform/query.d.ts +2 -2
  31. package/lib/types/platform/query.d.ts.map +1 -1
  32. package/lib/types/platform/theme.d.ts +3 -1
  33. package/lib/types/platform/theme.d.ts.map +1 -1
  34. package/package.json +8 -7
  35. package/lib/types/platform/widget/form.d.ts +0 -5
  36. package/lib/types/platform/widget/form.d.ts.map +0 -1
  37. package/lib/types/platform/widget/form.js +0 -5
  38. package/lib/types/platform/widget/meta.d.ts +0 -60
  39. package/lib/types/platform/widget/meta.d.ts.map +0 -1
  40. package/lib/types/platform/widget/meta.js +0 -6
  41. package/lib/utils/build.d.ts +0 -2
  42. package/lib/utils/build.d.ts.map +0 -1
  43. package/lib/utils/build.js +0 -75
@@ -0,0 +1 @@
1
+ {"description":"布局组件模板","additionalProperties":false,"type":"object","properties":{"name":{"description":"选填, 组件唯一标识","maxLength":214,"minLength":1,"type":"string"},"data":{"description":"选填, 组件可以接收的数据, 用作组件props入参\n需要符合 JSON SCHEMA 规范","default":{}},"events":{"description":"选填, 组件可以被捕获的事件信息","default":[],"type":"array","items":{"$ref":"#/definitions/IEvent"}},"classes":{"description":"选填,组件样式 API","type":"array","items":{"$ref":"#/definitions/IClasses"}},"properties":{"description":"选填,组件属性 API, Object 类型 json schema"},"methods":{"description":"选填,组件内定义的自定义方法","default":[],"type":"array","items":{"$ref":"#/definitions/IMethod"}},"compConfig":{"description":"选填, 组件需要在运行时获取的配置项","type":"object","properties":{"isDataContainer":{"description":"选填, 组件是否开启数据容器功能\n- 默认为 false\n- 设置为 true 后,在组件内可通过调用 `onDataChange` 事件将内部数据挂载到组件的 `$context` 上下文对象","type":"boolean"},"componentType":{"description":"选填, 组件类型\n\n支持将表单类组件设置为 `formField`,即可在表单容器中收集值","type":"string"}},"additionalProperties":false},"platforms":{"description":"选填, 组件适配的平台\n\n如果该字段为空, 则进行智能推断","type":"array","items":{"type":"string"}},"meta":{"description":"选填, 仅用于在低码平台的信息展示","type":"object","properties":{"name":{"description":"选填, 组件英文标识","type":"string"},"componentName":{"description":"选填, 用于生成组件 id 的前缀标识","type":"string"},"title":{"description":"选填, 组件别名, 建议用中文","type":"string"},"description":{"description":"选填, 组件简介, 建议用中文","type":"string"},"icon":{"description":"选填, 组件图标, 支持本地图片(大纲树里面用的)","type":"string"},"figureIcon":{"description":"选填, 组件大图标 (组件列表里用的)","type":"string"},"category":{"description":"必填, 组件分类, 建议用中文","type":"string"},"componentOrder":{"description":"选填, 组件的排序权重","minimum":1,"maximum":10000,"type":"number"},"platform":{"description":"选填, 组件生效的平台","type":"array","items":{"enum":["MOBILE","MOBILEWEB","MP","PCWEB","WEB"],"type":"string"}},"visible":{"description":"选填, 组件可见性配置\n\n默认均显示\n- `[]` 表示隐藏\n- `['APP']` 表示只在应用编辑器显示\n- `['COMPONENT']` 表示只在组件编辑器显示","type":"array","items":{"$ref":"#/definitions/VisibleItem"}},"templates":{"description":"选填,组件模板配置\n{@link https://tapd.woa.com/20422223/prong/stories/view/1020422223884227747 使用文档}","type":"array","items":{"$ref":"#/definitions/ITemplate"}},"deprecated":{"description":"选填, 标识旧组件废弃,控制单组件升级按钮显隐\n{@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002411487 使用文档}","type":"boolean"},"renderMode":{"description":"选填, 单组件渲染模式[升级/替换]\n{@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002411487 使用文档}","type":"array","items":{"$ref":"#/definitions/IRenderMode"}},"docsUrl":{"description":"选填, 组件说明文档的地址","type":"string"},"shortcut":{"description":"选填, 组件快捷编辑协议","$ref":"#/definitions/IShortcut"},"contextData":{"description":"选填,组件上下文协议\n\n配置后可通过 `$context.id.state.xx` 读取属性值","type":"object","additionalProperties":{}},"positionConstraint":{"description":"选填,组件相对位置限制\n{@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002466153 使用文档}","type":"object","properties":{"allowChildren":{"description":"可选,允许子组件类型","type":"array","items":{"type":"object","properties":{"componentType":{"description":"组件对应类型,对应 `componentConfig.componentType`","type":"string"},"recursive":{"description":"是否允许为隔代子组件","type":"boolean"},"tip":{"description":"用户犯错提示","type":"string"}},"additionalProperties":false,"required":["componentType"]}},"allowParent":{"description":"可选,允许父组件类型","type":"array","items":{"type":"object","properties":{"componentType":{"description":"组件对应类型,对应` componentConfig.componentType`","type":"string"},"recursive":{"description":"是否允许为隔代父组件","type":"boolean"},"tip":{"description":"用户犯错提示","type":"string"}},"additionalProperties":false,"required":["componentType","recursive"]}}},"additionalProperties":false},"keyWords":{"description":"选填,搜索关键词\n{@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002460167 使用文档}","type":"array","items":{"type":"string"}},"propertyPanelTips":{"description":"选填,属性面板提示,支持 markdown\n{@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002460139 使用文档}","type":"string"},"stylePanelTips":{"description":"选填,样式面板提示","type":"string"},"disableUpgradeAll":{"description":"选填,禁用升级应用内所有的组件","type":"boolean"},"validate":{"description":"选填,检查功能\n{@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002459983 使用文档}","type":"array","items":{"type":"object","properties":{"rule":{"description":"规则名称","type":"string"},"options":{"type":"object","additionalProperties":{},"properties":{"title":{"description":"标题,支持 markdown","type":"string"},"description":{"description":"描述,支持 markdown","type":"string"},"type":{"description":"类型","type":"string"},"name":{"description":"名称","type":"string"},"label":{"description":"标签","type":"string"},"tooltip":{"description":"提示","type":"string"},"version":{"description":"选填,版本,版本,支持 markdown","type":"string"},"allowFailure":{"description":"可选,是否允许失败","type":"boolean"},"matchedSelectedPlatform":{"description":"可选,限制当前选中平台,不填不限制,默认为 null","type":"array","items":{"enum":["h5","miniprogram","pc"],"type":"string"}},"matchedPublishedPlatform":{"description":"可选,限制当前发布平台,不填不限制,默认为 'all'","type":"array","items":{"enum":["all","miniprogram","web"],"type":"string"}},"extra":{"description":"特殊字段,因 rule 的不同而不同"},"action":{"type":"object","additionalProperties":{}}},"required":["description","title","type"]}},"additionalProperties":false,"required":["rule"]}},"inlineStyleForm":{"description":"选填,样式配置属性屏蔽\n{@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002470249 使用文档}","anyOf":[{"type":"object","additionalProperties":{"anyOf":[{"type":"object","properties":{"visible":{"type":"boolean"}},"additionalProperties":false,"required":["visible"]},{"type":"boolean"}]}},{"type":"object","properties":{"$blockedAll":{"type":"boolean","const":true}},"additionalProperties":false,"required":["$blockedAll"]}]},"group":{"description":"选填,属性分组信息","type":"object","additionalProperties":{"type":"object","properties":{"x-index":{"type":"number"},"expand":{"type":"boolean"}},"additionalProperties":false,"required":["expand","x-index"]}},"previewImageUrl":{"description":"组件使用示例缩略图","type":"string"},"componentType":{"description":"组件类型","type":"string"},"previewOperation":{"description":"preview 配置按钮\n{@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002676991 使用文档}","type":"object","properties":{"headerIcon":{"description":"选填,头部图标","type":"string"},"operation":{"description":"操作配置","type":"array","items":{"type":"object","properties":{"icon":{"description":"图标","type":"string"},"title":{"description":"标题","type":"string"},"action":{"description":"行为,由编辑器提供","type":"string"}},"additionalProperties":false,"required":["action","icon","title"]}},"previewSlotName":{"description":"操作区域会插入的插槽名称","type":"string"},"insertSlotName":{"description":"选填,插入插槽名称\n\n- 指定拖动时插入的插槽名称\n- 比如 指定为 `contentSlot`,如果 `form` 指定了值为 `contentSlot`,则会插入到 `contentSlot` 中,而不是 `form` 里","type":"string"}},"additionalProperties":false,"required":["operation"]},"queryGeneratorConfig":{"type":"object","properties":{"sceneConfig":{"type":"object","properties":{"scenes":{"type":"array","items":{"$ref":"#/definitions/Scene"}},"availableScenes":{"type":"array","items":{"$ref":"#/definitions/Scene"}},"validCombinations":{"type":"array","items":{"type":"array","items":{"$ref":"#/definitions/Scene"}}},"enableSelectMultiple":{"type":"boolean"}},"additionalProperties":false,"required":["availableScenes","scenes","validCombinations"]},"fieldsConfig":{"type":"object","properties":{"enableConfigFormat":{"description":"是否支持配置 format?","type":"boolean"},"showFieldTypeColumn":{"description":"是否显示字段标识的列?","type":"boolean"},"enableSelectFieldFormType":{"type":"boolean"}},"additionalProperties":false},"apisConfig":{"type":"object","properties":{"enableConfigRecordAndTotalKey":{"description":"是否配置 record 和 total 的键值?","type":"boolean"}},"additionalProperties":false,"required":["enableConfigRecordAndTotalKey"]},"mysqlConfig":{"type":"object","properties":{"autoGenerateCountQuery":{"description":"是否自动生成查询总条数语句?","type":"boolean"},"countName":{"description":"计数名字\n\n表示 `SELECT COUNT(*) as count FROM xxx;` 的 `count`,如果指定 `countName` 为 `abc`,则输出 `sql SELECT COUNT(*) as abc FROM xxx;`","type":"string"}},"additionalProperties":false},"bindParamsPath":{"description":"绑定路径配置\n\n如果没有配置,默认就是 `params`,举例说明:\n- 配置 `select.condition` 为 `'params.abc'`,则输出的 SQL 为 `SELECT aa FROM xxx WHERE key={{params.abc}}`\n- 配置 `create.value` 为 `'params.hello'`,则输出的 SQL 为 `INSERT INTO xxx (a, b) VALUES ({{params.hello.a}}, {{params.hello.b }})`","$ref":"#/definitions/Partial<Record<Scene,Partial<Record<SceneTarget,string>>>>"},"quickOperateButton":{"type":"array","items":{"type":"object","properties":{"icon":{"type":"string"},"targetField":{"type":"string"},"content":{"type":"string"}},"additionalProperties":false,"required":["content","icon","targetField"]}}},"additionalProperties":false,"required":["sceneConfig"]},"globalConfig":{"type":"object","additionalProperties":{}}},"additionalProperties":false,"required":["category"]},"extra":{"description":"选填, 扩展字段, 尽量避免用"},"isContainer":{"description":"选填, 是否容器组件\n\n容器可以包含子节点,但是不能配置插槽","type":"boolean"},"defaultStyles":{"description":"默认样式\ndefaultStyles 接收一个React.CSSProperties对象","type":"object","additionalProperties":{}},"items":{"description":"可选, 可递归结构, 子级对应","type":"array","items":{"$ref":"#/definitions/IPlatformComponent"}},"label":{"description":"可选, 对用户可读的名称, 如 \"用户名\"","type":"string"},"id":{"description":"选填, 当前页面内的唯一 ID","type":"string"},"resources":{"description":"可选, 应用的资源集合\n\n例如, 代码片段、组件库、静态资源","type":"array","items":{"$ref":"#/definitions/IResource"}},"dataset":{"description":"可选, 变量集合","$ref":"#/definitions/IDataset"}},"required":["id"],"definitions":{"IEvent":{"description":"低码组件可以被捕获的事件信息","type":"object","properties":{"name":{"description":"必填, 用作抛出和捕获事件的唯一标识","type":"string"},"title":{"description":"选填, 事件别名, 用于低码平台展示","type":"string"},"description":{"description":"选填 事件描述","type":"string"},"x-platforms":{"description":"选填,事件生效的平台","type":"array","items":{"enum":["MOBILE","MOBILEWEB","MP","PCWEB","WEB"],"type":"string"}},"detail":{"description":"事件参数对象","type":"object","additionalProperties":{}}},"additionalProperties":false,"required":["name","title"]},"IClasses":{"description":"组件样式 API","type":"object","properties":{"name":{"description":"样式名称","type":"string"},"selector":{"description":"样式选择器","type":"string"},"code":{"description":"样式片段代码(需要填写完整的样式代码)","type":"string"},"description":{"description":"样式说明","type":"string"}},"additionalProperties":false,"required":["name","selector"]},"IMethod":{"description":"低码组件可以暴露的自定义方法","type":"object","properties":{"name":{"description":"必填, 用作组件方法的唯一标识","type":"string"},"label":{"description":"必填, 组件方法别名, 用于低码平台展示","type":"string"},"params":{"description":"选填, 组件方法可以接收的数据\n需要符合 JSON SCHEMA 规范","default":{}},"x-platforms":{"description":"选填, 组件自定义方法适配的平台","type":"array","items":{"type":"string"}},"description":{"description":"选填, 组件方法描述","type":"string"}},"additionalProperties":false,"required":["label","name"]},"VisibleItem":{"description":"组件在应用编辑器/低码编辑器的生效情况","enum":["APP","COMPONENT"],"type":"string"},"ITemplate":{"description":"组件模板配置","type":"object","properties":{"to":{"description":"插入模板的节点或插槽\n不设置或设置 $children 表示插入到当前组件,可配置多个节点或插槽并用逗号隔开","type":"string"},"when":{"description":"插入模板的时机\n不设置或设置 $attached 表示刚拖入组件时执行,可配置多个属性名称并用逗号隔开","type":"string"},"body":{"description":"插入的模板主体\n目前仅支持 toml 配置语法,结构内容参考组件 CALS","type":"string"},"autoSelectPath":{"description":"插入模板时自动选中的节点\n如 template[0] 表示选中所插入模板的第1个节点","type":"string","pattern":"^template.*$"},"remain":{"description":"见文档 https://iwiki.woa.com/p/4009680778#templatesindexremain","type":"string"}},"additionalProperties":false},"IRenderMode":{"type":"object","properties":{"component":{"description":"必填, 转换的目标组件名称","type":"string"},"renderType":{"description":"必填, 表示升级还是替换","enum":["replace","update"],"type":"string"},"props":{"description":"选填, [源组件的属性路径]:[转换目标组件的属性路径] 标记属性路径的映射关系","type":"object","additionalProperties":{"type":"string"}},"materialName":{"description":"选填, 表示升级组件所属组件库,默认与废弃组件同库","type":"string"},"description":{"description":"选填, 升级说明","type":"string"}},"additionalProperties":false,"required":["component","renderType"]},"IShortcut":{"description":"组件快捷编辑协议","type":"object","properties":{"props":{"description":"选填,快捷编辑面板中支持的组件属性","type":"array","items":{"type":"string"}},"extra":{"description":"选填,快捷编辑面板中支持拖入的组件","type":"object","additionalProperties":{"type":"object","properties":{"x-component":{"type":"string","const":"container"},"x-component-props":{"type":"array","items":{"type":"string"}},"x-index":{"type":"number"},"x-insert-path":{"type":"string"}},"additionalProperties":false,"required":["x-component"]}}},"additionalProperties":false},"Scene":{"enum":["batchCreate","batchDelete","batchSelect","create","select","update"],"type":"string"},"Partial<Record<Scene,Partial<Record<SceneTarget,string>>>>":{"type":"object","properties":{"select":{"$ref":"#/definitions/Partial<Record<SceneTarget,string>>"},"batchCreate":{"$ref":"#/definitions/Partial<Record<SceneTarget,string>>"},"batchSelect":{"$ref":"#/definitions/Partial<Record<SceneTarget,string>>"},"batchDelete":{"$ref":"#/definitions/Partial<Record<SceneTarget,string>>"},"create":{"$ref":"#/definitions/Partial<Record<SceneTarget,string>>"},"update":{"$ref":"#/definitions/Partial<Record<SceneTarget,string>>"}},"additionalProperties":false},"Partial<Record<SceneTarget,string>>":{"type":"object","properties":{"value":{"type":"string"},"condition":{"type":"string"},"limit":{"type":"string"},"offset":{"type":"string"}},"additionalProperties":false},"IPlatformComponent":{"description":"云开发低码平台组件","type":"object","properties":{"attributes":{"additionalProperties":true,"description":"可选, 组件控制属性","$ref":"#/definitions/IPlatformAttributes"},"type":{"description":"选填, 组件类型","enum":["BASIC","COMPLEX","PAGE"],"type":"string"},"listeners":{"description":"可选, 组件绑定的监听器","type":"array","items":{"$ref":"#/definitions/IPlatformListener"}},"extra":{"description":"可选,平台实现有关字段","$ref":"#/definitions/IPlatformComponentExtra"},"items":{"description":"可选, 可递归结构, 子级对应","type":"array","items":{"$ref":"#/definitions/IPlatformComponent"}},"label":{"description":"可选, 对用户可读的名称, 如 \"用户名\"","type":"string"},"module":{"description":"所属组件库","type":"string"},"name":{"description":"可选, 数据字段名, 作为向后台传值的名称约定, 如 \"user_name\"","type":"string"},"id":{"description":"选填, 当前页面内的唯一 ID","type":"string"},"component":{"description":"必填, 组件名, 一般首字母大写的大驼峰形式, 如 Image","type":"string"},"resources":{"description":"可选, 应用的资源集合\n\n例如, 代码片段、组件库、静态资源","type":"array","items":{"$ref":"#/definitions/IResource"}},"dataset":{"description":"可选, 变量集合","$ref":"#/definitions/IDataset"},":class":{"description":"可选,动态绑定 class,字符串表达式\n'[\"1\", \"2\"]'","type":"string"},":style":{"description":"可选,动态绑定 style, 与静态合并,字符表达式\n'{width: 17}'","type":"string"},"scopedStyle":{"description":"可选,组件局部样式","type":"string"},"directives":{"description":"选填,指令属性","type":"object","properties":{":if":{"description":"选填,动态 if 指令\nboolean 或 字符串表达式","default":true,"type":["string","boolean"]},":display":{"description":"选填,动态 display 指令\nboolean 或 字符串表达式","default":true,"type":["string","boolean"]},":for":{"description":"选填,动态 for 指令\n字符串表达式 (item, index) in list","type":"string"},"key":{"description":"选填,静态 for key\n字符串,表示 for item 的 key","type":"string"}},"additionalProperties":false}},"additionalProperties":false},"IPlatformAttributes":{"additionalProperties":true,"type":"object","properties":{"theme":{"description":"可选, 皮肤","type":"string"},"class":{"description":"可选, 样式名","type":"string"},"style":{"description":"可选, 标准 CSS 属性, 由于过多不宜下钻定义","type":"object","properties":{},"additionalProperties":true},"hide":{"description":"可选, 是否隐藏","type":"boolean"}}},"IPlatformListener":{"description":"组件绑定的监听器","type":"object","properties":{"id":{"description":"监听器唯一标识","type":"string"},"description":{"description":"可选,用于标注额外的事件流","type":"string"},"extra":{"type":"object","properties":{"handlerParamExtraData":{"type":"object","additionalProperties":{}},"handlerAragsExtraData":{"type":"object","additionalProperties":{}}},"additionalProperties":false},"isCapturePhase":{"description":"可选,是否在捕获阶段响应","default":false,"type":"boolean"},"noPropagation":{"description":"可选,是否附上事件传播","type":"boolean"},"type":{"description":"可选, 监听器类型","type":"string"},"handler":{"description":"可选, 绑定的处理器","$ref":"#/definitions/IHandler"},"eventName":{"description":"必填, 监听的事件名, 来源于 IEvents 定义的事件","type":"string"}},"additionalProperties":false,"required":["eventName","id"]},"IHandler":{"description":"监听器触发的处理器 handler中可查询 诸如数据源信息以及各种事件信息","type":"object","properties":{"name":{"description":"必填, 处理器的名称","type":"string"},"module":{"description":"可选, 处理器所属的模块","type":"string"},"code":{"type":"string"},":code":{"description":"可选,handler inline 代码表达式\n因为主要作为引用来使用,使用表达式更合适","type":"string"},"params":{"description":"可选, 处理器的入参","anyOf":[{"type":"object","properties":{},"additionalProperties":true},{"type":"array","items":{}}]}},"additionalProperties":false,"required":["name"]},"IPlatformComponentExtra":{"type":"object","properties":{"commonStyle":{"description":"可选,样式分组配置","type":"object","properties":{},"additionalProperties":true},"xIndex":{"type":"number"},"staticResourceAttribute":{"type":"array","items":{"type":"string"}},"styleBindPath":{"description":"style bind path","type":"string"},"hideAdminPortalMenu":{"type":"boolean"},"attributeExtraData":{"description":"属性绑定的额外补充信息","type":"object","additionalProperties":{}},"anchored":{"description":"组件是否处于锚定状态?\n\n*针对非叶子节点的组件(如容器),如有 `anchored` 标记,则在预览区可优先被选中*","type":"boolean"},"dataForm":{"description":"自定义数据表单 JSON Schema\n\n*该字段会和组件库中对应组件声明的 dataForm 合并处理,同时覆盖同名字段配置,最终供 formily 消费*","type":"object","additionalProperties":{"type":"object","additionalProperties":{},"properties":{"type":{"type":"string"},"title":{"type":"string"}},"required":["title","type"]}},"ref":{"description":"表示当前节点源于开发态引用关系","type":"string"},"refAttributes":{"additionalProperties":true,"description":"引用节点的初始属性\n冗余记录为了diff","$ref":"#/definitions/IPlatformAttributes"},"include":{"description":"表示需要引用外部/本地资源","type":"array","items":{"type":"string"}}},"additionalProperties":false},"IResource":{"type":"object","additionalProperties":{},"properties":{"name":{"description":"必填,资源名","type":"string"},"type":{"description":"必填,资源类型","type":"string"}},"required":["name","type"]},"IDataset":{"description":"变量","type":"object","properties":{"state":{"description":"状态","type":"object","additionalProperties":{}},"params":{"description":"页面/应用 参数","type":"object","additionalProperties":{"$ref":"#/definitions/IParamsVariable"}},"pageName":{"description":"可选,页面配置名称","type":"string"}},"additionalProperties":false},"IParamsVariable":{"description":"页面参数定义","type":"object","properties":{"label":{"description":"中文名","type":"string"},"required":{"description":"是否必填, 默认 false","type":"boolean"},"sampleValue":{"description":"示例值, ide 开发时使用","type":"string"}},"additionalProperties":false,"required":["label"]}},"$schema":"http://json-schema.org/draft-07/schema#"}
@@ -1,6 +1,6 @@
1
- import { IListener, IResource } from './common';
2
- import { IDataSource } from './datasource';
3
- import { IComponent } from './component';
1
+ import type { IListener, IResource } from './common';
2
+ import type { IDataSource } from './datasource';
3
+ import type { IBaseComponent } from './component';
4
4
  export interface IApp {
5
5
  /**
6
6
  * 必填, 应用名称, 标识
@@ -21,8 +21,9 @@ export interface IApp {
21
21
  */
22
22
  version?: string;
23
23
  /**
24
- * 协议版本 semer version
25
- * x.x.x | latest
24
+ * 协议版本 (格式semver version)
25
+ *
26
+ * @example x.x.x | latest
26
27
  */
27
28
  schemaVersion?: string;
28
29
  /**
@@ -32,7 +33,7 @@ export interface IApp {
32
33
  /**
33
34
  * 选填, 应用的入口组件
34
35
  *
35
- * @default home
36
+ * @default "home"
36
37
  */
37
38
  main?: string;
38
39
  /**
@@ -42,7 +43,9 @@ export interface IApp {
42
43
  /**
43
44
  * 可选, 应用的控制属性
44
45
  */
45
- attributes?: Record<string, any>;
46
+ attributes?: {
47
+ [key: string]: any;
48
+ };
46
49
  /**
47
50
  * 可选, 应用事件信息
48
51
  */
@@ -50,7 +53,7 @@ export interface IApp {
50
53
  /**
51
54
  * 必填, 应用的组件集合
52
55
  */
53
- items: IComponent[];
56
+ items: IBaseComponent[];
54
57
  /**
55
58
  * 可选, 数据源集合
56
59
  */
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/types/basic/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,WAAW,IAAI;IACnB;;;;;OAKG;IAEH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEjC;;OAEG;IACH,MAAM,CAAC,EAAE,GAAG,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,UAAU,EAAE,CAAC;IAEpB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAE5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC;IAExB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;CACb"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/types/basic/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,IAAI;IACnB;;;;;OAKG;IAEH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,UAAU,CAAC,EAAE;QACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IAEF;;OAEG;IACH,MAAM,CAAC,EAAE,GAAG,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,cAAc,EAAE,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAE5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC;IAExB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;CACb"}
@@ -1,4 +1,4 @@
1
- export interface IResource extends Record<string, any> {
1
+ export interface IResource {
2
2
  /**
3
3
  * 必填,资源名
4
4
  */
@@ -7,6 +7,7 @@ export interface IResource extends Record<string, any> {
7
7
  * 必填,资源类型
8
8
  */
9
9
  type: string;
10
+ [key: string]: any;
10
11
  }
11
12
  /**
12
13
  * 应用/组件 绑定的监听器
@@ -21,6 +22,10 @@ export interface IListener {
21
22
  * @default false
22
23
  */
23
24
  isCapturePhase?: boolean;
25
+ /**
26
+ * 可选,是否附上事件传播
27
+ */
28
+ noPropagation?: boolean;
24
29
  /**
25
30
  * 可选, 监听器类型
26
31
  */
@@ -61,12 +66,18 @@ export interface IHandler {
61
66
  */
62
67
  params?: object | any[];
63
68
  }
64
- /** 变量 */
69
+ /**
70
+ * 变量
71
+ */
65
72
  export interface IDataset {
66
73
  /** 状态 */
67
- state?: Record<string, IStateVariable | any>;
74
+ state?: {
75
+ [key: string]: IStateVariable | any;
76
+ };
68
77
  /** 页面/应用 参数 */
69
- params?: Record<string, IParamsVariable>;
78
+ params?: {
79
+ [key: string]: IParamsVariable;
80
+ };
70
81
  /**
71
82
  * 可选,页面配置名称
72
83
  * @deprecated 请使用页面 attributes.title 代替
@@ -81,10 +92,13 @@ export interface IStateVariable {
81
92
  /**
82
93
  * 原始数据类型
83
94
  * string, number, object, array, boolean
95
+ *
96
+ * @todo 考虑把它改成枚举类型
84
97
  */
85
98
  dataType: string;
86
99
  /** 初始值 */
87
100
  initialValue: any;
101
+ [key: string]: any;
88
102
  }
89
103
  /** 页面参数定义 */
90
104
  export interface IParamsVariable {
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/basic/common.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACpD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,QAAQ,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,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M,CAAC;CACtB"}
@@ -1,7 +1,7 @@
1
- import { IListener, IResource, IDataset } from './common';
2
- export interface IComponent {
1
+ import type { IListener, IResource, IDataset } from './common';
2
+ export interface IBaseComponent {
3
3
  /**
4
- * 选填, 当前页面内的唯一ID
4
+ * 选填, 当前页面内的唯一 ID
5
5
  */
6
6
  id?: string;
7
7
  /**
@@ -17,7 +17,7 @@ export interface IComponent {
17
17
  */
18
18
  module?: string;
19
19
  /**
20
- * 必填, 组件名, 一般首字母大写的大驼峰形式, 如Image
20
+ * 必填, 组件名, 一般首字母大写的大驼峰形式, 如 Image
21
21
  */
22
22
  component?: string;
23
23
  /**
@@ -47,7 +47,7 @@ export interface IComponent {
47
47
  /**
48
48
  * 可选, 可递归结构, 子级对应
49
49
  */
50
- items?: IComponent[];
50
+ items?: IBaseComponent[];
51
51
  /**
52
52
  * 可选, 应用的资源集合
53
53
  *
@@ -102,19 +102,20 @@ export interface IComponent {
102
102
  key?: string;
103
103
  };
104
104
  }
105
- export interface IAttributes extends Record<string, any> {
105
+ export interface IAttributes {
106
106
  /**
107
107
  * 可选, 样式名
108
108
  */
109
109
  class?: string;
110
110
  /**
111
- * 可选, 标准CSS属性, 由于过多不宜下钻定义
111
+ * 可选, 标准 CSS 属性, 由于过多不宜下钻定义
112
112
  */
113
113
  style?: object;
114
114
  /**
115
115
  * 可选, 是否隐藏
116
116
  */
117
117
  hide?: boolean;
118
+ [key: string]: any;
118
119
  }
119
120
  export interface IValidity {
120
121
  /**
@@ -142,49 +143,49 @@ export interface IEvents {
142
143
  /**
143
144
  * 可选, 点击事件名
144
145
  *
145
- * @default 'click'
146
+ * @default "click"
146
147
  */
147
148
  clickEventName?: string;
148
149
  /**
149
150
  * 可选, 双击事件名
150
151
  *
151
- * @default 'dbClick'
152
+ * @default "dbClick"
152
153
  */
153
154
  dblClickEventName?: string;
154
155
  /**
155
156
  * 可选, 鼠标移入事件名
156
157
  *
157
- * @default 'mouseEnter'
158
+ * @default "mouseEnter"
158
159
  */
159
160
  mouseEnterEventName?: string;
160
161
  /**
161
162
  * 可选, 鼠标移出事件名
162
163
  *
163
- * @default 'mouseLeave'
164
+ * @default "mouseLeave"
164
165
  */
165
166
  mouseLeaveEventName?: string;
166
167
  /**
167
168
  * 可选, 值变化事件名
168
169
  *
169
- * @default 'change'
170
+ * @default "change"
170
171
  */
171
172
  changeEventName?: string;
172
173
  /**
173
174
  * 可选, 开始拖拽事件名
174
175
  *
175
- * @default 'dragStart'
176
+ * @default "dragStart"
176
177
  */
177
178
  dragStartEventName?: string;
178
179
  /**
179
180
  * 可选, 拖拽事件名
180
181
  *
181
- * @default 'drag'
182
+ * @default "drag"
182
183
  */
183
184
  dragEventName?: string;
184
185
  /**
185
186
  * 可选, 结束拖拽事件名
186
187
  *
187
- * @default 'dragEnd'
188
+ * @default "dragEnd"
188
189
  */
189
190
  dragEndEventName?: string;
190
191
  /**
@@ -192,19 +193,19 @@ export interface IEvents {
192
193
  */
193
194
  customEventName?: string;
194
195
  /**
195
- * 可选, 生命周期-connected事件名
196
+ * 可选, 生命周期 - connected 事件名
196
197
  */
197
198
  lifecycleConnectedEventName?: string;
198
199
  /**
199
- * 可选, 生命周期-disconnected事件名
200
+ * 可选, 生命周期 - disconnected 事件名
200
201
  */
201
202
  lifecycleDisconnectedEventName?: string;
202
203
  /**
203
- * 可选, 生命周期-adopted事件名
204
+ * 可选, 生命周期 - adopted 事件名
204
205
  */
205
206
  lifecycleAdoptedEventName?: string;
206
207
  /**
207
- * 可选, 生命周期-attributeChanged事件名
208
+ * 可选, 生命周期 - attributeChanged 事件名
208
209
  */
209
210
  lifecycleAttributeChangedEventName?: string;
210
211
  }
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/types/basic/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,EAA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}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAEjC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAGjC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC"}
@@ -1,6 +1,4 @@
1
- import type * as CSS from 'csstype';
2
- import { IComponent as IBasicComponent } from './basic/component';
3
- import { IPlatformComponent } from '../utils';
1
+ import type { IPlatformComponent } from './platform/component';
4
2
  /**
5
3
  * 低码组件库开发规范 (LCDS, Lowcode Components Development Specification)
6
4
  *
@@ -19,7 +17,6 @@ export interface IAction {
19
17
  /**
20
18
  * 选填, 平台方法可以接收的数据
21
19
  * 需要符合 JSON SCHEMA 规范
22
- *
23
20
  * @default {}
24
21
  */
25
22
  data?: any;
@@ -65,13 +62,11 @@ export interface IComponent {
65
62
  /**
66
63
  * 选填, 组件可以接收的数据, 用作组件props入参
67
64
  * 需要符合 JSON SCHEMA 规范
68
- *
69
65
  * @default {}
70
66
  */
71
67
  data?: any;
72
68
  /**
73
69
  * 选填, 组件可以被捕获的事件信息
74
- *
75
70
  * @default []
76
71
  */
77
72
  events?: IEvent[];
@@ -85,7 +80,6 @@ export interface IComponent {
85
80
  properties?: any;
86
81
  /**
87
82
  * 选填,组件内定义的自定义方法
88
- *
89
83
  * @default []
90
84
  */
91
85
  methods?: IMethod[];
@@ -96,12 +90,14 @@ export interface IComponent {
96
90
  compConfig?: {
97
91
  /**
98
92
  * 选填, 组件是否开启数据容器功能
99
- * 默认为 false, 设置为 true 后, 在组件内可通过调用 onDataChange 事件将内部数据挂载到组件的 $context 上下文对象
93
+ * - 默认为 false
94
+ * - 设置为 true 后,在组件内可通过调用 `onDataChange` 事件将内部数据挂载到组件的 `$context` 上下文对象
100
95
  */
101
96
  isDataContainer?: boolean;
102
97
  /**
103
98
  * 选填, 组件类型
104
- * 支持将表单类组件设置为 formField,即可在表单容器中收集值
99
+ *
100
+ * 支持将表单类组件设置为 `formField`,即可在表单容器中收集值
105
101
  */
106
102
  componentType?: string;
107
103
  };
@@ -132,16 +128,19 @@ export interface IComponent {
132
128
  */
133
129
  description?: string;
134
130
  /**
135
- * 选填, 组件图标, 支持本地图片
131
+ * 选填, 组件图标, 支持本地图片(大纲树里面用的)
136
132
  */
137
133
  icon?: string;
134
+ /**
135
+ * 选填, 组件大图标 (组件列表里用的)
136
+ */
137
+ figureIcon?: string;
138
138
  /**
139
139
  * 必填, 组件分类, 建议用中文
140
140
  */
141
141
  category: string;
142
142
  /**
143
143
  * 选填, 组件的排序权重
144
- *
145
144
  * @minimum 1
146
145
  * @maximum 10000
147
146
  */
@@ -152,7 +151,11 @@ export interface IComponent {
152
151
  platform?: XPlatform[];
153
152
  /**
154
153
  * 选填, 组件可见性配置
155
- * 默认均显示,[]表示隐藏, ['APP']表示只在应用编辑器显示,['COMPONENT']表示只在组件编辑器显示
154
+ *
155
+ * 默认均显示
156
+ * - `[]` 表示隐藏
157
+ * - `['APP']` 表示只在应用编辑器显示
158
+ * - `['COMPONENT']` 表示只在组件编辑器显示
156
159
  */
157
160
  visible?: VisibleItem[];
158
161
  /**
@@ -179,10 +182,14 @@ export interface IComponent {
179
182
  */
180
183
  shortcut?: IShortcut;
181
184
  /**
182
- * 选填,组件上下文协议,配置后可通过 $context.id.state.xx 读取属性值
185
+ * 选填,组件上下文协议
186
+ *
187
+ * 配置后可通过 `$context.id.state.xx` 读取属性值
183
188
  * @deprecated
184
189
  */
185
- contextData?: Record<string, unknown>;
190
+ contextData?: {
191
+ [key: string]: any;
192
+ };
186
193
  /**
187
194
  * 选填,组件相对位置限制
188
195
  * {@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002466153 使用文档}
@@ -193,7 +200,7 @@ export interface IComponent {
193
200
  */
194
201
  allowChildren?: {
195
202
  /**
196
- * 组件对应类型,对应 componentConfig.componentType
203
+ * 组件对应类型,对应 `componentConfig.componentType`
197
204
  */
198
205
  componentType: string;
199
206
  /**
@@ -210,7 +217,7 @@ export interface IComponent {
210
217
  */
211
218
  allowParent?: {
212
219
  /**
213
- * 组件对应类型,对应 componentConfig.componentType
220
+ * 组件对应类型,对应` componentConfig.componentType`
214
221
  */
215
222
  componentType: string;
216
223
  /**
@@ -295,7 +302,9 @@ export interface IComponent {
295
302
  * 特殊字段,因 rule 的不同而不同
296
303
  */
297
304
  extra?: any;
298
- action?: Record<string, unknown>;
305
+ action?: {
306
+ [key: string]: any;
307
+ };
299
308
  [k: string]: unknown;
300
309
  };
301
310
  }[];
@@ -306,17 +315,19 @@ export interface IComponent {
306
315
  inlineStyleForm?: {
307
316
  [key: string]: {
308
317
  visible: boolean;
309
- };
318
+ } | boolean;
310
319
  } | {
311
320
  $blockedAll: true;
312
321
  };
313
322
  /**
314
323
  * 选填,属性分组信息
315
324
  */
316
- group?: Record<string, {
317
- 'x-index': number;
318
- expand: boolean;
319
- }>;
325
+ group?: {
326
+ [key: string]: {
327
+ 'x-index': number;
328
+ expand: boolean;
329
+ };
330
+ };
320
331
  /**
321
332
  * 组件使用示例缩略图
322
333
  */
@@ -338,20 +349,70 @@ export interface IComponent {
338
349
  * 操作配置
339
350
  */
340
351
  operation: {
341
- /**
342
- * 图标
343
- */
352
+ /** 图标 */
344
353
  icon: string;
345
- /**
346
- * 标题
347
- */
354
+ /** 标题 */
348
355
  title: string;
356
+ /** 行为,由编辑器提供 */
357
+ action: string;
358
+ }[];
359
+ /**
360
+ * 操作区域会插入的插槽名称
361
+ */
362
+ previewSlotName?: string;
363
+ /**
364
+ * 选填,插入插槽名称
365
+ *
366
+ * - 指定拖动时插入的插槽名称
367
+ * - 比如 指定为 `contentSlot`,如果 `form` 指定了值为 `contentSlot`,则会插入到 `contentSlot` 中,而不是 `form` 里
368
+ */
369
+ insertSlotName?: string;
370
+ };
371
+ queryGeneratorConfig?: {
372
+ sceneConfig: {
373
+ scenes: Array<Scene>;
374
+ availableScenes: Array<Scene>;
375
+ validCombinations: Array<Scene[]>;
376
+ enableSelectMultiple?: boolean;
377
+ };
378
+ fieldsConfig?: {
379
+ /** 是否支持配置 format? */
380
+ enableConfigFormat?: boolean;
381
+ /** 是否显示字段标识的列? */
382
+ showFieldTypeColumn?: boolean;
383
+ enableSelectFieldFormType?: boolean;
384
+ };
385
+ apisConfig?: {
386
+ /** 是否配置 record 和 total 的键值? */
387
+ enableConfigRecordAndTotalKey: boolean;
388
+ };
389
+ mysqlConfig?: {
390
+ /** 是否自动生成查询总条数语句? */
391
+ autoGenerateCountQuery?: boolean;
349
392
  /**
350
- * 行为,由编辑器提供
393
+ * 计数名字
394
+ *
395
+ * 表示 `SELECT COUNT(*) as count FROM xxx;` 的 `count`,如果指定 `countName` 为 `abc`,则输出 `sql SELECT COUNT(*) as abc FROM xxx;`
351
396
  */
352
- action: string;
397
+ countName?: string;
398
+ };
399
+ /**
400
+ * 绑定路径配置
401
+ *
402
+ * 如果没有配置,默认就是 `params`,举例说明:
403
+ * - 配置 `select.condition` 为 `'params.abc'`,则输出的 SQL 为 `SELECT aa FROM xxx WHERE key={{params.abc}}`
404
+ * - 配置 `create.value` 为 `'params.hello'`,则输出的 SQL 为 `INSERT INTO xxx (a, b) VALUES ({{params.hello.a}}, {{params.hello.b }})`
405
+ */
406
+ bindParamsPath?: Partial<Record<Scene, Partial<Record<SceneTarget, string>>>>;
407
+ quickOperateButton?: {
408
+ icon: string;
409
+ targetField: string;
410
+ content: string;
353
411
  }[];
354
412
  };
413
+ globalConfig?: {
414
+ [key: string]: any;
415
+ };
355
416
  };
356
417
  /**
357
418
  * 选填, 扩展字段, 尽量避免用
@@ -367,12 +428,16 @@ export interface IComponent {
367
428
  * 默认样式
368
429
  * defaultStyles 接收一个React.CSSProperties对象
369
430
  */
370
- defaultStyles?: CSS.Properties<string | number>;
431
+ defaultStyles?: {
432
+ [key: string]: any;
433
+ };
371
434
  /**
372
435
  * 组件所包含的子组件树
373
436
  */
374
- items?: IBasicComponent[] | IPlatformComponent[];
437
+ items?: IPlatformComponent[];
375
438
  }
439
+ declare type Scene = 'batchCreate' | 'batchSelect' | 'batchDelete' | 'create' | 'select' | 'update';
440
+ declare type SceneTarget = 'condition' | 'value' | 'limit' | 'offset';
376
441
  /**
377
442
  * 低码组件可以被捕获的事件信息
378
443
  */
@@ -396,7 +461,9 @@ export interface IEvent {
396
461
  /**
397
462
  * 事件参数对象
398
463
  */
399
- detail?: Record<string, any>;
464
+ detail?: {
465
+ [key: string]: any;
466
+ };
400
467
  }
401
468
  /**
402
469
  * 低码组件可以暴露的自定义方法
@@ -497,6 +564,10 @@ export interface ITemplate {
497
564
  * 如 template[0] 表示选中所插入模板的第1个节点
498
565
  */
499
566
  autoSelectPath?: `template${string}`;
567
+ /**
568
+ * 见文档 https://iwiki.woa.com/p/4009680778#templatesindexremain
569
+ */
570
+ remain?: string;
500
571
  }
501
572
  /** 组件快捷编辑协议 */
502
573
  export interface IShortcut {
@@ -507,12 +578,14 @@ export interface IShortcut {
507
578
  /**
508
579
  * 选填,快捷编辑面板中支持拖入的组件
509
580
  */
510
- extra?: Record<string, {
511
- 'x-component': 'container';
512
- 'x-component-props'?: string[];
513
- 'x-index'?: number;
514
- 'x-insert-path'?: string;
515
- }>;
581
+ extra?: {
582
+ [key: string]: {
583
+ 'x-component': 'container';
584
+ 'x-component-props'?: string[];
585
+ 'x-index'?: number;
586
+ 'x-insert-path'?: string;
587
+ };
588
+ };
516
589
  }
517
590
  /** 组件样式 API */
518
591
  export interface IClasses {
@@ -533,4 +606,5 @@ export interface IClasses {
533
606
  */
534
607
  description?: string;
535
608
  }
609
+ export {};
536
610
  //# sourceMappingURL=lcds.d.ts.map