@blueking/bkui-form 0.0.42-beta.3 → 0.0.42-beta.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.
@@ -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);
@@ -10262,6 +10273,7 @@
10262
10273
  path: self.path,
10263
10274
  value: value
10264
10275
  });
10276
+ reactionDispatch(self.path, 'effect/update');
10265
10277
  }]),
10266
10278
  click: function click() {
10267
10279
  reactionDispatch(self.path, 'effect/click');
@@ -10281,7 +10293,10 @@
10281
10293
  // 渲染删除按钮(用于数组类型widget删除)
10282
10294
  var renderDelete = function renderDelete() {
10283
10295
  return h('span', {
10284
- class: ['bk-schema-form-group-delete'],
10296
+ class: ['bk-schema-form-group-delete', {
10297
+ disabled: _this5.disabled,
10298
+ readonly: _this5.readonly
10299
+ }],
10285
10300
  style: {
10286
10301
  right: '0px',
10287
10302
  top: '0px'
@@ -10444,6 +10459,7 @@
10444
10459
  },
10445
10460
  // 添加item
10446
10461
  handleAddItem: function handleAddItem() {
10462
+ if (this.disabled || this.readonly) return;
10447
10463
  var data = Schema.getSchemaDefaultValue(this.schema.items);
10448
10464
  var value = JSON.parse(JSON.stringify(this.value || []));
10449
10465
  value.push(data);
@@ -10454,6 +10470,7 @@
10454
10470
  },
10455
10471
  // 删除item
10456
10472
  handleDeleteItem: function handleDeleteItem(path) {
10473
+ if (this.disabled || this.readonly) return;
10457
10474
  var index = Number(Path.getPathLastProp(path));
10458
10475
  var value = JSON.parse(JSON.stringify(this.value || []));
10459
10476
  value.splice(index, 1);
@@ -10499,7 +10516,10 @@
10499
10516
  'bk-schema-form-item-auto-height': true
10500
10517
  }
10501
10518
  }, [h('span', {
10502
- class: ['bk-schema-form-group-add'],
10519
+ class: ['bk-schema-form-group-add', {
10520
+ disabled: this.disabled,
10521
+ readonly: this.readonly
10522
+ }],
10503
10523
  on: {
10504
10524
  click: function click() {
10505
10525
  self.handleAddItem();
@@ -11167,9 +11187,9 @@
11167
11187
  render: function render(h) {
11168
11188
  var _this$layout,
11169
11189
  _this$layout2,
11190
+ _this = this,
11170
11191
  _this$schema,
11171
- _this$layout3,
11172
- _this = this;
11192
+ _this$layout3;
11173
11193
  var schemaFormStyle = _objectSpread2({
11174
11194
  position: 'relative',
11175
11195
  border: this.border ? '1px solid #dcdee5' : 'none',
@@ -11182,7 +11202,10 @@
11182
11202
  var self = this;
11183
11203
  var renderDelete = function renderDelete() {
11184
11204
  return h('span', {
11185
- class: ['bk-schema-form-group-delete'],
11205
+ class: ['bk-schema-form-group-delete', {
11206
+ disabled: _this.disabled,
11207
+ readonly: _this.readonly
11208
+ }],
11186
11209
  style: {
11187
11210
  right: '10px',
11188
11211
  top: '10px'
@@ -11240,12 +11263,12 @@
11240
11263
  },
11241
11264
  methods: {
11242
11265
  handleAddItem: function handleAddItem() {
11243
- if (this.disabled) return;
11266
+ if (this.disabled || this.readonly) return;
11244
11267
  var data = Schema.getSchemaDefaultValue(this.schema.items);
11245
11268
  this.$emit('input', [].concat(_toConsumableArray(this.value), [data]));
11246
11269
  },
11247
11270
  handleRemoveItem: function handleRemoveItem(index) {
11248
- if (this.disabled) return;
11271
+ if (this.disabled || this.readonly) return;
11249
11272
  var value = JSON.parse(JSON.stringify(this.value));
11250
11273
  value.splice(index, 1);
11251
11274
  this.$emit('input', value);
@@ -11268,7 +11291,7 @@
11268
11291
  _this$value2;
11269
11292
  var labelBtnStyle = {
11270
11293
  'font-size': '16px',
11271
- color: '#979ba5',
11294
+ color: this.disabled ? '#c4c6cc' : '#979ba5',
11272
11295
  cursor: this.disabled ? 'not-allowed' : 'pointer',
11273
11296
  display: 'inline-block'
11274
11297
  };