orion-design 0.1.30 → 0.1.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. package/dist/components/Form/hooks/index.js +14 -11
  2. package/dist/components/Form/hooks/index.js.map +1 -1
  3. package/dist/components/LovTable/LovPagetable.vue.d.ts +492 -0
  4. package/dist/components/LovTable/index.d.ts +246 -0
  5. package/dist/components/LovTable/index.js +2 -1
  6. package/dist/components/LovTable/index.js.map +1 -1
  7. package/dist/components/Modal/index.js.map +1 -1
  8. package/dist/components/Modal/types.d.ts +1 -1
  9. package/dist/components/Modal/types.js.map +1 -1
  10. package/dist/components/Pagetable/Pagetable.d.ts +92 -1
  11. package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +13 -0
  12. package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +13 -0
  13. package/dist/components/Pagetable/columns/PagetableColumnLink.d.ts +13 -0
  14. package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +13 -0
  15. package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +13 -0
  16. package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +13 -0
  17. package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +13 -0
  18. package/dist/components/Pagetable/hooks/useColumns.js +20 -15
  19. package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
  20. package/dist/components/Pagetable/index.d.ts +155 -0
  21. package/dist/components/Pagetable/index.js +509 -451
  22. package/dist/components/Pagetable/index.js.map +1 -1
  23. package/dist/version/version.d.ts +1 -1
  24. package/dist/version/version.js +1 -1
  25. package/dist/version/version.js.map +1 -1
  26. package/package.json +1 -1
@@ -174,6 +174,10 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
174
174
  total?: number;
175
175
  };
176
176
  };
177
+ paginationTeleported: {
178
+ type: BooleanConstructor;
179
+ default: boolean;
180
+ };
177
181
  showRowNumber: {
178
182
  type: BooleanConstructor;
179
183
  default: boolean;
@@ -190,6 +194,66 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
190
194
  type: import('vue').PropType<"" | "small" | "default" | "large">;
191
195
  default: "" | "small" | "default" | "large";
192
196
  };
197
+ rowClassName: {
198
+ type: import('vue').PropType<string | ((data: {
199
+ rowData: any;
200
+ rowIndex: number;
201
+ }) => string)>;
202
+ default: string | ((data: {
203
+ rowData: any;
204
+ rowIndex: number;
205
+ }) => string);
206
+ };
207
+ rowStyle: {
208
+ type: import('vue').PropType<import('vue').CSSProperties | ((data: {
209
+ rowData: any;
210
+ rowIndex: number;
211
+ }) => import('vue').CSSProperties)>;
212
+ default: import('vue').CSSProperties | ((data: {
213
+ rowData: any;
214
+ rowIndex: number;
215
+ }) => import('vue').CSSProperties);
216
+ };
217
+ cellClassName: {
218
+ type: import('vue').PropType<string | ((data: {
219
+ rowData: any;
220
+ column: {
221
+ name: string;
222
+ head: string;
223
+ };
224
+ rowIndex: number;
225
+ columnIndex: number;
226
+ }) => string)>;
227
+ default: string | ((data: {
228
+ rowData: any;
229
+ column: {
230
+ name: string;
231
+ head: string;
232
+ };
233
+ rowIndex: number;
234
+ columnIndex: number;
235
+ }) => string);
236
+ };
237
+ cellStyle: {
238
+ type: import('vue').PropType<import('vue').CSSProperties | ((data: {
239
+ rowData: any;
240
+ column: {
241
+ name: string;
242
+ head: string;
243
+ };
244
+ rowIndex: number;
245
+ columnIndex: number;
246
+ }) => import('vue').CSSProperties)>;
247
+ default: import('vue').CSSProperties | ((data: {
248
+ rowData: any;
249
+ column: {
250
+ name: string;
251
+ head: string;
252
+ };
253
+ rowIndex: number;
254
+ columnIndex: number;
255
+ }) => import('vue').CSSProperties);
256
+ };
193
257
  }>> & Readonly<{
194
258
  onSelectionChange?: ((...args: any[]) => any) | undefined;
195
259
  onCurrentRowChange?: ((...args: any[]) => any) | undefined;
@@ -221,6 +285,10 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
221
285
  total?: number;
222
286
  };
223
287
  };
288
+ paginationTeleported: {
289
+ type: BooleanConstructor;
290
+ default: boolean;
291
+ };
224
292
  showRowNumber: {
225
293
  type: BooleanConstructor;
226
294
  default: boolean;
@@ -237,6 +305,66 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
237
305
  type: import('vue').PropType<"" | "small" | "default" | "large">;
238
306
  default: "" | "small" | "default" | "large";
239
307
  };
308
+ rowClassName: {
309
+ type: import('vue').PropType<string | ((data: {
310
+ rowData: any;
311
+ rowIndex: number;
312
+ }) => string)>;
313
+ default: string | ((data: {
314
+ rowData: any;
315
+ rowIndex: number;
316
+ }) => string);
317
+ };
318
+ rowStyle: {
319
+ type: import('vue').PropType<import('vue').CSSProperties | ((data: {
320
+ rowData: any;
321
+ rowIndex: number;
322
+ }) => import('vue').CSSProperties)>;
323
+ default: import('vue').CSSProperties | ((data: {
324
+ rowData: any;
325
+ rowIndex: number;
326
+ }) => import('vue').CSSProperties);
327
+ };
328
+ cellClassName: {
329
+ type: import('vue').PropType<string | ((data: {
330
+ rowData: any;
331
+ column: {
332
+ name: string;
333
+ head: string;
334
+ };
335
+ rowIndex: number;
336
+ columnIndex: number;
337
+ }) => string)>;
338
+ default: string | ((data: {
339
+ rowData: any;
340
+ column: {
341
+ name: string;
342
+ head: string;
343
+ };
344
+ rowIndex: number;
345
+ columnIndex: number;
346
+ }) => string);
347
+ };
348
+ cellStyle: {
349
+ type: import('vue').PropType<import('vue').CSSProperties | ((data: {
350
+ rowData: any;
351
+ column: {
352
+ name: string;
353
+ head: string;
354
+ };
355
+ rowIndex: number;
356
+ columnIndex: number;
357
+ }) => import('vue').CSSProperties)>;
358
+ default: import('vue').CSSProperties | ((data: {
359
+ rowData: any;
360
+ column: {
361
+ name: string;
362
+ head: string;
363
+ };
364
+ rowIndex: number;
365
+ columnIndex: number;
366
+ }) => import('vue').CSSProperties);
367
+ };
240
368
  }>> & Readonly<{
241
369
  onSelectionChange?: ((...args: any[]) => any) | undefined;
242
370
  onCurrentRowChange?: ((...args: any[]) => any) | undefined;
@@ -255,9 +383,36 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
255
383
  total?: number;
256
384
  };
257
385
  tailData: Record<string, any>;
386
+ paginationTeleported: boolean;
258
387
  showRowNumber: boolean;
259
388
  selectionMode: boolean;
260
389
  currentRowMode: boolean;
