@blueking/bkui-form 1.0.1-beta.3 → 1.0.1-beta.5
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,156 +0,0 @@
|
|
|
1
|
-
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
2
|
-
import Schema from '../../core/schema.ts.js';
|
|
3
|
-
import { defineComponent, h } from 'vue';
|
|
4
|
-
import SchemaField from '../field/SchemaField.tsx.js';
|
|
5
|
-
import props from '../field/FieldProps.ts.js';
|
|
6
|
-
import Path from '../../core/path.ts.js';
|
|
7
|
-
import Layout from '../../core/layout.ts.js';
|
|
8
|
-
import { mergeDeep, orderProperties } from '../../util/index.ts.js';
|
|
9
|
-
import FieldGroupWrap from '../common/FieldGroupWrap.tsx.js';
|
|
10
|
-
// 伪数组类型
|
|
11
|
-
export default defineComponent({
|
|
12
|
-
name: 'KeyValueArrayWidget',
|
|
13
|
-
props: Object.assign(Object.assign({}, props), {
|
|
14
|
-
// 当前值
|
|
15
|
-
modelValue: {
|
|
16
|
-
type: Array,
|
|
17
|
-
default: ()=>[]
|
|
18
|
-
}
|
|
19
|
-
}),
|
|
20
|
-
mounted () {
|
|
21
|
-
var _a;
|
|
22
|
-
const { minItems = 0 } = this.schema;
|
|
23
|
-
// 补全minItems项
|
|
24
|
-
if (((_a = this.modelValue) === null || _a === void 0 ? void 0 : _a.length) < minItems) {
|
|
25
|
-
const data = Schema.getSchemaDefaultValue(this.schema.items);
|
|
26
|
-
const remainData = new Array(minItems - this.modelValue.length).fill(data);
|
|
27
|
-
this.$emit('update:modelValue', [
|
|
28
|
-
...this.modelValue,
|
|
29
|
-
...remainData
|
|
30
|
-
]);
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
methods: {
|
|
34
|
-
handleAddItem () {
|
|
35
|
-
if (this.disabled) return;
|
|
36
|
-
const data = Schema.getSchemaDefaultValue(this.schema.items);
|
|
37
|
-
this.$emit('update:modelValue', [
|
|
38
|
-
...this.modelValue,
|
|
39
|
-
data
|
|
40
|
-
]);
|
|
41
|
-
},
|
|
42
|
-
handleRemoveItem (index) {
|
|
43
|
-
if (this.disabled) return;
|
|
44
|
-
const value = JSON.parse(JSON.stringify(this.modelValue));
|
|
45
|
-
value.splice(index, 1);
|
|
46
|
-
this.$emit('update:modelValue', value);
|
|
47
|
-
},
|
|
48
|
-
handleInput ({ path, value }) {
|
|
49
|
-
// 捕获widget input事件,包装继续传给上一层处理
|
|
50
|
-
const subPath = Path.getSubPath(this.path, path);
|
|
51
|
-
const newValue = Path.setPathValue(this.modelValue, subPath, value);
|
|
52
|
-
this.$emit('update:modelValue', newValue);
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
render () {
|
|
56
|
-
var _a, _b, _c, _d, _e;
|
|
57
|
-
const labelBtnStyle = {
|
|
58
|
-
'font-size': '16px',
|
|
59
|
-
color: '#979ba5',
|
|
60
|
-
cursor: this.disabled ? 'not-allowed' : 'pointer',
|
|
61
|
-
display: 'inline-block'
|
|
62
|
-
};
|
|
63
|
-
const properties = (_b = (_a = this.schema) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.properties;
|
|
64
|
-
const props = orderProperties(Object.keys(properties || {}), (_d = (_c = this.schema) === null || _c === void 0 ? void 0 : _c.items) === null || _d === void 0 ? void 0 : _d['ui:order']);
|
|
65
|
-
// props为空时,表示只有一个项
|
|
66
|
-
const keysLen = Object.keys(properties || {}).length;
|
|
67
|
-
const defaultCols = properties ? new Array(keysLen).fill('1fr').concat('20px').join(' ') : '1fr 20px';
|
|
68
|
-
const defaultContainerLayout = Object.assign({}, this.layout.container || {
|
|
69
|
-
display: 'grid',
|
|
70
|
-
gridGap: '24px',
|
|
71
|
-
'grid-template-columns': defaultCols // 默认配置
|
|
72
|
-
});
|
|
73
|
-
const self = this;
|
|
74
|
-
const dealSchema = (schema)=>// 处理当前控件默认Schema配置逻辑
|
|
75
|
-
mergeDeep({
|
|
76
|
-
'ui:component': {
|
|
77
|
-
placeholder: schema.title
|
|
78
|
-
},
|
|
79
|
-
'ui:props': {
|
|
80
|
-
// 默认不展示标题
|
|
81
|
-
showTitle: false,
|
|
82
|
-
// 0.1 兼容formItem设置 labelWidth 0 不生效问题
|
|
83
|
-
labelWidth: 0.1
|
|
84
|
-
}
|
|
85
|
-
}, schema);
|
|
86
|
-
const renderSchemaField = (data)=>{
|
|
87
|
-
const { path, schema, required, layout } = data;
|
|
88
|
-
return h(SchemaField, Object.assign(Object.assign({}, this.$props), {
|
|
89
|
-
key: path,
|
|
90
|
-
schema,
|
|
91
|
-
required,
|
|
92
|
-
path,
|
|
93
|
-
layout,
|
|
94
|
-
style: {
|
|
95
|
-
marginBottom: '10px'
|
|
96
|
-
},
|
|
97
|
-
'onUpdate:modelValue' (data) {
|
|
98
|
-
self.handleInput(data);
|
|
99
|
-
}
|
|
100
|
-
}));
|
|
101
|
-
};
|
|
102
|
-
return _createVNode("div", null, [
|
|
103
|
-
(_e = this.modelValue) === null || _e === void 0 ? void 0 : _e.map((_, index)=>{
|
|
104
|
-
var _a;
|
|
105
|
-
const groupPath = Path.getCurPath(this.path, `${index}`);
|
|
106
|
-
return _createVNode(FieldGroupWrap, _mergeProps(Object.assign(Object.assign({}, this.$props), {
|
|
107
|
-
path: groupPath,
|
|
108
|
-
modelValue: Path.getPathVal(this.rootData, groupPath),
|
|
109
|
-
schema: this.schema.items,
|
|
110
|
-
layout: Object.assign(Object.assign({}, this.layout), {
|
|
111
|
-
container: Object.assign({}, defaultContainerLayout)
|
|
112
|
-
})
|
|
113
|
-
}), {
|
|
114
|
-
"class": "mb10"
|
|
115
|
-
}), {
|
|
116
|
-
default: ()=>[
|
|
117
|
-
(props === null || props === void 0 ? void 0 : props.length) ? props.map((prop)=>{
|
|
118
|
-
var _a, _b;
|
|
119
|
-
const schemaItem = (_b = (_a = this.schema) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.properties[prop];
|
|
120
|
-
const curPath = Path.getCurPath(this.path, `${index}.${prop}`);
|
|
121
|
-
const lastProp = curPath.split('.').pop();
|
|
122
|
-
const layoutConfig = Layout.findLayoutByProp(lastProp, this.layout.group || []) || {};
|
|
123
|
-
return renderSchemaField({
|
|
124
|
-
path: curPath,
|
|
125
|
-
schema: dealSchema(schemaItem),
|
|
126
|
-
layout: layoutConfig,
|
|
127
|
-
required: Schema.isRequired(schemaItem, prop)
|
|
128
|
-
});
|
|
129
|
-
}) : renderSchemaField({
|
|
130
|
-
path: Path.getCurPath(this.path, index),
|
|
131
|
-
schema: dealSchema(((_a = this.schema) === null || _a === void 0 ? void 0 : _a.items) || {}),
|
|
132
|
-
layout: {},
|
|
133
|
-
required: false
|
|
134
|
-
}),
|
|
135
|
-
_createVNode("span", {
|
|
136
|
-
"style": labelBtnStyle,
|
|
137
|
-
"onClick": ()=>this.handleRemoveItem(index)
|
|
138
|
-
}, [
|
|
139
|
-
_createVNode("i", {
|
|
140
|
-
"class": "bk-form-icon icon-minus-line"
|
|
141
|
-
}, null)
|
|
142
|
-
])
|
|
143
|
-
]
|
|
144
|
-
});
|
|
145
|
-
}),
|
|
146
|
-
_createVNode("span", {
|
|
147
|
-
"onClick": this.handleAddItem,
|
|
148
|
-
"style": labelBtnStyle
|
|
149
|
-
}, [
|
|
150
|
-
_createVNode("i", {
|
|
151
|
-
"class": "bk-form-icon icon-plus-line"
|
|
152
|
-
}, null)
|
|
153
|
-
])
|
|
154
|
-
]);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
@@ -1,98 +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: 'RadioWidget',
|
|
57
|
-
props: {
|
|
58
|
-
datasource: {
|
|
59
|
-
type: Array,
|
|
60
|
-
default: ()=>[]
|
|
61
|
-
},
|
|
62
|
-
modelValue: {
|
|
63
|
-
type: [
|
|
64
|
-
String,
|
|
65
|
-
Number,
|
|
66
|
-
Boolean
|
|
67
|
-
],
|
|
68
|
-
default: ''
|
|
69
|
-
},
|
|
70
|
-
disabled: {
|
|
71
|
-
type: Boolean,
|
|
72
|
-
default: false
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
methods: {
|
|
76
|
-
handleChange (val) {
|
|
77
|
-
this.$emit('update:modelValue', val);
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
render () {
|
|
81
|
-
return h(register.getBaseWidget('radio-group'), _object_spread_props(_object_spread({}, this.$attrs), {
|
|
82
|
-
modelValue: this.modelValue,
|
|
83
|
-
onChange: this.handleChange
|
|
84
|
-
}), {
|
|
85
|
-
default: ()=>this.datasource.map((item)=>h(register.getBaseWidget('radio'), {
|
|
86
|
-
key: item.value,
|
|
87
|
-
class: [
|
|
88
|
-
'mr24'
|
|
89
|
-
],
|
|
90
|
-
modelValue: item.value,
|
|
91
|
-
label: item.value,
|
|
92
|
-
disabled: item.disabled || this.disabled
|
|
93
|
-
}, {
|
|
94
|
-
default: ()=>item.label
|
|
95
|
-
}))
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
});
|
|
@@ -1,98 +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, withDirectives } from 'vue';
|
|
55
|
-
export default defineComponent({
|
|
56
|
-
name: 'SelectWidget',
|
|
57
|
-
props: {
|
|
58
|
-
datasource: {
|
|
59
|
-
type: Array,
|
|
60
|
-
default: ()=>[]
|
|
61
|
-
},
|
|
62
|
-
modelValue: {
|
|
63
|
-
type: [
|
|
64
|
-
Array,
|
|
65
|
-
String,
|
|
66
|
-
Number,
|
|
67
|
-
Boolean
|
|
68
|
-
],
|
|
69
|
-
default: ''
|
|
70
|
-
},
|
|
71
|
-
loading: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
default: false
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
methods: {
|
|
77
|
-
handleSelectChange (val) {
|
|
78
|
-
this.$emit('update:modelValue', val);
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
render () {
|
|
82
|
-
return h(register.getBaseWidget('select'), _object_spread_props(_object_spread({}, this.$attrs), {
|
|
83
|
-
loading: this.loading,
|
|
84
|
-
modelValue: this.modelValue,
|
|
85
|
-
onChange: this.handleSelectChange
|
|
86
|
-
}), {
|
|
87
|
-
default: ()=>{
|
|
88
|
-
var _this_datasource;
|
|
89
|
-
return (_this_datasource = this.datasource) === null || _this_datasource === void 0 ? void 0 : _this_datasource.map((item)=>withDirectives(h(register.getBaseWidget('option'), {
|
|
90
|
-
key: item.value,
|
|
91
|
-
name: item.label,
|
|
92
|
-
id: item.value,
|
|
93
|
-
disabled: item.disabled
|
|
94
|
-
}), []));
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
});
|
|
@@ -1,73 +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: 'SwitchWidget',
|
|
57
|
-
props: {
|
|
58
|
-
modelValue: Boolean
|
|
59
|
-
},
|
|
60
|
-
methods: {
|
|
61
|
-
handleChange (v) {
|
|
62
|
-
this.$emit('update:modelValue', v);
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
render () {
|
|
66
|
-
return h(register.getBaseWidget('switcher'), _object_spread_props(_object_spread({}, this.$attrs), {
|
|
67
|
-
modelValue: this.modelValue,
|
|
68
|
-
onChange: (v)=>{
|
|
69
|
-
this.handleChange(v);
|
|
70
|
-
}
|
|
71
|
-
}));
|
|
72
|
-
}
|
|
73
|
-
});
|
|
@@ -1,145 +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 { defineComponent, h } from 'vue';
|
|
54
|
-
import props from '../field/FieldProps.ts.js';
|
|
55
|
-
import FieldGroupWrap from '../common/FieldGroupWrap.tsx.js';
|
|
56
|
-
import SchemaField from '../field/SchemaField.tsx.js';
|
|
57
|
-
import Schema from '../../core/schema.ts.js';
|
|
58
|
-
import Path from '../../core/path.ts.js';
|
|
59
|
-
import Layout from '../../core/layout.ts.js';
|
|
60
|
-
import register from '../../core/register.ts.js';
|
|
61
|
-
import { orderProperties } from '../../util/index.ts.js';
|
|
62
|
-
export default defineComponent({
|
|
63
|
-
name: 'TabWidget',
|
|
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
|
-
verifiable: {
|
|
83
|
-
type: Boolean,
|
|
84
|
-
default: false
|
|
85
|
-
}
|
|
86
|
-
}),
|
|
87
|
-
data () {
|
|
88
|
-
return {
|
|
89
|
-
active: ''
|
|
90
|
-
};
|
|
91
|
-
},
|
|
92
|
-
beforeMount () {
|
|
93
|
-
var _this_schema;
|
|
94
|
-
const properties = orderProperties(Object.keys(((_this_schema = this.schema) === null || _this_schema === void 0 ? void 0 : _this_schema.properties) || {}), this.schema['ui:order']);
|
|
95
|
-
this.active = properties === null || properties === void 0 ? void 0 : properties[0];
|
|
96
|
-
},
|
|
97
|
-
render () {
|
|
98
|
-
var _this_schema;
|
|
99
|
-
const groupWrapProps = _object_spread_props(_object_spread({}, this.$props), {
|
|
100
|
-
layout: _object_spread_props(_object_spread({}, this.layout), {
|
|
101
|
-
container: {}
|
|
102
|
-
}),
|
|
103
|
-
title: this.schema.title
|
|
104
|
-
});
|
|
105
|
-
const self = this;
|
|
106
|
-
const properties = orderProperties(Object.keys(((_this_schema = this.schema) === null || _this_schema === void 0 ? void 0 : _this_schema.properties) || {}), this.schema['ui:order']);
|
|
107
|
-
return h(FieldGroupWrap, _object_spread_props(_object_spread({}, groupWrapProps), {
|
|
108
|
-
onRemove (path) {
|
|
109
|
-
self.$emit('remove', path);
|
|
110
|
-
}
|
|
111
|
-
}), {
|
|
112
|
-
default: ()=>[
|
|
113
|
-
h(register.getBaseWidget('tab'), {
|
|
114
|
-
type: 'border-card',
|
|
115
|
-
active: this.active,
|
|
116
|
-
onChange: (name)=>{
|
|
117
|
-
this.active = name;
|
|
118
|
-
}
|
|
119
|
-
}, {
|
|
120
|
-
default: ()=>properties.map((key)=>{
|
|
121
|
-
var _this_schema_properties, _this_schema;
|
|
122
|
-
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];
|
|
123
|
-
const curPath = Path.getCurPath(this.path, key);
|
|
124
|
-
const lastProp = curPath.split('.').pop();
|
|
125
|
-
const layoutConfig = Layout.findLayoutByProp(lastProp, this.layout.group || []) || {};
|
|
126
|
-
return h(register.getBaseWidget('tab-panel'), {
|
|
127
|
-
key,
|
|
128
|
-
name: key,
|
|
129
|
-
label: schemaItem === null || schemaItem === void 0 ? void 0 : schemaItem.title
|
|
130
|
-
}, {
|
|
131
|
-
default: ()=>h(SchemaField, _object_spread_props(_object_spread({}, this.$props, this.$attrs), {
|
|
132
|
-
key: curPath,
|
|
133
|
-
schema: schemaItem,
|
|
134
|
-
required: Schema.isRequired(schemaItem, key),
|
|
135
|
-
path: curPath,
|
|
136
|
-
layout: layoutConfig,
|
|
137
|
-
removeable: false
|
|
138
|
-
}))
|
|
139
|
-
});
|
|
140
|
-
})
|
|
141
|
-
})
|
|
142
|
-
]
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
});
|