@blueking/bkui-form 0.0.42-beta.3 → 0.0.42-beta.4

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.
@@ -1542,6 +1542,10 @@
1542
1542
  type: Boolean,
1543
1543
  default: false
1544
1544
  },
1545
+ disabled: {
1546
+ type: Boolean,
1547
+ default: false
1548
+ },
1545
1549
  readonlyMode: {
1546
1550
  type: String,
1547
1551
  default: 'value',
@@ -10232,7 +10236,14 @@
10232
10236
  }
10233
10237
  },
10234
10238
  render: function render(h) {
10235
- var _events$callbacks, _this$$scopedSlots$de, _this$$scopedSlots$de2, _this$$scopedSlots, _this$widgetSchema$ui5, _this$$scopedSlots$su, _this$$scopedSlots2;
10239
+ var _events$callbacks,
10240
+ _this$$scopedSlots$de,
10241
+ _this$$scopedSlots$de2,
10242
+ _this$$scopedSlots,
10243
+ _this5 = this,
10244
+ _this$widgetSchema$ui5,
10245
+ _this$$scopedSlots$su,
10246
+ _this$$scopedSlots2;
10236
10247
  var _Schema$getUiComponen = Schema.getUiComponent(this.widgetSchema),
10237
10248
  name = _Schema$getUiComponen.name,
10238
10249
  uiVnodeData = _objectWithoutProperties(_Schema$getUiComponen, _excluded2);
@@ -10281,7 +10292,10 @@
10281
10292
  // 渲染删除按钮(用于数组类型widget删除)
10282
10293
  var renderDelete = function renderDelete() {
10283
10294
  return h('span', {
10284
- class: ['bk-schema-form-group-delete'],
10295
+ class: ['bk-schema-form-group-delete', {
10296
+ disabled: _this5.disabled,
10297
+ readonly: _this5.readonly
10298
+ }],
10285
10299
  style: {
10286
10300
  right: '0px',
10287
10301
  top: '0px'
@@ -10444,6 +10458,7 @@
10444
10458
  },
10445
10459
  // 添加item
10446
10460
  handleAddItem: function handleAddItem() {
10461
+ if (this.disabled || this.readonly) return;
10447
10462
  var data = Schema.getSchemaDefaultValue(this.schema.items);
10448
10463
  var value = JSON.parse(JSON.stringify(this.value || []));
10449
10464
  value.push(data);
@@ -10454,6 +10469,7 @@
10454
10469
  },
10455
10470
  // 删除item
10456
10471
  handleDeleteItem: function handleDeleteItem(path) {
10472
+ if (this.disabled || this.readonly) return;
10457
10473
  var index = Number(Path.getPathLastProp(path));
10458
10474
  var value = JSON.parse(JSON.stringify(this.value || []));
10459
10475
  value.splice(index, 1);
@@ -10499,7 +10515,10 @@
10499
10515
  'bk-schema-form-item-auto-height': true
10500
10516
  }
10501
10517
  }, [h('span', {
10502
- class: ['bk-schema-form-group-add'],
10518
+ class: ['bk-schema-form-group-add', {
10519
+ disabled: this.disabled,
10520
+ readonly: this.readonly
10521
+ }],
10503
10522
  on: {
10504
10523
  click: function click() {
10505
10524
  self.handleAddItem();
@@ -11167,9 +11186,9 @@
11167
11186
  render: function render(h) {
11168
11187
  var _this$layout,
11169
11188
  _this$layout2,
11189
+ _this = this,
11170
11190
  _this$schema,
11171
- _this$layout3,
11172
- _this = this;
11191
+ _this$layout3;
11173
11192
  var schemaFormStyle = _objectSpread2({
11174
11193
  position: 'relative',
11175
11194
  border: this.border ? '1px solid #dcdee5' : 'none',
@@ -11182,7 +11201,10 @@
11182
11201
  var self = this;
11183
11202
  var renderDelete = function renderDelete() {
11184
11203
  return h('span', {
11185
- class: ['bk-schema-form-group-delete'],
11204
+ class: ['bk-schema-form-group-delete', {
11205
+ disabled: _this.disabled,
11206
+ readonly: _this.readonly
11207
+ }],
11186
11208
  style: {
11187
11209
  right: '10px',
11188
11210
  top: '10px'
@@ -11240,12 +11262,12 @@
11240
11262
  },
11241
11263
  methods: {
11242
11264
  handleAddItem: function handleAddItem() {
11243
- if (this.disabled) return;
11265
+ if (this.disabled || this.readonly) return;
11244
11266
  var data = Schema.getSchemaDefaultValue(this.schema.items);
11245
11267
  this.$emit('input', [].concat(_toConsumableArray(this.value), [data]));
11246
11268
  },
11247
11269
  handleRemoveItem: function handleRemoveItem(index) {
11248
- if (this.disabled) return;
11270
+ if (this.disabled || this.readonly) return;
11249
11271
  var value = JSON.parse(JSON.stringify(this.value));
11250
11272
  value.splice(index, 1);
11251
11273
  this.$emit('input', value);
@@ -11268,7 +11290,7 @@
11268
11290
  _this$value2;
11269
11291
  var labelBtnStyle = {
11270
11292
  'font-size': '16px',
11271
- color: '#979ba5',
11293
+ color: this.disabled ? '#c4c6cc' : '#979ba5',
11272
11294
  cursor: this.disabled ? 'not-allowed' : 'pointer',
11273
11295
  display: 'inline-block'
11274
11296
  };