@byteluck-fe/model-driven-settings 1.8.0-beta.2 → 1.8.0-beta.3
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/esm/default/createFormBaseFields.js +2 -2
- package/dist/esm/props/base.js +4 -4
- package/dist/esm/props/checkbox.js +2 -2
- package/dist/esm/props/input-number.js +6 -6
- package/dist/esm/props/input.js +8 -8
- package/dist/esm/props/radio.js +4 -4
- package/dist/esm/props/select.js +4 -4
- package/dist/esm/props/switch.js +6 -6
- package/dist/esm/props/textarea.js +12 -12
- package/dist/esm/schema/group.js +4 -4
- package/dist/esm/schema/setting.js +6 -6
- package/dist/types/defineInstance.d.ts +3 -3
- package/dist/types/initSettings.d.ts +2 -2
- package/dist/types/schema/setting.d.ts +2 -2
- package/package.json +4 -4
|
@@ -58,8 +58,8 @@ export function createFormBaseFields(defaultValues) {
|
|
|
58
58
|
},
|
|
59
59
|
// 在明细表内隐藏
|
|
60
60
|
scopeEffect: function scopeEffect(driven, payload) {
|
|
61
|
-
var
|
|
62
|
-
if (((
|
|
61
|
+
var ref, ref1;
|
|
62
|
+
if (((ref = payload.current) === null || ref === void 0 ? void 0 : ref.type) !== ((ref1 = payload.from) === null || ref1 === void 0 ? void 0 : ref1.type)) {
|
|
63
63
|
//明细子表内默认开启
|
|
64
64
|
if (payload.current.type === "subtable") {
|
|
65
65
|
driven.setInstance(payload.control, "isHideCaption", true);
|
package/dist/esm/props/base.js
CHANGED
|
@@ -21,10 +21,10 @@ export var BaseProps = /*#__PURE__*/ function() {
|
|
|
21
21
|
"use strict";
|
|
22
22
|
function BaseProps(props) {
|
|
23
23
|
_classCallCheck(this, BaseProps);
|
|
24
|
-
var
|
|
25
|
-
this.visible = (
|
|
26
|
-
var
|
|
27
|
-
this.expression = (
|
|
24
|
+
var ref;
|
|
25
|
+
this.visible = (ref = props === null || props === void 0 ? void 0 : props.visible) !== null && ref !== void 0 ? ref : true;
|
|
26
|
+
var ref1;
|
|
27
|
+
this.expression = (ref1 = props === null || props === void 0 ? void 0 : props.expression) !== null && ref1 !== void 0 ? ref1 : false;
|
|
28
28
|
}
|
|
29
29
|
_createClass(BaseProps, [
|
|
30
30
|
{
|
|
@@ -78,8 +78,8 @@ export var CheckboxProps = /*#__PURE__*/ function(BaseProps) {
|
|
|
78
78
|
_classCallCheck(this, CheckboxProps);
|
|
79
79
|
var _this;
|
|
80
80
|
_this = _super.call(this, props);
|
|
81
|
-
var
|
|
82
|
-
_this.options = (
|
|
81
|
+
var ref;
|
|
82
|
+
_this.options = (ref = props === null || props === void 0 ? void 0 : props.options) !== null && ref !== void 0 ? ref : [];
|
|
83
83
|
return _this;
|
|
84
84
|
}
|
|
85
85
|
return CheckboxProps;
|
|
@@ -78,12 +78,12 @@ export var InputNumberProps = /*#__PURE__*/ function(BaseProps) {
|
|
|
78
78
|
_classCallCheck(this, InputNumberProps);
|
|
79
79
|
var _this;
|
|
80
80
|
_this = _super.call(this, props);
|
|
81
|
-
var
|
|
82
|
-
_this.max = (
|
|
83
|
-
var
|
|
84
|
-
_this.min = (
|
|
85
|
-
var
|
|
86
|
-
_this.placeholder = (
|
|
81
|
+
var ref;
|
|
82
|
+
_this.max = (ref = props === null || props === void 0 ? void 0 : props.max) !== null && ref !== void 0 ? ref : "";
|
|
83
|
+
var ref1;
|
|
84
|
+
_this.min = (ref1 = props === null || props === void 0 ? void 0 : props.min) !== null && ref1 !== void 0 ? ref1 : "";
|
|
85
|
+
var ref2;
|
|
86
|
+
_this.placeholder = (ref2 = props === null || props === void 0 ? void 0 : props.placeholder) !== null && ref2 !== void 0 ? ref2 : "";
|
|
87
87
|
return _this;
|
|
88
88
|
}
|
|
89
89
|
return InputNumberProps;
|
package/dist/esm/props/input.js
CHANGED
|
@@ -78,14 +78,14 @@ export var InputProps = /*#__PURE__*/ function(BaseProps) {
|
|
|
78
78
|
_classCallCheck(this, InputProps);
|
|
79
79
|
var _this;
|
|
80
80
|
_this = _super.call(this, props);
|
|
81
|
-
var
|
|
82
|
-
_this.maxLength = (
|
|
83
|
-
var
|
|
84
|
-
_this.minLength = (
|
|
85
|
-
var
|
|
86
|
-
_this.placeholder = (
|
|
87
|
-
var
|
|
88
|
-
_this.i18n = (
|
|
81
|
+
var ref;
|
|
82
|
+
_this.maxLength = (ref = props === null || props === void 0 ? void 0 : props.maxLength) !== null && ref !== void 0 ? ref : "";
|
|
83
|
+
var ref1;
|
|
84
|
+
_this.minLength = (ref1 = props === null || props === void 0 ? void 0 : props.minLength) !== null && ref1 !== void 0 ? ref1 : "";
|
|
85
|
+
var ref2;
|
|
86
|
+
_this.placeholder = (ref2 = props === null || props === void 0 ? void 0 : props.placeholder) !== null && ref2 !== void 0 ? ref2 : "";
|
|
87
|
+
var ref3;
|
|
88
|
+
_this.i18n = (ref3 = props === null || props === void 0 ? void 0 : props.i18n) !== null && ref3 !== void 0 ? ref3 : false;
|
|
89
89
|
return _this;
|
|
90
90
|
}
|
|
91
91
|
return InputProps;
|
package/dist/esm/props/radio.js
CHANGED
|
@@ -78,10 +78,10 @@ export var RadioProps = /*#__PURE__*/ function(BaseProps) {
|
|
|
78
78
|
_classCallCheck(this, RadioProps);
|
|
79
79
|
var _this;
|
|
80
80
|
_this = _super.call(this, props);
|
|
81
|
-
var
|
|
82
|
-
_this.options = (
|
|
83
|
-
var
|
|
84
|
-
_this.showType = (
|
|
81
|
+
var ref;
|
|
82
|
+
_this.options = (ref = props === null || props === void 0 ? void 0 : props.options) !== null && ref !== void 0 ? ref : [];
|
|
83
|
+
var ref1;
|
|
84
|
+
_this.showType = (ref1 = props === null || props === void 0 ? void 0 : props.showType) !== null && ref1 !== void 0 ? ref1 : "outline";
|
|
85
85
|
return _this;
|
|
86
86
|
}
|
|
87
87
|
return RadioProps;
|
package/dist/esm/props/select.js
CHANGED
|
@@ -78,10 +78,10 @@ export var SelectProps = /*#__PURE__*/ function(BaseProps) {
|
|
|
78
78
|
_classCallCheck(this, SelectProps);
|
|
79
79
|
var _this;
|
|
80
80
|
_this = _super.call(this, props);
|
|
81
|
-
var
|
|
82
|
-
_this.placeholder = (
|
|
83
|
-
var
|
|
84
|
-
_this.options = (
|
|
81
|
+
var ref;
|
|
82
|
+
_this.placeholder = (ref = props === null || props === void 0 ? void 0 : props.placeholder) !== null && ref !== void 0 ? ref : "";
|
|
83
|
+
var ref1;
|
|
84
|
+
_this.options = (ref1 = props === null || props === void 0 ? void 0 : props.options) !== null && ref1 !== void 0 ? ref1 : [];
|
|
85
85
|
return _this;
|
|
86
86
|
}
|
|
87
87
|
return SelectProps;
|
package/dist/esm/props/switch.js
CHANGED
|
@@ -78,12 +78,12 @@ export var SwitchProps = /*#__PURE__*/ function(BaseProps) {
|
|
|
78
78
|
_classCallCheck(this, SwitchProps);
|
|
79
79
|
var _this;
|
|
80
80
|
_this = _super.call(this, props);
|
|
81
|
-
var
|
|
82
|
-
_this.showType = (
|
|
83
|
-
var
|
|
84
|
-
_this.tips = (
|
|
85
|
-
var
|
|
86
|
-
_this.disabled = (
|
|
81
|
+
var ref;
|
|
82
|
+
_this.showType = (ref = props === null || props === void 0 ? void 0 : props.showType) !== null && ref !== void 0 ? ref : "switch";
|
|
83
|
+
var ref1;
|
|
84
|
+
_this.tips = (ref1 = props === null || props === void 0 ? void 0 : props.tips) !== null && ref1 !== void 0 ? ref1 : "";
|
|
85
|
+
var ref2;
|
|
86
|
+
_this.disabled = (ref2 = props === null || props === void 0 ? void 0 : props.disabled) !== null && ref2 !== void 0 ? ref2 : false;
|
|
87
87
|
return _this;
|
|
88
88
|
}
|
|
89
89
|
return SwitchProps;
|
|
@@ -78,18 +78,18 @@ export var TextareaProps = /*#__PURE__*/ function(BaseProps) {
|
|
|
78
78
|
_classCallCheck(this, TextareaProps);
|
|
79
79
|
var _this;
|
|
80
80
|
_this = _super.call(this, props);
|
|
81
|
-
var
|
|
82
|
-
_this.maxLength = (
|
|
83
|
-
var
|
|
84
|
-
_this.minLength = (
|
|
85
|
-
var
|
|
86
|
-
_this.placeholder = (
|
|
87
|
-
var
|
|
88
|
-
_this.maxRows = (
|
|
89
|
-
var
|
|
90
|
-
_this.minRows = (
|
|
91
|
-
var
|
|
92
|
-
_this.i18n = (
|
|
81
|
+
var ref;
|
|
82
|
+
_this.maxLength = (ref = props === null || props === void 0 ? void 0 : props.maxLength) !== null && ref !== void 0 ? ref : "";
|
|
83
|
+
var ref1;
|
|
84
|
+
_this.minLength = (ref1 = props === null || props === void 0 ? void 0 : props.minLength) !== null && ref1 !== void 0 ? ref1 : "";
|
|
85
|
+
var ref2;
|
|
86
|
+
_this.placeholder = (ref2 = props === null || props === void 0 ? void 0 : props.placeholder) !== null && ref2 !== void 0 ? ref2 : "";
|
|
87
|
+
var ref3;
|
|
88
|
+
_this.maxRows = (ref3 = props === null || props === void 0 ? void 0 : props.maxRows) !== null && ref3 !== void 0 ? ref3 : "";
|
|
89
|
+
var ref4;
|
|
90
|
+
_this.minRows = (ref4 = props === null || props === void 0 ? void 0 : props.minRows) !== null && ref4 !== void 0 ? ref4 : "";
|
|
91
|
+
var ref5;
|
|
92
|
+
_this.i18n = (ref5 = props === null || props === void 0 ? void 0 : props.i18n) !== null && ref5 !== void 0 ? ref5 : false;
|
|
93
93
|
return _this;
|
|
94
94
|
}
|
|
95
95
|
return TextareaProps;
|
package/dist/esm/schema/group.js
CHANGED
|
@@ -7,10 +7,10 @@ export var Group = function Group(schema) {
|
|
|
7
7
|
"use strict";
|
|
8
8
|
_classCallCheck(this, Group);
|
|
9
9
|
this.type = "group";
|
|
10
|
-
var
|
|
11
|
-
this.title = (
|
|
12
|
-
var
|
|
13
|
-
this.required = (
|
|
10
|
+
var _title;
|
|
11
|
+
this.title = (_title = schema.title) !== null && _title !== void 0 ? _title : "";
|
|
12
|
+
var _required;
|
|
13
|
+
this.required = (_required = schema.required) !== null && _required !== void 0 ? _required : false;
|
|
14
14
|
this.items = schema.items;
|
|
15
15
|
this.tips = schema.tips;
|
|
16
16
|
};
|
|
@@ -13,14 +13,14 @@ export var Setting = /*#__PURE__*/ function() {
|
|
|
13
13
|
this.label = schema.label;
|
|
14
14
|
this.key = schema.key;
|
|
15
15
|
this.component = schema.component;
|
|
16
|
-
var
|
|
17
|
-
this.effect = (
|
|
18
|
-
var
|
|
19
|
-
this.scopeEffect = (
|
|
16
|
+
var _effect;
|
|
17
|
+
this.effect = (_effect = schema.effect) !== null && _effect !== void 0 ? _effect : {};
|
|
18
|
+
var _scopeEffect;
|
|
19
|
+
this.scopeEffect = (_scopeEffect = schema.scopeEffect) !== null && _scopeEffect !== void 0 ? _scopeEffect : noop;
|
|
20
20
|
this.defaultValue = schema.defaultValue;
|
|
21
21
|
this.validator = schema.validator;
|
|
22
|
-
var
|
|
23
|
-
this.props = (
|
|
22
|
+
var _props;
|
|
23
|
+
this.props = (_props = schema.props) !== null && _props !== void 0 ? _props : new BaseProps();
|
|
24
24
|
// private init
|
|
25
25
|
this.effectKeys = Object.keys(this.effect);
|
|
26
26
|
}
|
|
@@ -62,12 +62,12 @@ interface CustomSchema extends BaseSchema<CustomProps> {
|
|
|
62
62
|
component: string;
|
|
63
63
|
props?: Partial<CustomProps>;
|
|
64
64
|
}
|
|
65
|
-
export type SettingSchemas = InputSchema | InputNumberSchema | TextareaSchema | SwitchSchema | SelectSchema | CheckboxSchema | RadioSchema | CustomSchema;
|
|
65
|
+
export declare type SettingSchemas = InputSchema | InputNumberSchema | TextareaSchema | SwitchSchema | SelectSchema | CheckboxSchema | RadioSchema | CustomSchema;
|
|
66
66
|
export interface RuntimeValidator {
|
|
67
67
|
(props: any, value: unknown, i18n: string): string | boolean | void;
|
|
68
68
|
}
|
|
69
|
-
export type FieldSchema = SettingSchemas | BaseSchema<{}>;
|
|
70
|
-
export type GroupsSchema = GroupSchema[] | TabSchema[];
|
|
69
|
+
export declare type FieldSchema = SettingSchemas | BaseSchema<{}>;
|
|
70
|
+
export declare type GroupsSchema = GroupSchema[] | TabSchema[];
|
|
71
71
|
export interface DefineInstanceParams {
|
|
72
72
|
fields: FieldSchema[];
|
|
73
73
|
groups: GroupsSchema;
|
|
@@ -9,6 +9,6 @@ import { SelectProps } from './props/select';
|
|
|
9
9
|
import { RadioProps } from './props/radio';
|
|
10
10
|
import { TextareaProps } from './props/textarea';
|
|
11
11
|
import { Tab } from './schema/tab';
|
|
12
|
-
export type Props = CustomProps | InputProps | TextareaProps | InputNumberProps | SwitchProps | CheckboxProps | RadioProps | SelectProps;
|
|
13
|
-
export type Settings = Group[] | Tab[];
|
|
12
|
+
export declare type Props = CustomProps | InputProps | TextareaProps | InputNumberProps | SwitchProps | CheckboxProps | RadioProps | SelectProps;
|
|
13
|
+
export declare type Settings = Group[] | Tab[];
|
|
14
14
|
export declare function initSettings(params: DefineInstanceParams): Settings;
|
|
@@ -2,8 +2,8 @@ import { BaseProps } from '../props/base';
|
|
|
2
2
|
export interface EffectFn<Props extends object> {
|
|
3
3
|
(driven: any, payload: any): void | Partial<Props>;
|
|
4
4
|
}
|
|
5
|
-
export type SupportedDataTypes = 'string' | 'boolean' | 'number' | 'object' | 'array' | 'DataBind' | 'DataSourceBind';
|
|
6
|
-
export type Validator<P extends any = any, T extends any = any> = (props: P, value: T) => boolean | string | void;
|
|
5
|
+
export declare type SupportedDataTypes = 'string' | 'boolean' | 'number' | 'object' | 'array' | 'DataBind' | 'DataSourceBind';
|
|
6
|
+
export declare type Validator<P extends any = any, T extends any = any> = (props: P, value: T) => boolean | string | void;
|
|
7
7
|
export interface BaseSchema<Props extends object> {
|
|
8
8
|
/**
|
|
9
9
|
* 数据类型,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byteluck-fe/model-driven-settings",
|
|
3
|
-
"version": "1.8.0-beta.
|
|
3
|
+
"version": "1.8.0-beta.3",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "郝晨光 <2293885211@qq.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"postpublish": "node ../../scripts/postpublish.js"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@byteluck-fe/model-driven-core": "^1.8.0-beta.
|
|
26
|
-
"@byteluck-fe/model-driven-shared": "^1.8.0-beta.
|
|
25
|
+
"@byteluck-fe/model-driven-core": "^1.8.0-beta.3",
|
|
26
|
+
"@byteluck-fe/model-driven-shared": "^1.8.0-beta.1",
|
|
27
27
|
"tslib": "^2.1.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "e56ad55aee5978785b387413f3e35f41533c59b8"
|
|
30
30
|
}
|