390
+ rowClassName: string | ((data: {
391
+ rowData: any;
392
+ rowIndex: number;
393
+ }) => string);
394
+ rowStyle: import('vue').CSSProperties | ((data: {
395
+ rowData: any;
396
+ rowIndex: number;
397
+ }) => import('vue').CSSProperties);
398
+ cellClassName: string | ((data: {
399
+ rowData: any;
400
+ column: {
401
+ name: string;
402
+ head: string;
403
+ };
404
+ rowIndex: number;
405
+ columnIndex: number;
406
+ }) => string);
407
+ cellStyle: import('vue').CSSProperties | ((data: {
408
+ rowData: any;
409
+ column: {
410
+ name: string;
411
+ head: string;
412
+ };
413
+ rowIndex: number;
414
+ columnIndex: number;
415
+ }) => import('vue').CSSProperties);
261
416
  }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
262
417
  P: {};
263
418
  B: {};
@@ -288,6 +443,10 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
288
443
  total?: number;
289
444
  };
290
445
  };
446
+ paginationTeleported: {
447
+ type: BooleanConstructor;
448
+ default: boolean;
449
+ };
291
450
  showRowNumber: {
292
451
  type: BooleanConstructor;
293
452
  default: boolean;
@@ -304,6 +463,66 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
304
463
  type: import('vue').PropType<"" | "small" | "default" | "large">;
305
464
  default: "" | "small" | "default" | "large";
306
465
  };
466
+ rowClassName: {
467
+ type: import('vue').PropType<string | ((data: {
468
+ rowData: any;
469
+ rowIndex: number;
470
+ }) => string)>;
471
+ default: string | ((data: {
472
+ rowData: any;
473
+ rowIndex: number;
474
+ }) => string);
475
+ };
476
+ rowStyle: {
477
+ type: import('vue').PropType<import('vue').CSSProperties | ((data: {
478
+ rowData: any;
479
+ rowIndex: number;
480
+ }) => import('vue').CSSProperties)>;
481
+ default: import('vue').CSSProperties | ((data: {
482
+ rowData: any;
483
+ rowIndex: number;
484
+ }) => import('vue').CSSProperties);
485
+ };
486
+ cellClassName: {
487
+ type: import('vue').PropType<string | ((data: {
488
+ rowData: any;
489
+ column: {
490
+ name: string;
491
+ head: string;
492
+ };
493
+ rowIndex: number;
494
+ columnIndex: number;
495
+ }) => string)>;
496
+ default: string | ((data: {
497
+ rowData: any;
498
+ column: {
499
+ name: string;
500
+ head: string;
501
+ };
502
+ rowIndex: number;
503
+ columnIndex: number;
504
+ }) => string);
505
+ };
506
+ cellStyle: {
507
+ type: import('vue').PropType<import('vue').CSSProperties | ((data: {
508
+ rowData: any;
509
+ column: {
510
+ name: string;
511
+ head: string;
512
+ };
513
+ rowIndex: number;
514
+ columnIndex: number;
515
+ }) => import('vue').CSSProperties)>;
516
+ default: import('vue').CSSProperties | ((data: {
517
+ rowData: any;
518
+ column: {
519
+ name: string;
520
+ head: string;
521
+ };
522
+ rowIndex: number;
523
+ columnIndex: number;
524
+ }) => import('vue').CSSProperties);
525
+ };
307
526
  }>> & Readonly<{
308
527
  onSelectionChange?: ((...args: any[]) => any) | undefined;
309
528
  onCurrentRowChange?: ((...args: any[]) => any) | undefined;
@@ -322,9 +541,36 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
322
541
  total?: number;
323
542
  };
324
543
  tailData: Record<string, any>;
544
+ paginationTeleported: boolean;
325
545
  showRowNumber: boolean;
326
546
  selectionMode: boolean;
327
547
  currentRowMode: boolean;
548
+ rowClassName: string | ((data: {
549
+ rowData: any;
550
+ rowIndex: number;
551
+ }) => string);
552
+ rowStyle: import('vue').CSSProperties | ((data: {
553
+ rowData: any;
554
+ rowIndex: number;
555
+ }) => import('vue').CSSProperties);
556
+ cellClassName: string | ((data: {
557
+ rowData: any;
558
+ column: {
559
+ name: string;
560
+ head: string;
561
+ };
562
+ rowIndex: number;
563
+ columnIndex: number;
564
+ }) => string);
565
+ cellStyle: import('vue').CSSProperties | ((data: {
566
+ rowData: any;
567
+ column: {
568
+ name: string;
569
+ head: string;
570
+ };
571
+ rowIndex: number;
572
+ columnIndex: number;
573
+ }) => import('vue').CSSProperties);
328
574
  }> | null;
