@blueking/bkui-form 0.0.6 → 0.0.7
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.
- package/package.json +1 -1
- package/dist/bkui-form-umd-min.js +0 -9
- package/dist/bkui-form-umd.js +0 -10858
- package/dist/bkui-form-umd.js.map +0 -1
- package/dist/bkui-form.css +0 -134
- package/dist/types/bkui-form.d.ts +0 -140
package/dist/bkui-form.css
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
.bk-schema-form .mr24 {
|
|
2
|
-
margin-right: 24px;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.bk-schema-form .bk-form-item {
|
|
6
|
-
margin-top: unset !important;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.bk-schema-form .bk-form-item .bk-form-content .group-text {
|
|
10
|
-
background-color: #f2f4f8;
|
|
11
|
-
height: 100%;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.bk-schema-form .bk-form-item .bk-select {
|
|
15
|
-
background-color: #fff;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.bk-schema-form .bk-form-item .bk-select.is-disabled {
|
|
19
|
-
background-color: #fafbfd;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.bk-schema-form .bk-schema-form-group.normal {
|
|
23
|
-
padding: 24px;
|
|
24
|
-
position: relative;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.bk-schema-form .bk-schema-form-group.card{
|
|
28
|
-
background: #fff;
|
|
29
|
-
padding: 0 24px 24px 24px;
|
|
30
|
-
border-radius: 2px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.bk-schema-form-group--error{
|
|
34
|
-
border-color: #f5222d !important;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.bk-schema-form-group__error-tips{
|
|
38
|
-
position: relative;
|
|
39
|
-
display: block;
|
|
40
|
-
width: 10px;
|
|
41
|
-
height: 10px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.bk-schema-form-group__error-tips-popover {
|
|
45
|
-
position: absolute;
|
|
46
|
-
top: -5px;
|
|
47
|
-
left: 0;
|
|
48
|
-
z-index: 1;
|
|
49
|
-
background: #fff;
|
|
50
|
-
border: 1px solid #f5222d;
|
|
51
|
-
color: #f5222d;
|
|
52
|
-
font-size: 12px;
|
|
53
|
-
margin-left: 10px;
|
|
54
|
-
font-weight: normal;
|
|
55
|
-
padding: 5px 10px;
|
|
56
|
-
border-radius: 2px;
|
|
57
|
-
max-height: 50px;
|
|
58
|
-
overflow:hidden;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.bk-schema-form-group__error-tips-popover:hover {
|
|
62
|
-
max-height: unset;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.bk-schema-form-group__error-tips-popover > p {
|
|
66
|
-
padding: 0;
|
|
67
|
-
margin: 0;
|
|
68
|
-
white-space: nowrap;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.bk-schema-form .bk-schema-form-group .bk-schema-form-group-title {
|
|
72
|
-
font-size: 14px;
|
|
73
|
-
font-weight: 600;
|
|
74
|
-
color: #63656E;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.bk-schema-form .bk-schema-form-group .bk-schema-form-group-title.normal {
|
|
78
|
-
position: absolute;
|
|
79
|
-
top: -1em;
|
|
80
|
-
left: 10px;
|
|
81
|
-
line-height: 2em;
|
|
82
|
-
padding: 0 0.5em;
|
|
83
|
-
background: #fff;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.bk-schema-form .bk-schema-form-group .bk-schema-form-group-title.card{
|
|
87
|
-
display: flex;
|
|
88
|
-
height: 50px;
|
|
89
|
-
align-items: center;
|
|
90
|
-
padding: 0 24px;
|
|
91
|
-
margin: 0 -24px 16px -24px;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.bk-schema-form .bk-collapse-item .bk-collapse-item-header {
|
|
95
|
-
height: 54px;
|
|
96
|
-
padding: 0;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.bk-schema-form .bk-collapse-item .bk-collapse-item-content {
|
|
100
|
-
background: #f5f7fa;
|
|
101
|
-
padding: 0 34px 16px 34px;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.bk-schema-form .bk-schema-form-group-add {
|
|
105
|
-
font-size: 14px;
|
|
106
|
-
color: #3a84ff;
|
|
107
|
-
cursor: pointer;
|
|
108
|
-
display: flex;
|
|
109
|
-
align-items: center;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.bk-schema-form .bk-schema-form-group-delete {
|
|
113
|
-
position: absolute;
|
|
114
|
-
cursor: pointer;
|
|
115
|
-
color: #979bA5;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.bk-schema-form .bk-schema-form-group-delete:hover {
|
|
119
|
-
color: #3a84ff;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.bk-schema-form-item__error-tips {
|
|
123
|
-
color: #f5222d;
|
|
124
|
-
font-size: 12px;
|
|
125
|
-
margin-top: 5px;
|
|
126
|
-
margin: 0;
|
|
127
|
-
line-height: 1.5em;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.bk-schema-form-item--error input,
|
|
131
|
-
.bk-schema-form-item--error .bk-textarea-wrapper,
|
|
132
|
-
.bk-schema-form-item--error .bk-select {
|
|
133
|
-
border: 1px solid #f5222d;
|
|
134
|
-
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import * as vue_types_vue from 'vue/types/vue';
|
|
2
|
-
import * as json_schema from 'json-schema';
|
|
3
|
-
import { JSONSchema6TypeName, JSONSchema7 } from 'json-schema';
|
|
4
|
-
import Vue, { VNodeData } from 'vue';
|
|
5
|
-
import styleInject from '../node_modules/style-inject/dist/style-inject.es.js';
|
|
6
|
-
|
|
7
|
-
type GlobalComponents = any;
|
|
8
|
-
interface IFormOption<T> {
|
|
9
|
-
// 组件命名空间,默认bk
|
|
10
|
-
namespace: string;
|
|
11
|
-
// Schema表单依赖的基础组件
|
|
12
|
-
baseWidgets?: {},
|
|
13
|
-
// 内置的自定义表单组件(包装特定逻辑后的别名)
|
|
14
|
-
components: {
|
|
15
|
-
[k in GlobalComponents]: T
|
|
16
|
-
},
|
|
17
|
-
// schema type对应的field类型
|
|
18
|
-
fields: {
|
|
19
|
-
[k in JSONSchema6TypeName]: T
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface IUIComponent extends VNodeData {
|
|
24
|
-
name: any;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
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-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}\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 16px -24px;\n}\n\n.bk-schema-form .bk-collapse-item .bk-collapse-item-header {\n height: 54px;\n padding: 0;\n}\n\n.bk-schema-form .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}\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: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}";
|
|
28
|
-
styleInject(css_248z);
|
|
29
|
-
|
|
30
|
-
declare function createForm<T>(opts?: Partial<IFormOption<T>>): vue_types_vue.ExtendedVue<Vue, {
|
|
31
|
-
rootData: {};
|
|
32
|
-
}, {
|
|
33
|
-
initFormData(): void;
|
|
34
|
-
emitFormValueChange(newValue: any, oldValue: any): void;
|
|
35
|
-
validateForm: () => boolean;
|
|
36
|
-
validateFormItem: (path: string) => boolean;
|
|
37
|
-
}, unknown, {
|
|
38
|
-
value: any;
|
|
39
|
-
rules: any;
|
|
40
|
-
schema: any;
|
|
41
|
-
width: string | number;
|
|
42
|
-
layout: any;
|
|
43
|
-
formType: string;
|
|
44
|
-
context: any;
|
|
45
|
-
httpAdapter: any;
|
|
46
|
-
}>;
|
|
47
|
-
|
|
48
|
-
declare class FormEvent {
|
|
49
|
-
callbacks: Record<string, Record<string, Array<Function>>>;
|
|
50
|
-
constructor();
|
|
51
|
-
on(path: string, type: string, cb: Function): this;
|
|
52
|
-
off(path: string, type: string, cb: Function): this;
|
|
53
|
-
once(path: string, type: string, cb: Function): this;
|
|
54
|
-
emit(path: string, type: string, ...arg: any[]): void;
|
|
55
|
-
}
|
|
56
|
-
declare const _default: FormEvent;
|
|
57
|
-
|
|
58
|
-
declare class Schema {
|
|
59
|
-
static rootSchema: JSONSchema7;
|
|
60
|
-
static resolveAllOf(schema: JSONSchema7): {
|
|
61
|
-
$id?: string | undefined;
|
|
62
|
-
$ref?: string | undefined;
|
|
63
|
-
$schema?: string | undefined;
|
|
64
|
-
$comment?: string | undefined;
|
|
65
|
-
$defs?: {
|
|
66
|
-
[key: string]: json_schema.JSONSchema7Definition;
|
|
67
|
-
} | undefined;
|
|
68
|
-
type?: json_schema.JSONSchema7TypeName | json_schema.JSONSchema7TypeName[] | undefined;
|
|
69
|
-
enum?: json_schema.JSONSchema7Type[] | undefined;
|
|
70
|
-
const?: json_schema.JSONSchema7Type | undefined;
|
|
71
|
-
multipleOf?: number | undefined;
|
|
72
|
-
maximum?: number | undefined;
|
|
73
|
-
exclusiveMaximum?: number | undefined;
|
|
74
|
-
minimum?: number | undefined;
|
|
75
|
-
exclusiveMinimum?: number | undefined;
|
|
76
|
-
maxLength?: number | undefined;
|
|
77
|
-
minLength?: number | undefined;
|
|
78
|
-
pattern?: string | undefined;
|
|
79
|
-
items?: json_schema.JSONSchema7Definition | json_schema.JSONSchema7Definition[] | undefined;
|
|
80
|
-
additionalItems?: json_schema.JSONSchema7Definition | undefined;
|
|
81
|
-
maxItems?: number | undefined;
|
|
82
|
-
minItems?: number | undefined;
|
|
83
|
-
uniqueItems?: boolean | undefined;
|
|
84
|
-
contains?: JSONSchema7 | undefined;
|
|
85
|
-
maxProperties?: number | undefined;
|
|
86
|
-
minProperties?: number | undefined;
|
|
87
|
-
required?: string[] | undefined;
|
|
88
|
-
properties?: {
|
|
89
|
-
[key: string]: json_schema.JSONSchema7Definition;
|
|
90
|
-
} | undefined;
|
|
91
|
-
patternProperties?: {
|
|
92
|
-
[key: string]: json_schema.JSONSchema7Definition;
|
|
93
|
-
} | undefined;
|
|
94
|
-
additionalProperties?: json_schema.JSONSchema7Definition | undefined;
|
|
95
|
-
dependencies?: {
|
|
96
|
-
[key: string]: string[] | json_schema.JSONSchema7Definition;
|
|
97
|
-
} | undefined;
|
|
98
|
-
propertyNames?: json_schema.JSONSchema7Definition | undefined;
|
|
99
|
-
if?: json_schema.JSONSchema7Definition | undefined;
|
|
100
|
-
then?: json_schema.JSONSchema7Definition | undefined;
|
|
101
|
-
else?: json_schema.JSONSchema7Definition | undefined;
|
|
102
|
-
anyOf?: json_schema.JSONSchema7Definition[] | undefined;
|
|
103
|
-
oneOf?: json_schema.JSONSchema7Definition[] | undefined;
|
|
104
|
-
not?: json_schema.JSONSchema7Definition | undefined;
|
|
105
|
-
format?: string | undefined;
|
|
106
|
-
contentMediaType?: string | undefined;
|
|
107
|
-
contentEncoding?: string | undefined;
|
|
108
|
-
definitions?: {
|
|
109
|
-
[key: string]: json_schema.JSONSchema7Definition;
|
|
110
|
-
} | undefined;
|
|
111
|
-
title?: string | undefined;
|
|
112
|
-
description?: string | undefined;
|
|
113
|
-
default?: json_schema.JSONSchema7Type | undefined;
|
|
114
|
-
readOnly?: boolean | undefined;
|
|
115
|
-
writeOnly?: boolean | undefined;
|
|
116
|
-
examples?: json_schema.JSONSchema7Type | undefined;
|
|
117
|
-
};
|
|
118
|
-
static mergeSchemaAllOf(...args: any[]): JSONSchema7;
|
|
119
|
-
static resolveRef(): void;
|
|
120
|
-
static resolveDependencies(): void;
|
|
121
|
-
static resolveAdditionalProperties(): void;
|
|
122
|
-
static resolveSchema(schema: JSONSchema7): JSONSchema7;
|
|
123
|
-
static getSchemaDefaultValue(_schema: JSONSchema7): any;
|
|
124
|
-
static getSchemaType(schema: JSONSchema7): string;
|
|
125
|
-
static getSchemaField(schema: JSONSchema7): Partial<IUIComponent>;
|
|
126
|
-
static isMultiSelect(schema: JSONSchema7): boolean;
|
|
127
|
-
static isTupleArray(schema: JSONSchema7): boolean;
|
|
128
|
-
static isCustomArrayWidget(schema: JSONSchema7): any;
|
|
129
|
-
static getGroupWrap(schema: JSONSchema7): Partial<IUIComponent>;
|
|
130
|
-
static getUiComponent(schema: JSONSchema7): Partial<IUIComponent>;
|
|
131
|
-
static getDefaultWidget(schema: JSONSchema7): string | object | null;
|
|
132
|
-
static isRequired(schema: JSONSchema7, name: string): boolean;
|
|
133
|
-
static getUiOptions(schema: JSONSchema7): any;
|
|
134
|
-
static getDependencies(schema: JSONSchema7, name: string): [string, string[] | json_schema.JSONSchema7Definition] | undefined;
|
|
135
|
-
static orderProps(): void;
|
|
136
|
-
static resolveDefaultDatasource(schema: JSONSchema7): any;
|
|
137
|
-
constructor(rootSchema: any);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export { Schema, createForm as default, _default as events };
|