@bchr/bchr-front-lib 0.5.4 → 0.5.5

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.
@@ -74,6 +74,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
74
74
  var icon = props.icon;
75
75
  var btnLabel = props.btnText;
76
76
  var type = "tertiary";
77
+ var typeClassName = "default-btn";
77
78
  var theme = "light";
78
79
  var confirmMsg = null;
79
80
  var confirmType = null;
@@ -87,6 +88,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
87
88
  icon = icon ? icon : /*#__PURE__*/_react["default"].createElement(_icons.PlusOutlined, null);
88
89
  btnLabel = hasBtnLabel ? props.btnText : "新增";
89
90
  type = "primary";
91
+ typeClassName = "default-btn";
90
92
  theme = "solid";
91
93
  break;
92
94
  }
@@ -96,6 +98,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
96
98
  icon = icon ? icon : /*#__PURE__*/_react["default"].createElement(_icons.BarsOutlined, null);
97
99
  btnLabel = hasBtnLabel ? props.btnText : "浏览";
98
100
  type = "primary";
101
+ typeClassName = "default-btn";
99
102
  theme = "solid";
100
103
  break;
101
104
  }
@@ -112,6 +115,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
112
115
  icon = icon ? icon : /*#__PURE__*/_react["default"].createElement(_icons.SaveOutlined, null);
113
116
  btnLabel = hasBtnLabel ? props.btnText : "保存";
114
117
  type = "primary";
118
+ typeClassName = "completed-save-btn";
115
119
  theme = "solid";
116
120
  break;
117
121
  }
@@ -121,6 +125,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
121
125
  icon = icon ? icon : /*#__PURE__*/_react["default"].createElement(_icons.UnorderedListOutlined, null);
122
126
  btnLabel = hasBtnLabel ? props.btnText : "选择";
123
127
  type = "primary";
128
+ typeClassName = "default-btn";
124
129
  theme = "solid";
125
130
  break;
126
131
  }
@@ -143,6 +148,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
143
148
  icon = icon ? icon : /*#__PURE__*/_react["default"].createElement(_icons.DeleteOutlined, null);
144
149
  btnLabel = hasBtnLabel ? props.btnText : "删除";
145
150
  type = "danger";
151
+ typeClassName = "danger-btn";
146
152
  theme = "solid";
147
153
  confirmMsg = "确定要删除[options]记录吗?";
148
154
  break;
@@ -153,6 +159,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
153
159
  icon = icon ? icon : /*#__PURE__*/_react["default"].createElement(_icons.StopOutlined, null);
154
160
  btnLabel = hasBtnLabel ? props.btnText : "终止";
155
161
  type = "danger";
162
+ typeClassName = "danger-btn";
156
163
  theme = "solid";
157
164
  confirmMsg = "确定要终止[options]记录吗?";
158
165
  break;
@@ -190,6 +197,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
190
197
  {
191
198
  icon = icon ? icon : /*#__PURE__*/_react["default"].createElement(_icons.UndoOutlined, null);
192
199
  btnLabel = hasBtnLabel ? props.btnText : "返回";
200
+ typeClassName = "default-return-btn";
193
201
  break;
194
202
  }
195
203
 
@@ -198,6 +206,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
198
206
  icon = icon ? icon : /*#__PURE__*/_react["default"].createElement(_icons.CheckSquareOutlined, null);
199
207
  btnLabel = hasBtnLabel ? props.btnText : "确定";
200
208
  type = "primary";
209
+ typeClassName = "completed-btn";
201
210
  theme = "solid";
202
211
  break;
203
212
  }
@@ -207,6 +216,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
207
216
  icon = icon ? icon : /*#__PURE__*/_react["default"].createElement(_icons.SwapLeftOutlined, null);
208
217
  btnLabel = hasBtnLabel ? props.btnText : "取消";
209
218
  type = "warning";
219
+ typeClassName = "completed-save-btn";
210
220
  confirmMsg = "确定要取消[options]吗?";
211
221
  theme = "solid";
212
222
  break;
@@ -231,6 +241,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
231
241
  icon = icon ? icon : /*#__PURE__*/_react["default"].createElement(_icons.SendOutlined, null);
232
242
  btnLabel = hasBtnLabel ? props.btnText : "提交";
233
243
  type = "primary";
244
+ typeClassName = "completed-submit-btn";
234
245
  theme = "solid";
235
246
  break;
236
247
  }
@@ -243,6 +254,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
243
254
  confirmMsg = "确定要收回[options]吗?";
244
255
  theme = "solid";