329
575
  }, any, import('vue').ComponentProvideOptions, {
330
576
  P: {};
@@ -116,7 +116,8 @@ const B = /* @__PURE__ */ A({
116
116
  onCurrentRowChange: b,
117
117
  pagination: t.pagination,
118
118
  "onUpdate:pagination": s,
119
- size: "small"
119
+ size: "small",
120
+ "pagination-teleported": !1
120
121
  }, {
121
122
  default: S(() => [
122
123
  z(t.$slots, "default")
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/LovTable/LovQuerytable.vue","../../../src/components/LovTable/LovPagetable.vue","../../../src/components/LovTable/index.ts"],"sourcesContent":["<template>\r\n <querytable ref=\"table\" :data=\"data\" @row-click=\"onRowClick\" current-row-mode @current-row-change=\"handleCurrentRowChange\" size=\"small\">\r\n <slot></slot>\r\n </querytable>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport { ref, useTemplateRef, watch } from 'vue'\r\nimport Querytable from '../Querytable'\r\nimport { useLov } from '../Form'\r\nimport { findIndex } from 'lodash-es'\r\n\r\ndefineOptions({ name: 'OLovQuerytable', inheritAttrs: true })\r\n\r\nconst { data } = defineProps<{ data: any[] }>()\r\nconst tableRef = useTemplateRef('table')\r\nconst currentRowIndex = ref()\r\nconst currentRowData = ref()\r\n\r\nconst lov = useLov()\r\nlov?.registerKeydownHandler((code) => {\r\n if (code == 'ArrowUp') {\r\n let nextRow: any\r\n if (currentRowIndex.value == 0) {\r\n nextRow = data[data.length - 1]\r\n } else {\r\n nextRow = data[currentRowIndex.value - 1]\r\n }\r\n //@ts-ignore\r\n tableRef.value.setCurrentRow(nextRow)\r\n scrollToRow(currentRowIndex.value)\r\n } else if (code == 'ArrowDown') {\r\n let nextRow: any\r\n if (currentRowIndex.value == data.length - 1) {\r\n nextRow = data[0]\r\n } else {\r\n nextRow = data[currentRowIndex.value + 1]\r\n }\r\n //@ts-ignore\r\n tableRef.value.setCurrentRow(nextRow)\r\n scrollToRow(currentRowIndex.value)\r\n } else if (code == 'Enter') {\r\n currentRowData.value && lov?.backfill(currentRowData.value)\r\n }\r\n})\r\n\r\nconst scrollToRow = (index: number) => {\r\n const $table = tableRef.value?.$el\r\n const $row = $table.querySelectorAll('.el-table__row')[index]\r\n $row.scrollIntoViewIfNeeded()\r\n}\r\n\r\nconst onRowClick = (row: any) => {\r\n lov?.backfill(row)\r\n}\r\n\r\nconst handleCurrentRowChange = (row: any) => {\r\n const index = findIndex(data, row)\r\n if (index == -1) {\r\n currentRowIndex.value = 0\r\n currentRowData.value = data[0]\r\n } else {\r\n currentRowIndex.value = index\r\n currentRowData.value = row\r\n }\r\n}\r\n\r\nwatch(\r\n () => data,\r\n () => {\r\n if (data.length > 0) {\r\n //@ts-ignore\r\n tableRef.value.setCurrentRow(data[0])\r\n }\r\n }\r\n)\r\n</script>\r\n","<template>\r\n <pagetable\r\n ref=\"table\"\r\n :data=\"data\"\r\n @row-click=\"onRowClick\"\r\n current-row-mode\r\n @current-row-change=\"handleCurrentRowChange\"\r\n :pagination=\"pagination\"\r\n @update:pagination=\"onUpdatePagination\"\r\n size=\"small\"\r\n >\r\n <slot></slot>\r\n </pagetable>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport Pagetable from '../Pagetable'\r\nimport { useLov } from '../Form'\r\nimport { ref, useTemplateRef, watch } from 'vue'\r\nimport { findIndex } from 'lodash-es'\r\n\r\ndefineOptions({ name: 'OLovPagetable', inheritAttrs: true })\r\n\r\nconst { data, pagination } = defineProps<{\r\n data: any[]\r\n pagination: {\r\n currentPage?: number\r\n pageSize?: number\r\n total?: number\r\n }\r\n}>()\r\n\r\nconst emits = defineEmits(['update:pagination'])\r\nconst onUpdatePagination = (data: any) => {\r\n emits('update:pagination', data)\r\n}\r\n\r\nconst tableRef = useTemplateRef('table')\r\nconst currentRowIndex = ref()\r\nconst currentRowData = ref()\r\n\r\nconst lov = useLov()\r\nlov?.registerKeydownHandler((code) => {\r\n if (code == 'ArrowUp') {\r\n let nextRow: any\r\n if (currentRowIndex.value == 0) {\r\n nextRow = data[data.length - 1]\r\n } else {\r\n nextRow = data[currentRowIndex.value - 1]\r\n }\r\n //@ts-ignore\r\n tableRef.value.setCurrentRow(nextRow)\r\n scrollToRow(currentRowIndex.value)\r\n } else if (code == 'ArrowDown') {\r\n let nextRow: any\r\n if (currentRowIndex.value == data.length - 1) {\r\n nextRow = data[0]\r\n } else {\r\n nextRow = data[currentRowIndex.value + 1]\r\n }\r\n //@ts-ignore\r\n tableRef.value.setCurrentRow(nextRow)\r\n scrollToRow(currentRowIndex.value)\r\n } else if (code == 'Enter') {\r\n currentRowData.value && lov?.backfill(currentRowData.value)\r\n } else if (code == 'ArrowLeft') {\r\n const currentPage = pagination?.currentPage\r\n const pageSize = pagination?.pageSize\r\n const total = pagination?.total\r\n if (!currentPage || !pageSize || !total) {\r\n return\r\n }\r\n if (currentPage > 1) {\r\n emits('update:pagination', {\r\n ...pagination,\r\n currentPage: currentPage - 1,\r\n })\r\n }\r\n } else if (code == 'ArrowRight') {\r\n const currentPage = pagination?.currentPage\r\n const pageSize = pagination?.pageSize\r\n const total = pagination?.total\r\n if (!currentPage || !pageSize || !total) {\r\n return\r\n }\r\n const totalPage = Math.ceil(total / pageSize)\r\n if (currentPage < totalPage) {\r\n emits('update:pagination', {\r\n ...pagination,\r\n currentPage: currentPage + 1,\r\n })\r\n }\r\n }\r\n})\r\n\r\nconst scrollToRow = (index: number) => {\r\n const $table = tableRef.value?.$el\r\n const $row = $table.querySelectorAll('.el-table__row')[index]\r\n $row.scrollIntoViewIfNeeded()\r\n}\r\n\r\nconst onRowClick = (row: any) => {\r\n lov?.backfill(row)\r\n}\r\n\r\nconst handleCurrentRowChange = (row: any) => {\r\n const index = findIndex(data, row)\r\n if (index == -1) {\r\n currentRowIndex.value = 0\r\n currentRowData.value = data[0]\r\n } else {\r\n currentRowIndex.value = index\r\n currentRowData.value = row\r\n }\r\n}\r\n\r\nwatch(\r\n () => data,\r\n () => {\r\n if (data.length > 0) {\r\n //@ts-ignore\r\n tableRef.value.setCurrentRow(data[0])\r\n }\r\n }\r\n)\r\n</script>\r\n","import { withInstall } from '../_util'\r\n\r\nimport LovQuerytable from './LovQuerytable.vue'\r\nimport LovPagetable from './LovPagetable.vue'\r\n\r\nexport default withInstall(\r\n {},\r\n {\r\n LovQuerytable,\r\n LovPagetable,\r\n }\r\n)\r\n"],"names":["tableRef","useTemplateRef","currentRowIndex","ref","currentRowData","lov","useLov","code","nextRow","__props","scrollToRow","index","_a","onRowClick","row","handleCurrentRowChange","findIndex","watch","emits","__emit","onUpdatePagination","data","currentPage","pageSize","_b","total","_c","_d","_e","_f","totalPage","withInstall","LovQuerytable","LovPagetable"],"mappings":";;;;;;;;;;;;;;;;AAcM,UAAAA,IAAWC,EAAe,OAAO,GACjCC,IAAkBC,KAClBC,IAAiBD,KAEjBE,IAAMC;AACP,IAAAD,KAAA,QAAAA,EAAA,uBAAuB,CAACE,MAAS;AACpC,UAAIA,KAAQ,WAAW;AACjB,YAAAC;AACA,QAAAN,EAAgB,SAAS,IAC3BM,IAAUC,EAAI,KAACA,EAAI,KAAC,SAAS,CAAC,IAE9BD,IAAUC,OAAKP,EAAgB,QAAQ,CAAC,GAGjCF,EAAA,MAAM,cAAcQ,CAAO,GACpCE,EAAYR,EAAgB,KAAK;AAAA,MAAA,WACxBK,KAAQ,aAAa;AAC1B,YAAAC;AACJ,QAAIN,EAAgB,SAASO,EAAI,KAAC,SAAS,IAC/BD,IAAAC,OAAK,CAAC,IAEhBD,IAAUC,OAAKP,EAAgB,QAAQ,CAAC,GAGjCF,EAAA,MAAM,cAAcQ,CAAO,GACpCE,EAAYR,EAAgB,KAAK;AAAA,MAAA,MACnC,CAAWK,KAAQ,WACjBH,EAAe,UAASC,KAAA,QAAAA,EAAK,SAASD,EAAe;AAAA,IACvD;AAGI,UAAAM,IAAc,CAACC,MAAkB;;AAGrC,QAFe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,MAE7BP,EAAgB,QAAQS,GACxBP,EAAe,QAAQU;AAAA,IACzB;AAGF,WAAAG;AAAA,MACE,MAAMR,EAAI;AAAA,MACV,MAAM;AACA,QAAAA,EAAI,KAAC,SAAS,KAEhBT,EAAS,MAAM,cAAcS,EAAA,KAAK,CAAC,CAAC;AAAA,MAExC;AAAA,IAAA;;;;;;;;;;;;;;;;ICrHFE,IAAeoB;AAAA,EACb,CAAC;AAAA,EACD;AAAA,IAAA,eACEC;AAAAA,IAAA,cACAC;AAAAA,EACF;AACF;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/LovTable/LovQuerytable.vue","../../../src/components/LovTable/LovPagetable.vue","../../../src/components/LovTable/index.ts"],"sourcesContent":["<template>\r\n <querytable ref=\"table\" :data=\"data\" @row-click=\"onRowClick\" current-row-mode\r\n @current-row-change=\"handleCurrentRowChange\" size=\"small\">\r\n <slot></slot>\r\n </querytable>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport { ref, useTemplateRef, watch } from 'vue'\r\nimport Querytable from '../Querytable'\r\nimport { useLov } from '../Form'\r\nimport { findIndex } from 'lodash-es'\r\n\r\ndefineOptions({ name: 'OLovQuerytable', inheritAttrs: true })\r\n\r\nconst { data } = defineProps<{ data: any[] }>()\r\nconst tableRef = useTemplateRef('table')\r\nconst currentRowIndex = ref()\r\nconst currentRowData = ref()\r\n\r\nconst lov = useLov()\r\nlov?.registerKeydownHandler((code) => {\r\n if (code == 'ArrowUp') {\r\n let nextRow: any\r\n if (currentRowIndex.value == 0) {\r\n nextRow = data[data.length - 1]\r\n } else {\r\n nextRow = data[currentRowIndex.value - 1]\r\n }\r\n //@ts-ignore\r\n tableRef.value.setCurrentRow(nextRow)\r\n scrollToRow(currentRowIndex.value)\r\n } else if (code == 'ArrowDown') {\r\n let nextRow: any\r\n if (currentRowIndex.value == data.length - 1) {\r\n nextRow = data[0]\r\n } else {\r\n nextRow = data[currentRowIndex.value + 1]\r\n }\r\n //@ts-ignore\r\n tableRef.value.setCurrentRow(nextRow)\r\n scrollToRow(currentRowIndex.value)\r\n } else if (code == 'Enter') {\r\n currentRowData.value && lov?.backfill(currentRowData.value)\r\n }\r\n})\r\n\r\nconst scrollToRow = (index: number) => {\r\n const $table = tableRef.value?.$el\r\n const $row = $table.querySelectorAll('.el-table__row')[index]\r\n $row.scrollIntoViewIfNeeded()\r\n}\r\n\r\nconst onRowClick = (row: any) => {\r\n lov?.backfill(row)\r\n}\r\n\r\nconst handleCurrentRowChange = (row: any) => {\r\n const index = findIndex(data, row)\r\n if (index == -1) {\r\n currentRowIndex.value = 0\r\n currentRowData.value = data[0]\r\n } else {\r\n currentRowIndex.value = index\r\n currentRowData.value = row\r\n }\r\n}\r\n\r\nwatch(\r\n () => data,\r\n () => {\r\n if (data.length > 0) {\r\n //@ts-ignore\r\n tableRef.value.setCurrentRow(data[0])\r\n }\r\n }\r\n)\r\n</script>\r\n","<template>\r\n <pagetable ref=\"table\" :data=\"data\" @row-click=\"onRowClick\" current-row-mode\r\n @current-row-change=\"handleCurrentRowChange\" :pagination=\"pagination\" @update:pagination=\"onUpdatePagination\"\r\n size=\"small\" :pagination-teleported=\"false\">\r\n <slot></slot>\r\n </pagetable>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport Pagetable from '../Pagetable'\r\nimport { useLov } from '../Form'\r\nimport { ref, useTemplateRef, watch } from 'vue'\r\nimport { findIndex } from 'lodash-es'\r\n\r\ndefineOptions({ name: 'OLovPagetable', inheritAttrs: true })\r\n\r\nconst { data, pagination } = defineProps<{\r\n data: any[]\r\n pagination: {\r\n currentPage?: number\r\n pageSize?: number\r\n total?: number\r\n }\r\n}>()\r\n\r\nconst emits = defineEmits(['update:pagination'])\r\nconst onUpdatePagination = (data: any) => {\r\n emits('update:pagination', data)\r\n}\r\n\r\nconst tableRef = useTemplateRef('table')\r\nconst currentRowIndex = ref()\r\nconst currentRowData = ref()\r\n\r\nconst lov = useLov()\r\nlov?.registerKeydownHandler((code) => {\r\n if (code == 'ArrowUp') {\r\n let nextRow: any\r\n if (currentRowIndex.value == 0) {\r\n nextRow = data[data.length - 1]\r\n } else {\r\n nextRow = data[currentRowIndex.value - 1]\r\n }\r\n //@ts-ignore\r\n tableRef.value.setCurrentRow(nextRow)\r\n scrollToRow(currentRowIndex.value)\r\n } else if (code == 'ArrowDown') {\r\n let nextRow: any\r\n if (currentRowIndex.value == data.length - 1) {\r\n nextRow = data[0]\r\n } else {\r\n nextRow = data[currentRowIndex.value + 1]\r\n }\r\n //@ts-ignore\r\n tableRef.value.setCurrentRow(nextRow)\r\n scrollToRow(currentRowIndex.value)\r\n } else if (code == 'Enter') {\r\n currentRowData.value && lov?.backfill(currentRowData.value)\r\n } else if (code == 'ArrowLeft') {\r\n const currentPage = pagination?.currentPage\r\n const pageSize = pagination?.pageSize\r\n const total = pagination?.total\r\n if (!currentPage || !pageSize || !total) {\r\n return\r\n }\r\n if (currentPage > 1) {\r\n emits('update:pagination', {\r\n ...pagination,\r\n currentPage: currentPage - 1,\r\n })\r\n }\r\n } else if (code == 'ArrowRight') {\r\n const currentPage = pagination?.currentPage\r\n const pageSize = pagination?.pageSize\r\n const total = pagination?.total\r\n if (!currentPage || !pageSize || !total) {\r\n return\r\n }\r\n const totalPage = Math.ceil(total / pageSize)\r\n if (currentPage < totalPage) {\r\n emits('update:pagination', {\r\n ...pagination,\r\n currentPage: currentPage + 1,\r\n })\r\n }\r\n }\r\n})\r\n\r\nconst scrollToRow = (index: number) => {\r\n const $table = tableRef.value?.$el\r\n const $row = $table.querySelectorAll('.el-table__row')[index]\r\n $row.scrollIntoViewIfNeeded()\r\n}\r\n\r\nconst onRowClick = (row: any) => {\r\n lov?.backfill(row)\r\n}\r\n\r\nconst handleCurrentRowChange = (row: any) => {\r\n const index = findIndex(data, row)\r\n if (index == -1) {\r\n currentRowIndex.value = 0\r\n currentRowData.value = data[0]\r\n } else {\r\n currentRowIndex.value = index\r\n currentRowData.value = row\r\n }\r\n}\r\n\r\nwatch(\r\n () => data,\r\n () => {\r\n if (data.length > 0) {\r\n //@ts-ignore\r\n tableRef.value.setCurrentRow(data[0])\r\n }\r\n }\r\n)\r\n</script>\r\n","import { withInstall } from '../_util'\r\n\r\nimport LovQuerytable from './LovQuerytable.vue'\r\nimport LovPagetable from './LovPagetable.vue'\r\n\r\nexport default withInstall(\r\n {},\r\n {\r\n LovQuerytable,\r\n LovPagetable,\r\n }\r\n)\r\n"],"names":["tableRef","useTemplateRef","currentRowIndex","ref","currentRowData","lov","useLov","code","nextRow","__props","scrollToRow","index","_a","onRowClick","row","handleCurrentRowChange","findIndex","watch","emits","__emit","onUpdatePagination","data","currentPage","pageSize","_b","total","_c","_d","_e","_f","totalPage","withInstall","LovQuerytable","LovPagetable"],"mappings":";;;;;;;;;;;;;;;;AAeM,UAAAA,IAAWC,EAAe,OAAO,GACjCC,IAAkBC,KAClBC,IAAiBD,KAEjBE,IAAMC;AACP,IAAAD,KAAA,QAAAA,EAAA,uBAAuB,CAACE,MAAS;AACpC,UAAIA,KAAQ,WAAW;AACjB,YAAAC;AACA,QAAAN,EAAgB,SAAS,IAC3BM,IAAUC,EAAI,KAACA,EAAI,KAAC,SAAS,CAAC,IAE9BD,IAAUC,OAAKP,EAAgB,QAAQ,CAAC,GAGjCF,EAAA,MAAM,cAAcQ,CAAO,GACpCE,EAAYR,EAAgB,KAAK;AAAA,MAAA,WACxBK,KAAQ,aAAa;AAC1B,YAAAC;AACJ,QAAIN,EAAgB,SAASO,EAAI,KAAC,SAAS,IAC/BD,IAAAC,OAAK,CAAC,IAEhBD,IAAUC,OAAKP,EAAgB,QAAQ,CAAC,GAGjCF,EAAA,MAAM,cAAcQ,CAAO,GACpCE,EAAYR,EAAgB,KAAK;AAAA,MAAA,MACnC,CAAWK,KAAQ,WACjBH,EAAe,UAASC,KAAA,QAAAA,EAAK,SAASD,EAAe;AAAA,IACvD;AAGI,UAAAM,IAAc,CAACC,MAAkB;;AAGrC,QAFeC,IAAAZ,EAAS,UAAT,gBAAAY,EA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e,QAAQU;AAAA,IACzB;AAGF,WAAAG;AAAA,MACE,MAAMR,EAAI;AAAA,MACV,MAAM;AACA,QAAAA,EAAI,KAAC,SAAS,KAEhBT,EAAS,MAAM,cAAcS,EAAA,KAAK,CAAC,CAAC;AAAA,MAExC;AAAA,IAAA;;;;;;;;;;;;;;;;;IC9GFE,IAAeoB;AAAA,EACb,CAAC;AAAA,EACD;AAAA,IAAA,eACEC;AAAAA,IAAA,cACAC;AAAAA,EACF;AACF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Modal/Modal.tsx","../../../src/components/Modal/ModalLocator.vue","../../../src/components/Modal/index.ts"],"sourcesContent":["import { defineComponent, inject, provide, ref, shallowRef } from 'vue'\r\nimport { ElDialog } from 'element-plus'\r\nimport { addUnit } from '../_util'\r\nimport { modalContextKey, modalLocatorContextKey, ModalOptions } from './types'\r\n\r\nconst Modal = defineComponent({\r\n name: 'OModal',\r\n setup(props, { slots, attrs, emit, expose }) {\r\n const modalLocator = inject(modalLocatorContextKey)\r\n\r\n const show = ref(false)\r\n const title = ref<string>()\r\n const content = shallowRef()\r\n const contentProps = ref<Record<string, any>>()\r\n const width = ref<number | string>()\r\n const height = ref<number | string>()\r\n const __resolve = ref<(value: Record<string, any> | PromiseLike<Record<string, any>>) => void>()\r\n const showClose = ref(true)\r\n const appendTo = ref<string | HTMLElement>()\r\n\r\n const _open: (options: ModalOptions) => Promise<Record<string, any>> = async (options) => {\r\n show.value = true\r\n title.value = options.title\r\n content.value = options.content\r\n if (options.contentProps) {\r\n contentProps.value = options.contentProps\r\n } else {\r\n contentProps.value = {}\r\n }\r\n if (options.width) {\r\n width.value = options.width\r\n }\r\n if (options.height) {\r\n height.value = addUnit(options.height)\r\n }\r\n if (options.showClose != undefined && options.showClose == false) {\r\n showClose.value = false\r\n }\r\n if (options.locator) {\r\n appendTo.value = options.locator\r\n } else {\r\n if (modalLocator && modalLocator.locator.value) {\r\n appendTo.value = modalLocator.locator.value\r\n }\r\n }\r\n\r\n const promise = new Promise<Record<string, any>>((resolve, reject) => {\r\n __resolve.value = resolve\r\n })\r\n\r\n return promise\r\n }\r\n expose({\r\n open: _open,\r\n })\r\n\r\n const _close: (options: Record<string, any>) => void = (options) => {\r\n const resolve = __resolve.value\r\n\r\n show.value = false\r\n title.value = undefined\r\n content.value = undefined\r\n contentProps.value = undefined\r\n width.value = undefined\r\n height.value = undefined\r\n __resolve.value = undefined\r\n showClose.value = true\r\n appendTo.value = undefined\r\n\r\n resolve && resolve(options)\r\n }\r\n provide(modalContextKey, { close: _close })\r\n\r\n return () => {\r\n const Children = content.value\r\n return show.value ? (\r\n <ElDialog\r\n title={title.value}\r\n width={width.value}\r\n modelValue={show.value}\r\n beforeClose={_close}\r\n draggable={true}\r\n closeOnClickModal={false}\r\n closeOnPressEscape={false}\r\n showClose={showClose.value}\r\n alignCenter={true}\r\n style={{ height: height.value }}\r\n appendTo={appendTo.value}\r\n >\r\n <Children {...contentProps.value}></Children>\r\n </ElDialog>\r\n ) : (\r\n <></>\r\n )\r\n }\r\n },\r\n})\r\n\r\nexport default Modal\r\n","<template>\r\n <div ref=\"modal-locator\" class=\"orion-modal-locator\"><slot></slot></div>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport { provide, useTemplateRef } from 'vue'\r\nimport { modalLocatorContextKey } from './types'\r\n\r\ndefineOptions({ name: 'OModalLocator', inheritAttrs: true })\r\nconst locator = useTemplateRef('modal-locator')\r\n\r\nprovide(modalLocatorContextKey, {\r\n locator,\r\n})\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.orion-modal-locator {\r\n width: 100%;\r\n height: 100%;\r\n overflow: auto;\r\n box-sizing: border-box;\r\n position: relative;\r\n\r\n :deep(> .el-overlay) {\r\n position: absolute;\r\n\r\n > .el-overlay-dialog {\r\n position: absolute;\r\n }\r\n }\r\n}\r\n</style>\r\n","import { withInstall } from '../_util'\r\n\r\nimport Modal from './Modal'\r\nimport ModalLocator from './ModalLocator.vue'\r\n\r\nexport default withInstall<typeof Modal, { ModalLocator: typeof ModalLocator }>(Modal, { ModalLocator })\r\n"],"names":["Modal","defineComponent","name","setup","props","slots","attrs","emit","expose","modalLocator","inject","modalLocatorContextKey","show","ref","title","content","shallowRef","contentProps","width","height","__resolve","showClose","appendTo","open","options","value","addUnit","undefined","locator","Promise","resolve","reject","_close","provide","modalContextKey","close","Children","_createVNode","ElDialog","default","_Fragment","useTemplateRef","index","withInstall","ModalLocator"],"mappings":";;;;;;AAKA,MAAMA,IAAQC,gBAAAA,EAAgB;AAAA,EAC5BC,MAAM;AAAA,EACNC,MAAMC,GAAO;AAAA,IAAEC,OAAAA;AAAAA,IAAOC,OAAAA;AAAAA,IAAOC,MAAAA;AAAAA,IAAMC,QAAAA;AAAAA,EAAO,GAAG;AAC3C,UAAMC,IAAeC,EAAOC,CAAsB,GAE5CC,IAAOC,EAAI,EAAK,GAChBC,IAAQD,KACRE,IAAUC,KACVC,IAAeJ,KACfK,IAAQL,KACRM,IAASN,KACTO,IAAYP,KACZQ,IAAYR,EAAI,EAAI,GACpBS,IAAWT;AAkCjBL,IAAAA,EAAO;AAAA,MACLe,MAjCqE,OAAOC,OAC5EZ,EAAKa,QAAQ,IACbX,EAAMW,QAAQD,EAAQV,OACtBC,EAAQU,QAAQD,EAAQT,SACpBS,EAAQP,eACVA,EAAaQ,QAAQD,EAAQP,eAE7BA,EAAaQ,QAAQ,IAEnBD,EAAQN,UACVA,EAAMO,QAAQD,EAAQN,QAEpBM,EAAQL,WACVA,EAAOM,QAAQC,EAAQF,EAAQL,MAAM,IAEnCK,EAAQH,aAAaM,QAAaH,EAAQH,aAAa,OACzDA,EAAUI,QAAQ,KAEhBD,EAAQI,UACVN,EAASG,QAAQD,EAAQI,UAErBnB,KAAgBA,EAAamB,QAAQH,UACvCH,EAASG,QAAQhB,EAAamB,QAAQH,QAI1B,IAAII,QAA6B,CAACC,GAASC,MAAW;AACpEX,QAAAA,EAAUK,QAAQK;AAAAA,MACpB,CAAC;AAAA,IAMH,CAAC;AAED,UAAME,IAAkDR,CAAAA,MAAY;AAClE,YAAMM,IAAUV,EAAUK;AAE1Bb,MAAAA,EAAKa,QAAQ,IACbX,EAAMW,QAAQE,QACdZ,EAAQU,QAAQE,QAChBV,EAAaQ,QAAQE,QACrBT,EAAMO,QAAQE,QACdR,EAAOM,QAAQE,QACfP,EAAUK,QAAQE,QAClBN,EAAUI,QAAQ,IAClBH,EAASG,QAAQE,QAEjBG,KAAWA,EAAQN,CAAO;AAAA;AAE5BS,WAAAA,EAAQC,GAAiB;AAAA,MAAEC,OAAOH;AAAAA,IAAO,CAAC,GAEnC,MAAM;AACX,YAAMI,IAAWrB,EAAQU;AACzB,aAAOb,EAAKa,QAAKY,EAAAC,GAAA;AAAA,QAAA,OAENxB,EAAMW;AAAAA,QAAK,OACXP,EAAMO;AAAAA,QAAK,YACNb,EAAKa;AAAAA,QAAK,aACTO;AAAAA,QAAM,WACR;AAAA,QAAI,mBACI;AAAA,QAAK,oBACJ;AAAA,QAAK,WACdX,EAAUI;AAAAA,QAAK,aACb;AAAA,QAAI,OACV;AAAA,UAAEN,QAAQA,EAAOM;AAAAA,QAAO;AAAA,QAAA,UACrBH,EAASG;AAAAA,MAAK,GAAA;AAAA,QAAAc,SAAAA,MAAAF,CAAAA,EAAAD,GAEVnB,EAAaQ,OAAK,IAAA,CAAA;AAAA,MAAAY,CAAAA,IAAAA,EAAAG,GAInC,MAAA,IAAA;AAAA;EAEL;AACF,CAAC;;;;;;;;ACxFK,UAAAZ,IAAUa,EAAe,eAAe;AAE9C,WAAAR,EAAQtB,GAAwB;AAAA,MAC9B,SAAAiB;AAAA,IAAA,CACD;;;;;;;;;iECPDc,IAAeC,EAAiE3C,GAAO,EAAE,cAAA4C,GAAc;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Modal/Modal.tsx","../../../src/components/Modal/ModalLocator.vue","../../../src/components/Modal/index.ts"],"sourcesContent":["import { defineComponent, inject, provide, ref, shallowRef } from 'vue'\r\nimport { ElDialog } from 'element-plus'\r\nimport { addUnit } from '../_util'\r\nimport { modalContextKey, modalLocatorContextKey, ModalOptions } from './types'\r\n\r\nconst Modal = defineComponent({\r\n name: 'OModal',\r\n setup(props, { slots, attrs, emit, expose }) {\r\n const modalLocator = inject(modalLocatorContextKey)\r\n\r\n const show = ref(false)\r\n const title = ref<string>()\r\n const content = shallowRef()\r\n const contentProps = ref<Record<string, any>>()\r\n const width = ref<number | string>()\r\n const height = ref<number | string>()\r\n const __resolve = ref<(value: Record<string, any> | PromiseLike<Record<string, any>>) => void>()\r\n const showClose = ref(true)\r\n const appendTo = ref<HTMLElement>()\r\n\r\n const _open: (options: ModalOptions) => Promise<Record<string, any>> = async (options) => {\r\n show.value = true\r\n title.value = options.title\r\n content.value = options.content\r\n if (options.contentProps) {\r\n contentProps.value = options.contentProps\r\n } else {\r\n contentProps.value = {}\r\n }\r\n if (options.width) {\r\n width.value = options.width\r\n }\r\n if (options.height) {\r\n height.value = addUnit(options.height)\r\n }\r\n if (options.showClose != undefined && options.showClose == false) {\r\n showClose.value = false\r\n }\r\n if (options.locator) {\r\n appendTo.value = options.locator\r\n } else {\r\n if (modalLocator && modalLocator.locator.value) {\r\n appendTo.value = modalLocator.locator.value\r\n }\r\n }\r\n\r\n const promise = new Promise<Record<string, any>>((resolve, reject) => {\r\n __resolve.value = resolve\r\n })\r\n\r\n return promise\r\n }\r\n expose({\r\n open: _open,\r\n })\r\n\r\n const _close: (options: Record<string, any>) => void = (options) => {\r\n const resolve = __resolve.value\r\n\r\n show.value = false\r\n title.value = undefined\r\n content.value = undefined\r\n contentProps.value = undefined\r\n width.value = undefined\r\n height.value = undefined\r\n __resolve.value = undefined\r\n showClose.value = true\r\n appendTo.value = undefined\r\n\r\n resolve && resolve(options)\r\n }\r\n provide(modalContextKey, { close: _close })\r\n\r\n return () => {\r\n const Children = content.value\r\n return show.value ? (\r\n <ElDialog\r\n title={title.value}\r\n width={width.value}\r\n modelValue={show.value}\r\n beforeClose={_close}\r\n draggable={true}\r\n closeOnClickModal={false}\r\n closeOnPressEscape={false}\r\n showClose={showClose.value}\r\n alignCenter={true}\r\n style={{ height: height.value }}\r\n appendTo={appendTo.value}\r\n >\r\n <Children {...contentProps.value}></Children>\r\n </ElDialog>\r\n ) : (\r\n <></>\r\n )\r\n }\r\n },\r\n})\r\n\r\nexport default Modal\r\n","<template>\r\n <div ref=\"modal-locator\" class=\"orion-modal-locator\"><slot></slot></div>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport { provide, useTemplateRef } from 'vue'\r\nimport { modalLocatorContextKey } from './types'\r\n\r\ndefineOptions({ name: 'OModalLocator', inheritAttrs: true })\r\nconst locator = useTemplateRef('modal-locator')\r\n\r\nprovide(modalLocatorContextKey, {\r\n locator,\r\n})\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.orion-modal-locator {\r\n width: 100%;\r\n height: 100%;\r\n overflow: auto;\r\n box-sizing: border-box;\r\n position: relative;\r\n\r\n :deep(> .el-overlay) {\r\n position: absolute;\r\n\r\n > .el-overlay-dialog {\r\n position: absolute;\r\n }\r\n }\r\n}\r\n</style>\r\n","import { withInstall } from '../_util'\r\n\r\nimport Modal from './Modal'\r\nimport ModalLocator from './ModalLocator.vue'\r\n\r\nexport default withInstall<typeof Modal, { ModalLocator: typeof ModalLocator }>(Modal, { ModalLocator })\r\n"],"names":["Modal","defineComponent","name","setup","props","slots","attrs","emit","expose","modalLocator","inject","modalLocatorContextKey","show","ref","title","content","shallowRef","contentProps","width","height","__resolve","showClose","appendTo","open","options","value","addUnit","undefined","locator","Promise","resolve","reject","_close","provide","modalContextKey","close","Children","_createVNode","ElDialog","default","_Fragment","useTemplateRef","index","withInstall","ModalLocator"],"mappings":";;;;;;AAKA,MAAMA,IAAQC,gBAAAA,EAAgB;AAAA,EAC5BC,MAAM;AAAA,EACNC,MAAMC,GAAO;AAAA,IAAEC,OAAAA;AAAAA,IAAOC,OAAAA;AAAAA,IAAOC,MAAAA;AAA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Y,EAAAC,GAAA;AAAA,QAAA,OAENxB,EAAMW;AAAAA,QAAK,OACXP,EAAMO;AAAAA,QAAK,YACNb,EAAKa;AAAAA,QAAK,aACTO;AAAAA,QAAM,WACR;AAAA,QAAI,mBACI;AAAA,QAAK,oBACJ;AAAA,QAAK,WACdX,EAAUI;AAAAA,QAAK,aACb;AAAA,QAAI,OACV;AAAA,UAAEN,QAAQA,EAAOM;AAAAA,QAAO;AAAA,QAAA,UACrBH,EAASG;AAAAA,MAAK,GAAA;AAAA,QAAAc,SAAAA,MAAAF,CAAAA,EAAAD,GAEVnB,EAAaQ,OAAK,IAAA,CAAA;AAAA,MAAAY,CAAAA,IAAAA,EAAAG,GAInC,MAAA,IAAA;AAAA;EAEL;AACF,CAAC;;;;;;;;ACxFK,UAAAZ,IAAUa,EAAe,eAAe;AAE9C,WAAAR,EAAQtB,GAAwB;AAAA,MAC9B,SAAAiB;AAAA,IAAA,CACD;;;;;;;;;iECPDc,IAAeC,EAAiE3C,GAAO,EAAE,cAAA4C,GAAc;"}
@@ -6,7 +6,7 @@ export interface ModalOptions {
6
6
  width?: number | string;
7
7
  height?: number | string;
8
8
  showClose?: boolean;
9
- locator?: string | HTMLElement;
9
+ locator?: HTMLElement;
10
10
  }
