@vue-ui-kit/ant 2.1.0 → 2.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-ui-kit/ant",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Vue3 UI Kit based on Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -46,7 +46,7 @@
46
46
  "email": "adoin@qq.com"
47
47
  },
48
48
  "dependencies": {
49
- "e-virt-table": "^1.2.33",
49
+ "e-virt-table": "^1.2.35",
50
50
  "uuid": "^10.0.0",
51
51
  "xe-utils": "^3.7.6"
52
52
  },
@@ -166,8 +166,9 @@ export interface ToolbarConfig {
166
166
  buttons?: Array<ToolbarButtonProps>;
167
167
  tools?: Array<{
168
168
  code: string;
169
- icon: string;
169
+ icon?: string;
170
170
  type?: ButtonType;
171
+ content?: string;
171
172
  disabled?: boolean;
172
173
  size?: 'small' | 'large' | 'middle';
173
174
  }>;
@@ -516,7 +516,8 @@
516
516
  @click="debounceToolToolClick(tool.code)"
517
517
  :loading="loading.toolbar || (!!tool.code && codeLoadings[tool.code])"
518
518
  >
519
- <Icon :icon="tool.icon" />
519
+ <Icon v-if="tool.icon" :icon="tool.icon" />
520
+ {{ tool.content }}
520
521
  </a-button>
521
522
  </template>
522
523
  </span>
@@ -38,6 +38,7 @@
38
38
  const propsWithDefaults = computed(() => ({
39
39
  ...props,
40
40
  config: {
41
+ AUTO_ROW_HEIGHT: true,
41
42
  DISABLED: true, // 内部写死的默认配置
42
43
  ...canvasTableDefaults, // 全局配置
43
44
  ...props.config, // 用户传入的配置
@@ -299,6 +300,7 @@
299
300
  v-for="cell in view.cells"
300
301
  :key="`${cell.rowKey}_${cell.key}`"
301
302
  :style="cell.style"
303
+ v-bind="cell.domDataset"
302
304
  >
303
305
  <component
304
306
  v-if="typeof cell.render === 'function'"
@@ -577,7 +577,8 @@
577
577
  @click="debounceToolToolClick(tool.code)"
578
578
  :loading="loading.toolbar || (!!tool.code && codeLoadings[tool.code])"
579
579
  >
580
- <Icon :icon="tool.icon" />
580
+ <Icon v-if="tool.icon" :icon="tool.icon" />
581
+ {{ tool.content }}
581
582
  </a-button>
582
583
  </template>
583
584
  </span>
@@ -210,12 +210,20 @@ const renderBasic = (name: string) => {
210
210
  },
211
211
  };
212
212
  };
213
- type GetPopupContainer = () => HTMLElement
214
- const renderBtn = (btnOpt: BtnOptions, params: RenderTableParams, getPopupContainer?: GetPopupContainer,) =>
213
+ type GetPopupContainer = () => HTMLElement;
214
+ const renderBtn = (
215
+ btnOpt: BtnOptions,
216
+ params: RenderTableParams,
217
+ getPopupContainer?: GetPopupContainer,
218
+ ) =>
215
219
  btnOpt.dropdowns &&
216
220
  btnOpt.dropdowns.length > 0 &&
217
221
  btnOpt.dropdowns.filter((f) => !f.hiddenIf?.(params)).length > 0 ? (
218
- <Dropdown getPopupContainer={getPopupContainer ?? (() => document.querySelector('.p-wrapper') as HTMLElement)}>
222
+ <Dropdown
223
+ getPopupContainer={
224
+ getPopupContainer ?? (() => document.querySelector('.p-wrapper') as HTMLElement)
225
+ }
226
+ >
219
227
  {{
220
228
  default: () => (
221
229
  <Button
@@ -456,23 +464,26 @@ const renders: RenderFactory = {
456
464
  },
457
465
  ButtonTree: {
458
466
  renderDefault({ children = [], props = {} as Recordable }, params: RenderTableParams) {
459
- const spanRef = ref<HTMLElement | null>(null)
467
+ const spanRef = ref<HTMLElement | null>(null);
460
468
  return (
461
469
  <span ref={spanRef} class={props.noGap ? 'align-no-gap-box' : 'align-gap-box'}>
462
- {
463
- (children as BtnOptions[]).filter(f => !f.hiddenIf?.(params)).map(item =>
470
+ {(children as BtnOptions[])
471
+ .filter((f) => !f.hiddenIf?.(params))
472
+ .map((item) =>
464
473
  renderBtn(item, params, () => {
465
- return spanRef.value?.parentElement?.parentElement?.parentElement?.parentElement || document.body
474
+ return (
475
+ spanRef.value?.parentElement?.parentElement?.parentElement?.parentElement ||
476
+ document.body
477
+ );
466
478
  }),
467
- ) ?? []
468
- }
479
+ ) ?? []}
469
480
  </span>
470
- )
481
+ );
471
482
  },
472
483
  },
473
484
  $radio: {
474
485
  renderItemContent(
475
- { props = {}, events = {}, options, defaultValue }: RenderOptions,
486
+ { props = {}, events = {}, options, defaultValue }: RenderOptions,
476
487
  { data, field }: RenderFormParams,
477
488
  ) {
478
489
  if (isGoodValue(defaultValue) && valued(field) && isBadValue(data[field!])) {