245
256
  type = "primary";
257
+ typeClassName = "completed-save-btn";
246
258
  break;
247
259
  }
248
260
 
@@ -251,6 +263,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
251
263
  icon = icon ? icon : /*#__PURE__*/_react["default"].createElement(_icons.CheckCircleOutlined, null);
252
264
  btnLabel = hasBtnLabel ? props.btnText : "审批";
253
265
  type = "warning";
266
+ typeClassName = "completed-save-btn";
254
267
  break;
255
268
  }
256
269
 
@@ -260,6 +273,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
260
273
  type = "warning";
261
274
  btnLabel = hasBtnLabel ? props.btnText : "驳回";
262
275
  theme = "solid";
276
+ typeClassName = "completed-save-btn";
263
277
  break;
264
278
  }
265
279
 
@@ -295,6 +309,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
295
309
  {
296
310
  icon = icon ? icon : /*#__PURE__*/_react["default"].createElement(_icons.CheckCircleOutlined, null);
297
311
  type = hasBtnLabel ? props.btnText : "warning";
312
+ typeClassName = "completed-save-btn";
298
313
  btnLabel = "撤销生效";
299
314
  confirmMsg = "确定要撤销生效[options]吗?";
300
315
  theme = "solid";
@@ -368,6 +383,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
368
383
  {
369
384
  icon = icon ? icon : /*#__PURE__*/_react["default"].createElement(_icons.LockOutlined, null);
370
385
  type = "warning";
386
+ typeClassName = "completed-save-btn";
371
387
  btnLabel = hasBtnLabel ? props.btnText : "禁用";
372
388
  theme = "solid";
373
389
  confirmMsg = "确定要禁用[options]记录吗?";
@@ -393,6 +409,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
393
409
  icon = icon ? icon : /*#__PURE__*/_react["default"].createElement(_icons.ClearOutlined, null);
394
410
  btnLabel = hasBtnLabel ? props.btnText : "清除";
395
411
  type = "warning";
412
+ typeClassName = "completed-save-btn";
396
413
  theme = "solid";
397
414
  break;
398
415
  }
@@ -429,6 +446,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
429
446
  if (!buttonProps.icon) buttonProps.icon = icon;
430
447
  if (!buttonProps.type) buttonProps.type = type;
431
448
  if (!buttonProps.theme) buttonProps.theme = theme;
449
+ if (!buttonProps.className) buttonProps.className = typeClassName;
432
450
 
433
451
  if (innerLine) {
434
452
  if (!buttonProps.size) {
@@ -437,7 +455,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
437
455
  }
438
456
 
439
457
  if (confirmMsg && confirmMsg.trim().length > 0 && typeof buttonProps.onClick === "function") {
440
- if (_utils.Values.isEmpty(buttonProps.checkField) || _utils.Values.isEmpty(buttonProps.checkData)) {
458
+ if (_utils.Values.isEmpty(buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.checkField) || _utils.Values.isNull(buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.checkData)) {
441
459
  throw new Error("Please enter the check field and table data before transmitting the check field and table data");
442
460
  }
443
461
 
@@ -461,7 +479,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
461
479
  };
462
480
 
463
481
  buttonProps.onClick = function () {
464
- if (_utils.Values.isEmpty(checkField) || _utils.Values.isEmpty(checkData)) {
482
+ if (_utils.Values.isEmpty(checkField) || _utils.Values.isNull(buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.checkData)) {
465
483
  throw new Error("Please enter the check field and table data before transmitting the check field and table data");
466
484
  }
467
485
 
@@ -487,7 +505,7 @@ var buildActionButton = function buildActionButton(props, subActionButton, inner
487
505
  }
488
506
  }
489
507
 
490
- modalOptions.content.replace('[options]', checkedNames.join(','));
508
+ modalOptions.content = modalOptions.content.replace('[options]', checkedNames.join(','));
491
509
 
492
510
  if (confirmType) {
493
511
  if (confirmType === 'danger') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bchr/bchr-front-lib",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "bchr front lib",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -81,12 +81,13 @@ const buildActionButton = function(props, subActionButton, innerLine) {
81
81
  let loading = props.loading != null ? props.loading : false;
82
82
  let icon = props.icon;
83
83
  let btnLabel = props.btnText;
84
- let type = "tertiary";
85
- let theme = "light";
86
- let confirmMsg = null;
87
- let confirmType = null;
88
- let checkField = null;
89
- let checkData = null;
84
+ let type = "tertiary";
85
+ let typeClassName= "default-btn";
86
+ let theme = "light";
87
+ let confirmMsg = null;
88
+ let confirmType = null;
89
+ let checkField = null;
90
+ let checkData = null;
90
91
  let hasBtnLabel = props.btnText !== null && props.btnText !== undefined;
91
92
 
92
93
  switch (props.actionType) {
@@ -94,6 +95,7 @@ const buildActionButton = function(props, subActionButton, innerLine) {
94
95
  icon = icon ? icon : <PlusOutlined />;
95
96
  btnLabel = hasBtnLabel ? props.btnText : "新增";
96
97
  type = "primary";
98
+ typeClassName= "default-btn";
97
99
  theme = "solid";
98
100
  break;
99
101
  }
@@ -101,6 +103,7 @@ const buildActionButton = function(props, subActionButton, innerLine) {
101
103
  icon = icon ? icon : <BarsOutlined />
102
104
  btnLabel = hasBtnLabel ? props.btnText : "浏览";
103
105
  type = "primary";
106
+ typeClassName= "default-btn";
104
107
  theme = "solid";
105
108
  break;
106
109
  }
@@ -113,6 +116,7 @@ const buildActionButton = function(props, subActionButton, innerLine) {
113
116
  icon = icon ? icon : <SaveOutlined />
114
117
  btnLabel = hasBtnLabel ? props.btnText : "保存";
115
118
  type = "primary";
119
+ typeClassName= "completed-save-btn";
116
120
  theme = "solid";
117
121
  break;
118
122
  }
@@ -120,6 +124,7 @@ const buildActionButton = function(props, subActionButton, innerLine) {
120
124
  icon = icon ? icon : <UnorderedListOutlined />
121
125
  btnLabel = hasBtnLabel ? props.btnText : "选择";
122
126
  type = "primary";
127
+ typeClassName= "default-btn";
123
128
  theme = "solid";
124
129
  break;
125
130
  }
@@ -136,6 +141,7 @@ const buildActionButton = function(props, subActionButton, innerLine) {
136
141
  icon = icon ? icon : <DeleteOutlined />
137
142
  btnLabel = hasBtnLabel ? props.btnText : "删除";
138
143
  type = "danger";
144
+ typeClassName= "danger-btn";
139
145
  theme = "solid";
140
146
  confirmMsg = "确定要删除[options]记录吗?";
141
147
  break;
@@ -144,6 +150,7 @@ const buildActionButton = function(props, subActionButton, innerLine) {
144
150
  icon = icon ? icon : <StopOutlined />
145
151
  btnLabel = hasBtnLabel ? props.btnText : "终止";
146
152
  type = "danger";
153
+ typeClassName= "danger-btn";
147
154
  theme = "solid";
148
155
  confirmMsg = "确定要终止[options]记录吗?";
149
156
  break;
@@ -171,19 +178,22 @@ const buildActionButton = function(props, subActionButton, innerLine) {
171
178
  case ActionButtonTypes.ReturnBack : {
172
179
  icon = icon ? icon : <UndoOutlined />
173
180
  btnLabel = hasBtnLabel ? props.btnText : "返回";
181
+ typeClassName= "default-return-btn";
174
182
  break;
175
183
  }
176
184
  case ActionButtonTypes.OK : {
177
185
  icon = icon ? icon : <CheckSquareOutlined />
178
186
  btnLabel = hasBtnLabel ? props.btnText : "确定";
179
187
  type = "primary";
188
+ typeClassName= "completed-btn";
180
189
  theme = "solid";
181
190
  break;
182
191
  }
183
192
  case ActionButtonTypes.Cancel : {
184
193
  icon = icon ? icon : <SwapLeftOutlined />
185
194
  btnLabel = hasBtnLabel ? props.btnText : "取消";
186
- type = "warning"
195
+ type = "warning";
196
+ typeClassName= "completed-save-btn";
187
197
  confirmMsg = "确定要取消[options]吗?";
188
198
  theme = "solid";
189
199
  break;
@@ -202,6 +212,7 @@ const buildActionButton = function(props, subActionButton, innerLine) {
202
212
  icon = icon ? icon : <SendOutlined />
203
213
  btnLabel = hasBtnLabel ? props.btnText : "提交";
204
214
  type = "primary";
215
+ typeClassName= "completed-submit-btn";
205
216
  theme = "solid";
206
217
  break;
207
218
  }
@@ -212,12 +223,14 @@ const buildActionButton = function(props, subActionButton, innerLine) {
212
223
  confirmMsg = "确定要收回[options]吗?";
213
224
  theme = "solid";
214
225
  type = "primary";
226
+ typeClassName= "completed-save-btn";
215
227
  break;
216
228
  }
217
229
  case ActionButtonTypes.Approve : {
218
230
  icon = icon ? icon : <CheckCircleOutlined />
219
231
  btnLabel = hasBtnLabel ? props.btnText : "审批";
220
232
  type = "warning"
233
+ typeClassName= "completed-save-btn";
221
234
  break;
222
235
  }
223
236
  case ActionButtonTypes.Reject : {
@@ -225,6 +238,7 @@ const buildActionButton = function(props, subActionButton, innerLine) {
225
238
  type = "warning";
226
239
  btnLabel = hasBtnLabel ? props.btnText : "驳回";
227
240
  theme = "solid";
241
+ typeClassName= "completed-save-btn";
228
242
  break;
229
243
  }
230
244
  case ActionButtonTypes.Export : {
@@ -249,7 +263,8 @@ const buildActionButton = function(props, subActionButton, innerLine) {
249
263
  }
250
264
  case ActionButtonTypes.Invalid : {
251
265
  icon = icon ? icon : <CheckCircleOutlined />
252
- type = hasBtnLabel ? props.btnText : "warning"
266
+ type = hasBtnLabel ? props.btnText : "warning";
267
+ typeClassName= "completed-save-btn";
253
268
  btnLabel = "撤销生效";
254
269
  confirmMsg = "确定要撤销生效[options]吗?";
255
270
  theme = "solid";
@@ -296,7 +311,8 @@ const buildActionButton = function(props, subActionButton, innerLine) {
296
311
  }
297
312
  case ActionButtonTypes.Disable : {
298
313
  icon = icon ? icon : <LockOutlined />
299
- type = "warning"
314
+ type = "warning";
315
+ typeClassName= "completed-save-btn";
300
316
  btnLabel = hasBtnLabel ? props.btnText : "禁用";
301
317
  theme = "solid";
302
318
  confirmMsg = "确定要禁用[options]记录吗?";
@@ -316,6 +332,7 @@ const buildActionButton = function(props, subActionButton, innerLine) {
316
332
  icon = icon ? icon : <ClearOutlined />
317
333
  btnLabel = hasBtnLabel ? props.btnText : "清除";
318
334
  type = "warning"
335
+ typeClassName= "completed-save-btn";
319
336
  theme = "solid";
320
337
  break;
321
338
  }
@@ -355,6 +372,7 @@ const buildActionButton = function(props, subActionButton, innerLine) {
355
372
  if (!buttonProps.icon) buttonProps.icon = icon;
356
373
  if (!buttonProps.type) buttonProps.type = type;
357
374
  if (!buttonProps.theme) buttonProps.theme = theme;
375
+ if (!buttonProps.className) buttonProps.className = typeClassName;
358
376
 
359
377
  if (innerLine) {
360
378
  if (!buttonProps.size) {
@@ -363,7 +381,7 @@ const buildActionButton = function(props, subActionButton, innerLine) {
363
381
  }
364
382
 
365
383
  if (confirmMsg && confirmMsg.trim().length > 0 && typeof buttonProps.onClick === "function") {
366
- if (Values.isEmpty(buttonProps.checkField) || Values.isEmpty(buttonProps.checkData)) {
384
+ if (Values.isEmpty(buttonProps?.checkField) || Values.isNull(buttonProps?.checkData)) {
367
385
  throw new Error("Please enter the check field and table data before transmitting the check field and table data");
368
386
  }
369
387
 
@@ -382,7 +400,7 @@ const buildActionButton = function(props, subActionButton, innerLine) {
382
400
  okButtonProps : {type: buttonProps.type, theme : "solid", icon: <CheckOutlined />}
383
401
  };
384
402
  buttonProps.onClick = function() {
385
- if (Values.isEmpty(checkField) || Values.isEmpty(checkData)) {
403
+ if (Values.isEmpty(checkField) || Values.isNull(buttonProps?.checkData)) {
386
404
  throw new Error("Please enter the check field and table data before transmitting the check field and table data");
387
405
  }
388
406
 
@@ -405,7 +423,7 @@ const buildActionButton = function(props, subActionButton, innerLine) {
405
423
  }
406
424
  }
407
425
 
408
- modalOptions.content.replace('[options]', checkedNames.join(','));
426
+ modalOptions.content = modalOptions.content.replace('[options]', checkedNames.join(','));
409
427
 
410
428
  if (confirmType) {
411
429
  if (confirmType === 'danger') {