@blueking/bkui-form 1.0.1-beta.3 → 1.0.1-beta.4
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/dist/adapter/common/FieldGroupWrap.d.ts +209 -0
- package/dist/adapter/field/ArrayField.d.ts +147 -0
- package/dist/adapter/field/BooleanField.d.ts +145 -0
- package/dist/adapter/field/CompositionField.d.ts +151 -0
- package/dist/adapter/field/FieldProps.d.ts +70 -0
- package/dist/adapter/field/NumberField.d.ts +145 -0
- package/dist/adapter/field/ObjectField.d.ts +147 -0
- package/dist/adapter/field/SchemaField.d.ts +145 -0
- package/dist/adapter/field/StringField.d.ts +4 -0
- package/dist/adapter/widget/ArrayWidget.d.ts +154 -0
- package/dist/adapter/widget/ButtonWidget.d.ts +16 -0
- package/dist/adapter/widget/CheckboxWidget.d.ts +34 -0
- package/dist/adapter/widget/CollapseGroupWidget.d.ts +196 -0
- package/dist/adapter/widget/ColorPickerWidget.d.ts +8 -0
- package/dist/adapter/widget/InputWidget.d.ts +30 -0
- package/dist/adapter/widget/KeyValueArrayWidget.d.ts +157 -0
- package/dist/adapter/widget/RadioWidget.d.ts +37 -0
- package/dist/adapter/widget/SelectWidget.d.ts +37 -0
- package/dist/adapter/widget/SwitchWidget.d.ts +10 -0
- package/dist/adapter/widget/TabGroupWidget.d.ts +187 -0
- package/dist/adapter/widget/TableWidget.d.ts +154 -0
- package/dist/adapter/widget/Widget.d.ts +182 -0
- package/dist/controller/form.d.ts +141 -0
- package/dist/controller/props.d.ts +62 -0
- package/dist/core/events.d.ts +10 -0
- package/dist/core/expression.d.ts +13 -0
- package/dist/core/form.d.ts +5 -0
- package/dist/core/lang.d.ts +1 -0
- package/dist/core/layout.d.ts +20 -0
- package/dist/core/lifecycle.d.ts +0 -0
- package/dist/core/path.d.ts +9 -0
- package/dist/core/proxy.d.ts +3 -0
- package/dist/core/reaction.d.ts +5 -0
- package/dist/core/register.d.ts +19 -0
- package/dist/core/schema.d.ts +26 -0
- package/dist/core/validator.d.ts +35 -0
- package/dist/core/widgetTree.d.ts +40 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.es.js +7443 -0
- package/dist/index.umd.js +12 -0
- package/dist/style.css +1 -0
- package/dist/util/fetch.d.ts +10 -0
- package/dist/util/index.d.ts +23 -0
- package/package.json +24 -12
- package/esm/adapter/common/FieldGroupWrap.tsx.js +0 -199
- package/esm/adapter/field/ArrayField.tsx.js +0 -55
- package/esm/adapter/field/BooleanField.tsx.js +0 -41
- package/esm/adapter/field/CompositionField.tsx.js +0 -113
- package/esm/adapter/field/FieldProps.ts.js +0 -85
- package/esm/adapter/field/NumberField.tsx.js +0 -19
- package/esm/adapter/field/ObjectField.tsx.js +0 -58
- package/esm/adapter/field/SchemaField.tsx.js +0 -28
- package/esm/adapter/field/StringField.tsx.js +0 -4
- package/esm/adapter/widget/ArrayWidget.ts.js +0 -196
- package/esm/adapter/widget/ButtonWidget.ts.js +0 -76
- package/esm/adapter/widget/CheckboxWidget.ts.js +0 -101
- package/esm/adapter/widget/CollapseGroupWidget.ts.js +0 -140
- package/esm/adapter/widget/ColorPickerWidget.ts.js +0 -71
- package/esm/adapter/widget/InputWidget.ts.js +0 -79
- package/esm/adapter/widget/KeyValueArrayWidget.tsx.js +0 -156
- package/esm/adapter/widget/RadioWidget.ts.js +0 -98
- package/esm/adapter/widget/SelectWidget.ts.js +0 -98
- package/esm/adapter/widget/SwitchWidget.ts.js +0 -73
- package/esm/adapter/widget/TabGroupWidget.ts.js +0 -145
- package/esm/adapter/widget/TableWidget.ts.js +0 -205
- package/esm/adapter/widget/Widget.ts.js +0 -497
- package/esm/assets/fonts/iconcool.eot +0 -0
- package/esm/assets/fonts/iconcool.svg +0 -53
- package/esm/assets/fonts/iconcool.ttf +0 -0
- package/esm/assets/fonts/iconcool.woff +0 -0
- package/esm/assets/style.css +0 -43
- package/esm/controller/form.css +0 -164
- package/esm/controller/form.tsx.js +0 -159
- package/esm/controller/props.ts.js +0 -75
- package/esm/core/events.ts.js +0 -74
- package/esm/core/expression.ts.js +0 -67
- package/esm/core/lang.ts.js +0 -25
- package/esm/core/layout.ts.js +0 -149
- package/esm/core/path.ts.js +0 -60
- package/esm/core/proxy.ts.js +0 -10
- package/esm/core/reaction.ts.js +0 -116
- package/esm/core/register.ts.js +0 -74
- package/esm/core/schema.ts.js +0 -302
- package/esm/core/validator.ts.js +0 -248
- package/esm/core/widgetTree.ts.js +0 -163
- package/esm/index.ts.js +0 -6
- package/esm/node_modules/@blueking/cli-service/dist/lib/path.js +0 -35
- package/esm/node_modules/@blueking/cli-service/dist/lib/util.js +0 -233
- package/esm/node_modules/@blueking/cli-service/dist/tools/rust/helper/path.js +0 -172
- package/esm/node_modules/ajv/dist/ajv.js +0 -50
- package/esm/node_modules/ajv/dist/compile/codegen/code.js +0 -156
- package/esm/node_modules/ajv/dist/compile/codegen/index.js +0 -697
- package/esm/node_modules/ajv/dist/compile/codegen/scope.js +0 -143
- package/esm/node_modules/ajv/dist/compile/errors.js +0 -123
- package/esm/node_modules/ajv/dist/compile/index.js +0 -242
- package/esm/node_modules/ajv/dist/compile/names.js +0 -28
- package/esm/node_modules/ajv/dist/compile/ref_error.js +0 -12
- package/esm/node_modules/ajv/dist/compile/resolve.js +0 -155
- package/esm/node_modules/ajv/dist/compile/rules.js +0 -26
- package/esm/node_modules/ajv/dist/compile/util.js +0 -178
- package/esm/node_modules/ajv/dist/compile/validate/applicability.js +0 -19
- package/esm/node_modules/ajv/dist/compile/validate/boolSchema.js +0 -50
- package/esm/node_modules/ajv/dist/compile/validate/dataType.js +0 -203
- package/esm/node_modules/ajv/dist/compile/validate/defaults.js +0 -35
- package/esm/node_modules/ajv/dist/compile/validate/index.js +0 -520
- package/esm/node_modules/ajv/dist/compile/validate/keyword.js +0 -124
- package/esm/node_modules/ajv/dist/compile/validate/subschema.js +0 -81
- package/esm/node_modules/ajv/dist/core.js +0 -618
- package/esm/node_modules/ajv/dist/refs/data.json +0 -13
- package/esm/node_modules/ajv/dist/refs/json-schema-draft-07.json +0 -151
- package/esm/node_modules/ajv/dist/runtime/equal.js +0 -7
- package/esm/node_modules/ajv/dist/runtime/ucs2length.js +0 -24
- package/esm/node_modules/ajv/dist/runtime/uri.js +0 -6
- package/esm/node_modules/ajv/dist/runtime/validation_error.js +0 -11
- package/esm/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +0 -49
- package/esm/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +0 -106
- package/esm/node_modules/ajv/dist/vocabularies/applicator/allOf.js +0 -23
- package/esm/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +0 -12
- package/esm/node_modules/ajv/dist/vocabularies/applicator/contains.js +0 -95
- package/esm/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +0 -85
- package/esm/node_modules/ajv/dist/vocabularies/applicator/if.js +0 -66
- package/esm/node_modules/ajv/dist/vocabularies/applicator/index.js +0 -44
- package/esm/node_modules/ajv/dist/vocabularies/applicator/items.js +0 -52
- package/esm/node_modules/ajv/dist/vocabularies/applicator/items2020.js +0 -30
- package/esm/node_modules/ajv/dist/vocabularies/applicator/not.js +0 -26
- package/esm/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +0 -60
- package/esm/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +0 -75
- package/esm/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +0 -12
- package/esm/node_modules/ajv/dist/vocabularies/applicator/properties.js +0 -54
- package/esm/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +0 -38
- package/esm/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +0 -13
- package/esm/node_modules/ajv/dist/vocabularies/code.js +0 -131
- package/esm/node_modules/ajv/dist/vocabularies/core/id.js +0 -10
- package/esm/node_modules/ajv/dist/vocabularies/core/index.js +0 -16
- package/esm/node_modules/ajv/dist/vocabularies/core/ref.js +0 -122
- package/esm/node_modules/ajv/dist/vocabularies/discriminator/index.js +0 -104
- package/esm/node_modules/ajv/dist/vocabularies/discriminator/types.js +0 -9
- package/esm/node_modules/ajv/dist/vocabularies/draft7.js +0 -17
- package/esm/node_modules/ajv/dist/vocabularies/format/format.js +0 -92
- package/esm/node_modules/ajv/dist/vocabularies/format/index.js +0 -6
- package/esm/node_modules/ajv/dist/vocabularies/metadata.js +0 -18
- package/esm/node_modules/ajv/dist/vocabularies/validation/const.js +0 -25
- package/esm/node_modules/ajv/dist/vocabularies/validation/enum.js +0 -48
- package/esm/node_modules/ajv/dist/vocabularies/validation/index.js +0 -33
- package/esm/node_modules/ajv/dist/vocabularies/validation/limitItems.js +0 -24
- package/esm/node_modules/ajv/dist/vocabularies/validation/limitLength.js +0 -27
- package/esm/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +0 -27
- package/esm/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +0 -24
- package/esm/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +0 -26
- package/esm/node_modules/ajv/dist/vocabularies/validation/pattern.js +0 -24
- package/esm/node_modules/ajv/dist/vocabularies/validation/required.js +0 -79
- package/esm/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +0 -64
- package/esm/node_modules/ajv-formats/dist/formats.js +0 -173
- package/esm/node_modules/ajv-formats/dist/index.js +0 -37
- package/esm/node_modules/ajv-formats/dist/limit.js +0 -69
- package/esm/node_modules/ajv-i18n/localize/zh/index.js +0 -154
- package/esm/node_modules/fast-deep-equal/index.js +0 -46
- package/esm/node_modules/fast-uri/index.js +0 -303
- package/esm/node_modules/fast-uri/lib/schemes.js +0 -188
- package/esm/node_modules/fast-uri/lib/scopedChars.js +0 -30
- package/esm/node_modules/fast-uri/lib/utils.js +0 -244
- package/esm/node_modules/json-schema-traverse/index.js +0 -89
- package/esm/node_modules/semver/classes/comparator.js +0 -143
- package/esm/node_modules/semver/classes/range.js +0 -557
- package/esm/node_modules/semver/classes/semver.js +0 -333
- package/esm/node_modules/semver/functions/clean.js +0 -8
- package/esm/node_modules/semver/functions/cmp.js +0 -54
- package/esm/node_modules/semver/functions/coerce.js +0 -62
- package/esm/node_modules/semver/functions/compare-build.js +0 -9
- package/esm/node_modules/semver/functions/compare-loose.js +0 -5
- package/esm/node_modules/semver/functions/compare.js +0 -7
- package/esm/node_modules/semver/functions/diff.js +0 -60
- package/esm/node_modules/semver/functions/eq.js +0 -5
- package/esm/node_modules/semver/functions/gt.js +0 -5
- package/esm/node_modules/semver/functions/gte.js +0 -5
- package/esm/node_modules/semver/functions/inc.js +0 -21
- package/esm/node_modules/semver/functions/lt.js +0 -5
- package/esm/node_modules/semver/functions/lte.js +0 -5
- package/esm/node_modules/semver/functions/major.js +0 -5
- package/esm/node_modules/semver/functions/minor.js +0 -5
- package/esm/node_modules/semver/functions/neq.js +0 -5
- package/esm/node_modules/semver/functions/parse.js +0 -18
- package/esm/node_modules/semver/functions/patch.js +0 -5
- package/esm/node_modules/semver/functions/prerelease.js +0 -8
- package/esm/node_modules/semver/functions/rcompare.js +0 -5
- package/esm/node_modules/semver/functions/rsort.js +0 -5
- package/esm/node_modules/semver/functions/satisfies.js +0 -12
- package/esm/node_modules/semver/functions/sort.js +0 -5
- package/esm/node_modules/semver/functions/valid.js +0 -8
- package/esm/node_modules/semver/index.js +0 -91
- package/esm/node_modules/semver/internal/constants.js +0 -37
- package/esm/node_modules/semver/internal/debug.js +0 -11
- package/esm/node_modules/semver/internal/identifiers.js +0 -29
- package/esm/node_modules/semver/internal/lrucache.js +0 -42
- package/esm/node_modules/semver/internal/parse-options.js +0 -17
- package/esm/node_modules/semver/internal/re.js +0 -223
- package/esm/node_modules/semver/ranges/gtr.js +0 -6
- package/esm/node_modules/semver/ranges/intersects.js +0 -9
- package/esm/node_modules/semver/ranges/ltr.js +0 -6
- package/esm/node_modules/semver/ranges/max-satisfying.js +0 -27
- package/esm/node_modules/semver/ranges/min-satisfying.js +0 -26
- package/esm/node_modules/semver/ranges/min-version.js +0 -63
- package/esm/node_modules/semver/ranges/outside.js +0 -82
- package/esm/node_modules/semver/ranges/simplify.js +0 -49
- package/esm/node_modules/semver/ranges/subset.js +0 -249
- package/esm/node_modules/semver/ranges/to-comparators.js +0 -10
- package/esm/node_modules/semver/ranges/valid.js +0 -13
- package/esm/util/fetch.ts.js +0 -190
- package/esm/util/index.ts.js +0 -276
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
function _define_property(obj, key, value) {
|
|
2
|
-
if (key in obj) {
|
|
3
|
-
Object.defineProperty(obj, key, {
|
|
4
|
-
value: value,
|
|
5
|
-
enumerable: true,
|
|
6
|
-
configurable: true,
|
|
7
|
-
writable: true
|
|
8
|
-
});
|
|
9
|
-
} else {
|
|
10
|
-
obj[key] = value;
|
|
11
|
-
}
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
function _object_spread(target) {
|
|
15
|
-
for(var i = 1; i < arguments.length; i++){
|
|
16
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
-
var ownKeys = Object.keys(source);
|
|
18
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
ownKeys.forEach(function(key) {
|
|
24
|
-
_define_property(target, key, source[key]);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
}
|
|
29
|
-
function ownKeys(object, enumerableOnly) {
|
|
30
|
-
var keys = Object.keys(object);
|
|
31
|
-
if (Object.getOwnPropertySymbols) {
|
|
32
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
-
if (enumerableOnly) {
|
|
34
|
-
symbols = symbols.filter(function(sym) {
|
|
35
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
keys.push.apply(keys, symbols);
|
|
39
|
-
}
|
|
40
|
-
return keys;
|
|
41
|
-
}
|
|
42
|
-
function _object_spread_props(target, source) {
|
|
43
|
-
source = source != null ? source : {};
|
|
44
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
-
} else {
|
|
47
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return target;
|
|
52
|
-
}
|
|
53
|
-
function _object_without_properties(source, excluded) {
|
|
54
|
-
if (source == null) return {};
|
|
55
|
-
var target = _object_without_properties_loose(source, excluded);
|
|
56
|
-
var key, i;
|
|
57
|
-
if (Object.getOwnPropertySymbols) {
|
|
58
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
59
|
-
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
60
|
-
key = sourceSymbolKeys[i];
|
|
61
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
62
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
63
|
-
target[key] = source[key];
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return target;
|
|
67
|
-
}
|
|
68
|
-
function _object_without_properties_loose(source, excluded) {
|
|
69
|
-
if (source == null) return {};
|
|
70
|
-
var target = {};
|
|
71
|
-
var sourceKeys = Object.keys(source);
|
|
72
|
-
var key, i;
|
|
73
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
74
|
-
key = sourceKeys[i];
|
|
75
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
76
|
-
target[key] = source[key];
|
|
77
|
-
}
|
|
78
|
-
return target;
|
|
79
|
-
}
|
|
80
|
-
import Schema from '../../core/schema.ts.js';
|
|
81
|
-
import { defineComponent, h } from 'vue';
|
|
82
|
-
import props from '../field/FieldProps.ts.js';
|
|
83
|
-
import { mergeDeep } from '../../util/index.ts.js';
|
|
84
|
-
import SchemaField from '../field/SchemaField.tsx.js';
|
|
85
|
-
import Path from '../../core/path.ts.js';
|
|
86
|
-
import register from '../../core/register.ts.js';
|
|
87
|
-
import locale from '../../core/lang.ts.js';
|
|
88
|
-
// 默认数组控件
|
|
89
|
-
export default defineComponent({
|
|
90
|
-
name: 'ArrayWidget',
|
|
91
|
-
props: _object_spread_props(_object_spread({}, props), {
|
|
92
|
-
modelValue: {
|
|
93
|
-
type: Array,
|
|
94
|
-
default: ()=>[]
|
|
95
|
-
}
|
|
96
|
-
}),
|
|
97
|
-
mounted () {
|
|
98
|
-
this.handleFillItem();
|
|
99
|
-
},
|
|
100
|
-
methods: {
|
|
101
|
-
// 补全minItems项
|
|
102
|
-
handleFillItem () {
|
|
103
|
-
const { minItems = 0 } = this.schema;
|
|
104
|
-
const valueLen = this.modelValue ? this.modelValue.length : 0;
|
|
105
|
-
if (valueLen < minItems) {
|
|
106
|
-
const data = Schema.getSchemaDefaultValue(this.schema.items);
|
|
107
|
-
const remainData = new Array(minItems - valueLen).fill(data);
|
|
108
|
-
this.$emit('update:modelValue', {
|
|
109
|
-
path: this.path,
|
|
110
|
-
value: [
|
|
111
|
-
...this.modelValue || [],
|
|
112
|
-
...remainData
|
|
113
|
-
]
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
// 添加item
|
|
118
|
-
handleAddItem () {
|
|
119
|
-
const data = Schema.getSchemaDefaultValue(this.schema.items);
|
|
120
|
-
const value = JSON.parse(JSON.stringify(this.modelValue || []));
|
|
121
|
-
value.push(data);
|
|
122
|
-
this.$emit('update:modelValue', {
|
|
123
|
-
path: this.path,
|
|
124
|
-
value
|
|
125
|
-
});
|
|
126
|
-
},
|
|
127
|
-
// 删除item
|
|
128
|
-
handleDeleteItem (path) {
|
|
129
|
-
const index = Number(Path.getPathLastProp(path));
|
|
130
|
-
const value = JSON.parse(JSON.stringify(this.modelValue || []));
|
|
131
|
-
value.splice(index, 1);
|
|
132
|
-
this.$emit('update:modelValue', {
|
|
133
|
-
path: this.path,
|
|
134
|
-
value
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
render () {
|
|
139
|
-
const self = this;
|
|
140
|
-
const arrVnodeList = (Array.isArray(this.modelValue) ? this.modelValue : []).map((_, index)=>{
|
|
141
|
-
const curPath = Path.getCurPath(this.path, index);
|
|
142
|
-
return h(SchemaField, _object_spread_props(_object_spread({}, this.$props, this.$attrs), {
|
|
143
|
-
key: `${curPath}-${this.modelValue.length}`,
|
|
144
|
-
schema: this.schema.items,
|
|
145
|
-
path: curPath,
|
|
146
|
-
layout: _object_spread_props(_object_spread({}, this.layout), {
|
|
147
|
-
item: {}
|
|
148
|
-
}),
|
|
149
|
-
removeable: true,
|
|
150
|
-
onRemove (path) {
|
|
151
|
-
self.handleDeleteItem(path);
|
|
152
|
-
}
|
|
153
|
-
}));
|
|
154
|
-
});
|
|
155
|
-
const _Schema_getGroupWrap = Schema.getGroupWrap(this.schema), { name } = _Schema_getGroupWrap, vnode = _object_without_properties(_Schema_getGroupWrap, [
|
|
156
|
-
"name"
|
|
157
|
-
]);
|
|
158
|
-
return h(name, mergeDeep(_object_spread_props(_object_spread({}, this.$props), {
|
|
159
|
-
layout: {},
|
|
160
|
-
showTitle: true,
|
|
161
|
-
style: _object_spread({}, this.layout.item || {}),
|
|
162
|
-
// 监听 FieldGroupWrap 的 update:modelValue 事件(用于重置默认值等功能)
|
|
163
|
-
'onUpdate:modelValue': (data)=>{
|
|
164
|
-
self.$emit('update:modelValue', data);
|
|
165
|
-
}
|
|
166
|
-
}), vnode), {
|
|
167
|
-
default: ()=>[
|
|
168
|
-
...arrVnodeList,
|
|
169
|
-
!this.readonly ? h(register.getBaseWidget('form-item'), {
|
|
170
|
-
labelWidth: 0,
|
|
171
|
-
class: {
|
|
172
|
-
'bk-schema-form-item-auto-height': true
|
|
173
|
-
}
|
|
174
|
-
}, {
|
|
175
|
-
default: ()=>[
|
|
176
|
-
h('span', {
|
|
177
|
-
class: [
|
|
178
|
-
'bk-schema-form-group-add'
|
|
179
|
-
],
|
|
180
|
-
onClick () {
|
|
181
|
-
self.handleAddItem();
|
|
182
|
-
}
|
|
183
|
-
}, [
|
|
184
|
-
h('i', {
|
|
185
|
-
class: [
|
|
186
|
-
'bk-form-icon icon-plus-circle-shape mr5'
|
|
187
|
-
]
|
|
188
|
-
}),
|
|
189
|
-
locale('add')
|
|
190
|
-
])
|
|
191
|
-
]
|
|
192
|
-
}) : undefined
|
|
193
|
-
]
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
});
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
function _define_property(obj, key, value) {
|
|
2
|
-
if (key in obj) {
|
|
3
|
-
Object.defineProperty(obj, key, {
|
|
4
|
-
value: value,
|
|
5
|
-
enumerable: true,
|
|
6
|
-
configurable: true,
|
|
7
|
-
writable: true
|
|
8
|
-
});
|
|
9
|
-
} else {
|
|
10
|
-
obj[key] = value;
|
|
11
|
-
}
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
function _object_spread(target) {
|
|
15
|
-
for(var i = 1; i < arguments.length; i++){
|
|
16
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
-
var ownKeys = Object.keys(source);
|
|
18
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
ownKeys.forEach(function(key) {
|
|
24
|
-
_define_property(target, key, source[key]);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
}
|
|
29
|
-
function ownKeys(object, enumerableOnly) {
|
|
30
|
-
var keys = Object.keys(object);
|
|
31
|
-
if (Object.getOwnPropertySymbols) {
|
|
32
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
-
if (enumerableOnly) {
|
|
34
|
-
symbols = symbols.filter(function(sym) {
|
|
35
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
keys.push.apply(keys, symbols);
|
|
39
|
-
}
|
|
40
|
-
return keys;
|
|
41
|
-
}
|
|
42
|
-
function _object_spread_props(target, source) {
|
|
43
|
-
source = source != null ? source : {};
|
|
44
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
-
} else {
|
|
47
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return target;
|
|
52
|
-
}
|
|
53
|
-
import register from '../../core/register.ts.js';
|
|
54
|
-
import { defineComponent, h } from 'vue';
|
|
55
|
-
export default defineComponent({
|
|
56
|
-
name: 'ButtonWidget',
|
|
57
|
-
props: {
|
|
58
|
-
word: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: ''
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
methods: {
|
|
64
|
-
handleClick () {
|
|
65
|
-
this.$emit('click');
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
render () {
|
|
69
|
-
const self = this;
|
|
70
|
-
return h(register.getBaseWidget('button'), _object_spread_props(_object_spread({}, this.$attrs), {
|
|
71
|
-
onClick: self.handleClick()
|
|
72
|
-
}), {
|
|
73
|
-
default: ()=>this.word
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
});
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
function _define_property(obj, key, value) {
|
|
2
|
-
if (key in obj) {
|
|
3
|
-
Object.defineProperty(obj, key, {
|
|
4
|
-
value: value,
|
|
5
|
-
enumerable: true,
|
|
6
|
-
configurable: true,
|
|
7
|
-
writable: true
|
|
8
|
-
});
|
|
9
|
-
} else {
|
|
10
|
-
obj[key] = value;
|
|
11
|
-
}
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
function _object_spread(target) {
|
|
15
|
-
for(var i = 1; i < arguments.length; i++){
|
|
16
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
-
var ownKeys = Object.keys(source);
|
|
18
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
ownKeys.forEach(function(key) {
|
|
24
|
-
_define_property(target, key, source[key]);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
}
|
|
29
|
-
function ownKeys(object, enumerableOnly) {
|
|
30
|
-
var keys = Object.keys(object);
|
|
31
|
-
if (Object.getOwnPropertySymbols) {
|
|
32
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
-
if (enumerableOnly) {
|
|
34
|
-
symbols = symbols.filter(function(sym) {
|
|
35
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
keys.push.apply(keys, symbols);
|
|
39
|
-
}
|
|
40
|
-
return keys;
|
|
41
|
-
}
|
|
42
|
-
function _object_spread_props(target, source) {
|
|
43
|
-
source = source != null ? source : {};
|
|
44
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
-
} else {
|
|
47
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return target;
|
|
52
|
-
}
|
|
53
|
-
import register from '../../core/register.ts.js';
|
|
54
|
-
import { defineComponent, h } from 'vue';
|
|
55
|
-
export default defineComponent({
|
|
56
|
-
name: 'CheckboxWidget',
|
|
57
|
-
props: {
|
|
58
|
-
datasource: {
|
|
59
|
-
type: Array,
|
|
60
|
-
default: ()=>[]
|
|
61
|
-
},
|
|
62
|
-
modelValue: {
|
|
63
|
-
type: [
|
|
64
|
-
Array,
|
|
65
|
-
Boolean
|
|
66
|
-
],
|
|
67
|
-
default: ()=>[]
|
|
68
|
-
},
|
|
69
|
-
// 单个checkbox时文案
|
|
70
|
-
label: {
|
|
71
|
-
type: String,
|
|
72
|
-
default: ''
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
methods: {
|
|
76
|
-
handleChange (val) {
|
|
77
|
-
this.$emit('update:modelValue', val);
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
render () {
|
|
81
|
-
return Array.isArray(this.modelValue) ? h(register.getBaseWidget('checkbox-group'), {
|
|
82
|
-
modelValue: this.modelValue,
|
|
83
|
-
onChange: this.handleChange
|
|
84
|
-
}, {
|
|
85
|
-
default: ()=>this.datasource.map((item)=>h(register.getBaseWidget('checkbox'), _object_spread_props(_object_spread({}, this.$attrs), {
|
|
86
|
-
key: item.value,
|
|
87
|
-
class: [
|
|
88
|
-
'mr24'
|
|
89
|
-
],
|
|
90
|
-
label: item.value
|
|
91
|
-
}), {
|
|
92
|
-
default: ()=>item.label
|
|
93
|
-
}))
|
|
94
|
-
}) : h(register.getBaseWidget('checkbox'), {
|
|
95
|
-
modelValue: this.modelValue,
|
|
96
|
-
onChange: this.handleChange
|
|
97
|
-
}, {
|
|
98
|
-
default: ()=>this.label
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
});
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
function _define_property(obj, key, value) {
|
|
2
|
-
if (key in obj) {
|
|
3
|
-
Object.defineProperty(obj, key, {
|
|
4
|
-
value: value,
|
|
5
|
-
enumerable: true,
|
|
6
|
-
configurable: true,
|
|
7
|
-
writable: true
|
|
8
|
-
});
|
|
9
|
-
} else {
|
|
10
|
-
obj[key] = value;
|
|
11
|
-
}
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
function _object_spread(target) {
|
|
15
|
-
for(var i = 1; i < arguments.length; i++){
|
|
16
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
-
var ownKeys = Object.keys(source);
|
|
18
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
ownKeys.forEach(function(key) {
|
|
24
|
-
_define_property(target, key, source[key]);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
}
|
|
29
|
-
function ownKeys(object, enumerableOnly) {
|
|
30
|
-
var keys = Object.keys(object);
|
|
31
|
-
if (Object.getOwnPropertySymbols) {
|
|
32
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
-
if (enumerableOnly) {
|
|
34
|
-
symbols = symbols.filter(function(sym) {
|
|
35
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
keys.push.apply(keys, symbols);
|
|
39
|
-
}
|
|
40
|
-
return keys;
|
|
41
|
-
}
|
|
42
|
-
function _object_spread_props(target, source) {
|
|
43
|
-
source = source != null ? source : {};
|
|
44
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
-
} else {
|
|
47
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return target;
|
|
52
|
-
}
|
|
53
|
-
import Layout from '../../core/layout.ts.js';
|
|
54
|
-
import Path from '../../core/path.ts.js';
|
|
55
|
-
import register from '../../core/register.ts.js';
|
|
56
|
-
import Schema from '../../core/schema.ts.js';
|
|
57
|
-
import { orderProperties } from '../../util/index.ts.js';
|
|
58
|
-
import { defineComponent, h } from 'vue';
|
|
59
|
-
import FieldGroupWrap from '../common/FieldGroupWrap.tsx.js';
|
|
60
|
-
import props from '../field/FieldProps.ts.js';
|
|
61
|
-
import SchemaField from '../field/SchemaField.tsx.js';
|
|
62
|
-
export default defineComponent({
|
|
63
|
-
name: 'CollapseWidget',
|
|
64
|
-
props: _object_spread_props(_object_spread({}, props), {
|
|
65
|
-
type: {
|
|
66
|
-
type: String,
|
|
67
|
-
default: 'default',
|
|
68
|
-
validator: (value)=>[
|
|
69
|
-
'default',
|
|
70
|
-
'normal',
|
|
71
|
-
'card'
|
|
72
|
-
].includes(value)
|
|
73
|
-
},
|
|
74
|
-
showTitle: {
|
|
75
|
-
type: Boolean,
|
|
76
|
-
default: false
|
|
77
|
-
},
|
|
78
|
-
border: {
|
|
79
|
-
type: Boolean,
|
|
80
|
-
default: false
|
|
81
|
-
},
|
|
82
|
-
defaultActiveName: {
|
|
83
|
-
type: Array,
|
|
84
|
-
default: ()=>[]
|
|
85
|
-
},
|
|
86
|
-
verifiable: {
|
|
87
|
-
type: Boolean,
|
|
88
|
-
default: false
|
|
89
|
-
}
|
|
90
|
-
}),
|
|
91
|
-
data () {
|
|
92
|
-
return {
|
|
93
|
-
activeName: this.defaultActiveName
|
|
94
|
-
};
|
|
95
|
-
},
|
|
96
|
-
render () {
|
|
97
|
-
var _this_schema;
|
|
98
|
-
const groupWrapProps = _object_spread_props(_object_spread({}, this.$props), {
|
|
99
|
-
layout: _object_spread_props(_object_spread({}, this.layout), {
|
|
100
|
-
container: {}
|
|
101
|
-
}),
|
|
102
|
-
title: this.schema.title
|
|
103
|
-
});
|
|
104
|
-
const properties = orderProperties(Object.keys(((_this_schema = this.schema) === null || _this_schema === void 0 ? void 0 : _this_schema.properties) || {}), this.schema['ui:order']);
|
|
105
|
-
const collapseItems = properties.map((key)=>{
|
|
106
|
-
var _this_schema_properties, _this_schema;
|
|
107
|
-
const schemaItem = (_this_schema = this.schema) === null || _this_schema === void 0 ? void 0 : (_this_schema_properties = _this_schema.properties) === null || _this_schema_properties === void 0 ? void 0 : _this_schema_properties[key];
|
|
108
|
-
const curPath = Path.getCurPath(this.path, key);
|
|
109
|
-
const lastProp = curPath.split('.').pop();
|
|
110
|
-
const layoutConfig = Layout.findLayoutByProp(lastProp, this.layout.group || []) || {};
|
|
111
|
-
return h(register.getBaseWidget('collapse-panel'), {
|
|
112
|
-
key,
|
|
113
|
-
name: key,
|
|
114
|
-
title: schemaItem.title
|
|
115
|
-
}, {
|
|
116
|
-
content: ()=>h(SchemaField, _object_spread_props(_object_spread({
|
|
117
|
-
key: curPath
|
|
118
|
-
}, this.$props, this.$attrs), {
|
|
119
|
-
schema: schemaItem,
|
|
120
|
-
required: Schema.isRequired(schemaItem, key),
|
|
121
|
-
path: curPath,
|
|
122
|
-
layout: layoutConfig,
|
|
123
|
-
removeable: false
|
|
124
|
-
}))
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
const self = this;
|
|
128
|
-
return h(FieldGroupWrap, _object_spread({}, groupWrapProps), {
|
|
129
|
-
default: ()=>h(register.getBaseWidget('collapse'), {
|
|
130
|
-
'use-card-theme': true,
|
|
131
|
-
modelValue: this.activeName,
|
|
132
|
-
'onUpdate:modelValue' (actives) {
|
|
133
|
-
self.activeName = actives;
|
|
134
|
-
}
|
|
135
|
-
}, {
|
|
136
|
-
default: ()=>collapseItems
|
|
137
|
-
})
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
});
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
function _define_property(obj, key, value) {
|
|
2
|
-
if (key in obj) {
|
|
3
|
-
Object.defineProperty(obj, key, {
|
|
4
|
-
value: value,
|
|
5
|
-
enumerable: true,
|
|
6
|
-
configurable: true,
|
|
7
|
-
writable: true
|
|
8
|
-
});
|
|
9
|
-
} else {
|
|
10
|
-
obj[key] = value;
|
|
11
|
-
}
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
function _object_spread(target) {
|
|
15
|
-
for(var i = 1; i < arguments.length; i++){
|
|
16
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
-
var ownKeys = Object.keys(source);
|
|
18
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
ownKeys.forEach(function(key) {
|
|
24
|
-
_define_property(target, key, source[key]);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
}
|
|
29
|
-
function ownKeys(object, enumerableOnly) {
|
|
30
|
-
var keys = Object.keys(object);
|
|
31
|
-
if (Object.getOwnPropertySymbols) {
|
|
32
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
-
if (enumerableOnly) {
|
|
34
|
-
symbols = symbols.filter(function(sym) {
|
|
35
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
keys.push.apply(keys, symbols);
|
|
39
|
-
}
|
|
40
|
-
return keys;
|
|
41
|
-
}
|
|
42
|
-
function _object_spread_props(target, source) {
|
|
43
|
-
source = source != null ? source : {};
|
|
44
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
-
} else {
|
|
47
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return target;
|
|
52
|
-
}
|
|
53
|
-
import register from '../../core/register.ts.js';
|
|
54
|
-
import { defineComponent, h } from 'vue';
|
|
55
|
-
export default defineComponent({
|
|
56
|
-
name: 'ColorPicker',
|
|
57
|
-
props: {
|
|
58
|
-
modelValue: String
|
|
59
|
-
},
|
|
60
|
-
methods: {
|
|
61
|
-
handleChange (color) {
|
|
62
|
-
this.$emit('update:modelValue', color);
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
render () {
|
|
66
|
-
return h(register.getBaseWidget('color-picker'), _object_spread_props(_object_spread({}, this.$attrs), {
|
|
67
|
-
modelValue: this.modelValue,
|
|
68
|
-
onChange: this.handleChange
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
});
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
function _define_property(obj, key, value) {
|
|
2
|
-
if (key in obj) {
|
|
3
|
-
Object.defineProperty(obj, key, {
|
|
4
|
-
value: value,
|
|
5
|
-
enumerable: true,
|
|
6
|
-
configurable: true,
|
|
7
|
-
writable: true
|
|
8
|
-
});
|
|
9
|
-
} else {
|
|
10
|
-
obj[key] = value;
|
|
11
|
-
}
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
function _object_spread(target) {
|
|
15
|
-
for(var i = 1; i < arguments.length; i++){
|
|
16
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
-
var ownKeys = Object.keys(source);
|
|
18
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
ownKeys.forEach(function(key) {
|
|
24
|
-
_define_property(target, key, source[key]);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
}
|
|
29
|
-
import register from '../../core/register.ts.js';
|
|
30
|
-
import { defineComponent, h } from 'vue';
|
|
31
|
-
export default defineComponent({
|
|
32
|
-
name: 'InputWidget',
|
|
33
|
-
props: {
|
|
34
|
-
modelValue: [
|
|
35
|
-
String,
|
|
36
|
-
Number
|
|
37
|
-
],
|
|
38
|
-
unit: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: ''
|
|
41
|
-
},
|
|
42
|
-
maxRows: {
|
|
43
|
-
type: Number,
|
|
44
|
-
default: 0
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
computed: {
|
|
48
|
-
rows () {
|
|
49
|
-
const len = String(this.modelValue).split('\n').length;
|
|
50
|
-
return len <= this.maxRows ? len : this.maxRows;
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
methods: {
|
|
54
|
-
handleInput (v) {
|
|
55
|
-
if (this.$attrs.type === 'number') {
|
|
56
|
-
this.$emit('update:modelValue', isNaN(v) || v === '' ? v : Number(v));
|
|
57
|
-
} else {
|
|
58
|
-
this.$emit('update:modelValue', v);
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
handleBlur (e) {
|
|
62
|
-
var _e_target;
|
|
63
|
-
const value = e === null || e === void 0 ? void 0 : (_e_target = e.target) === null || _e_target === void 0 ? void 0 : _e_target.value;
|
|
64
|
-
if (this.$attrs.type === 'number' && isNaN(value)) {
|
|
65
|
-
this.$emit('update:modelValue', this.$attrs.min || 0);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
render () {
|
|
70
|
-
return h(register.getBaseWidget('input'), _object_spread({
|
|
71
|
-
suffix: this.unit,
|
|
72
|
-
modelValue: this.modelValue,
|
|
73
|
-
rows: this.rows,
|
|
74
|
-
type: this.maxRows > 1 || Number(this.$attrs.rows) > 1 ? 'textarea' : 'text',
|
|
75
|
-
onInput: this.handleInput,
|
|
76
|
-
onBlur: this.handleBlur
|
|
77
|
-
}, this.$attrs));
|
|
78
|
-
}
|
|
79
|
-
});
|