11
11
  export interface ModalContext {
12
12
  close: (options: Record<string, any>) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../src/components/Modal/types.ts"],"sourcesContent":["import { InjectionKey, ShallowRef, VNode } from 'vue'\r\n\r\nexport interface ModalOptions {\r\n title: string\r\n content: VNode\r\n contentProps?: Record<string, any>\r\n width?: number | string\r\n height?: number | string\r\n showClose?: boolean\r\n locator?: string | HTMLElement\r\n}\r\n\r\nexport interface ModalContext {\r\n close: (options: Record<string, any>) => void\r\n}\r\n\r\nexport const modalContextKey: InjectionKey<ModalContext> = Symbol('modalContextKey')\r\n\r\nexport interface ModalLocatorContext {\r\n locator: ShallowRef<HTMLElement | null>\r\n}\r\n\r\nexport const modalLocatorContextKey: InjectionKey<ModalLocatorContext> = Symbol('modalLocatorContextKey')\r\n"],"names":["modalContextKey","modalLocatorContextKey"],"mappings":"AAgBa,MAAAA,IAA8C,OAAO,iBAAiB,GAMtEC,IAA4D,OAAO,wBAAwB;"}
1
+ {"version":3,"file":"types.js","sources":["../../../src/components/Modal/types.ts"],"sourcesContent":["import { InjectionKey, ShallowRef, VNode } from 'vue'\r\n\r\nexport interface ModalOptions {\r\n title: string\r\n content: VNode\r\n contentProps?: Record<string, any>\r\n width?: number | string\r\n height?: number | string\r\n showClose?: boolean\r\n locator?: HTMLElement\r\n}\r\n\r\nexport interface ModalContext {\r\n close: (options: Record<string, any>) => void\r\n}\r\n\r\nexport const modalContextKey: InjectionKey<ModalContext> = Symbol('modalContextKey')\r\n\r\nexport interface ModalLocatorContext {\r\n locator: ShallowRef<HTMLElement | null>\r\n}\r\n\r\nexport const modalLocatorContextKey: InjectionKey<ModalLocatorContext> = Symbol('modalLocatorContextKey')\r\n"],"names":["modalContextKey","modalLocatorContextKey"],"mappings":"AAgBa,MAAAA,IAA8C,OAAO,iBAAiB,GAMtEC,IAA4D,OAAO,wBAAwB;"}
@@ -1,4 +1,30 @@
1
- import { PropType, ExtractPropTypes } from 'vue';
1
+ import { PropType, ExtractPropTypes, CSSProperties } from 'vue';
2
+ type rowClassNameFn = (data: {
3
+ rowData: any;
4
+ rowIndex: number;
5
+ }) => string;
6
+ type rowStyleFn = (data: {
7
+ rowData: any;
8
+ rowIndex: number;
9
+ }) => CSSProperties;
10
+ type cellClassNameFn = (data: {
11
+ rowData: any;
12
+ column: {
13
+ name: string;
14
+ head: string;
15
+ };
16
+ rowIndex: number;
17
+ columnIndex: number;
18
+ }) => string;
19
+ type cellStyleFn = (data: {
20
+ rowData: any;
21
+ column: {
22
+ name: string;
23
+ head: string;
24
+ };
25
+ rowIndex: number;
26
+ columnIndex: number;
27
+ }) => CSSProperties;
2
28
  export declare const pagetableProps: () => {
3
29
  data: {
4
30
  type: PropType<any[]>;
@@ -22,6 +48,10 @@ export declare const pagetableProps: () => {
22
48
  total?: number;
23
49
  };
24
50
  };
51
+ paginationTeleported: {
52
+ type: BooleanConstructor;
53
+ default: boolean;
54
+ };
25
55
  showRowNumber: {
26
56
  type: BooleanConstructor;
27
57
  default: boolean;
@@ -38,6 +68,22 @@ export declare const pagetableProps: () => {
38
68
  type: PropType<"" | "small" | "default" | "large">;
39
69
  default: "" | "small" | "default" | "large";
40
70
  };
71
+ rowClassName: {
72
+ type: PropType<string | rowClassNameFn>;
73
+ default: string | rowClassNameFn;
74
+ };
75
+ rowStyle: {
76
+ type: PropType<CSSProperties | rowStyleFn>;
77
+ default: CSSProperties | rowStyleFn;
78
+ };
79
+ cellClassName: {
80
+ type: PropType<string | cellClassNameFn>;
81
+ default: string | cellClassNameFn;
82
+ };
83
+ cellStyle: {
84
+ type: PropType<CSSProperties | cellStyleFn>;
85
+ default: CSSProperties | cellStyleFn;
86
+ };
41
87
  };
42
88
  export type PagetableProps = Partial<ExtractPropTypes<ReturnType<typeof pagetableProps>>>;
43
89
  declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
@@ -63,6 +109,10 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
63
109
  total?: number;
64
110
  };
65
111
  };
