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