@deot/vc-components 1.0.22 → 1.0.24

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.
@@ -14700,7 +14700,7 @@
14700
14700
  },
14701
14701
  width: {
14702
14702
  type: Number,
14703
- default: 300
14703
+ default: 600
14704
14704
  },
14705
14705
  height: {
14706
14706
  type: Number,
@@ -14726,6 +14726,8 @@
14726
14726
  maskStyle: [Object, String],
14727
14727
  wrapperClass: [Object, String],
14728
14728
  wrapperStyle: [Object, String],
14729
+ contentStyle: [Object, String],
14730
+ contentClass: [Object, String],
14729
14731
  closeWithCancel: {
14730
14732
  type: Boolean,
14731
14733
  default: true
@@ -14885,7 +14887,8 @@
14885
14887
  "class": "vc-drawer__content-container"
14886
14888
  }, [vue.createVNode(Scroller, {
14887
14889
  "native": false,
14888
- "contentClass": "vc-drawer__content"
14890
+ "contentClass": [props.contentClass, 'vc-drawer__content'],
14891
+ "contentStyle": props.contentStyle
14889
14892
  }, {
14890
14893
  default: () => [typeof props.content === 'string' ? vue.createVNode("div", {
14891
14894
  "innerHTML": props.content
@@ -15177,7 +15180,10 @@
15177
15180
  type: String,
15178
15181
  default: "right"
15179
15182
  },
15180
- contentStyle: String
15183
+ contentStyle: [Object, String],
15184
+ contentClass: [Object, String],
15185
+ labelStyle: [Object, String],
15186
+ labelClass: [Object, String]
15181
15187
  };
15182
15188
 
15183
15189
  class Validator {
@@ -15384,10 +15390,13 @@
15384
15390
  });
15385
15391
  const labelStyle = vue.computed(() => {
15386
15392
  const labelWidth = props.labelWidth === 0 || props.labelWidth ? props.labelWidth : isNest.value ? 0 : form.props.labelWidth;
15387
- return {
15388
- width: labelPosition.value !== "top" && labelWidth && labelWidth > 0 ? `${labelWidth}px` : "auto",
15389
- textAlign: labelPosition.value === "top" ? "left" : labelPosition.value
15390
- };
15393
+ return [
15394
+ {
15395
+ width: labelPosition.value !== "top" && labelWidth && labelWidth > 0 ? `${labelWidth}px` : "auto",
15396
+ textAlign: labelPosition.value === "top" ? "left" : labelPosition.value
15397
+ },
15398
+ props.labelStyle
15399
+ ];
15391
15400
  });
15392
15401
  const contentStyle = vue.computed(() => {
15393
15402
  const labelWidth = props.labelWidth === 0 || props.labelWidth ? props.labelWidth : form.props.labelWidth;
@@ -15599,14 +15608,14 @@
15599
15608
  })];
15600
15609
  return vue.createVNode("div", {
15601
15610
  "class": ['vc-form-item', classes.value]
15602
- }, [vue.createVNode("div", {
15611
+ }, [(label || slots.label) && vue.createVNode("div", {
15603
15612
  "style": labelStyle.value,
15604
- "class": "vc-form-item__label",
15613
+ "class": ['vc-form-item__label', props.labelClass],
15605
15614
  "for": labelFor
15606
15615
  }, [vue.createVNode("label", null, [label || slots.label?.()])]), vue.createVNode("div", {
15607
15616
  "class": "vc-form-item__wrapper"
15608
15617
  }, [vue.createVNode("div", {
15609
- "class": "vc-form-item__content",
15618
+ "class": ['vc-form-item__content', props.contentClass],
15610
15619
  "style": contentStyle.value
15611
15620
  }, [slots.default?.(), slots.error ? slots.error({
15612
15621
  show: showError.value,
@@ -17060,10 +17069,14 @@
17060
17069
  validator: (v) => /(small|medium|large)/.test(v),
17061
17070
  default: "small"
17062
17071
  },
17072
+ contentStyle: [Object, String],
17063
17073
  contentClass: [Object, String],
17064
17074
  width: {
17065
17075
  type: Number
17066
17076
  },
17077
+ height: {
17078
+ type: Number
17079
+ },
17067
17080
  mask: {
17068
17081
  type: Boolean,
17069
17082
  default: true
@@ -17155,6 +17168,9 @@
17155
17168
  const x = vue.ref(0);
17156
17169
  const y = vue.ref(0);
17157
17170
  const isActive = vue.ref(false);
17171
+
17172
+ // 注: 服务端渲染为0, 在客服端激活前,展示端存在问题【高度不定】
17173
+ const MAX_HEIGHT = IS_SERVER$2 ? 0 : window.innerHeight - 20;
17158
17174
  const defaultSize = vue.computed(() => {
17159
17175
  let width = 0;
17160
17176
  let height = 0;
@@ -17174,16 +17190,20 @@
17174
17190
  }
17175
17191
  return {
17176
17192
  width: props.width || width,
17177
- height
17193
+ height: Math.min(props.height || height, MAX_HEIGHT)
17178
17194
  };
17179
17195
  });
17180
17196
  const basicStyle = vue.computed(() => {
17181
- return {
17197
+ const result = {
17182
17198
  width: `${defaultSize.value.width}px`,
17183
- minHeight: `${defaultSize.value.height}px`,
17184
- // 注: 服务端渲染为0, 在客服端激活前,展示端存在问题【高度不定】
17185
- maxHeight: IS_SERVER$2 ? 0 : `${window.innerHeight - 20}px`
17199
+ maxHeight: `${MAX_HEIGHT}px`
17186
17200
  };
17201
+ if (props.height) {
17202
+ result.height = `${defaultSize.value.height}px`;
17203
+ } else {
17204
+ result.minHeight = `${defaultSize.value.height}px`;
17205
+ }
17206
+ return result;
17187
17207
  });
17188
17208
  const draggableStyle = vue.computed(() => {
17189
17209
  if (IS_SERVER$2 || !props.draggable) return {};
@@ -17306,6 +17326,7 @@
17306
17326
  * container在最大值时,需要移除,宽度才会缩回去
17307
17327
  */
17308
17328
  const handleContentResize = () => {
17329
+ if (props.height) return;
17309
17330
  const needRefreshScroller = !!scroller.value.wrapper.style.getPropertyValue('height');
17310
17331
  const needRefreshContainer = !!container.value.style.getPropertyValue('height');
17311
17332
  needRefreshContainer && container.value.style.removeProperty('height');
@@ -17451,7 +17472,8 @@
17451
17472
  "height": isTransitionEnd.value ? row.height : void 0,
17452
17473
  "contentClass": [{
17453
17474
  'is-confirm': props.mode
17454
- }, props.contentClass, 'vc-modal__content']
17475
+ }, props.contentClass, 'vc-modal__content'],
17476
+ "contentStyle": props.contentStyle
17455
17477
  }, {
17456
17478
  default: () => [typeof props.content === 'string' ? vue.createVNode("div", {
17457
17479
  "innerHTML": props.content
@@ -18529,7 +18551,8 @@
18529
18551
  }, [vue.createVNode(Spin, {
18530
18552
  "size": 16
18531
18553
  }, null)]), vue.createVNode(Scroller, {
18532
- "class": "vc-select__options"
18554
+ "class": "vc-select__options",
18555
+ "max-height": "200px"
18533
18556
  }, {
18534
18557
  default: () => [props.data ? vue.createVNode("div", null, [props.data.map(item => {
18535
18558
  let _slot;
@@ -39176,6 +39199,7 @@
39176
39199
  const key = getValueOfRow(row, rowIndex);
39177
39200
  const selected = table.store.isSelected(row);
39178
39201
  const height = rowHeight || rowData.height;
39202
+ const maxColumnIndex = columns.length - 1;
39179
39203
  return vue.createVNode("div", {
39180
39204
  "key": key,
39181
39205
  "class": [getRowClass(row, rowIndex), 'vc-table__tr'],
@@ -39211,8 +39235,10 @@
39211
39235
  column,
39212
39236
  rowIndex,
39213
39237
  columnIndex,
39238
+ selected,
39214
39239
  store: table.store,
39215
- selected
39240
+ isHead: columnIndex === 0,
39241
+ isTail: columnIndex === maxColumnIndex
39216
39242
  })]);
39217
39243
  })]);
39218
39244
  };
@@ -39711,6 +39737,8 @@
39711
39737
  stripe: Boolean,
39712
39738
  // 是否带有纵向边框
39713
39739
  border: Boolean,
39740
+ // 是否分割线
39741
+ divider: Boolean,
39714
39742
  // 非常影响表格虚拟滚动的性能,按容器的高度手动优化该值
39715
39743
  // 后续考虑移除,动态计算
39716
39744
  rows: {
@@ -39851,6 +39879,7 @@
39851
39879
  'vc-table--fit': props.fit,
39852
39880
  'vc-table--striped': props.stripe,
39853
39881
  'vc-table--border': props.border || states.isGroup,
39882
+ 'vc-table--divider': props.border || props.divider,
39854
39883
  'vc-table--group': states.isGroup,
39855
39884
  'vc-table--fluid-height': props.maxHeight,
39856
39885
  'vc-table--scrollable-x': layout.states.scrollX,
@@ -40635,10 +40664,11 @@
40635
40664
  }
40636
40665
  const line = column.line || VcInstance.options.TableColumn?.line;
40637
40666
  if (line && value) {
40667
+ const base = rowData.isHead || rowData.isTail ? 36 : 24; // 目前gap是12
40638
40668
  const style = {
40639
40669
  // 目前左右pading为10
40640
40670
  // TODO: 含有border还要-1
40641
- width: (column.realWidth || column.width) - 20 + 'px'
40671
+ width: (column.realWidth || column.width) - base + 'px'
40642
40672
  };
40643
40673
  return vue.createVNode(Text, {
40644
40674
  "style": style,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/vc-components",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",