@vue-ui-kit/ant 2.0.1 → 2.0.3

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/dist/style.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";:root{--p-theme-bg: #fff}.p-pane{background-color:var(--p-theme-bg);padding:16px;border-radius:4px}.w-full{width:100%}.cursor-pointer{cursor:pointer}.py-4x{padding-top:4px;padding-bottom:4px}.px-2x{padding-left:2px;padding-right:2px}.pl-4x{padding-left:1em}.pl-8{padding-left:2em}.h-0{height:0}.h-full{height:100%}.flex{display:flex}.flex-col{flex-direction:column}.flex-1{flex:1}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-4px{gap:4px}.gap-8px{gap:8px}.pt-8px{padding-top:8px}.px-16px{padding-left:16px;padding-right:16px}.mt-4px{margin-top:4px}.text-right{text-align:right}.overflow-y-auto{overflow-y:auto}.p-theme-bg{background-color:var(--p-theme-bg)}.p-wrapper .p-form-wrapper{z-index:4}.p-wrapper .p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper{border-color:#d9d9d9!important}.p-wrapper .p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus{border-color:#4096ff!important}.p-wrapper .p-error-hang-out .ant-form-item-explain-error{opacity:0!important;transform:translateY(-10px)!important;max-height:0!important;overflow:hidden!important;transition:none!important}.p-wrapper .ant-form-item-explain-error{opacity:0;transform:translateY(-10px);max-height:0;overflow:hidden;transition:opacity .3s ease-out .3s,transform .3s ease-out .3s,max-height .3s ease-out .3s}.p-wrapper .ant-form-item-has-error .ant-form-item-explain-error{opacity:1;transform:translateY(0);max-height:100px}.p-wrapper .p-toolbar-wrapper{box-shadow:0 8px #fff;border-radius:.5em .5em 0 0;margin-bottom:-.5em}.p-wrapper .ant-form .ant-form-item{margin-bottom:0}.p-wrapper .ant-form .ant-form-item.p-required .ant-form-item-label>label:before{display:inline-block;margin-inline-end:4px;color:#ff4d4f;font-size:14px;font-family:SimSun,sans-serif;line-height:1;content:"*"}.p-wrapper .ant-form .ant-form-item .ant-form-item-label{display:flex;align-items:start;justify-content:flex-end}.p-wrapper .ant-form .ant-form-item .ant-form-item-label>label{white-space:break-spaces;align-items:flex-start;height:fit-content;padding-top:.36em}.p-wrapper .ant-form .ant-form-item .ant-form-item-label>label:after{padding-left:4px;margin-inline-start:unset}.p-wrapper .ant-form.ant-form-vertical .ant-form-item .ant-form-item-label{justify-content:flex-start;font-weight:600}.p-wrapper .ant-table-sticky-scroll{visibility:hidden}.p-wrapper .ant-table-header.ant-table-sticky-holder:before{content:"";width:100%;position:absolute;height:22px;display:block;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);top:-16px}.p-wrapper .ant-table-wrapper .ant-table-pagination.ant-pagination{margin:unset;padding:16px 0}.p-wrapper .p-inner-scroll>.ant-table-wrapper{height:100%}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading{height:100%}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading>.ant-spin-container{height:100%;display:flex;flex-direction:column}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading>.ant-spin-container>.ant-table{border-radius:unset}.p-wrapper .ant-pagination-options .ant-select{width:100px}.p-error-group-tab{position:relative;overflow:visible;color:#f5222d!important}.p-error-group-tab:after{content:"🏷️";position:absolute;top:-1em;right:0;width:1em;height:1em;font-size:.8em;animation:heartbeat 2s infinite}.p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper{border-color:#d9d9d9!important}.p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus{border-color:#4096ff!important}.p-error-hang-out .ant-form-item-explain-error{display:none}.no-error-border{border-color:#d9d9d9!important}.no-error-border:focus{border-color:#4096ff!important}.p-content-align-right.ant-form-item .ant-form-item-control-input-content{display:flex;justify-content:flex-end;align-items:center;text-align:right}.p-content-align-center.ant-form-item .ant-form-item-control-input-content{display:flex;justify-content:center;align-items:center;text-align:center}@keyframes heartbeat{0%{transform:scale(1)}6%{transform:scale(1.22)}12%{transform:scale(1)}18%{transform:scale(1.18)}24%{transform:scale(1)}48%{transform:scale(1)}54%{transform:scale(1.22)}60%{transform:scale(1)}66%{transform:scale(1.18)}72%{transform:scale(1)}to{transform:scale(1)}}
1
+ @charset "UTF-8";:root{--p-theme-bg: #fff}.p-pane{background-color:var(--p-theme-bg);padding:16px;border-radius:4px}.w-full{width:100%}.cursor-pointer{cursor:pointer}.py-4x{padding-top:4px;padding-bottom:4px}.px-2x{padding-left:2px;padding-right:2px}.pl-4x{padding-left:1em}.pl-8{padding-left:2em}.h-0{height:0}.h-full{height:100%}.flex{display:flex}.flex-col{flex-direction:column}.flex-1{flex:1}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-4px{gap:4px}.gap-8px{gap:8px}.pt-8px{padding-top:8px}.px-16px{padding-left:16px;padding-right:16px}.mt-4px{margin-top:4px}.text-right{text-align:right}.overflow-y-auto{overflow-y:auto}.p-theme-bg{background-color:var(--p-theme-bg)}.p-wrapper .p-form-wrapper{z-index:4}.p-wrapper .p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper{border-color:#d9d9d9!important}.p-wrapper .p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus{border-color:#4096ff!important}.p-wrapper .p-error-hang-out .ant-form-item-explain-error{opacity:0!important;transform:translateY(-10px)!important;max-height:0!important;overflow:hidden!important;transition:none!important}.p-wrapper .ant-form-item-explain-error{opacity:0;transform:translateY(-10px);max-height:0;overflow:hidden;transition:opacity .3s ease-out .3s,transform .3s ease-out .3s,max-height .3s ease-out .3s}.p-wrapper .ant-form-item-has-error .ant-form-item-explain-error{opacity:1;transform:translateY(0);max-height:100px}.p-wrapper .p-toolbar-wrapper{box-shadow:0 8px #fff;border-radius:.5em .5em 0 0;margin-bottom:-.5em}.p-wrapper .ant-form .ant-form-item{margin-bottom:0}.p-wrapper .ant-form .ant-form-item.p-required .ant-form-item-label>label:before{display:inline-block;margin-inline-end:4px;color:#ff4d4f;font-size:14px;font-family:SimSun,sans-serif;line-height:1;content:"*"}.p-wrapper .ant-form .ant-form-item .ant-form-item-label{display:flex;align-items:start;justify-content:flex-end}.p-wrapper .ant-form .ant-form-item .ant-form-item-label>label{white-space:break-spaces;align-items:flex-start;height:fit-content;padding-top:.36em}.p-wrapper .ant-form .ant-form-item .ant-form-item-label>label:after{padding-left:4px;margin-inline-start:unset}.p-wrapper .ant-form.ant-form-vertical .ant-form-item .ant-form-item-label{justify-content:flex-start;font-weight:600}.p-wrapper .ant-table-sticky-scroll{visibility:hidden}.p-wrapper .ant-table-header.ant-table-sticky-holder:before{content:"";width:100%;position:absolute;height:22px;display:block;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);top:-16px}.p-wrapper .ant-table-wrapper .ant-table-pagination.ant-pagination{margin:unset;padding:16px 0}.p-wrapper .h-lack .ant-table-wrapper .ant-table-pagination.ant-pagination{padding:unset;margin-top:8px}.p-wrapper .p-inner-scroll>.ant-table-wrapper{height:100%}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading{height:100%}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading>.ant-spin-container{height:100%;display:flex;flex-direction:column}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading>.ant-spin-container>.ant-table{flex:1;height:0;overflow-y:hidden;border-radius:unset}.p-wrapper .p-inner-scroll>.ant-table-wrapper>.ant-spin-nested-loading>.ant-spin-container>.ant-table>.ant-table-container>.ant-table-body{position:relative}.p-wrapper .ant-pagination-options .ant-select{width:100px}.p-wrapper .ant-table-cell:not(.normal-break){word-break:break-all}.p-error-group-tab{position:relative;overflow:visible;color:#f5222d!important}.p-error-group-tab:after{content:"🏷️";position:absolute;top:-1em;right:0;width:1em;height:1em;font-size:.8em;animation:heartbeat 2s infinite}.ant-picker-dropdown .ant-picker-footer{padding-left:4px}.p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper{border-color:#d9d9d9!important}.p-error-hang-out .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus{border-color:#4096ff!important}.p-error-hang-out .ant-form-item-explain-error{display:none}.no-error-border{border-color:#d9d9d9!important}.no-error-border:focus{border-color:#4096ff!important}@media (max-width: 575px){.p-wrapper .ant-form .ant-form-item .ant-form-item-label{justify-content:flex-start}}.p-content-align-right.ant-form-item .ant-form-item-control-input-content{display:flex;justify-content:flex-end;align-items:center;text-align:right}.p-content-align-center.ant-form-item .ant-form-item-control-input-content{display:flex;justify-content:center;align-items:center;text-align:center}@keyframes heartbeat{0%{transform:scale(1)}6%{transform:scale(1.22)}12%{transform:scale(1)}18%{transform:scale(1.18)}24%{transform:scale(1)}48%{transform:scale(1)}54%{transform:scale(1.22)}60%{transform:scale(1)}66%{transform:scale(1.18)}72%{transform:scale(1)}to{transform:scale(1)}}
package/dist/style.scss CHANGED
@@ -209,7 +209,12 @@
209
209
  margin: unset;
210
210
  padding: 16px 0;
211
211
  }
