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