| 13 | } |
| 14 | |
| 15 | export interface IDynamicFormItemSchema { |
| 16 | id: string; |
| 17 | default: string | number | boolean | Array<unknown>; |
| 18 | label: I18nObject; |
| 19 | /** Form value key. Names prefixed with ``__system.`` denote display-only |
| 20 | * fields whose value is resolved from |
| 21 | * ``DynamicFormComponent.systemContext`` (e.g. ``__system.outbound_ips`` |
| 22 | * → ``systemContext.outbound_ips``) — same namespace as ``show_if``. |
| 23 | * Such fields are rendered read-only with copy buttons, excluded from |
| 24 | * form state/validation/emission, and hidden when the value is empty. */ |
| 25 | name: string; |
| 26 | required: boolean; |
| 27 | type: DynamicFormItemType; |
| 28 | description?: I18nObject; |
| 29 | options?: IDynamicFormItemOption[]; |
| 30 | /** When the condition matches, the field is rendered. Same evaluator as |
| 31 | * ``disable_if`` — supports the ``__system.*`` namespace via |
| 32 | * ``DynamicFormComponent.systemContext``. */ |
| 33 | show_if?: IShowIfCondition; |
| 34 | /** When the condition matches, the field is rendered as read-only/disabled |
| 35 | * but stays visible. Use this when the operator needs to see that the |
| 36 | * field exists but can't be edited under the current runtime state (e.g. |
| 37 | * a sandbox-bound field when Box is disabled). Pair with |
| 38 | * ``disabled_tooltip`` to explain why. */ |
| 39 | disable_if?: IShowIfCondition; |
| 40 | /** Tooltip shown next to the field label when ``disable_if`` is active. */ |
| 41 | disabled_tooltip?: I18nObject; |
| 42 | |
| 43 | /** when type is PLUGIN_SELECTOR, the scopes is the scopes of components(plugin contains), the default is all */ |
| 44 | scopes?: string[]; |
| 45 | accept?: string; // For file type: accepted MIME types |
| 46 | login_platform?: string; // For qr-code-login type: platform identifier (e.g. 'feishu', 'weixin') |
| 47 | } |
| 48 | |
| 49 | export enum DynamicFormItemType { |
| 50 | INT = 'integer', |
nothing calls this directly
no outgoing calls
no test coverage detected