@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.
@@ -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);
@@ -10273,7 +10284,10 @@ var Widget = Vue.extend({
10273
10284
  // 渲染删除按钮(用于数组类型widget删除)
10274
10285
  var renderDelete = function renderDelete() {
10275
10286
  return h('span', {
10276
- class: ['bk-schema-form-group-delete'],
10287
+ class: ['bk-schema-form-group-delete', {
10288
+ disabled: _this5.disabled,
10289
+ readonly: _this5.readonly
10290
+ }],
10277
10291
  style: {
10278
10292
  right: '0px',
10279
10293
  top: '0px'
@@ -10436,6 +10450,7 @@ var ArrayWidget = Vue.extend({
10436
10450
  },
10437
10451
  // 添加item
10438
10452
  handleAddItem: function handleAddItem() {
10453
+ if (this.disabled || this.readonly) return;
10439
10454
  var data = Schema.getSchemaDefaultValue(this.schema.items);
10440
10455
  var value = JSON.parse(JSON.stringify(this.value || []));
10441
10456
  value.push(data);
@@ -10446,6 +10461,7 @@ var ArrayWidget = Vue.extend({
10446
10461
  },
10447
10462
  // 删除item
10448
10463
  handleDeleteItem: function handleDeleteItem(path) {
10464
+ if (this.disabled || this.readonly) return;
10449
10465
  var index = Number(Path.getPathLastProp(path));
10450
10466
  var value = JSON.parse(JSON.stringify(this.value || []));
10451
10467
  value.splice(index, 1);
@@ -10491,7 +10507,10 @@ var ArrayWidget = Vue.extend({
10491
10507
  'bk-schema-form-item-auto-height': true
10492
10508
  }
10493
10509
  }, [h('span', {
10494
- class: ['bk-schema-form-group-add'],
10510
+ class: ['bk-schema-form-group-add', {
10511
+ disabled: this.disabled,
10512
+ readonly: this.readonly
10513
+ }],
10495
10514
  on: {
10496
10515
  click: function click() {
10497
10516
  self.handleAddItem();
@@ -11159,9 +11178,9 @@ var FieldGroupWrap = Vue.extend({
11159
11178
  render: function render(h) {
11160
11179
  var _this$layout,
11161
11180
  _this$layout2,
11181
+ _this = this,
11162
11182
  _this$schema,
11163
- _this$layout3,
11164
- _this = this;
11183
+ _this$layout3;
11165
11184
  var schemaFormStyle = _objectSpread2({
11166
11185
  position: 'relative',
11167
11186
  border: this.border ? '1px solid #dcdee5' : 'none',
@@ -11174,7 +11193,10 @@ var FieldGroupWrap = Vue.extend({
11174
11193
  var self = this;
11175
11194
  var renderDelete = function renderDelete() {
11176
11195
  return h('span', {
11177
- class: ['bk-schema-form-group-delete'],
11196
+ class: ['bk-schema-form-group-delete', {
11197
+ disabled: _this.disabled,
11198
+ readonly: _this.readonly
11199
+ }],
11178
11200
  style: {
11179
11201
  right: '10px',
11180
11202
  top: '10px'
@@ -11232,12 +11254,12 @@ var KeyValueArrayWidget = Vue.extend({
11232
11254
  },
11233
11255
  methods: {
11234
11256
  handleAddItem: function handleAddItem() {
11235
- if (this.disabled) return;
11257
+ if (this.disabled || this.readonly) return;
11236
11258
  var data = Schema.getSchemaDefaultValue(this.schema.items);
11237
11259
  this.$emit('input', [].concat(_toConsumableArray(this.value), [data]));
11238
11260
  },
11239
11261
  handleRemoveItem: function handleRemoveItem(index) {
11240
- if (this.disabled) return;
11262
+ if (this.disabled || this.readonly) return;
11241
11263
  var value = JSON.parse(JSON.stringify(this.value));
11242
11264
  value.splice(index, 1);
11243
11265
  this.$emit('input', value);
@@ -11260,7 +11282,7 @@ var KeyValueArrayWidget = Vue.extend({
11260
11282
  _this$value2;
11261
11283
  var labelBtnStyle = {
11262
11284
  'font-size': '16px',
11263
- color: '#979ba5',
11285
+ color: this.disabled ? '#c4c6cc' : '#979ba5',
11264
11286
  cursor: this.disabled ? 'not-allowed' : 'pointer',
11265
11287
  display: 'inline-block'
11266
11288
  };