@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.
@@ -1534,6 +1534,10 @@ var props$1 = {
1534
1534
  type: Boolean,
1535
1535
  default: false
1536
1536
  },
1537
+ disabled: {
1538
+ type: Boolean,
1539
+ default: false
1540
+ },
1537
1541
  readonlyMode: {
1538
1542
  type: String,
1539
1543
  default: 'value',
@@ -10224,7 +10228,14 @@ var Widget = Vue.extend({
10224
10228
  }
10225
10229
  },
10226
10230
  render: function render(h) {
10227
- var _events$callbacks, _this$$scopedSlots$de, _this$$scopedSlots$de2, _this$$scopedSlots, _this$widgetSchema$ui5, _this$$scopedSlots$su, _this$$scopedSlots2;
10231
+ var _events$callbacks,
10232
+ _this$$scopedSlots$de,
10233
+ _this$$scopedSlots$de2,
10234
+ _this$$scopedSlots,
10235
+ _this5 = this,
10236
+ _this$widgetSchema$ui5,
10237
+ _this$$scopedSlots$su,
10238
+ _this$$scopedSlots2;
10228
10239
  var _Schema$getUiComponen = Schema.getUiComponent(this.widgetSchema),
10229
10240
  name = _Schema$getUiComponen.name,
10230
10241
  uiVnodeData = _objectWithoutProperties(_Schema$getUiComponen, _excluded2);
@@ -10254,6 +10265,7 @@ var Widget = Vue.extend({
10254
10265
  path: self.path,
10255
10266
  value: value
10256
10267
  });
10268
+ reactionDispatch(self.path, 'effect/update');
10257
10269
  }]),
10258
10270
  click: function click() {
10259
10271
  reactionDispatch(self.path, 'effect/click');
@@ -10273,7 +10285,10 @@ var Widget = Vue.extend({
10273
10285
  // 渲染删除按钮(用于数组类型widget删除)
10274
10286
  var renderDelete = function renderDelete() {
10275
10287
  return h('span', {
10276
- class: ['bk-schema-form-group-delete'],
10288
+ class: ['bk-schema-form-group-delete', {
10289
+ disabled: _this5.disabled,
10290
+ readonly: _this5.readonly
10291
+ }],
10277
10292
  style: {
10278
10293
  right: '0px',
10279
10294
  top: '0px'
@@ -10436,6 +10451,7 @@ var ArrayWidget = Vue.extend({
10436
10451
  },
10437
10452
  // 添加item
10438
10453
  handleAddItem: function handleAddItem() {
10454
+ if (this.disabled || this.readonly) return;
10439
10455
  var data = Schema.getSchemaDefaultValue(this.schema.items);
10440
10456
  var value = JSON.parse(JSON.stringify(this.value || []));
10441
10457
  value.push(data);
@@ -10446,6 +10462,7 @@ var ArrayWidget = Vue.extend({
10446
10462
  },
10447
10463
  // 删除item
10448
10464
  handleDeleteItem: function handleDeleteItem(path) {
10465
+ if (this.disabled || this.readonly) return;
10449
10466
  var index = Number(Path.getPathLastProp(path));
10450
10467
  var value = JSON.parse(JSON.stringify(this.value || []));
10451
10468
  value.splice(index, 1);
@@ -10491,7 +10508,10 @@ var ArrayWidget = Vue.extend({
10491
10508
  'bk-schema-form-item-auto-height': true
10492
10509
  }
10493
10510
  }, [h('span', {
10494
- class: ['bk-schema-form-group-add'],
10511
+ class: ['bk-schema-form-group-add', {
10512
+ disabled: this.disabled,
10513
+ readonly: this.readonly
10514
+ }],
10495
10515
  on: {
10496
10516
  click: function click() {
10497
10517
  self.handleAddItem();
@@ -11159,9 +11179,9 @@ var FieldGroupWrap = Vue.extend({
11159
11179
  render: function render(h) {
11160
11180
  var _this$layout,
11161
11181
  _this$layout2,
11182
+ _this = this,
11162
11183
  _this$schema,
11163
- _this$layout3,
11164
- _this = this;
11184
+ _this$layout3;
11165
11185
  var schemaFormStyle = _objectSpread2({
11166
11186
  position: 'relative',
11167
11187
  border: this.border ? '1px solid #dcdee5' : 'none',
@@ -11174,7 +11194,10 @@ var FieldGroupWrap = Vue.extend({
11174
11194
  var self = this;
11175
11195
  var renderDelete = function renderDelete() {
11176
11196
  return h('span', {
11177
- class: ['bk-schema-form-group-delete'],
11197
+ class: ['bk-schema-form-group-delete', {
11198
+ disabled: _this.disabled,
11199
+ readonly: _this.readonly
11200
+ }],
11178
11201
  style: {
11179
11202
  right: '10px',
11180
11203
  top: '10px'
@@ -11232,12 +11255,12 @@ var KeyValueArrayWidget = Vue.extend({
11232
11255
  },
11233
11256
  methods: {
11234
11257
  handleAddItem: function handleAddItem() {
11235
- if (this.disabled) return;
11258
+ if (this.disabled || this.readonly) return;
11236
11259
  var data = Schema.getSchemaDefaultValue(this.schema.items);
11237
11260
  this.$emit('input', [].concat(_toConsumableArray(this.value), [data]));
11238
11261
  },
11239
11262
  handleRemoveItem: function handleRemoveItem(index) {
11240
- if (this.disabled) return;
11263
+ if (this.disabled || this.readonly) return;
11241
11264
  var value = JSON.parse(JSON.stringify(this.value));
11242
11265
  value.splice(index, 1);
11243
11266
  this.$emit('input', value);
@@ -11260,7 +11283,7 @@ var KeyValueArrayWidget = Vue.extend({
11260
11283
  _this$value2;
11261
11284
  var labelBtnStyle = {
11262
11285
  'font-size': '16px',
11263
- color: '#979ba5',
11286
+ color: this.disabled ? '#c4c6cc' : '#979ba5',
11264
11287
  cursor: this.disabled ? 'not-allowed' : 'pointer',
11265
11288
  display: 'inline-block'
11266
11289
  };