@vue-ui-kit/ant 2.0.1 → 2.0.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.
@@ -8,6 +8,7 @@ declare const _default: <T extends Recordable = Recordable, B extends Recordable
8
8
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onChange" | "onReady"> & CanvasTableProps<T, B> & Partial<{}>> & import('vue').PublicProps;
9
9
  expose(exposed: import('vue').ShallowUnwrapRef<{
10
10
  $table: null;
11
+ selectedRecords: import('vue').ComputedRef<import('@vue/reactivity').UnwrapRefSimple<T>[]>;
11
12
  }>): void;
12
13
  attrs: any;
13
14
  slots: Partial<Record<string, (_: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-ui-kit/ant",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Vue3 UI Kit based on Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -5,6 +5,7 @@ import { FormProps } from 'ant-design-vue/lib/form/Form';
5
5
  import { TableColumnType, TableProps, TooltipProps } from 'ant-design-vue';
6
6
  import { ButtonType } from 'ant-design-vue/lib/button/buttonTypes';
7
7
  import type { ConfigType, Column as EVirtColumn } from 'e-virt-table';
8
+ import EVirtTable from 'e-virt-table';
8
9
 
9
10
  export interface CellFuncArg<D extends Recordable = Recordable> {
10
11
  row: D;
@@ -371,3 +372,7 @@ export interface PFormGroupInstance {
371
372
  validate: (index: number, ignoreTabError?: boolean) => Promise<void>;
372
373
  validateFields: (index: number, fields: string[], ignoreTabError?: boolean) => Promise<void>;
373
374
  }
375
+ export interface PCanvasTableInstance<T extends Recordable = Recordable> {
376
+ $table: InstanceType<typeof EVirtTable>;
377
+ selectedRecords: T[];
378
+ }
@@ -28,6 +28,7 @@
28
28
  const defaultConfig = {
29
29
  DISABLED: true,
30
30
  };
31
+ const selectedRecords = ref<T[]>([]);
31
32
  const props = defineProps<CanvasTableProps<T, B>>();
32
33
  let eVirtTable: EVirtTable | null = null;
33
34
  const attrs = useAttrs();
@@ -164,7 +165,7 @@
164
165
  editorType.value = 'text';
165
166
  });
166
167
  eVirtTable.on('selectionChange', (selection) => {
167
- console.log('selection', selection);
168
+ selectedRecords.value = selection;
168
169
  });
169
170
  emit('ready', eVirtTable);
170
171
  });
@@ -210,6 +211,7 @@
210
211
  );
211
212
  defineExpose({
212
213
  $table: eVirtTable,
214
+ selectedRecords: computed(() => selectedRecords.value),
213
215
  });
214
216
  </script>
215
217
  <template>
@@ -11,7 +11,15 @@
11
11
  import { Button as AButton, Modal as AModal } from 'ant-design-vue';
12
12
 
13
13
  const gridEl = ref<PGridInstance<D>>();
14
-
14
+ const defaultBodyStyle = {
15
+ minHeight: '642px',
16
+ };
17
+ const mergedBodyStyle = computed(() => {
18
+ return {
19
+ ...defaultBodyStyle,
20
+ ...props.bodyStyle,
21
+ };
22
+ });
15
23
  const props = withDefaults(defineProps<PromisePickerProps<D, F>>(), {
16
24
  title: '数据选择',
17
25
  width: '70%',
@@ -87,7 +95,7 @@
87
95
  :width="width"
88
96
  :footer="isMultiple ? undefined : null"
89
97
  @cancel="handleCancel"
90
- :body-style="bodyStyle"
98
+ :body-style="mergedBodyStyle"
91
99
  >
92
100
  <p-grid v-bind="gridSetting" ref="gridEl" @pick="selectRow" />
93
101
  <template v-if="isMultiple" #footer>