112
+ paginationTeleported: {
113
+ type: BooleanConstructor;
114
+ default: boolean;
115
+ };
66
116
  showRowNumber: {
67
117
  type: BooleanConstructor;
68
118
  default: boolean;
@@ -79,6 +129,22 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
79
129
  type: PropType<"" | "small" | "default" | "large">;
80
130
  default: "" | "small" | "default" | "large";
81
131
  };
132
+ rowClassName: {
133
+ type: PropType<string | rowClassNameFn>;
134
+ default: string | rowClassNameFn;
135
+ };
136
+ rowStyle: {
137
+ type: PropType<CSSProperties | rowStyleFn>;
138
+ default: CSSProperties | rowStyleFn;
139
+ };
140
+ cellClassName: {
141
+ type: PropType<string | cellClassNameFn>;
142
+ default: string | cellClassNameFn;
143
+ };
144
+ cellStyle: {
145
+ type: PropType<CSSProperties | cellStyleFn>;
146
+ default: CSSProperties | cellStyleFn;
147
+ };
82
148
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "update:pagination" | "rowClick" | "rowDblclick" | "cellClick" | "cellDblclick")[], "selectionChange" | "currentRowChange" | "update:pagination" | "rowClick" | "rowDblclick" | "cellClick" | "cellDblclick", import('vue').PublicProps, Readonly<ExtractPropTypes<{
83
149
  data: {
84
150
  type: PropType<any[]>;
@@ -102,6 +168,10 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
102
168
  total?: number;
103
169
  };
104
170
  };
