@next-libs/cmdb-instances 6.5.1 → 6.6.1

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.
@@ -3,18 +3,20 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.attribute = exports.structList = exports.structData2 = exports.structData = void 0;
6
+ exports.attributeWithRegex = exports.attribute = exports.structList = exports.structData2 = exports.structData = void 0;
7
7
  const structData = {
8
8
  arr: ["abc", "def"],
9
9
  str: "string",
10
10
  int: 1000,
11
11
  ip: "0.0.0.0",
12
- enum: "1",
12
+ enum1: "1",
13
+ enum2: "3",
13
14
  date: "2019-05-24",
14
15
  datetime: "2019-05-24 12:00:00",
15
16
  enums: ["1", "3"],
16
17
  float: 100.1,
17
18
  json: "666",
19
+ bool: true,
18
20
  json1: {
19
21
  test: "666"
20
22
  }
@@ -49,17 +51,22 @@ const attribute = {
49
51
  type: "str"
50
52
  }, {
51
53
  id: "int",
52
- name: "数组",
54
+ name: "整型",
53
55
  type: "int"
54
56
  }, {
55
57
  id: "ip",
56
58
  name: "IP地址",
57
59
  type: "ip"
58
60
  }, {
59
- id: "enum",
60
- name: "枚举",
61
+ id: "enum1",
62
+ name: "枚举(<6)",
61
63
  type: "enum",
62
64
  regex: ["1", "3", "5", "7", "9"]
65
+ }, {
66
+ id: "enum2",
67
+ name: "枚举(>=6)",
68
+ type: "enum",
69
+ regex: ["1", "3", "5", "7", "9", "11"]
63
70
  }, {
64
71
  id: "date",
65
72
  name: "日期",
@@ -77,6 +84,10 @@ const attribute = {
77
84
  id: "float",
78
85
  name: "浮点型",
79
86
  type: "float"
87
+ }, {
88
+ id: "bool",
89
+ name: "布尔型",
90
+ type: "bool"
80
91
  }, {
81
92
  id: "json",
82
93
  name: "json",
@@ -88,4 +99,63 @@ const attribute = {
88
99
  }]
89
100
  }
90
101
  };
91
- exports.attribute = attribute;
102
+ exports.attribute = attribute;
103
+ const attributeWithRegex = {
104
+ name: "结构体",
105
+ id: "struct",
106
+ value: {
107
+ type: "structs",
108
+ struct_define: [{
109
+ id: "arr",
110
+ name: "数组",
111
+ type: "arr",
112
+ regex: "^678"
113
+ }, {
114
+ id: "str",
115
+ name: "字符串",
116
+ type: "str",
117
+ regex: "^abc"
118
+ }, {
119
+ id: "int",
120
+ name: "整型",
121
+ type: "int",
122
+ regex: "10$"
123
+ }, {
124
+ id: "ip",
125
+ name: "IP地址",
126
+ type: "ip",
127
+ regex: "^((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]?\\d)(\\[[^\\[\\],;\\s]{1,100}\\]|)$"
128
+ }, {
129
+ id: "enum1",
130
+ name: "枚举(<6)",
131
+ type: "enum",
132
+ regex: ["1", "3", "5", "7", "9"]
133
+ }, {
134
+ id: "enum2",
135
+ name: "枚举(>=6)",
136
+ type: "enum",
137
+ regex: ["1", "3", "5", "7", "9", "11"]
138
+ }, {
139
+ id: "enums",
140
+ name: "枚举多选",
141
+ type: "enums",
142
+ regex: ["1", "3", "5", "7", "9"]
143
+ }, {
144
+ id: "json",
145
+ name: "json",
146
+ type: "json",
147
+ regex: JSON.stringify({
148
+ type: "object",
149
+ properties: {
150
+ city: {
151
+ type: "string"
152
+ },
153
+ number: {
154
+ type: "number"
155
+ }
156
+ }
157
+ })
158
+ }]
159
+ }
160
+ };
161
+ exports.attributeWithRegex = attributeWithRegex;
@@ -134,8 +134,10 @@ export class ModelAttributeFormControl extends Component {
134
134
  });
135
135
 
136
136
  _defineProperty(this, "validateJson", err => {
137
+ var _this$props$jsonValid, _this$props;
138
+
137
139
  var error = some(err, ["type", "error"]);
138
- this.props.jsonValidateCollection(error);
140
+ (_this$props$jsonValid = (_this$props = this.props).jsonValidateCollection) === null || _this$props$jsonValid === void 0 ? void 0 : _this$props$jsonValid.call(_this$props, error);
139
141
  this.setState({
140
142
  showError: error
141
143
  });