212
-
212
+ .h-lack {
213
+ .ant-table-wrapper .ant-table-pagination.ant-pagination {
214
+ padding: unset;
215
+ margin-top: 8px;
216
+ }
217
+ }
213
218
  .p-inner-scroll {
214
219
  & > .ant-table-wrapper {
215
220
  height: 100%;
@@ -223,11 +228,15 @@
223
228
  flex-direction: column;
224
229
 
225
230
  & > .ant-table {
226
- //flex: 1;
227
- //height: 0;
228
- //overflow: auto;
231
+ flex: 1;
232
+ height: 0;
233
+ overflow-y: hidden;
229
234
  /*border-radius: unset; 修复模糊问题 according to https://stackoverflow.com/questions/49349337/chrome-text-blur-with-overflow-yscroll-and-fixed-height*/
230
235
  border-radius: unset;
236
+
237
+ & > .ant-table-container > .ant-table-body {
238
+ position: relative;
239
+ }
231
240
  }
232
241
  }
233
242
  }
@@ -239,6 +248,9 @@
239
248
  width: 100px;
240
249
  }
241
250
  }
251
+ .ant-table-cell:not(.normal-break) {
252
+ word-break: break-all;
253
+ }
242
254
  }
243
255
  .p-error-group-tab {
244
256
  position: relative;
@@ -255,6 +267,11 @@
255
267
  animation: heartbeat 2s infinite;
256
268
  }