171
+ paginationTeleported: {
172
+ type: BooleanConstructor;
173
+ default: boolean;
174
+ };
105
175
  showRowNumber: {
106
176
  type: BooleanConstructor;
107
177
  default: boolean;
@@ -118,6 +188,22 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
118
188
  type: PropType<"" | "small" | "default" | "large">;
119
189
  default: "" | "small" | "default" | "large";
120
190
  };
191
+ rowClassName: {
192
+ type: PropType<string | rowClassNameFn>;
193
+ default: string | rowClassNameFn;
194
+ };
195
+ rowStyle: {
196
+ type: PropType<CSSProperties | rowStyleFn>;
197
+ default: CSSProperties | rowStyleFn;
198
+ };
199
+ cellClassName: {
200
+ type: PropType<string | cellClassNameFn>;
201
+ default: string | cellClassNameFn;
202
+ };
203
+ cellStyle: {
204
+ type: PropType<CSSProperties | cellStyleFn>;
205
+ default: CSSProperties | cellStyleFn;
206
+ };
121
207
  }>> & Readonly<{
122
208
  onSelectionChange?: ((...args: any[]) => any) | undefined;
123
209
  onCurrentRowChange?: ((...args: any[]) => any) | undefined;
@@ -136,8 +222,13 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
136
222
  total?: number;
137
223
  };
