@byteluck-fe/model-driven-settings 2.23.0-beta.7 → 2.23.0
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/README.md +30 -30
- package/dist/esm/default/createBaseFields.js +2 -2
- package/dist/esm/default/createFormBaseFields.js +9 -9
- package/dist/esm/props/base.js +7 -7
- package/dist/index.umd.js +2 -44
- package/dist/types/default/createBaseFields.d.ts +2 -2
- package/dist/types/default/createFormBaseFields.d.ts +3 -3
- package/dist/types/default/index.d.ts +2 -2
- package/dist/types/defineInstance.d.ts +83 -83
- package/dist/types/index.d.ts +4 -4
- package/dist/types/initSettings.d.ts +14 -14
- package/dist/types/props/base.d.ts +21 -21
- package/dist/types/props/checkbox.d.ts +5 -5
- package/dist/types/props/custom.d.ts +5 -5
- package/dist/types/props/input-number.d.ts +7 -7
- package/dist/types/props/input.d.ts +8 -8
- package/dist/types/props/radio.d.ts +6 -6
- package/dist/types/props/select.d.ts +6 -6
- package/dist/types/props/switch.d.ts +7 -7
- package/dist/types/props/textarea.d.ts +10 -10
- package/dist/types/schema/group.d.ts +19 -19
- package/dist/types/schema/index.d.ts +3 -3
- package/dist/types/schema/setting.d.ts +69 -69
- package/dist/types/schema/tab.d.ts +15 -15
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
# Settings
|
|
2
|
-
自定义控件设置
|
|
3
|
-
|
|
4
|
-
```
|
|
5
|
-
│ defineInstance.ts // 定义控件函数
|
|
6
|
-
│ index.ts
|
|
7
|
-
│ initSettings.ts // 初始化setting,被外部引用
|
|
8
|
-
│
|
|
9
|
-
├─default // 内部默认值
|
|
10
|
-
│ createBaseFields.ts // 基础控件的默认setting
|
|
11
|
-
│ createFormBaseFields.ts // 表单控件的默认setting
|
|
12
|
-
│ index.ts
|
|
13
|
-
│
|
|
14
|
-
├─props // 内置的setting控件
|
|
15
|
-
│ base.ts
|
|
16
|
-
│ checkbox.ts
|
|
17
|
-
│ custom.ts
|
|
18
|
-
│ input-number.ts
|
|
19
|
-
│ input.ts
|
|
20
|
-
│ radio.ts
|
|
21
|
-
│ select.ts
|
|
22
|
-
│ switch.ts
|
|
23
|
-
│ textarea.ts
|
|
24
|
-
│
|
|
25
|
-
└─schema // setting的容器和schema定义
|
|
26
|
-
group.ts
|
|
27
|
-
index.ts
|
|
28
|
-
setting.ts
|
|
29
|
-
tab.ts
|
|
30
|
-
```
|
|
1
|
+
# Settings
|
|
2
|
+
自定义控件设置
|
|
3
|
+
|
|
4
|
+
```
|
|
5
|
+
│ defineInstance.ts // 定义控件函数
|
|
6
|
+
│ index.ts
|
|
7
|
+
│ initSettings.ts // 初始化setting,被外部引用
|
|
8
|
+
│
|
|
9
|
+
├─default // 内部默认值
|
|
10
|
+
│ createBaseFields.ts // 基础控件的默认setting
|
|
11
|
+
│ createFormBaseFields.ts // 表单控件的默认setting
|
|
12
|
+
│ index.ts
|
|
13
|
+
│
|
|
14
|
+
├─props // 内置的setting控件
|
|
15
|
+
│ base.ts
|
|
16
|
+
│ checkbox.ts
|
|
17
|
+
│ custom.ts
|
|
18
|
+
│ input-number.ts
|
|
19
|
+
│ input.ts
|
|
20
|
+
│ radio.ts
|
|
21
|
+
│ select.ts
|
|
22
|
+
│ switch.ts
|
|
23
|
+
│ textarea.ts
|
|
24
|
+
│
|
|
25
|
+
└─schema // setting的容器和schema定义
|
|
26
|
+
group.ts
|
|
27
|
+
index.ts
|
|
28
|
+
setting.ts
|
|
29
|
+
tab.ts
|
|
30
|
+
```
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
2
2
|
export function createBaseFields() {
|
|
3
3
|
return [
|
|
4
4
|
{
|
|
5
|
-
label:
|
|
5
|
+
label: getLocaleText('CMD.hide', null, '隐藏'),
|
|
6
6
|
key: 'isHide',
|
|
7
7
|
type: 'boolean',
|
|
8
8
|
component: 'switch'
|
|
@@ -24,7 +24,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
24
24
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
25
25
|
}
|
|
26
26
|
import { createBaseFields } from './createBaseFields';
|
|
27
|
-
import {
|
|
27
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
28
28
|
export function createFormBaseFields(defaultValues) {
|
|
29
29
|
return _to_consumable_array(createBaseFields()).concat([
|
|
30
30
|
{
|
|
@@ -44,12 +44,12 @@ export function createFormBaseFields(defaultValues) {
|
|
|
44
44
|
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.caption,
|
|
45
45
|
validator: function validator(value) {
|
|
46
46
|
if (!value) {
|
|
47
|
-
return
|
|
47
|
+
return getLocaleText('CMD.titleRequired', null, '标题必填');
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
|
-
label:
|
|
52
|
+
label: getLocaleText('CMD.hideCaption', null, '隐藏标题'),
|
|
53
53
|
key: 'isHideCaption',
|
|
54
54
|
type: 'boolean',
|
|
55
55
|
component: 'switch',
|
|
@@ -80,11 +80,11 @@ export function createFormBaseFields(defaultValues) {
|
|
|
80
80
|
showType: 'solid',
|
|
81
81
|
options: [
|
|
82
82
|
{
|
|
83
|
-
label:
|
|
83
|
+
label: getLocaleText('CMD.top', null, '上下布局'),
|
|
84
84
|
value: 'top'
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
|
-
label:
|
|
87
|
+
label: getLocaleText('CMD.left', null, '左右布局'),
|
|
88
88
|
value: 'left'
|
|
89
89
|
}
|
|
90
90
|
]
|
|
@@ -99,25 +99,25 @@ export function createFormBaseFields(defaultValues) {
|
|
|
99
99
|
showType: 'solid',
|
|
100
100
|
options: [
|
|
101
101
|
{
|
|
102
|
-
label:
|
|
102
|
+
label: getLocaleText('CMD.default', null, '普通'),
|
|
103
103
|
value: 'default'
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
|
-
label:
|
|
106
|
+
label: getLocaleText('CMD.readonly', null, '只读'),
|
|
107
107
|
value: 'readonly'
|
|
108
108
|
}
|
|
109
109
|
]
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
|
-
label:
|
|
113
|
+
label: getLocaleText('CMD.required', null, '必填'),
|
|
114
114
|
key: 'required',
|
|
115
115
|
type: 'boolean',
|
|
116
116
|
component: 'switch',
|
|
117
117
|
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.required
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
|
-
label:
|
|
120
|
+
label: getLocaleText('CMD.textTip', null, '提示文字'),
|
|
121
121
|
key: 'placeholder',
|
|
122
122
|
type: 'string',
|
|
123
123
|
component: 'input',
|
package/dist/esm/props/base.js
CHANGED
|
@@ -34,15 +34,15 @@ export var BaseProps = /*#__PURE__*/ function() {
|
|
|
34
34
|
"use strict";
|
|
35
35
|
function BaseProps(props) {
|
|
36
36
|
_class_call_check(this, BaseProps);
|
|
37
|
-
/**
|
|
38
|
-
* 显示隐藏
|
|
37
|
+
/**
|
|
38
|
+
* 显示隐藏
|
|
39
39
|
* */ _define_property(this, "visible", void 0);
|
|
40
|
-
/**
|
|
41
|
-
* 开启表达式
|
|
40
|
+
/**
|
|
41
|
+
* 开启表达式
|
|
42
42
|
* */ _define_property(this, "expression", void 0);
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* 是否改变父属性
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* 是否改变父属性
|
|
46
46
|
*/ _define_property(this, "updateParent", void 0);
|
|
47
47
|
var _props_visible;
|
|
48
48
|
this.visible = (_props_visible = props === null || props === void 0 ? void 0 : props.visible) !== null && _props_visible !== void 0 ? _props_visible : true;
|