257
269
  }
270
+ .ant-picker-dropdown {
271
+ .ant-picker-footer {
272
+ padding-left: 4px;
273
+ }
274
+ }
258
275
  .p-error-hang-out {
259
276
  .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
260
277
  .ant-input-affix-wrapper-borderless
@@ -269,6 +286,7 @@
269
286
  display: none;
270
287
  }
271
288
  }
289
+
272
290
  .no-error-border {
273
291
  border-color: #d9d9d9 !important;
274
292
 
@@ -276,6 +294,11 @@
276
294
  border-color: #4096ff !important;
277
295
  }
278
296
  }
297
+ @media (max-width: 575px) {
298
+ .p-wrapper .ant-form .ant-form-item .ant-form-item-label {
299
+ justify-content: flex-start;
300
+ }
301
+ }
279
302
  //endregion
280
303
 
281
304
  /* #region EVirtTable */
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.3",
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();
@@ -134,6 +135,7 @@
134
135
  },
135
136
  columns: props.columns.map((col) => parseToEVirtColumn(col)),
136
137
  data: props.data,
138
+ footerData: props.footerData,
137
139
  emptyElement: eVirtTableEmptyRef.value || undefined,
138
140
  overlayerElement: eVirtTableOverlayerRef.value || undefined,
139
141
  editorElement: eVirtTableEditorRef.value || undefined,
@@ -164,7 +166,7 @@
164
166
  editorType.value = 'text';
165
167
  });
166
168
  eVirtTable.on('selectionChange', (selection) => {
167
- console.log('selection', selection);
169
+ selectedRecords.value = selection;
168
170
  });
169
171
  emit('ready', eVirtTable);
170
172
  });
@@ -210,6 +212,7 @@
210
212
  );
211
213
  defineExpose({
212
214
  $table: eVirtTable,
215
+ selectedRecords: computed(() => selectedRecords.value),
213
216
  });
214
217
  </script>
215
218
  <template>
@@ -4,7 +4,7 @@
4
4
  name="PromisePicker"
5
5
  generic="D extends Recordable = Recordable, F extends Recordable = Recordable"
6
6
  >
7
- import { reactive, ref, computed } from 'vue';
7
+ import { reactive, ref, computed, onMounted, nextTick } from 'vue';
8
8
  import { PGridInstance, PromisePickerProps } from '#/antProxy';