138
224
  tailData: Record<string, any>;
225
+ paginationTeleported: boolean;
139
226
  showRowNumber: boolean;
140
227
  selectionMode: boolean;
141
228
  currentRowMode: boolean;
229
+ rowClassName: string | rowClassNameFn;
230
+ rowStyle: CSSProperties | rowStyleFn;
231
+ cellClassName: string | cellClassNameFn;
232
+ cellStyle: CSSProperties | cellStyleFn;
142
233
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
143
234
  export default _default;
@@ -10,6 +10,10 @@ export declare const pagetableColumnButtongroupProps: () => {
10
10
  type: PropType<"center" | "left" | "right">;
11
11
  default: "center" | "left" | "right";
12
12
  };
13
+ bodyAlign: {
14
+ type: PropType<"center" | "left" | "right">;
15
+ default: "center" | "left" | "right";
16
+ };
13
17
  name: {
14
18
  type: PropType<string>;
15
19
  default: string;
@@ -37,6 +41,10 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
37
41
  type: PropType<"center" | "left" | "right">;
38
42
  default: "center" | "left" | "right";
39
43
  };
44
+ bodyAlign: {
45
+ type: PropType<"center" | "left" | "right">;
46
+ default: "center" | "left" | "right";
47
+ };
40
48
  name: {
41
49
  type: PropType<string>;
42
50
  default: string;
@@ -62,6 +70,10 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
62
70
  type: PropType<"center" | "left" | "right">;
63
71
  default: "center" | "left" | "right";
64
72
  };
