@byteluck-fe/model-driven-settings 1.8.0-beta.3 → 1.8.1-beta.2
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 _payload_current, _payload_from;
|
|
62
|
+
if (((_payload_current = payload.current) === null || _payload_current === void 0 ? void 0 : _payload_current.type) !== ((_payload_from = payload.from) === null || _payload_from === void 0 ? void 0 : _payload_from.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 _props_visible;
|
|
25
|
+
this.visible = (_props_visible = props === null || props === void 0 ? void 0 : props.visible) !== null && _props_visible !== void 0 ? _props_visible : true;
|
|
26
|
+
var _props_expression;
|
|
27
|
+
this.expression = (_props_expression = props === null || props === void 0 ? void 0 : props.expression) !== null && _props_expression !== void 0 ? _props_expression : 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 _props_options;
|
|
82
|
+
_this.options = (_props_options = props === null || props === void 0 ? void 0 : props.options) !== null && _props_options !== void 0 ? _props_options : [];
|
|
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 _props_max;
|
|
82
|
+
_this.max = (_props_max = props === null || props === void 0 ? void 0 : props.max) !== null && _props_max !== void 0 ? _props_max : "";
|
|
83
|
+
var _props_min;
|
|
84
|
+
_this.min = (_props_min = props === null || props === void 0 ? void 0 : props.min) !== null && _props_min !== void 0 ? _props_min : "";
|
|
85
|
+
var _props_placeholder;
|
|
86
|
+
_this.placeholder = (_props_placeholder = props === null || props === void 0 ? void 0 : props.placeholder) !== null && _props_placeholder !== void 0 ? _props_placeholder : "";
|
|
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 _props_maxLength;
|
|
82
|
+
_this.maxLength = (_props_maxLength = props === null || props === void 0 ? void 0 : props.maxLength) !== null && _props_maxLength !== void 0 ? _props_maxLength : "";
|
|
83
|
+
var _props_minLength;
|
|
84
|
+
_this.minLength = (_props_minLength = props === null || props === void 0 ? void 0 : props.minLength) !== null && _props_minLength !== void 0 ? _props_minLength : "";
|
|
85
|
+
var _props_placeholder;
|
|
86
|
+
_this.placeholder = (_props_placeholder = props === null || props === void 0 ? void 0 : props.placeholder) !== null && _props_placeholder !== void 0 ? _props_placeholder : "";
|
|
87
|
+
var _props_i18n;
|
|
88
|
+
_this.i18n = (_props_i18n = props === null || props === void 0 ? void 0 : props.i18n) !== null && _props_i18n !== void 0 ? _props_i18n : 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 _props_options;
|
|
82
|
+
_this.options = (_props_options = props === null || props === void 0 ? void 0 : props.options) !== null && _props_options !== void 0 ? _props_options : [];
|
|
83
|
+
var _props_showType;
|
|
84
|
+
_this.showType = (_props_showType = props === null || props === void 0 ? void 0 : props.showType) !== null && _props_showType !== void 0 ? _props_showType : "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 _props_placeholder;
|
|
82
|
+
_this.placeholder = (_props_placeholder = props === null || props === void 0 ? void 0 : props.placeholder) !== null && _props_placeholder !== void 0 ? _props_placeholder : "";
|
|
83
|
+
var _props_options;
|
|
84
|
+
_this.options = (_props_options = props === null || props === void 0 ? void 0 : props.options) !== null && _props_options !== void 0 ? _props_options : [];
|
|
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 _props_showType;
|
|
82
|
+
_this.showType = (_props_showType = props === null || props === void 0 ? void 0 : props.showType) !== null && _props_showType !== void 0 ? _props_showType : "switch";
|
|
83
|
+
var _props_tips;
|
|
84
|
+
_this.tips = (_props_tips = props === null || props === void 0 ? void 0 : props.tips) !== null && _props_tips !== void 0 ? _props_tips : "";
|
|
85
|
+
var _props_disabled;
|
|
86
|
+
_this.disabled = (_props_disabled = props === null || props === void 0 ? void 0 : props.disabled) !== null && _props_disabled !== void 0 ? _props_disabled : 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 _props_maxLength;
|
|
82
|
+
_this.maxLength = (_props_maxLength = props === null || props === void 0 ? void 0 : props.maxLength) !== null && _props_maxLength !== void 0 ? _props_maxLength : "";
|
|
83
|
+
var _props_minLength;
|
|
84
|
+
_this.minLength = (_props_minLength = props === null || props === void 0 ? void 0 : props.minLength) !== null && _props_minLength !== void 0 ? _props_minLength : "";
|
|
85
|
+
var _props_placeholder;
|
|
86
|
+
_this.placeholder = (_props_placeholder = props === null || props === void 0 ? void 0 : props.placeholder) !== null && _props_placeholder !== void 0 ? _props_placeholder : "";
|
|
87
|
+
var _props_maxRows;
|
|
88
|
+
_this.maxRows = (_props_maxRows = props === null || props === void 0 ? void 0 : props.maxRows) !== null && _props_maxRows !== void 0 ? _props_maxRows : "";
|
|
89
|
+
var _props_minRows;
|
|
90
|
+
_this.minRows = (_props_minRows = props === null || props === void 0 ? void 0 : props.minRows) !== null && _props_minRows !== void 0 ? _props_minRows : "";
|
|
91
|
+
var _props_i18n;
|
|
92
|
+
_this.i18n = (_props_i18n = props === null || props === void 0 ? void 0 : props.i18n) !== null && _props_i18n !== void 0 ? _props_i18n : 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 _schema_title;
|
|
11
|
+
this.title = (_schema_title = schema.title) !== null && _schema_title !== void 0 ? _schema_title : "";
|
|
12
|
+
var _schema_required;
|
|
13
|
+
this.required = (_schema_required = schema.required) !== null && _schema_required !== void 0 ? _schema_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 _schema_effect;
|
|
17
|
+
this.effect = (_schema_effect = schema.effect) !== null && _schema_effect !== void 0 ? _schema_effect : {};
|
|
18
|
+
var _schema_scopeEffect;
|
|
19
|
+
this.scopeEffect = (_schema_scopeEffect = schema.scopeEffect) !== null && _schema_scopeEffect !== void 0 ? _schema_scopeEffect : noop;
|
|
20
20
|
this.defaultValue = schema.defaultValue;
|
|
21
21
|
this.validator = schema.validator;
|
|
22
|
-
var
|
|
23
|
-
this.props = (
|
|
22
|
+
var _schema_props;
|
|
23
|
+
this.props = (_schema_props = schema.props) !== null && _schema_props !== void 0 ? _schema_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
|
|
65
|
+
export 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
|
|
70
|
-
export
|
|
69
|
+
export type FieldSchema = SettingSchemas | BaseSchema<{}>;
|
|
70
|
+
export 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
|
|
13
|
-
export
|
|
12
|
+
export type Props = CustomProps | InputProps | TextareaProps | InputNumberProps | SwitchProps | CheckboxProps | RadioProps | SelectProps;
|
|
13
|
+
export 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
|
|
6
|
-
export
|
|
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;
|
|
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.
|
|
3
|
+
"version": "1.8.1-beta.2",
|
|
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": "
|
|
26
|
-
"@byteluck-fe/model-driven-shared": "
|
|
25
|
+
"@byteluck-fe/model-driven-core": "1.8.1-beta.2",
|
|
26
|
+
"@byteluck-fe/model-driven-shared": "1.8.1-beta.1",
|
|
27
27
|
"tslib": "^2.1.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "dab568d1d94fe0e0688d7bfb1ba894291d5d1c50"
|
|
30
30
|
}
|