@byteluck-fe/model-driven-shared 2.21.0-beta.15 → 2.22.0-beta.6
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/EventLogic.js +72 -72
- package/dist/esm/RulesMessage.js +4 -4
- package/dist/esm/calc.js +3 -3
- package/dist/esm/constant.js +1 -1
- package/dist/esm/entity/Department.js +3 -3
- package/dist/esm/entity/User.js +25 -25
- package/dist/esm/entity/index.js +2 -2
- package/dist/esm/enum.js +1 -1
- package/dist/esm/genNonDuplicateId.js +3 -3
- package/dist/esm/index.js +13 -13
- package/dist/esm/locales/index.js +3 -3
- package/dist/esm/log.js +6 -6
- package/dist/esm/loopControls.js +4 -4
- package/dist/esm/updateValueFromKeys.js +3 -3
- package/dist/esm/utils.js +12 -16
- package/dist/esm/watcher.js +8 -8
- package/package.json +2 -2
package/dist/esm/EventLogic.js
CHANGED
|
@@ -33,119 +33,119 @@ function _define_property(obj, key, value) {
|
|
|
33
33
|
// type InnerEventCode = 'click' | 'click-finish' | 'change'
|
|
34
34
|
var eventMap = [
|
|
35
35
|
{
|
|
36
|
-
key:
|
|
37
|
-
name:
|
|
38
|
-
code:
|
|
36
|
+
key: "on_click",
|
|
37
|
+
name: "点击时",
|
|
38
|
+
code: "click"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
key:
|
|
42
|
-
name:
|
|
43
|
-
code:
|
|
41
|
+
key: "on_click_finish",
|
|
42
|
+
name: "执行完成时",
|
|
43
|
+
code: "click-finish"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
|
-
key:
|
|
47
|
-
name:
|
|
48
|
-
code:
|
|
46
|
+
key: "on_change",
|
|
47
|
+
name: "值发生变化时",
|
|
48
|
+
code: "change"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
key:
|
|
52
|
-
name:
|
|
53
|
-
code:
|
|
51
|
+
key: "on_search",
|
|
52
|
+
name: "搜索时",
|
|
53
|
+
code: "search"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
key:
|
|
57
|
-
name:
|
|
58
|
-
code:
|
|
56
|
+
key: "on_list_change",
|
|
57
|
+
name: "列表数据变化时",
|
|
58
|
+
code: "list-change"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
key:
|
|
62
|
-
name:
|
|
63
|
-
code:
|
|
61
|
+
key: "on_list_search",
|
|
62
|
+
name: "列表数据查询构建时",
|
|
63
|
+
code: "list-search"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
|
-
key:
|
|
67
|
-
name:
|
|
68
|
-
code:
|
|
66
|
+
key: "on_list_mounted",
|
|
67
|
+
name: "列表数据返回时",
|
|
68
|
+
code: "list-mounted"
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
|
-
key:
|
|
72
|
-
name:
|
|
73
|
-
code:
|
|
71
|
+
key: "on_list_delete",
|
|
72
|
+
name: "列表数据删除时",
|
|
73
|
+
code: "list-delete"
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
|
-
key:
|
|
77
|
-
name:
|
|
78
|
-
code:
|
|
76
|
+
key: "on_list_before_insert",
|
|
77
|
+
name: "列表数据插入前",
|
|
78
|
+
code: "list-before-insert"
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
|
-
key:
|
|
82
|
-
name:
|
|
83
|
-
code:
|
|
81
|
+
key: "on_input",
|
|
82
|
+
name: "用户输入时",
|
|
83
|
+
code: "input"
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
|
-
key:
|
|
87
|
-
name:
|
|
88
|
-
code:
|
|
86
|
+
key: "on_blur",
|
|
87
|
+
name: "失去焦点时",
|
|
88
|
+
code: "blur"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
key:
|
|
92
|
-
name:
|
|
93
|
-
code:
|
|
91
|
+
key: "on_focus",
|
|
92
|
+
name: "获取焦点时",
|
|
93
|
+
code: "focus"
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
|
-
key:
|
|
97
|
-
name:
|
|
98
|
-
code:
|
|
96
|
+
key: "on_wps_open",
|
|
97
|
+
name: "打开文件时",
|
|
98
|
+
code: "wps-open"
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
|
-
key:
|
|
102
|
-
name:
|
|
103
|
-
code:
|
|
101
|
+
key: "on_wps_save",
|
|
102
|
+
name: "保存文件时",
|
|
103
|
+
code: "wps-save"
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
|
-
key:
|
|
107
|
-
name:
|
|
108
|
-
code:
|
|
106
|
+
key: "on_wps_rename",
|
|
107
|
+
name: "重命名时",
|
|
108
|
+
code: "wps-rename"
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
|
-
key:
|
|
112
|
-
name:
|
|
113
|
-
code:
|
|
111
|
+
key: "on_list_actions",
|
|
112
|
+
name: "点击操作按钮时",
|
|
113
|
+
code: "list-actions"
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
|
-
key:
|
|
117
|
-
name:
|
|
118
|
-
code:
|
|
116
|
+
key: "on_list_render_operation",
|
|
117
|
+
name: "操作列渲染时",
|
|
118
|
+
code: "list-render-operation"
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
|
-
key:
|
|
122
|
-
name:
|
|
123
|
-
code:
|
|
121
|
+
key: "on_list_rowclick",
|
|
122
|
+
name: "行点击时",
|
|
123
|
+
code: "list-rowclick"
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
|
-
key:
|
|
127
|
-
name:
|
|
128
|
-
code:
|
|
126
|
+
key: "on_list_before_rowdelete",
|
|
127
|
+
name: "行删除前",
|
|
128
|
+
code: "list-before-rowdelete"
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
|
-
key:
|
|
132
|
-
name:
|
|
133
|
-
code:
|
|
131
|
+
key: "on_list_before_import",
|
|
132
|
+
name: "列表数据导入前",
|
|
133
|
+
code: "list-before-import"
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
|
-
key:
|
|
137
|
-
name:
|
|
138
|
-
code:
|
|
136
|
+
key: "on_list_rows_checked",
|
|
137
|
+
name: "行选中时",
|
|
138
|
+
code: "list-rows-checked"
|
|
139
139
|
},
|
|
140
140
|
{
|
|
141
|
-
key:
|
|
142
|
-
name:
|
|
143
|
-
code:
|
|
141
|
+
key: "on_change_tab",
|
|
142
|
+
name: "标签页切换时",
|
|
143
|
+
code: "change-tab"
|
|
144
144
|
},
|
|
145
145
|
{
|
|
146
|
-
key:
|
|
147
|
-
name:
|
|
148
|
-
code:
|
|
146
|
+
key: "on_modal_ok",
|
|
147
|
+
name: "弹窗确认时",
|
|
148
|
+
code: "modal-ok"
|
|
149
149
|
}
|
|
150
150
|
];
|
|
151
151
|
export var EventLogic = /*#__PURE__*/ function() {
|
|
@@ -157,7 +157,7 @@ export var EventLogic = /*#__PURE__*/ function() {
|
|
|
157
157
|
{
|
|
158
158
|
key: "getEventsFromKeys",
|
|
159
159
|
value: function getEventsFromKeys(keys) {
|
|
160
|
-
var eventKeys = typeof keys ===
|
|
160
|
+
var eventKeys = typeof keys === "string" ? [
|
|
161
161
|
keys
|
|
162
162
|
] : keys;
|
|
163
163
|
return EventLogic.events.filter(function(item) {
|
|
@@ -175,8 +175,8 @@ export var EventLogic = /*#__PURE__*/ function() {
|
|
|
175
175
|
}));
|
|
176
176
|
var eventCustomEvents = control.customEvents.map(function(item) {
|
|
177
177
|
var key = item.key;
|
|
178
|
-
if (item.namespace !== undefined && item.namespace !== null && item.namespace !==
|
|
179
|
-
key = item.namespace +
|
|
178
|
+
if (item.namespace !== undefined && item.namespace !== null && item.namespace !== "") {
|
|
179
|
+
key = item.namespace + ":" + item.key;
|
|
180
180
|
}
|
|
181
181
|
return {
|
|
182
182
|
key: key,
|
package/dist/esm/RulesMessage.js
CHANGED
|
@@ -30,9 +30,9 @@ function _define_property(obj, key, value) {
|
|
|
30
30
|
}
|
|
31
31
|
return obj;
|
|
32
32
|
}
|
|
33
|
-
import OkI18n from
|
|
34
|
-
import messages from
|
|
35
|
-
import { DEFAULT_LOCALE } from
|
|
33
|
+
import OkI18n from "ok-i18n";
|
|
34
|
+
import messages from "./locales";
|
|
35
|
+
import { DEFAULT_LOCALE } from "./constant";
|
|
36
36
|
export var RulesMessage = /*#__PURE__*/ function() {
|
|
37
37
|
"use strict";
|
|
38
38
|
function RulesMessage() {
|
|
@@ -43,7 +43,7 @@ export var RulesMessage = /*#__PURE__*/ function() {
|
|
|
43
43
|
key: "getMessage",
|
|
44
44
|
value: function getMessage(messageKey) {
|
|
45
45
|
var variable = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
46
|
-
return this.$i18n.$t(messageKey,
|
|
46
|
+
return this.$i18n.$t(messageKey, "", variable);
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
{
|
package/dist/esm/calc.js
CHANGED
|
@@ -29,7 +29,7 @@ export var CALC_TOKEN_TYPE;
|
|
|
29
29
|
* */ CALC_TOKEN_TYPE["VariableInMainTable"] = "VariableInMainTable";
|
|
30
30
|
/**
|
|
31
31
|
* 变量存在当前明细子表内
|
|
32
|
-
* 说明计算公式在明细子表的某一行,且依赖项也在同一行内
|
|
32
|
+
* 说明计算公式在明细子表的某一行,且依赖项也在同一行内
|
|
33
33
|
* */ CALC_TOKEN_TYPE["VariableInCurrentSubTable"] = "VariableInCurrentSubTable";
|
|
34
34
|
/**
|
|
35
35
|
* 变量存在其它明细子表内
|
|
@@ -77,9 +77,9 @@ export var CalcScriptEchoItem = function CalcScriptEchoItem(props) {
|
|
|
77
77
|
* 绑定的是其它明细子表内变量时,必须有aggregateType
|
|
78
78
|
* */ _define_property(this, "aggregateType", void 0);
|
|
79
79
|
var _props_name;
|
|
80
|
-
this.name = (_props_name = props === null || props === void 0 ? void 0 : props.name) !== null && _props_name !== void 0 ? _props_name :
|
|
80
|
+
this.name = (_props_name = props === null || props === void 0 ? void 0 : props.name) !== null && _props_name !== void 0 ? _props_name : "";
|
|
81
81
|
var _props_id;
|
|
82
|
-
this.id = (_props_id = props === null || props === void 0 ? void 0 : props.id) !== null && _props_id !== void 0 ? _props_id :
|
|
82
|
+
this.id = (_props_id = props === null || props === void 0 ? void 0 : props.id) !== null && _props_id !== void 0 ? _props_id : "";
|
|
83
83
|
var _props_type;
|
|
84
84
|
this.type = (_props_type = props === null || props === void 0 ? void 0 : props.type) !== null && _props_type !== void 0 ? _props_type : "Number";
|
|
85
85
|
var _props_subTableId;
|
package/dist/esm/constant.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var DEFAULT_LOCALE =
|
|
1
|
+
export var DEFAULT_LOCALE = "zh-CN";
|
|
2
2
|
export var noop = function() {};
|
|
@@ -22,11 +22,11 @@ function _define_property(obj, key, value) {
|
|
|
22
22
|
export var DepartmentEntity = function DepartmentEntity() {
|
|
23
23
|
"use strict";
|
|
24
24
|
_class_call_check(this, DepartmentEntity);
|
|
25
|
-
_define_property(this,
|
|
25
|
+
_define_property(this, "department_en_name", void 0);
|
|
26
26
|
/**
|
|
27
27
|
* 部门编号
|
|
28
|
-
*/ _define_property(this,
|
|
28
|
+
*/ _define_property(this, "department_id", void 0);
|
|
29
29
|
/**
|
|
30
30
|
* 部门名称
|
|
31
|
-
*/ _define_property(this,
|
|
31
|
+
*/ _define_property(this, "department_name", void 0);
|
|
32
32
|
};
|
package/dist/esm/entity/User.js
CHANGED
|
@@ -22,65 +22,65 @@ function _define_property(obj, key, value) {
|
|
|
22
22
|
export var UserEntity = function UserEntity() {
|
|
23
23
|
"use strict";
|
|
24
24
|
_class_call_check(this, UserEntity);
|
|
25
|
-
_define_property(this,
|
|
26
|
-
_define_property(this,
|
|
25
|
+
_define_property(this, "avatar_big", void 0);
|
|
26
|
+
_define_property(this, "avatar_small", void 0);
|
|
27
27
|
/**
|
|
28
28
|
* 员工头像地址
|
|
29
|
-
*/ _define_property(this,
|
|
29
|
+
*/ _define_property(this, "avatar_url", void 0);
|
|
30
30
|
/**
|
|
31
31
|
* 归属部门英文名称
|
|
32
|
-
*/ _define_property(this,
|
|
33
|
-
_define_property(this,
|
|
32
|
+
*/ _define_property(this, "belong_dept_en_name", void 0);
|
|
33
|
+
_define_property(this, "belong_dept_id_list", void 0);
|
|
34
34
|
/**
|
|
35
35
|
* 归属部门ID
|
|
36
|
-
*/ _define_property(this,
|
|
36
|
+
*/ _define_property(this, "belong_dept_ids", void 0);
|
|
37
37
|
/**
|
|
38
38
|
* 归属部门名称
|
|
39
|
-
*/ _define_property(this,
|
|
39
|
+
*/ _define_property(this, "belong_dept_name", void 0);
|
|
40
40
|
/**
|
|
41
41
|
* 当前语言版本
|
|
42
|
-
*/ _define_property(this,
|
|
42
|
+
*/ _define_property(this, "cookie_language_enum", void 0);
|
|
43
43
|
/**
|
|
44
44
|
* 部门id
|
|
45
|
-
*/ _define_property(this,
|
|
45
|
+
*/ _define_property(this, "department_id", void 0);
|
|
46
46
|
/**
|
|
47
47
|
* 部门名称
|
|
48
|
-
*/ _define_property(this,
|
|
48
|
+
*/ _define_property(this, "department_name", void 0);
|
|
49
49
|
/**
|
|
50
50
|
* 员工邮箱
|
|
51
|
-
*/ _define_property(this,
|
|
51
|
+
*/ _define_property(this, "email", void 0);
|
|
52
52
|
/**
|
|
53
53
|
* 工号
|
|
54
|
-
*/ _define_property(this,
|
|
54
|
+
*/ _define_property(this, "employee_card", void 0);
|
|
55
55
|
/**
|
|
56
56
|
* 英文名
|
|
57
|
-
*/ _define_property(this,
|
|
57
|
+
*/ _define_property(this, "employee_en_name", void 0);
|
|
58
58
|
/**
|
|
59
59
|
* 员工编号
|
|
60
|
-
*/ _define_property(this,
|
|
60
|
+
*/ _define_property(this, "employee_id", void 0);
|
|
61
61
|
/**
|
|
62
62
|
* 员工姓名
|
|
63
|
-
*/ _define_property(this,
|
|
64
|
-
_define_property(this,
|
|
63
|
+
*/ _define_property(this, "employee_name", void 0);
|
|
64
|
+
_define_property(this, "external_user", void 0);
|
|
65
65
|
/**
|
|
66
66
|
* 性别
|
|
67
|
-
*/ _define_property(this,
|
|
68
|
-
_define_property(this,
|
|
67
|
+
*/ _define_property(this, "gender", void 0);
|
|
68
|
+
_define_property(this, "is_show_chat_group", void 0);
|
|
69
69
|
/**
|
|
70
70
|
* 负责部门英文名称
|
|
71
|
-
*/ _define_property(this,
|
|
71
|
+
*/ _define_property(this, "manage_dept_en_name", void 0);
|
|
72
72
|
/**
|
|
73
73
|
* 负责部门ID
|
|
74
|
-
*/ _define_property(this,
|
|
74
|
+
*/ _define_property(this, "manage_dept_ids", void 0);
|
|
75
75
|
/**
|
|
76
76
|
* 负责部门名称
|
|
77
|
-
*/ _define_property(this,
|
|
78
|
-
_define_property(this,
|
|
77
|
+
*/ _define_property(this, "manage_dept_name", void 0);
|
|
78
|
+
_define_property(this, "msg_relation_type", void 0);
|
|
79
79
|
/**
|
|
80
80
|
* 职级
|
|
81
|
-
*/ _define_property(this,
|
|
81
|
+
*/ _define_property(this, "sequence", void 0);
|
|
82
82
|
/**
|
|
83
83
|
* 固定电话
|
|
84
|
-
*/ _define_property(this,
|
|
85
|
-
_define_property(this,
|
|
84
|
+
*/ _define_property(this, "telephone", void 0);
|
|
85
|
+
_define_property(this, "tenant_id", void 0);
|
|
86
86
|
};
|
package/dist/esm/entity/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./Department";
|
|
2
|
+
export * from "./User";
|
package/dist/esm/enum.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var firstStr =
|
|
2
|
-
var str = firstStr +
|
|
1
|
+
var firstStr = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
2
|
+
var str = firstStr + "0123456789";
|
|
3
3
|
export function genNonDuplicateId() {
|
|
4
4
|
var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 15;
|
|
5
|
-
var result =
|
|
5
|
+
var result = "";
|
|
6
6
|
for(var i = 0; i < n; i++){
|
|
7
7
|
//第一位不能是数字
|
|
8
8
|
var randomStr = i === 0 ? firstStr : str;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
1
|
+
export * from "./entity";
|
|
2
|
+
export * from "./locales";
|
|
3
|
+
export * from "./calc";
|
|
4
|
+
export * from "./constant";
|
|
5
|
+
export * from "./enum";
|
|
6
|
+
export * from "./genNonDuplicateId";
|
|
7
|
+
export * from "./log";
|
|
8
|
+
export * from "./loopControls";
|
|
9
|
+
export * from "./RulesMessage";
|
|
10
|
+
export * from "./updateValueFromKeys";
|
|
11
|
+
export * from "./utils";
|
|
12
|
+
export * from "./watcher";
|
|
13
|
+
export * from "./EventLogic";
|
package/dist/esm/log.js
CHANGED
|
@@ -148,7 +148,7 @@ export function warn() {
|
|
|
148
148
|
var _logger;
|
|
149
149
|
var other = data.slice(1);
|
|
150
150
|
(_logger = logger).warn.apply(_logger, [
|
|
151
|
-
|
|
151
|
+
"\uD83E\uDDD0 Driven Warning:" + data[0]
|
|
152
152
|
].concat(_to_consumable_array(other)));
|
|
153
153
|
}
|
|
154
154
|
export function log() {
|
|
@@ -158,11 +158,11 @@ export function log() {
|
|
|
158
158
|
var _logger;
|
|
159
159
|
var other = data.slice(1);
|
|
160
160
|
(_logger = logger).log.apply(_logger, [
|
|
161
|
-
|
|
161
|
+
"\uD83D\uDE80 Driven Log:" + data[0]
|
|
162
162
|
].concat(_to_consumable_array(other)));
|
|
163
163
|
}
|
|
164
164
|
function joinMessage(message) {
|
|
165
|
-
return message +
|
|
165
|
+
return message + " \uD83D\uDC1B\uD83D\uDC1B\uD83D\uDC1B";
|
|
166
166
|
}
|
|
167
167
|
// 驱动错误
|
|
168
168
|
var DrivenError = /*#__PURE__*/ function(Error1) {
|
|
@@ -173,8 +173,8 @@ var DrivenError = /*#__PURE__*/ function(Error1) {
|
|
|
173
173
|
_class_call_check(this, DrivenError);
|
|
174
174
|
var _this;
|
|
175
175
|
_this = _super.call(this, message);
|
|
176
|
-
_this.name =
|
|
177
|
-
_this.message = message ? joinMessage(message) :
|
|
176
|
+
_this.name = "\uD83D\uDCA5 Driven Error";
|
|
177
|
+
_this.message = message ? joinMessage(message) : "An unknown error occurred in the Driven, please contact the person in charge \uD83D\uDE91\uD83D\uDE91\uD83D\uDE91";
|
|
178
178
|
return _this;
|
|
179
179
|
}
|
|
180
180
|
return DrivenError;
|
|
@@ -188,7 +188,7 @@ var DrivenReferenceError = /*#__PURE__*/ function(DrivenError) {
|
|
|
188
188
|
_class_call_check(this, DrivenReferenceError);
|
|
189
189
|
var _this;
|
|
190
190
|
_this = _super.call(this, message);
|
|
191
|
-
_this.name =
|
|
191
|
+
_this.name = "\uD83D\uDEA8 Driven Reference Error";
|
|
192
192
|
return _this;
|
|
193
193
|
}
|
|
194
194
|
return DrivenReferenceError;
|
package/dist/esm/loopControls.js
CHANGED
|
@@ -2,16 +2,16 @@ export function loopFormSchema(schema, callback) {
|
|
|
2
2
|
if (Array.isArray(schema)) {
|
|
3
3
|
schema.map(function(item) {
|
|
4
4
|
switch(item.controlType){
|
|
5
|
-
case
|
|
5
|
+
case "layout":
|
|
6
6
|
loopFormSchema(item === null || item === void 0 ? void 0 : item.children, callback);
|
|
7
7
|
break;
|
|
8
|
-
case
|
|
8
|
+
case "wrap":
|
|
9
9
|
loopFormSchema(item === null || item === void 0 ? void 0 : item.children, callback);
|
|
10
10
|
break;
|
|
11
|
-
case
|
|
11
|
+
case "search":
|
|
12
12
|
loopFormSchema(item === null || item === void 0 ? void 0 : item.children, callback);
|
|
13
13
|
break;
|
|
14
|
-
case
|
|
14
|
+
case "form":
|
|
15
15
|
callback(item);
|
|
16
16
|
default:
|
|
17
17
|
break;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { warn } from
|
|
1
|
+
import { warn } from "./log";
|
|
2
2
|
/**
|
|
3
3
|
* 通过key字符串类修改对象上边的属性
|
|
4
4
|
* @param obj 执行修改的对象
|
|
@@ -8,8 +8,8 @@ import { warn } from './log';
|
|
|
8
8
|
* */ export function updateValueFromKeys(obj, key, value) {
|
|
9
9
|
// 'obj[0].name' 会被转换为 obj.0.name 然后变成 ['obj', 0, 'name']数组,最终匹配内容
|
|
10
10
|
var keyList = key.replace(/\[(\d)]/g, function(text, $1) {
|
|
11
|
-
return
|
|
12
|
-
}).split(
|
|
11
|
+
return "." + $1;
|
|
12
|
+
}).split(".");
|
|
13
13
|
var result = false;
|
|
14
14
|
keyList.reduce(function(props, current, index, arr) {
|
|
15
15
|
var nowProps = props;
|
package/dist/esm/utils.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
import { camelizeKeys as camelizeKeys_1, decamelizeKeys as decamelizeKeys_1 } from 'humps';
|
|
6
|
-
import { CONTROL_TYPE } from './enum';
|
|
7
|
-
import cloneJSON from 'fast-json-clone';
|
|
1
|
+
import { camelizeKeys as camelizeKeys_1, decamelizeKeys as decamelizeKeys_1 } from "humps";
|
|
2
|
+
import { CONTROL_TYPE } from "./enum";
|
|
3
|
+
import cloneJSON from "fast-json-clone";
|
|
8
4
|
export function JSONCopy(value) {
|
|
9
5
|
if (value !== undefined) {
|
|
10
|
-
if (
|
|
6
|
+
if (typeof value === "object") {
|
|
11
7
|
return cloneJSON(value);
|
|
12
8
|
} else {
|
|
13
9
|
return value;
|
|
@@ -17,25 +13,25 @@ export function JSONCopy(value) {
|
|
|
17
13
|
}
|
|
18
14
|
}
|
|
19
15
|
export function isLanguageObject(arg) {
|
|
20
|
-
return isPlainObject(arg) &&
|
|
16
|
+
return isPlainObject(arg) && "zh" in arg;
|
|
21
17
|
}
|
|
22
18
|
export function isPlainObject(arg) {
|
|
23
|
-
return Object.prototype.toString.call(arg) ===
|
|
19
|
+
return Object.prototype.toString.call(arg) === "[object Object]";
|
|
24
20
|
}
|
|
25
21
|
export function isObject(val) {
|
|
26
|
-
return val != null &&
|
|
22
|
+
return val != null && typeof val === "object" && Array.isArray(val) === false;
|
|
27
23
|
}
|
|
28
24
|
export function isArray(val) {
|
|
29
25
|
return Array.isArray(val);
|
|
30
26
|
}
|
|
31
27
|
export function isString(val) {
|
|
32
|
-
return typeof val ===
|
|
28
|
+
return typeof val === "string";
|
|
33
29
|
}
|
|
34
30
|
export function isNumber(val) {
|
|
35
|
-
return typeof val ===
|
|
31
|
+
return typeof val === "number";
|
|
36
32
|
}
|
|
37
33
|
export function isFunction(val) {
|
|
38
|
-
return typeof val ===
|
|
34
|
+
return typeof val === "function";
|
|
39
35
|
}
|
|
40
36
|
export function isStringArray(value) {
|
|
41
37
|
return isArray(value) && value.every(function(item) {
|
|
@@ -49,7 +45,7 @@ export function isNumberArray(value) {
|
|
|
49
45
|
}
|
|
50
46
|
export function isNumberAndEmptyStringArray(value) {
|
|
51
47
|
return isArray(value) && value.every(function(item) {
|
|
52
|
-
return isNumber(item) || item ===
|
|
48
|
+
return isNumber(item) || item === "";
|
|
53
49
|
});
|
|
54
50
|
}
|
|
55
51
|
export function isJSONArray(value) {
|
|
@@ -59,7 +55,7 @@ export function isJSONObject(value) {
|
|
|
59
55
|
return /^{.*?}$/.test(value);
|
|
60
56
|
}
|
|
61
57
|
export function toNumberOrEmpty(value) {
|
|
62
|
-
return isNaN(parseFloat(value)) ?
|
|
58
|
+
return isNaN(parseFloat(value)) ? "" : Number(value);
|
|
63
59
|
}
|
|
64
60
|
export function getNotRepeatItems(arr) {
|
|
65
61
|
return arr.reduce(function(result, current) {
|
package/dist/esm/watcher.js
CHANGED
|
@@ -179,7 +179,7 @@ function _ts_generator(thisArg, body) {
|
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
import { log, logerror } from
|
|
182
|
+
import { log, logerror } from "./log";
|
|
183
183
|
// 通信总线
|
|
184
184
|
var Watcher = /*#__PURE__*/ function() {
|
|
185
185
|
"use strict";
|
|
@@ -244,9 +244,9 @@ var Watcher = /*#__PURE__*/ function() {
|
|
|
244
244
|
6
|
|
245
245
|
]);
|
|
246
246
|
_this.debug && log.apply(void 0, [
|
|
247
|
-
"正在执行 ".concat(key, " 事件: ").concat(callback.applyingPluginName ?
|
|
248
|
-
return
|
|
249
|
-
}).join(
|
|
247
|
+
"正在执行 ".concat(key, " 事件: ").concat(callback.applyingPluginName ? "当前执行的插件为:" + callback.applyingPluginName : "", ", 当前执行函数的参数为").concat(payload.map(function() {
|
|
248
|
+
return "%o";
|
|
249
|
+
}).join(","), "。")
|
|
250
250
|
].concat(_to_consumable_array(payload)));
|
|
251
251
|
return [
|
|
252
252
|
4,
|
|
@@ -255,9 +255,9 @@ var Watcher = /*#__PURE__*/ function() {
|
|
|
255
255
|
case 4:
|
|
256
256
|
result = _state.sent();
|
|
257
257
|
_this.debug && log.apply(void 0, [
|
|
258
|
-
"正在执行 ".concat(key, " 事件: ").concat(callback.applyingPluginName ?
|
|
259
|
-
return
|
|
260
|
-
}).join(
|
|
258
|
+
"正在执行 ".concat(key, " 事件: ").concat(callback.applyingPluginName ? "当前执行的插件为:" + callback.applyingPluginName : "", ", 当前执行函数的参数为").concat(payload.map(function() {
|
|
259
|
+
return "%o";
|
|
260
|
+
}).join(","), "; 函数的返回结果为%o")
|
|
261
261
|
].concat(_to_consumable_array(payload), [
|
|
262
262
|
result
|
|
263
263
|
]));
|
|
@@ -274,7 +274,7 @@ var Watcher = /*#__PURE__*/ function() {
|
|
|
274
274
|
];
|
|
275
275
|
case 5:
|
|
276
276
|
e = _state.sent();
|
|
277
|
-
logerror(String(e) +
|
|
277
|
+
logerror(String(e) + ":" + String(e.stack));
|
|
278
278
|
return [
|
|
279
279
|
3,
|
|
280
280
|
6
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byteluck-fe/model-driven-shared",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.22.0-beta.6",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "郝晨光 <2293885211@qq.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"humps": "^2.0.1",
|
|
31
31
|
"ok-i18n": "^3.0.0"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "5b7a6ae39fcac35fb56be60575258aa2644892b9"
|
|
34
34
|
}
|