9
9
  import PGrid from '@/components/PGrid.vue';
10
10
  import { $warning } from '@/hooks/useMessage';
@@ -12,6 +12,7 @@
12
12
 
13
13
  const gridEl = ref<PGridInstance<D>>();
14
14
 
15
+ const rendered = ref(false);
15
16
  const props = withDefaults(defineProps<PromisePickerProps<D, F>>(), {
16
17
  title: '数据选择',
17
18
  width: '70%',
@@ -60,18 +61,27 @@
60
61
  });
61
62
  }
62
63
  };
64
+ onMounted(() => {});
63
65
  defineExpose({
64
66
  pick: () =>
65
67
  new Promise<{ row: D; field?: string } | D[]>((resolve, reject) => {
66
68
  resolvePromise = resolve;
67
69
  rejectPromise = reject;
70
+ rendered.value = false;
68
71
  visible.modal = true;
72
+ nextTick(() => {
73
+ rendered.value = true;
74
+ });
69
75
  }),
70
76
  pickMultiple: () =>
71
77
  new Promise<{ row: D; field?: string } | D[]>((resolve, reject) => {
72
78
  multipleResolver = resolve;
73
79
  rejectPromise = reject;
80
+ rendered.value = false;
74
81
  visible.modal = true;
82
+ nextTick(() => {
83
+ rendered.value = true;
84
+ });
75
85
  }),
76
86
  grid: gridEl,
77
87
  hide: () => {
@@ -89,7 +99,9 @@
89
99
  @cancel="handleCancel"
90
100
  :body-style="bodyStyle"
91
101
  >
92
- <p-grid v-bind="gridSetting" ref="gridEl" @pick="selectRow" />
102
+ <div :style="{ minHeight: rendered ? 'unset' : '642px' }">
103
+ <p-grid v-bind="gridSetting" ref="gridEl" @pick="selectRow" />
104
+ </div>
93
105
  <template v-if="isMultiple" #footer>
94
106
  <div class="w-full text-right p-2">
95
107
  <span>
@@ -205,7 +205,12 @@
205
205
  margin: unset;
206
206
  padding: 16px 0;
207
207
  }
208
-
208
+ .h-lack {
209
+ .ant-table-wrapper .ant-table-pagination.ant-pagination {
210
+ padding: unset;
211
+ margin-top: 8px;
212
+ }
213
+ }
209
214
  .p-inner-scroll {
210
215
  & > .ant-table-wrapper {
211
216
  height: 100%;
@@ -219,11 +224,15 @@
219
224
  flex-direction: column;
220
225
 
221
226
  & > .ant-table {
222
- //flex: 1;
223
- //height: 0;
224
- //overflow: auto;
227
+ flex: 1;
228
+ height: 0;
229
+ overflow-y: hidden;
225
230
  /*border-radius: unset; 修复模糊问题 according to https://stackoverflow.com/questions/49349337/chrome-text-blur-with-overflow-yscroll-and-fixed-height*/
226
231
  border-radius: unset;
232
+
233
+ & > .ant-table-container > .ant-table-body {
234
+ position: relative;
235
+ }
227
236
  }
228
237
  }
229
238
  }
@@ -235,6 +244,9 @@
235
244
  width: 100px;
236
245
  }
237
246
  }
247
+ .ant-table-cell:not(.normal-break) {
248
+ word-break: break-all;
249
+ }
238
250
  }
239
251
  .p-error-group-tab {
240
252
  position: relative;
@@ -251,6 +263,11 @@
251
263
  animation: heartbeat 2s infinite;
252
264
  }
253
265
  }
266
+ .ant-picker-dropdown {
267
+ .ant-picker-footer {
268
+ padding-left: 4px;
269
+ }
270
+ }
254
271
  .p-error-hang-out {
255
272
  .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
256
273
  .ant-input-affix-wrapper-borderless
@@ -265,6 +282,7 @@
265
282
  display: none;
266
283
  }
267
284
  }
285
+
268
286
  .no-error-border {
269
287
  border-color: #d9d9d9 !important;
270
288
 
@@ -272,6 +290,11 @@
272
290
  border-color: #4096ff !important;
273
291
  }
274
292
  }
293
+ @media (max-width: 575px) {
294
+ .p-wrapper .ant-form .ant-form-item .ant-form-item-label {
295
+ justify-content: flex-start;
296
+ }
297
+ }
275
298
  //endregion
276
299
 
277
300
  /* #region EVirtTable */