import * as vue_types_vue from 'vue/types/vue'; import * as Vue from 'vue'; import Vue__default, { VNodeData } from 'vue'; import * as ajv from 'ajv'; import * as json_schema from 'json-schema'; import { JSONSchema6TypeName, JSONSchema7 } from 'json-schema'; import styleInject from '../node_modules/style-inject/dist/style-inject.es.js'; type GlobalComponents = any; interface IFormOption { // 组件命名空间,默认bk namespace: string; // Schema表单依赖的基础组件 baseWidgets?: {}; // 内置的自定义表单组件(包装特定逻辑后的别名) components: { [k in GlobalComponents]: T }; // schema type对应的field类型 fields: { [k in JSONSchema6TypeName | 'composition']: T; } } interface IUIComponent extends VNodeData { name: any; } interface IValidateResult { result: boolean message: string | undefined path: string } var css_248z = ".bk-schema-form .mr24 {\n margin-right: 24px;\n}\n\n.bk-schema-form .bk-form-item {\n margin-top: unset !important;\n}\n\n.bk-schema-form .bk-form-item .bk-form-content .group-text {\n background-color: #f2f4f8;\n height: 100%;\n}\n\n.bk-schema-form .bk-form-item .bk-select {\n background-color: #fff;\n}\n\n.bk-schema-form .bk-form-item .bk-select.is-disabled {\n background-color: #fafbfd;\n}\n\n.bk-schema-form .bk-schema-form-group.normal {\n padding: 24px;\n position: relative;\n}\n\n.bk-schema-form .bk-schema-form-group.card{\n background: #fff;\n padding: 0 24px 24px 24px;\n border-radius: 2px;\n}\n\n.bk-schema-form .bk-schema-form-group.hide-empty-row .bk-schema-form-group-content {\n row-gap: 0 !important;\n}\n\n.bk-schema-form .bk-schema-form-group.hide-empty-row .bk-schema-form-group-content .bk-form-item {\n margin-bottom: 20px;\n}\n\n.bk-schema-form-group--error{\n border-color: #f5222d !important;\n}\n\n.bk-schema-form-group__error-tips{\n position: relative;\n display: block;\n width: 10px;\n height: 10px;\n}\n\n.bk-schema-form-group__error-tips-popover {\n position: absolute;\n top: -5px;\n left: 0;\n z-index: 1;\n background: #fff;\n border: 1px solid #f5222d;\n color: #f5222d;\n font-size: 12px;\n margin-left: 10px;\n font-weight: normal;\n padding: 5px 10px;\n border-radius: 2px;\n max-height: 50px;\n overflow:hidden;\n}\n\n.bk-schema-form-group__error-tips-popover:hover {\n max-height: unset;\n}\n\n.bk-schema-form-group__error-tips-popover > p {\n padding: 0;\n margin: 0;\n white-space: nowrap;\n}\n\n.bk-schema-form .bk-schema-form-group .bk-schema-form-group-title {\n font-size: 14px;\n font-weight: 600;\n color: #63656E;\n position: relative;\n}\n.bk-schema-form .bk-schema-form-group .bk-schema-form-group-title.is-required:after {\n height: 8px;\n line-height: 1;\n content: \"*\";\n color: #ea3636;\n font-size: 12px;\n position: absolute;\n display: inline-block;\n vertical-align: middle;\n top: 50%;\n transform: translate(3px, -50%);\n}\n.bk-schema-form .bk-schema-form-group .group-has-desc{\n border-bottom: 1px dashed #979ba5;\n cursor: pointer;\n}\n.bk-schema-form .bk-schema-form-group .bk-schema-form-group-title.default {\n display: inline-block;\n margin-bottom: 10px;\n}\n\n.bk-schema-form .bk-schema-form-group .bk-schema-form-group-title.normal {\n position: absolute;\n top: -1em;\n left: 10px;\n line-height: 2em;\n padding: 0 0.5em;\n background: #fff;\n}\n\n.bk-schema-form .bk-schema-form-group .bk-schema-form-group-title.card{\n display: flex;\n height: 50px;\n align-items: center;\n padding: 0 24px;\n margin: 0 -24px 8px -24px;\n}\n\n.bk-schema-form .bk-collapse.normal .bk-collapse-item .bk-collapse-item-header {\n height: 54px;\n padding: 0;\n}\n\n.bk-schema-form .bk-collapse.normal .bk-collapse-item .bk-collapse-item-content {\n background: #f5f7fa;\n padding: 0 34px 16px 34px;\n}\n\n.bk-schema-form .bk-schema-form-group-add {\n font-size: 14px;\n color: #3a84ff;\n cursor: pointer;\n display: flex;\n align-items: center;\n font-size: 12px;\n}\n\n.bk-schema-form .bk-schema-form-group-add.large {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 32px;\n flex: 1;\n border: 1px dashed #3a84ff;\n border-radius: 2px;\n color: #3a84ff;\n cursor: pointer;\n text-align: center;\n}\n.bk-schema-form .bk-schema-form-group-add.large.error {\n border: 1px dashed #f5222d;\n}\n\n.bk-schema-form .bk-schema-form-group-add.disabled {\n color: #c4c6cc;\n cursor: not-allowed;\n}\n\n.bk-schema-form .bk-schema-form-group-add.large.disabled {\n border: 1px dashed #c4c6cc;\n}\n\n.bk-schema-form .bk-schema-form-group-add.readonly {\n color: #c4c6cc;\n}\n\n.bk-schema-form .bk-schema-form-group-delete {\n position: absolute;\n cursor: pointer;\n color: #979bA5;\n}\n\n.bk-schema-form .bk-schema-form-group-delete.disabled {\n color: #c4c6cc;\n cursor: not-allowed;\n}\n\n.bk-schema-form .bk-schema-form-group-delete.readonly {\n color: #c4c6cc;\n}\n\n.bk-schema-form .bk-schema-form-group-delete:hover {\n color: #3a84ff;\n}\n\n.bk-schema-form-item__error-tips {\n color: #f5222d;\n font-size: 12px;\n margin-top: 5px;\n margin: 0;\n line-height: 1.5em;\n}\n\n.bk-schema-form-item--error input,\n.bk-schema-form-item--error .bk-textarea-wrapper,\n.bk-schema-form-item--error .bk-select {\n border: 1px solid #f5222d;\n}\n\n.bk-schema-form .bk-schema-form-group .bk-form-unit-input .bk-textarea-wrapper {\n min-height: 32px;\n}\n\n.bk-schema-form .bk-schema-form-group .bk-form-unit-input textarea {\n min-height: 30px;\n}\n\n.bk-schema-form .bk-schema-form-item-auto-height .bk-form-content {\n min-height: auto;\n line-height: 1;\n}\n\n.bk-schema-form .table-widget-actions .action-btn {\n margin-right: 8px;\n font-size: 14px;\n cursor: pointer;\n}\n.bk-schema-form .table-widget-actions .action-btn:hover {\n color: #3a84ff;\n}\n.bk-schema-form .is-disabled .action-btn {\n color: #dcdee5 !important;\n cursor: not-allowed;\n}\n.bk-schema-form .bk-table-fixed-right {\n height: 100% !important;\n border-bottom: 1px solid #dfe0e5;\n}"; styleInject(css_248z); interface INodeConfig { id: string; type: 'node' | 'group'; index?: number; instance: any; parent: WidgetNode | null; children: WidgetNode[]; } declare class WidgetNode { id: string; instance: any; parent: WidgetNode | null; type: 'node' | 'group'; index?: number; children: WidgetNode[]; constructor(config: INodeConfig); get value(): any; get isChildrenVisible(): any; /** * 获取 parents */ get parents(): any[]; get firstChild(): WidgetNode; get lastChild(): WidgetNode; getSibling(lastProp: string): WidgetNode | undefined; getSiblings(): WidgetNode[]; /** * 是否是叶子节点 */ get isLeaf(): boolean; appendChild(node: WidgetNode): WidgetNode[] | (WidgetNode & any[]); removeChild(node: WidgetNode): WidgetNode[] | (WidgetNode & any[]); } declare class WidgetTree { widgetMap: Record; addWidgetNode(path: string, instance: any, type: 'node' | 'group', index?: number): void; removeWidgetNode(path: string, instance: any): void; } declare function createForm(opts?: Partial>): vue_types_vue.ExtendedVue, Record, never, never, (event: string, ...args: any[]) => Vue__default, Record, never, never, any>>, { rootData: {}; formKey: string; widgetTree: WidgetTree; }, { initFormData(): void; emitFormValueChange(newValue: any, oldValue: any): void; validateForm(): boolean; validateFormItem(path: string): IValidateResult; validate(): Promise; validateSchema: (schema: ajv.AnySchema) => Promise; }, unknown, { value: any; rules: any; schema: any; width: string | number; layout: any; formType: string; context: any; httpAdapter: any; readonly: boolean; disabled: boolean; readonlyMode: string; labelWidth: number; }, {}, Vue.ComponentOptionsMixin, Vue.ComponentOptionsMixin>; declare class FormEvent { callbacks: Record>>; constructor(); on(path: string, type: string, cb: Function): this; off(path: string, type: string, cb: Function): this; once(path: string, type: string, cb: Function): this; emit(path: string, type: string, ...arg: any[]): void; } declare const _default: FormEvent; declare class Schema { static rootSchema: JSONSchema7; static resolveRef(): void; static resolveDependencies(): void; static resolveAdditionalProperties(): void; static resolveSchema(schema: JSONSchema7): JSONSchema7; static getSchemaDefaultValue(_schema: JSONSchema7): any; static getSchemaType(schema: JSONSchema7): string; static getUiProps(props: string, schema: JSONSchema7): Partial; static getSchemaField(schema: JSONSchema7): Partial; static isMultiSelect(schema: JSONSchema7): boolean; static isTupleArray(schema: JSONSchema7): boolean; static isCustomArrayWidget(schema: JSONSchema7): any; static getGroupWrap(schema: JSONSchema7): Partial; static getUiComponent(schema: JSONSchema7): Partial; static getDefaultWidget(schema: JSONSchema7): string | object | null; static isRequired(schema: JSONSchema7, name: string): boolean; static getUiOptions(schema: JSONSchema7): any; static getDependencies(schema: JSONSchema7, name: string): [string, string[] | json_schema.JSONSchema7Definition] | undefined; static resolveDefaultDatasource(schema: JSONSchema7): any; constructor(rootSchema: any); } export { Schema, createForm as default, _default as events };