@next-core/brick-kit 2.122.7 → 2.122.11
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/CHANGELOG.md +32 -0
- package/dist/index.bundle.js +104 -71
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +104 -71
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/CustomForms/ExpandCustomForm.d.ts +2 -2
- package/dist/types/core/CustomForms/ExpandCustomForm.d.ts.map +1 -1
- package/dist/types/core/CustomForms/constants.d.ts.map +1 -1
- package/dist/types/themeAndMode.d.ts.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.122.11](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.122.10...@next-core/brick-kit@2.122.11) (2022-07-14)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @next-core/brick-kit
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.122.10](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.122.9...@next-core/brick-kit@2.122.10) (2022-07-12)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @next-core/brick-kit
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [2.122.9](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.122.8...@next-core/brick-kit@2.122.9) (2022-07-12)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @next-core/brick-kit
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [2.122.8](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.122.7...@next-core/brick-kit@2.122.8) (2022-07-12)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @next-core/brick-kit
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
## [2.122.7](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.122.6...@next-core/brick-kit@2.122.7) (2022-07-07)
|
|
7
39
|
|
|
8
40
|
**Note:** Version bump only for package @next-core/brick-kit
|
package/dist/index.bundle.js
CHANGED
|
@@ -437,8 +437,11 @@
|
|
|
437
437
|
return currentMode;
|
|
438
438
|
}
|
|
439
439
|
function getCssPropertyValue(name) {
|
|
440
|
+
var _window$getComputedSt;
|
|
441
|
+
|
|
440
442
|
var el = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.documentElement;
|
|
441
|
-
|
|
443
|
+
if (!el) return "";
|
|
444
|
+
return ((_window$getComputedSt = window.getComputedStyle(el)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.getPropertyValue(name)) || "";
|
|
442
445
|
}
|
|
443
446
|
|
|
444
447
|
function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -1565,7 +1568,8 @@
|
|
|
1565
1568
|
|
|
1566
1569
|
case "THEME":
|
|
1567
1570
|
return {
|
|
1568
|
-
getTheme: collectCoverage ? () => "light" : getTheme
|
|
1571
|
+
getTheme: collectCoverage ? () => "light" : getTheme,
|
|
1572
|
+
getCssPropertyValue: collectCoverage ? () => "" : getCssPropertyValue
|
|
1569
1573
|
};
|
|
1570
1574
|
|
|
1571
1575
|
case "console":
|
|
@@ -7954,7 +7958,7 @@
|
|
|
7954
7958
|
}
|
|
7955
7959
|
|
|
7956
7960
|
var formRenderer = "form-renderer.form-renderer";
|
|
7957
|
-
var filterProperties = ["brick", "slots", "properties", "events", "if", "context", "bricks", "mountPoint"];
|
|
7961
|
+
var filterProperties = ["instanceId", "brick", "slots", "properties", "events", "if", "context", "bricks", "mountPoint"];
|
|
7958
7962
|
|
|
7959
7963
|
class Kernel {
|
|
7960
7964
|
constructor() {
|
|
@@ -9069,7 +9073,20 @@
|
|
|
9069
9073
|
brick: "div",
|
|
9070
9074
|
slots: {
|
|
9071
9075
|
"": {
|
|
9072
|
-
bricks:
|
|
9076
|
+
bricks: [{
|
|
9077
|
+
brick: "basic-bricks.micro-view",
|
|
9078
|
+
properties: {
|
|
9079
|
+
style: {
|
|
9080
|
+
padding: "12px"
|
|
9081
|
+
}
|
|
9082
|
+
},
|
|
9083
|
+
slots: {
|
|
9084
|
+
content: {
|
|
9085
|
+
bricks: formStoryboard,
|
|
9086
|
+
type: "bricks"
|
|
9087
|
+
}
|
|
9088
|
+
}
|
|
9089
|
+
}],
|
|
9073
9090
|
type: "bricks"
|
|
9074
9091
|
}
|
|
9075
9092
|
}
|
|
@@ -9089,20 +9106,31 @@
|
|
|
9089
9106
|
}
|
|
9090
9107
|
}
|
|
9091
9108
|
function getDefaultProperties(_name, fields) {
|
|
9092
|
-
var field = fields.filter(item => item.
|
|
9093
|
-
var defaultValue = {};
|
|
9109
|
+
var field = fields.filter(item => item.fieldId === _name)[0];
|
|
9094
9110
|
|
|
9095
9111
|
if (field) {
|
|
9096
|
-
|
|
9112
|
+
var defaultValue = {
|
|
9113
|
+
brick: "forms.general-input",
|
|
9114
|
+
properties: {
|
|
9115
|
+
id: field.fieldId,
|
|
9116
|
+
name: field.fieldId,
|
|
9117
|
+
label: field.name,
|
|
9118
|
+
readOnly: field.limit.includes("READONLY"),
|
|
9119
|
+
required: field.limit.includes("REQUIRED"),
|
|
9120
|
+
placeholder: field.description
|
|
9121
|
+
}
|
|
9122
|
+
};
|
|
9123
|
+
|
|
9124
|
+
switch (field.fieldType) {
|
|
9097
9125
|
case "STRING":
|
|
9098
9126
|
defaultValue = {
|
|
9099
9127
|
brick: "forms.general-input",
|
|
9100
9128
|
properties: {
|
|
9101
|
-
id: field.
|
|
9102
|
-
name: field.
|
|
9129
|
+
id: field.fieldId,
|
|
9130
|
+
name: field.fieldId,
|
|
9103
9131
|
label: field.name,
|
|
9104
|
-
readOnly: field.limit.includes("
|
|
9105
|
-
required: field.limit.includes("
|
|
9132
|
+
readOnly: field.limit.includes("READONLY"),
|
|
9133
|
+
required: field.limit.includes("REQUIRED"),
|
|
9106
9134
|
placeholder: field.description
|
|
9107
9135
|
}
|
|
9108
9136
|
};
|
|
@@ -9112,11 +9140,11 @@
|
|
|
9112
9140
|
defaultValue = {
|
|
9113
9141
|
brick: "forms.general-input-number",
|
|
9114
9142
|
properties: {
|
|
9115
|
-
id: field.
|
|
9116
|
-
name: field.
|
|
9143
|
+
id: field.fieldId,
|
|
9144
|
+
name: field.fieldId,
|
|
9117
9145
|
label: field.name,
|
|
9118
|
-
readOnly: field.limit.includes("
|
|
9119
|
-
required: field.limit.includes("
|
|
9146
|
+
readOnly: field.limit.includes("READONLY"),
|
|
9147
|
+
required: field.limit.includes("REQUIRED"),
|
|
9120
9148
|
placeholder: field.description,
|
|
9121
9149
|
precision: 0,
|
|
9122
9150
|
inputBoxStyle: {
|
|
@@ -9130,11 +9158,11 @@
|
|
|
9130
9158
|
defaultValue = {
|
|
9131
9159
|
brick: "forms.general-switch",
|
|
9132
9160
|
properties: {
|
|
9133
|
-
id: field.
|
|
9134
|
-
name: field.
|
|
9161
|
+
id: field.fieldId,
|
|
9162
|
+
name: field.fieldId,
|
|
9135
9163
|
label: field.name,
|
|
9136
|
-
readOnly: field.limit.includes("
|
|
9137
|
-
required: field.limit.includes("
|
|
9164
|
+
readOnly: field.limit.includes("READONLY"),
|
|
9165
|
+
required: field.limit.includes("REQUIRED")
|
|
9138
9166
|
}
|
|
9139
9167
|
};
|
|
9140
9168
|
break;
|
|
@@ -9143,11 +9171,11 @@
|
|
|
9143
9171
|
defaultValue = {
|
|
9144
9172
|
brick: "forms.general-input-number",
|
|
9145
9173
|
properties: {
|
|
9146
|
-
id: field.
|
|
9147
|
-
name: field.
|
|
9174
|
+
id: field.fieldId,
|
|
9175
|
+
name: field.fieldId,
|
|
9148
9176
|
label: field.name,
|
|
9149
|
-
readOnly: field.limit.includes("
|
|
9150
|
-
required: field.limit.includes("
|
|
9177
|
+
readOnly: field.limit.includes("READONLY"),
|
|
9178
|
+
required: field.limit.includes("REQUIRED"),
|
|
9151
9179
|
placeholder: field.description,
|
|
9152
9180
|
inputBoxStyle: {
|
|
9153
9181
|
width: "100%"
|
|
@@ -9156,15 +9184,15 @@
|
|
|
9156
9184
|
};
|
|
9157
9185
|
break;
|
|
9158
9186
|
|
|
9159
|
-
case "
|
|
9187
|
+
case "ENUM":
|
|
9160
9188
|
defaultValue = {
|
|
9161
9189
|
brick: "forms.general-select",
|
|
9162
9190
|
properties: {
|
|
9163
|
-
id: field.
|
|
9164
|
-
name: field.
|
|
9191
|
+
id: field.fieldId,
|
|
9192
|
+
name: field.fieldId,
|
|
9165
9193
|
label: field.name,
|
|
9166
|
-
readOnly: field.limit.includes("
|
|
9167
|
-
required: field.limit.includes("
|
|
9194
|
+
readOnly: field.limit.includes("READONLY"),
|
|
9195
|
+
required: field.limit.includes("REQUIRED"),
|
|
9168
9196
|
options: [{
|
|
9169
9197
|
label: "选项一",
|
|
9170
9198
|
value: 1
|
|
@@ -9180,15 +9208,15 @@
|
|
|
9180
9208
|
};
|
|
9181
9209
|
break;
|
|
9182
9210
|
|
|
9183
|
-
case "
|
|
9211
|
+
case "ENUMS":
|
|
9184
9212
|
defaultValue = {
|
|
9185
9213
|
brick: "forms.general-select",
|
|
9186
9214
|
properties: {
|
|
9187
|
-
id: field.
|
|
9188
|
-
name: field.
|
|
9215
|
+
id: field.fieldId,
|
|
9216
|
+
name: field.fieldId,
|
|
9189
9217
|
label: field.name,
|
|
9190
|
-
readOnly: field.limit.includes("
|
|
9191
|
-
required: field.limit.includes("
|
|
9218
|
+
readOnly: field.limit.includes("READONLY"),
|
|
9219
|
+
required: field.limit.includes("REQUIRED"),
|
|
9192
9220
|
mode: "multiple",
|
|
9193
9221
|
options: [{
|
|
9194
9222
|
label: "选项一",
|
|
@@ -9209,11 +9237,11 @@
|
|
|
9209
9237
|
defaultValue = {
|
|
9210
9238
|
brick: "forms.general-date-picker",
|
|
9211
9239
|
properties: {
|
|
9212
|
-
id: field.
|
|
9213
|
-
name: field.
|
|
9240
|
+
id: field.fieldId,
|
|
9241
|
+
name: field.fieldId,
|
|
9214
9242
|
label: field.name,
|
|
9215
|
-
readOnly: field.limit.includes("
|
|
9216
|
-
required: field.limit.includes("
|
|
9243
|
+
readOnly: field.limit.includes("READONLY"),
|
|
9244
|
+
required: field.limit.includes("REQUIRED"),
|
|
9217
9245
|
placeholder: field.description
|
|
9218
9246
|
}
|
|
9219
9247
|
};
|
|
@@ -9223,11 +9251,11 @@
|
|
|
9223
9251
|
defaultValue = {
|
|
9224
9252
|
brick: "forms.general-date-picker",
|
|
9225
9253
|
properties: {
|
|
9226
|
-
id: field.
|
|
9227
|
-
name: field.
|
|
9254
|
+
id: field.fieldId,
|
|
9255
|
+
name: field.fieldId,
|
|
9228
9256
|
label: field.name,
|
|
9229
|
-
readOnly: field.limit.includes("
|
|
9230
|
-
required: field.limit.includes("
|
|
9257
|
+
readOnly: field.limit.includes("READONLY"),
|
|
9258
|
+
required: field.limit.includes("REQUIRED"),
|
|
9231
9259
|
placeholder: field.description
|
|
9232
9260
|
}
|
|
9233
9261
|
};
|
|
@@ -9237,11 +9265,11 @@
|
|
|
9237
9265
|
defaultValue = {
|
|
9238
9266
|
brick: "forms.general-input",
|
|
9239
9267
|
properties: {
|
|
9240
|
-
id: field.
|
|
9241
|
-
name: field.
|
|
9268
|
+
id: field.fieldId,
|
|
9269
|
+
name: field.fieldId,
|
|
9242
9270
|
label: field.name,
|
|
9243
|
-
readOnly: field.limit.includes("
|
|
9244
|
-
required: field.limit.includes("
|
|
9271
|
+
readOnly: field.limit.includes("READONLY"),
|
|
9272
|
+
required: field.limit.includes("REQUIRED"),
|
|
9245
9273
|
placeholder: field.description,
|
|
9246
9274
|
pattern: /((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}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/
|
|
9247
9275
|
}
|
|
@@ -9249,56 +9277,59 @@
|
|
|
9249
9277
|
break;
|
|
9250
9278
|
|
|
9251
9279
|
case "JSON":
|
|
9252
|
-
defaultValue = {
|
|
9280
|
+
defaultValue = {
|
|
9281
|
+
brick: "forms.general-textarea",
|
|
9282
|
+
properties: {
|
|
9283
|
+
id: field.fieldId,
|
|
9284
|
+
name: field.fieldId,
|
|
9285
|
+
label: field.name
|
|
9286
|
+
}
|
|
9287
|
+
};
|
|
9253
9288
|
break;
|
|
9254
9289
|
|
|
9255
9290
|
case "ARRAY":
|
|
9256
|
-
defaultValue = {};
|
|
9257
|
-
break;
|
|
9258
|
-
|
|
9259
|
-
case "STRUCTURE":
|
|
9260
9291
|
defaultValue = {
|
|
9261
|
-
brick: "forms.
|
|
9292
|
+
brick: "forms.general-select",
|
|
9262
9293
|
properties: {
|
|
9263
|
-
id: field.
|
|
9264
|
-
name: field.
|
|
9265
|
-
label: field.name
|
|
9266
|
-
readOnly: field.limit.includes("readOnly"),
|
|
9267
|
-
required: field.limit.includes("required")
|
|
9294
|
+
id: field.fieldId,
|
|
9295
|
+
name: field.fieldId,
|
|
9296
|
+
label: field.name
|
|
9268
9297
|
}
|
|
9269
9298
|
};
|
|
9270
9299
|
break;
|
|
9271
9300
|
|
|
9272
|
-
case "
|
|
9301
|
+
case "STRUCTURE":
|
|
9273
9302
|
defaultValue = {
|
|
9274
9303
|
brick: "forms.cmdb-instance-select-panel",
|
|
9275
9304
|
properties: {
|
|
9276
|
-
id: field.
|
|
9277
|
-
name: field.
|
|
9305
|
+
id: field.fieldId,
|
|
9306
|
+
name: field.fieldId,
|
|
9278
9307
|
label: field.name,
|
|
9279
|
-
readOnly: field.limit.includes("
|
|
9280
|
-
required: field.limit.includes("
|
|
9308
|
+
readOnly: field.limit.includes("READONLY"),
|
|
9309
|
+
required: field.limit.includes("REQUIRED")
|
|
9281
9310
|
}
|
|
9282
9311
|
};
|
|
9283
9312
|
break;
|
|
9284
9313
|
|
|
9285
|
-
|
|
9314
|
+
case "STRUCTURE_ARRAY":
|
|
9286
9315
|
defaultValue = {
|
|
9287
|
-
brick: "forms.
|
|
9316
|
+
brick: "forms.cmdb-instance-select-panel",
|
|
9288
9317
|
properties: {
|
|
9289
|
-
id: field.
|
|
9290
|
-
name: field.
|
|
9318
|
+
id: field.fieldId,
|
|
9319
|
+
name: field.fieldId,
|
|
9291
9320
|
label: field.name,
|
|
9292
|
-
readOnly: field.limit.includes("
|
|
9293
|
-
required: field.limit.includes("
|
|
9294
|
-
placeholder: field.description
|
|
9321
|
+
readOnly: field.limit.includes("READONLY"),
|
|
9322
|
+
required: field.limit.includes("REQUIRED")
|
|
9295
9323
|
}
|
|
9296
9324
|
};
|
|
9297
9325
|
break;
|
|
9298
9326
|
}
|
|
9299
|
-
}
|
|
9300
9327
|
|
|
9301
|
-
|
|
9328
|
+
defaultValue.properties.dataset = {
|
|
9329
|
+
testid: field.fieldId
|
|
9330
|
+
};
|
|
9331
|
+
return defaultValue;
|
|
9332
|
+
} else return {};
|
|
9302
9333
|
}
|
|
9303
9334
|
function getStoryboard(datasource, result, fields) {
|
|
9304
9335
|
var _loop = function (i) {
|
|
@@ -9316,7 +9347,9 @@
|
|
|
9316
9347
|
});
|
|
9317
9348
|
Object.keys(dataItem).forEach(item => {
|
|
9318
9349
|
if (filterProperties.includes(item)) {
|
|
9319
|
-
|
|
9350
|
+
var _key = item === "instanceId" ? "iid" : item;
|
|
9351
|
+
|
|
9352
|
+
resultItem[_key] = dataItem[item];
|
|
9320
9353
|
}
|
|
9321
9354
|
});
|
|
9322
9355
|
|