@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.
package/dist/index.js CHANGED
@@ -8479,7 +8479,7 @@ const props$P = {
8479
8479
  },
8480
8480
  width: {
8481
8481
  type: Number,
8482
- default: 300
8482
+ default: 600
8483
8483
  },
8484
8484
  height: {
8485
8485
  type: Number,
@@ -8505,6 +8505,8 @@ const props$P = {
8505
8505
  maskStyle: [Object, String],
8506
8506
  wrapperClass: [Object, String],
8507
8507
  wrapperStyle: [Object, String],
8508
+ contentStyle: [Object, String],
8509
+ contentClass: [Object, String],
8508
8510
  closeWithCancel: {
8509
8511
  type: Boolean,
8510
8512
  default: true
@@ -8664,7 +8666,8 @@ const DrawerView = /* @__PURE__ */ defineComponent({
8664
8666
  "class": "vc-drawer__content-container"
8665
8667
  }, [createVNode(Scroller, {
8666
8668
  "native": false,
8667
- "contentClass": "vc-drawer__content"
8669
+ "contentClass": [props.contentClass, 'vc-drawer__content'],
8670
+ "contentStyle": props.contentStyle
8668
8671
  }, {
8669
8672
  default: () => [typeof props.content === 'string' ? createVNode("div", {
8670
8673
  "innerHTML": props.content
@@ -8956,7 +8959,10 @@ const props$L = {
8956
8959
  type: String,
8957
8960
  default: "right"
8958
8961
  },
8959
- contentStyle: String
8962
+ contentStyle: [Object, String],
8963
+ contentClass: [Object, String],
8964
+ labelStyle: [Object, String],
8965
+ labelClass: [Object, String]
8960
8966
  };
8961
8967
 
8962
8968
  const filterEmpty = (val) => {
@@ -9031,10 +9037,13 @@ const useFormItem = (expose) => {
9031
9037
  });
9032
9038
  const labelStyle = computed(() => {
9033
9039
  const labelWidth = props.labelWidth === 0 || props.labelWidth ? props.labelWidth : isNest.value ? 0 : form.props.labelWidth;
9034
- return {
9035
- width: labelPosition.value !== "top" && labelWidth && labelWidth > 0 ? `${labelWidth}px` : "auto",
9036
- textAlign: labelPosition.value === "top" ? "left" : labelPosition.value
9037
- };
9040
+ return [
9041
+ {
9042
+ width: labelPosition.value !== "top" && labelWidth && labelWidth > 0 ? `${labelWidth}px` : "auto",
9043
+ textAlign: labelPosition.value === "top" ? "left" : labelPosition.value
9044
+ },
9045
+ props.labelStyle
9046
+ ];
9038
9047
  });
9039
9048
  const contentStyle = computed(() => {
9040
9049
  const labelWidth = props.labelWidth === 0 || props.labelWidth ? props.labelWidth : form.props.labelWidth;
@@ -9246,14 +9255,14 @@ const FormItem = /* @__PURE__ */ defineComponent({
9246
9255
  })];
9247
9256
  return createVNode("div", {
9248
9257
  "class": ['vc-form-item', classes.value]
9249
- }, [createVNode("div", {
9258
+ }, [(label || slots.label) && createVNode("div", {
9250
9259
  "style": labelStyle.value,
9251
- "class": "vc-form-item__label",
9260
+ "class": ['vc-form-item__label', props.labelClass],
9252
9261
  "for": labelFor
9253
9262
  }, [createVNode("label", null, [label || slots.label?.()])]), createVNode("div", {
9254
9263
  "class": "vc-form-item__wrapper"
9255
9264
  }, [createVNode("div", {
9256
- "class": "vc-form-item__content",
9265
+ "class": ['vc-form-item__content', props.contentClass],
9257
9266
  "style": contentStyle.value
9258
9267
  }, [slots.default?.(), slots.error ? slots.error({
9259
9268
  show: showError.value,
@@ -10286,10 +10295,14 @@ const props$z = {
10286
10295
  validator: (v) => /(small|medium|large)/.test(v),
10287
10296
  default: "small"
10288
10297
  },
10298
+ contentStyle: [Object, String],
10289
10299
  contentClass: [Object, String],
10290
10300
  width: {
10291
10301
  type: Number
10292
10302
  },
10303
+ height: {
10304
+ type: Number
10305
+ },
10293
10306
  mask: {
10294
10307
  type: Boolean,
10295
10308
  default: true
@@ -10381,6 +10394,9 @@ const ModalView = /* @__PURE__ */ defineComponent({
10381
10394
  const x = ref(0);
10382
10395
  const y = ref(0);
10383
10396
  const isActive = ref(false);
10397
+
10398
+ // 注: 服务端渲染为0, 在客服端激活前,展示端存在问题【高度不定】
10399
+ const MAX_HEIGHT = IS_SERVER$1 ? 0 : window.innerHeight - 20;
10384
10400
  const defaultSize = computed(() => {
10385
10401
  let width = 0;
10386
10402
  let height = 0;
@@ -10400,16 +10416,20 @@ const ModalView = /* @__PURE__ */ defineComponent({
10400
10416
  }
10401
10417
  return {
10402
10418
  width: props.width || width,
10403
- height
10419
+ height: Math.min(props.height || height, MAX_HEIGHT)
10404
10420
  };
10405
10421
  });
10406
10422
  const basicStyle = computed(() => {
10407
- return {
10423
+ const result = {
10408
10424
  width: `${defaultSize.value.width}px`,
10409
- minHeight: `${defaultSize.value.height}px`,
10410
- // 注: 服务端渲染为0, 在客服端激活前,展示端存在问题【高度不定】
10411
- maxHeight: IS_SERVER$1 ? 0 : `${window.innerHeight - 20}px`
10425
+ maxHeight: `${MAX_HEIGHT}px`
10412
10426
  };
10427
+ if (props.height) {
10428
+ result.height = `${defaultSize.value.height}px`;
10429
+ } else {
10430
+ result.minHeight = `${defaultSize.value.height}px`;
10431
+ }
10432
+ return result;
10413
10433
  });
10414
10434
  const draggableStyle = computed(() => {
10415
10435
  if (IS_SERVER$1 || !props.draggable) return {};
@@ -10532,6 +10552,7 @@ const ModalView = /* @__PURE__ */ defineComponent({
10532
10552
  * container在最大值时,需要移除,宽度才会缩回去
10533
10553
  */
10534
10554
  const handleContentResize = () => {
10555
+ if (props.height) return;
10535
10556
  const needRefreshScroller = !!scroller.value.wrapper.style.getPropertyValue('height');
10536
10557
  const needRefreshContainer = !!container.value.style.getPropertyValue('height');
10537
10558
  needRefreshContainer && container.value.style.removeProperty('height');
@@ -10677,7 +10698,8 @@ const ModalView = /* @__PURE__ */ defineComponent({
10677
10698
  "height": isTransitionEnd.value ? row.height : void 0,
10678
10699
  "contentClass": [{
10679
10700
  'is-confirm': props.mode
10680
- }, props.contentClass, 'vc-modal__content']
10701
+ }, props.contentClass, 'vc-modal__content'],
10702
+ "contentStyle": props.contentStyle
10681
10703
  }, {
10682
10704
  default: () => [typeof props.content === 'string' ? createVNode("div", {
10683
10705
  "innerHTML": props.content
@@ -11755,7 +11777,8 @@ const Select = /* @__PURE__ */ defineComponent({
11755
11777
  }, [createVNode(Spin, {
11756
11778
  "size": 16
11757
11779
  }, null)]), createVNode(Scroller, {
11758
- "class": "vc-select__options"
11780
+ "class": "vc-select__options",
11781
+ "max-height": "200px"
11759
11782
  }, {
11760
11783
  default: () => [props.data ? createVNode("div", null, [props.data.map(item => {
11761
11784
  let _slot;
@@ -15077,6 +15100,7 @@ const TableBody = /* @__PURE__ */ defineComponent({
15077
15100
  const key = getValueOfRow(row, rowIndex);
15078
15101
  const selected = table.store.isSelected(row);
15079
15102
  const height = rowHeight || rowData.height;
15103
+ const maxColumnIndex = columns.length - 1;
15080
15104
  return createVNode("div", {
15081
15105
  "key": key,
15082
15106
  "class": [getRowClass(row, rowIndex), 'vc-table__tr'],
@@ -15112,8 +15136,10 @@ const TableBody = /* @__PURE__ */ defineComponent({
15112
15136
  column,
15113
15137
  rowIndex,
15114
15138
  columnIndex,
15139
+ selected,
15115
15140
  store: table.store,
15116
- selected
15141
+ isHead: columnIndex === 0,
15142
+ isTail: columnIndex === maxColumnIndex
15117
15143
  })]);
15118
15144
  })]);
15119
15145
  };
@@ -15612,6 +15638,8 @@ const props$c = {
15612
15638
  stripe: Boolean,
15613
15639
  // 是否带有纵向边框
15614
15640
  border: Boolean,
15641
+ // 是否分割线
15642
+ divider: Boolean,
15615
15643
  // 非常影响表格虚拟滚动的性能,按容器的高度手动优化该值
15616
15644
  // 后续考虑移除,动态计算
15617
15645
  rows: {
@@ -15752,6 +15780,7 @@ const Table = /* @__PURE__ */ defineComponent({
15752
15780
  'vc-table--fit': props.fit,
15753
15781
  'vc-table--striped': props.stripe,
15754
15782
  'vc-table--border': props.border || states.isGroup,
15783
+ 'vc-table--divider': props.border || props.divider,
15755
15784
  'vc-table--group': states.isGroup,
15756
15785
  'vc-table--fluid-height': props.maxHeight,
15757
15786
  'vc-table--scrollable-x': layout.states.scrollX,
@@ -16536,10 +16565,11 @@ const defaultRenderCell = (rowData = {}) => {
16536
16565
  }
16537
16566
  const line = column.line || VcInstance.options.TableColumn?.line;
16538
16567
  if (line && value) {
16568
+ const base = rowData.isHead || rowData.isTail ? 36 : 24; // 目前gap是12
16539
16569
  const style = {
16540
16570
  // 目前左右pading为10
16541
16571
  // TODO: 含有border还要-1
16542
- width: (column.realWidth || column.width) - 20 + 'px'
16572
+ width: (column.realWidth || column.width) - base + 'px'
16543
16573
  };
16544
16574
  return createVNode(Text, {
16545
16575
  "style": style,