73
+ bodyAlign: {
74
+ type: PropType<"center" | "left" | "right">;
75
+ default: "center" | "left" | "right";
76
+ };
65
77
  name: {
66
78
  type: PropType<string>;
67
79
  default: string;
@@ -83,6 +95,7 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
83
95
  head: string;
84
96
  width: string | boolean;
85
97
  name: string;
98
+ bodyAlign: "center" | "left" | "right";
86
99
  tail: string | boolean;
87
100
  headAlign: "center" | "left" | "right";
88
101
  }, CustomSlotsType<{
@@ -9,6 +9,10 @@ export declare const pagetableColumnDateProps: () => {
9
9
  type: PropType<"center" | "left" | "right">;
10
10
  default: "center" | "left" | "right";
11
11
  };
12
+ bodyAlign: {
13
+ type: PropType<"center" | "left" | "right">;
14
+ default: "center" | "left" | "right";
15
+ };
12
16
  name: {
13
17
  type: PropType<string>;
14
18
  default: string;
@@ -44,6 +48,10 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
44
48
  type: PropType<"center" | "left" | "right">;
45
49
  default: "center" | "left" | "right";
46
50
  };
51
+ bodyAlign: {
52
+ type: PropType<"center" | "left" | "right">;
53
+ default: "center" | "left" | "right";
54
+ };
47
55
  name: {
48
56
  type: PropType<string>;
49
57
  default: string;
@@ -77,6 +85,10 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
77
85
  type: PropType<"center" | "left" | "right">;
78
86
  default: "center" | "left" | "right";
79
87
  };
88
+ bodyAlign: {
89
+ type: PropType<"center" | "left" | "right">;
90
+ default: "center" | "left" | "right";
91
+ };
80
92
  name: {
81
93
  type: PropType<string>;
82
94
  default: string;
@@ -107,6 +119,7 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
107
119
  width: string | boolean;
108
120
  name: string;
109
121
  format: string;
122
+ bodyAlign: "center" | "left" | "right";
110
123
  tail: string | boolean;
111
124
  headAlign: "center" | "left" | "right";
112
125
  sourceFormat: string;