@nocopypaste/vue-grid 0.5.0 → 0.7.0

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.
Files changed (93) hide show
  1. package/AGENTS.md +10 -2
  2. package/CHANGELOG.md +37 -0
  3. package/README.md +177 -79
  4. package/agent/api.json +63 -9
  5. package/agent/api.md +16 -6
  6. package/agent/grid-config.schema.json +9 -11
  7. package/dist/agent/api.js +63 -9
  8. package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js +545 -518
  9. package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  10. package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js +4 -3
  11. package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/components/VGridColumnMenu.vue_vue_type_script_setup_true_lang.js +58 -53
  13. package/dist/components/VGridColumnMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  14. package/dist/components/VGridFilterInput.vue_vue_type_script_setup_true_lang.js +50 -49
  15. package/dist/components/VGridFilterInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  16. package/dist/components/VGridFilterPanel.vue_vue_type_script_setup_true_lang.js +151 -146
  17. package/dist/components/VGridFilterPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  18. package/dist/components/VGridFilterPopover.vue_vue_type_script_setup_true_lang.js +44 -43
  19. package/dist/components/VGridFilterPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
  20. package/dist/components/VGridGroupCells.vue_vue_type_script_setup_true_lang.js +10 -8
  21. package/dist/components/VGridGroupCells.vue_vue_type_script_setup_true_lang.js.map +1 -1
  22. package/dist/components/VGridHeader.vue_vue_type_script_setup_true_lang.js +62 -57
  23. package/dist/components/VGridHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/components/VGridMenu.vue_vue_type_script_setup_true_lang.js +59 -58
  25. package/dist/components/VGridMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  26. package/dist/components/VGridPagination.vue_vue_type_script_setup_true_lang.js +62 -55
  27. package/dist/components/VGridPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  28. package/dist/components/VGridResizeHandle.vue_vue_type_script_setup_true_lang.js +1 -1
  29. package/dist/components/VGridResizeHandle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/VGridRows.vue_vue_type_script_setup_true_lang.js +60 -59
  31. package/dist/components/VGridRows.vue_vue_type_script_setup_true_lang.js.map +1 -1
  32. package/dist/components/VGridSearch.vue_vue_type_script_setup_true_lang.js +27 -26
  33. package/dist/components/VGridSearch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  34. package/dist/components/VGridSelectionBanner.vue_vue_type_script_setup_true_lang.js +12 -11
  35. package/dist/components/VGridSelectionBanner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  36. package/dist/components/VGridStatusBar.vue_vue_type_script_setup_true_lang.js +37 -30
  37. package/dist/components/VGridStatusBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  38. package/dist/composables/useGridExport.js +98 -51
  39. package/dist/composables/useGridExport.js.map +1 -1
  40. package/dist/composables/useGridMenus.js +41 -41
  41. package/dist/composables/useGridMenus.js.map +1 -1
  42. package/dist/composables/useStatusBar.js +9 -0
  43. package/dist/composables/useStatusBar.js.map +1 -1
  44. package/dist/core/xlsx.js +172 -0
  45. package/dist/core/xlsx.js.map +1 -0
  46. package/dist/features/export.js.map +1 -1
  47. package/dist/index.js +55 -54
  48. package/dist/internal/context.js.map +1 -1
  49. package/dist/internal/messages.js +20 -0
  50. package/dist/internal/messages.js.map +1 -0
  51. package/dist/internal/print.js +51 -0
  52. package/dist/internal/print.js.map +1 -0
  53. package/dist/renderers/ActionsMenuCell.vue_vue_type_script_setup_true_lang.js +31 -30
  54. package/dist/renderers/ActionsMenuCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  55. package/dist/renderers/ChangeCell.vue_vue_type_script_setup_true_lang.js +28 -27
  56. package/dist/renderers/ChangeCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  57. package/dist/renderers/CopyCell.vue_vue_type_script_setup_true_lang.js +22 -21
  58. package/dist/renderers/CopyCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  59. package/dist/renderers/DetailsCell.vue_vue_type_script_setup_true_lang.js +37 -36
  60. package/dist/renderers/DetailsCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  61. package/dist/renderers/EditCell.vue_vue_type_script_setup_true_lang.js +16 -15
  62. package/dist/renderers/EditCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  63. package/dist/renderers/IconToggleCell.vue_vue_type_script_setup_true_lang.js +19 -18
  64. package/dist/renderers/IconToggleCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  65. package/dist/renderers/JsonCell.vue_vue_type_script_setup_true_lang.js +21 -20
  66. package/dist/renderers/JsonCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  67. package/dist/renderers/JsonTreeCell.vue_vue_type_script_setup_true_lang.js +21 -20
  68. package/dist/renderers/JsonTreeCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  69. package/dist/renderers/ListCell.vue_vue_type_script_setup_true_lang.js +18 -17
  70. package/dist/renderers/ListCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  71. package/dist/renderers/MultiLineCell.vue_vue_type_script_setup_true_lang.js +35 -34
  72. package/dist/renderers/MultiLineCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  73. package/dist/renderers/parts/CopyButton.vue_vue_type_script_setup_true_lang.js +19 -18
  74. package/dist/renderers/parts/CopyButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  75. package/dist/types/components/VGrid.vue.d.ts +34 -7
  76. package/dist/types/components/VGridColumnMenu.vue.d.ts +4 -5
  77. package/dist/types/components/VGridMenu.vue.d.ts +1 -1
  78. package/dist/types/components/VGridPagination.vue.d.ts +8 -3
  79. package/dist/types/components/VGridSearch.vue.d.ts +2 -2
  80. package/dist/types/composables/useGridExport.d.ts +6 -1
  81. package/dist/types/composables/useGridMenus.d.ts +3 -1
  82. package/dist/types/composables/useStatusBar.d.ts +7 -0
  83. package/dist/types/core/xlsx.d.ts +34 -0
  84. package/dist/types/features/export.d.ts +6 -4
  85. package/dist/types/index.d.ts +1 -0
  86. package/dist/types/internal/context.d.ts +5 -1
  87. package/dist/types/internal/messages.d.ts +16 -0
  88. package/dist/types/internal/print.d.ts +16 -0
  89. package/dist/types/renderers/parts/CopyButton.vue.d.ts +1 -3
  90. package/dist/types/types.d.ts +314 -0
  91. package/llms-full.txt +203 -87
  92. package/llms.txt +1 -1
  93. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CopyButton.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementVNode","_normalizeClass","_withModifiers","_createBlock","_resolveDynamicComponent","_unref","_toDisplayString","_hoisted_1","_hoisted_2","CopyButton_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","done","ref","timer","copy","copyText","onBeforeUnmount","openBlock","createElementBlock","Fragment","createElementVNode","normalizeClass","withModifiers","createBlock","resolveDynamicComponent","unref","CheckIcon","CopyIcon","toDisplayString"],"sources":["../../../src/renderers/parts/CopyButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onBeforeUnmount, ref } from 'vue'\nimport { copyText } from '../../internal/clipboard'\nimport { CheckIcon, CopyIcon } from './icons'\n\nconst props = withDefaults(defineProps<{ text: string; label?: string; title?: string }>(), {\n label: 'Copy',\n})\nconst emit = defineEmits<{ copied: [text: string]; failed: [text: string] }>()\n\nconst done = ref(false)\nlet timer = 0\n\nasync function copy() {\n const ok = await copyText(props.text)\n if (!ok) return emit('failed', props.text)\n emit('copied', props.text)\n done.value = true\n window.clearTimeout(timer)\n timer = window.setTimeout(() => (done.value = false), 1500)\n}\n\nonBeforeUnmount(() => window.clearTimeout(timer))\n</script>\n\n<template>\n <button\n type=\"button\"\n :class=\"['vg-icon-button', 'vg-copy-button', { 'vg-copy-done': done }]\"\n :aria-label=\"done ? 'Copied' : label\"\n :title=\"title ?? text\"\n @click.stop=\"copy\"\n >\n <component :is=\"done ? CheckIcon : CopyIcon\" />\n </button>\n <span class=\"vg-sr-only\" aria-live=\"polite\">{{ done ? 'Copied' : '' }}</span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAKA,IAAMY,IAAQC,GAGRC,IAAOH,GAEPI,IAAOC,EAAI,EAAK,GAClBC,IAAQ;EAEZ,eAAeC,IAAO;GAEpB,IAAI,CAAC,MADYC,EAASP,EAAM,IAAI,GAC3B,OAAOE,EAAK,UAAUF,EAAM,IAAI;GAIzC,AAHAE,EAAK,UAAUF,EAAM,IAAI,GACzB,EAAK,QAAQ,IACb,OAAO,aAAaK,CAAK,GACzB,IAAQ,OAAO,iBAAkB,EAAK,QAAQ,IAAQ,IAAI;EAC5D;E,OAEAG,QAAsB,OAAO,aAAaH,CAAK,CAAC,I,2BAI9ChB,EAQS,UAAA;GAPP,MAAK;GACJ,OAAKC,EAAA;IAAA;IAAA;IAAA,EAAA,gBAAyDa,EAAA,MAAI;GAAA,CAAA;GAClE,cAAYA,EAAA,QAAI,WAAcF,EAAA;GAC9B,OAAOA,EAAA,SAASA,EAAA;GAChB,SAAKV,EAAOe,GAAI,CAAA,MAAA,CAAA;E,KAEjBlB,EAAA,GAAAI,EAA+CC,EAA/BU,EAAA,QAAOT,EAAAwB,CAAA,IAAYxB,EAAAyB,CAAA,CAAQ,CAAA,E,WAE7C9B,EAA6E,QAA7EQ,GAA6EF,EAA9BQ,EAAA,QAAI,WAAA,EAAA,GAAA,CAAA,C"}
1
+ {"version":3,"file":"CopyButton.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementVNode","_normalizeClass","_unref","_withModifiers","_createBlock","_resolveDynamicComponent","_toDisplayString","_hoisted_1","_hoisted_2","CopyButton_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","m","useMessages","emit","done","ref","timer","copy","copyText","onBeforeUnmount","openBlock","createElementBlock","Fragment","createElementVNode","normalizeClass","unref","withModifiers","createBlock","resolveDynamicComponent","CheckIcon","CopyIcon","toDisplayString"],"sources":["../../../src/renderers/parts/CopyButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onBeforeUnmount, ref } from 'vue'\nimport { copyText } from '../../internal/clipboard'\nimport { useMessages } from '../../internal/messages'\nimport { CheckIcon, CopyIcon } from './icons'\n\nconst props = defineProps<{ text: string; label?: string; title?: string }>()\nconst m = useMessages()\nconst emit = defineEmits<{ copied: [text: string]; failed: [text: string] }>()\n\nconst done = ref(false)\nlet timer = 0\n\nasync function copy() {\n const ok = await copyText(props.text)\n if (!ok) return emit('failed', props.text)\n emit('copied', props.text)\n done.value = true\n window.clearTimeout(timer)\n timer = window.setTimeout(() => (done.value = false), 1500)\n}\n\nonBeforeUnmount(() => window.clearTimeout(timer))\n</script>\n\n<template>\n <button\n type=\"button\"\n :class=\"['vg-icon-button', 'vg-copy-button', { 'vg-copy-done': done }]\"\n :aria-label=\"done ? (m.copied ?? 'Copied') : (label ?? m.copy ?? 'Copy')\"\n :title=\"title ?? text\"\n @click.stop=\"copy\"\n >\n <component :is=\"done ? CheckIcon : CopyIcon\" />\n </button>\n <span class=\"vg-sr-only\" aria-live=\"polite\">{{ done ? (m.copied ?? 'Copied') : '' }}</span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAMA,IAAMY,IAAQC,GACRC,IAAIC,EAAY,GAChBC,IAAOL,GAEPM,IAAOC,EAAI,EAAK,GAClBC,IAAQ;EAEZ,eAAeC,IAAO;GAEpB,IAAI,CAAC,MADYC,EAAST,EAAM,IAAI,GAC3B,OAAOI,EAAK,UAAUJ,EAAM,IAAI;GAIzC,AAHAI,EAAK,UAAUJ,EAAM,IAAI,GACzB,EAAK,QAAQ,IACb,OAAO,aAAaO,CAAK,GACzB,IAAQ,OAAO,iBAAkB,EAAK,QAAQ,IAAQ,IAAI;EAC5D;E,OAEAG,QAAsB,OAAO,aAAaH,CAAK,CAAC,I,2BAI9ClB,EAQS,UAAA;GAPP,MAAK;GACJ,OAAKC,EAAA;IAAA;IAAA;IAAA,EAAA,gBAAyDe,EAAA,MAAI;GAAA,CAAA;GAClE,cAAYA,EAAA,QAAQd,EAAAW,CAAA,CAAC,CAAC,UAAM,WAAiBD,EAAA,SAASV,EAAAW,CAAA,CAAC,CAAC,QAAI;GAC5D,OAAOD,EAAA,SAASA,EAAA;GAChB,SAAKT,EAAOgB,GAAI,CAAA,MAAA,CAAA;E,KAEjBpB,EAAA,GAAAK,EAA+CC,EAA/BW,EAAA,QAAOd,EAAA6B,CAAA,IAAY7B,EAAA8B,CAAA,CAAQ,CAAA,E,WAE7ChC,EAA2F,QAA3FQ,GAA2FF,EAA5CU,EAAA,QAAQd,EAAAW,CAAA,CAAC,CAAC,UAAM,WAAA,EAAA,GAAA,CAAA,C"}
@@ -1,7 +1,7 @@
1
1
  import type { RowGroup } from '../core/grouping';
2
2
  import { type RowKeyGetter } from '../core/value';
3
3
  import type { DataSource, GridQuery } from '../composables/useDataSource';
4
- import type { CellActionEvent, CellClickEvent, CellContext, CellRendererDefinition, ClassValue, ColumnDef, ColumnState, FlashMode, FilterState, GridFeature, FilterStateStorage, ColumnStateStorage, ContextActionEvent, CopyEvent, Density, GridPart, HeaderActionEvent, HeaderMenuContext, MenuItem, PinnedRowsState, RowKey, SortState, StatusBarOptions, StatusBarScope, VGridExposed, VirtualOptions } from '../types';
4
+ import type { CellActionEvent, CellClickEvent, CellContext, CellRendererDefinition, ClassValue, ColumnDef, ColumnState, FlashMode, FilterState, GridFeature, FilterStateStorage, ColumnStateStorage, ContextActionEvent, CopyEvent, Density, GridPart, HeaderActionEvent, HeaderMenuContext, MenuItem, PinnedRowsState, RowKey, SortState, PaginationOptions, StatusBarOptions, StatusBarScope, GridMessages, GridParts, VGridExposed, VirtualOptions } from '../types';
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
7
7
  declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
@@ -25,15 +25,17 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
25
25
  */
26
26
  dataSource?: DataSource<T>;
27
27
  /** Built-in pagination under the grid (server-side with `dataSource`, client-side otherwise). */
28
- pagination?: boolean | {
29
- pageSizes?: number[];
30
- };
28
+ pagination?: boolean | PaginationOptions;
31
29
  /**
32
30
  * A status bar under the grid (status bar feature): rows that pass the filters ("84 of 200
33
31
  * rows"), selected rows, active filters with Clear; `{ summary: ['total'] }` adds the sum and
34
32
  * average of those columns over the selected rows. `#status-bar` replaces its content.
35
33
  */
36
34
  statusBar?: boolean | StatusBarOptions;
35
+ /** Built-in text (translations, wording), over `createVueGrid({ messages })`. */
36
+ messages?: GridMessages;
37
+ /** Built-in parts to leave out (`{ progressBar: false }`), over `createVueGrid({ parts })`. */
38
+ parts?: GridParts;
37
39
  /**
38
40
  * `controlled` (default): a header click only updates `v-model:sort` (sort on the server or in
39
41
  * your own code). `client`: the grid sorts the rows itself. Ignored with `dataSource`.
@@ -45,7 +47,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
45
47
  filterRow?: boolean;
46
48
  /** Persist the filter model (`string` = localStorage key). */
47
49
  filterStorage?: FilterStateStorage | string;
48
- /** Shown when filters hide every row. */
50
+ /** Shown when filters hide every row. Default: `messages.noMatch`, else `No rows match the current filters.` */
49
51
  noMatchText?: string;
50
52
  /** A selection column: `true` = multi-select (with select-all), `'single'` = one row. */
51
53
  selectable?: boolean | "single";
@@ -99,7 +101,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
99
101
  density?: Density;
100
102
  /** Shows a progress bar and sets `aria-busy` (server data sets it by itself). */
101
103
  loading?: boolean;
102
- /** Shown when there are no rows. */
104
+ /** Shown when there are no rows. Default: `messages.empty`, else `No data to show.` */
103
105
  emptyText?: string;
104
106
  /** Accessible name of the grid. */
105
107
  ariaLabel?: string;
@@ -121,7 +123,10 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
121
123
  * it to the bottom, `'top'` under the header.
122
124
  */
123
125
  totals?: boolean | "top" | "bottom";
124
- /** The totals row's label, in its first column (unless that column has an aggregate). */
126
+ /**
127
+ * The totals row's label, in its first column (unless that column has an aggregate). Default:
128
+ * `messages.total`, else `Total`.
129
+ */
125
130
  totalsLabel?: string;
126
131
  /** Totals row values by column key, instead of computing them (e.g. totals from a server). */
127
132
  aggregates?: Record<string, unknown>;
@@ -215,6 +220,28 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
215
220
  }) => unknown;
216
221
  /** Shown when there are no rows. */
217
222
  empty?: () => unknown;
223
+ /** Shown when filters hide every row, instead of the message and its Clear filters button. */
224
+ 'no-match'?: (scope: {
225
+ clearFilters: () => void;
226
+ filterCount: number;
227
+ }) => unknown;
228
+ /**
229
+ * A failed server request (server data): `stale` when the rows from before stay on screen (the
230
+ * notice above them), else in place of the rows. `retry()` asks again.
231
+ */
232
+ 'load-error'?: (scope: {
233
+ error: unknown;
234
+ retry: () => Promise<void>;
235
+ stale: boolean;
236
+ }) => unknown;
237
+ /** Selection with server data: the "Select all N rows" banner. */
238
+ 'select-all-banner'?: (scope: {
239
+ total: number;
240
+ page: number;
241
+ all: boolean;
242
+ selectAll: () => void;
243
+ clearSelection: () => void;
244
+ }) => unknown;
218
245
  /** The status bar's content (status bar feature): replaces the counts and the summary. */
219
246
  'status-bar'?: (scope: StatusBarScope) => unknown;
220
247
  /** Shown while loading with no rows yet. */
@@ -1,8 +1,11 @@
1
1
  import type { ColumnDef, ColumnState } from '../types';
2
2
  type __VLS_Props = {
3
3
  columns: readonly ColumnDef[];
4
+ /** The button. Default: `messages.columns`, else `Columns`. */
4
5
  label?: string;
6
+ /** Default: `messages.filterColumns`, else `Filter columns…`. */
5
7
  filterPlaceholder?: string;
8
+ /** Default: `messages.resetColumns`, else `Reset columns`. */
6
9
  resetLabel?: string;
7
10
  };
8
11
  type __VLS_ModelProps = {
@@ -13,10 +16,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
13
16
  "update:columnState": (value: ColumnState | undefined) => any;
14
17
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
15
18
  "onUpdate:columnState"?: ((value: ColumnState | undefined) => any) | undefined;
16
- }>, {
17
- label: string;
18
- filterPlaceholder: string;
19
- resetLabel: string;
20
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
20
  declare const _default: typeof __VLS_export;
22
21
  export default _default;
@@ -11,6 +11,7 @@ import type { MenuAction, MenuItem } from '../types';
11
11
  */
12
12
  type __VLS_Props = {
13
13
  items: readonly MenuItem[];
14
+ /** The menu's name for screen readers. Default: `messages.menu`, else `Menu`. */
14
15
  label?: string;
15
16
  placement?: Placement;
16
17
  /** Popover id (for `popovertarget`). Generated when omitted. */
@@ -35,7 +36,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
35
36
  onClose?: (() => any) | undefined;
36
37
  onOpen?: (() => any) | undefined;
37
38
  }>, {
38
- label: string;
39
39
  placement: Placement;
40
40
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
41
41
  declare const _default: typeof __VLS_export;
@@ -3,9 +3,15 @@ type __VLS_Props = {
3
3
  /** Page-size choices; renders a selector when given. */
4
4
  pageSizes?: number[];
5
5
  siblings?: number;
6
+ /** Default: `messages.pagination`, else `Pagination`. */
6
7
  ariaLabel?: string;
7
- /** Use `{from}`, `{to}` and `{total}` placeholders; empty string hides the summary. */
8
+ /**
9
+ * Use `{from}`, `{to}` and `{total}` placeholders; an empty string hides the summary. Default:
10
+ * `messages.pageSummary`, else `{from}–{to} of {total}`.
11
+ */
8
12
  summary?: string;
13
+ /** The first and last page buttons (« »). Default `true`. */
14
+ firstLast?: boolean;
9
15
  };
10
16
  type __VLS_ModelProps = {
11
17
  'page'?: number;
@@ -19,9 +25,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
19
25
  "onUpdate:page"?: ((value: number) => any) | undefined;
20
26
  "onUpdate:pageSize"?: ((value: number) => any) | undefined;
21
27
  }>, {
22
- summary: string;
23
- ariaLabel: string;
24
28
  siblings: number;
29
+ firstLast: boolean;
25
30
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
31
  declare const _default: typeof __VLS_export;
27
32
  export default _default;
@@ -4,7 +4,9 @@
4
4
  */
5
5
  type __VLS_Props = {
6
6
  modelValue?: string;
7
+ /** Default: `messages.searchPlaceholder`, else `Search…`. */
7
8
  placeholder?: string;
9
+ /** Default: `messages.searchLabel`, else `Search rows`. */
8
10
  label?: string;
9
11
  debounce?: number;
10
12
  };
@@ -13,8 +15,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
13
15
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
16
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
15
17
  }>, {
16
- placeholder: string;
17
- label: string;
18
18
  modelValue: string;
19
19
  debounce: number;
20
20
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,6 +1,6 @@
1
1
  import type { Ref } from 'vue';
2
2
  import type { ResolvedColumn } from '../internal/context';
3
- import type { CellRendererDefinition, ColumnDef, CopyEvent, ExportOptions, FormatContext, RowKey } from '../types';
3
+ import type { CellRendererDefinition, ColumnDef, CopyEvent, ExportOptions, FormatContext, PrintOptions, RowKey, XlsxExportOptions } from '../types';
4
4
  export interface GridExportOptions<T> {
5
5
  /** The visible columns, resolved (renderer definition and options). */
6
6
  columns: () => readonly ResolvedColumn[];
@@ -44,6 +44,11 @@ export declare function useGridExport<T>(opts: GridExportOptions<T>): {
44
44
  filename?: string;
45
45
  bom?: boolean;
46
46
  }) => void;
47
+ getXlsx: (o?: XlsxExportOptions) => Promise<Blob>;
48
+ exportXlsx: (o?: XlsxExportOptions & {
49
+ filename?: string;
50
+ }) => Promise<void>;
51
+ print: (o?: PrintOptions) => Promise<void>;
47
52
  copyRows: (o?: ExportOptions) => Promise<boolean>;
48
53
  onKeyDown: (event: KeyboardEvent) => void;
49
54
  };
@@ -1,11 +1,13 @@
1
1
  import { type Ref } from 'vue';
2
2
  import type { AnchorTarget } from '../internal/anchor';
3
- import type { CellContext, ColumnDef, ColumnState, ContextActionEvent, HeaderActionEvent, HeaderMenuContext, MenuAction, MenuItem, SortState } from '../types';
3
+ import type { GridMessages, CellContext, ColumnDef, ColumnState, ContextActionEvent, HeaderActionEvent, HeaderMenuContext, MenuAction, MenuItem, SortState } from '../types';
4
4
  export interface MenuHandle {
5
5
  openAt(target: AnchorTarget, focusAfterClose?: HTMLElement | null): Promise<void>;
6
6
  }
7
7
  export interface GridMenusOptions<T> {
8
8
  menu: Ref<MenuHandle | undefined>;
9
+ /** The grid's built-in text. */
10
+ messages: () => GridMessages;
9
11
  columns: () => readonly ColumnDef<T>[];
10
12
  columnState: () => ColumnState;
11
13
  setColumnState: (state: ColumnState) => void;
@@ -38,6 +38,13 @@ export interface UseStatusBarOptions<T> {
38
38
  */
39
39
  export declare function useStatusBar<T>(opts: UseStatusBarOptions<T>): {
40
40
  enabled: import("vue").ComputedRef<boolean>;
41
+ /** Which items show (each on unless `false`). */
42
+ show: import("vue").ComputedRef<{
43
+ rows: boolean;
44
+ selected: boolean;
45
+ filters: boolean;
46
+ clear: boolean;
47
+ }>;
41
48
  canClear: boolean;
42
49
  scope: import("vue").ComputedRef<StatusBarScope>;
43
50
  };
@@ -0,0 +1,34 @@
1
+ import type { ColumnDef } from '../types';
2
+ /** How a column's values are written: Excel number formats for money, percentages and dates. */
3
+ export type XlsxFormat = 'auto' | 'number' | 'money' | 'percent' | 'date' | 'datetime';
4
+ export interface ToXlsxOptions {
5
+ /** The sheet's name (31 characters at most; `[]:*?/\` are dropped). Default `Sheet1`. */
6
+ sheetName?: string;
7
+ /** A bold header line with the column headers, frozen. Default `true`. */
8
+ header?: boolean;
9
+ /** Time zone that date-times are written in (Excel dates have none). Default: the browser's. */
10
+ timeZone?: string;
11
+ /** Formats by column key, instead of the ones guessed from each column's renderer. */
12
+ formats?: Record<string, XlsxFormat>;
13
+ }
14
+ /** One sheet, ready to write: values are raw (typed) or text. */
15
+ export interface XlsxSheet {
16
+ name?: string;
17
+ header?: readonly string[];
18
+ formats: readonly XlsxFormat[];
19
+ rows: readonly (readonly unknown[])[];
20
+ /** A last, bold line (the totals row). */
21
+ footer?: readonly unknown[];
22
+ timeZone?: string;
23
+ }
24
+ /** The Excel format a column's renderer implies (`currency` → money, `date` → date, …). */
25
+ export declare function xlsxFormatOf(col: ColumnDef): XlsxFormat;
26
+ /**
27
+ * Rows as an Excel workbook (the bytes of an .xlsx file): one row per row, one cell per column
28
+ * (its `exportValue`, else the cell value), typed: numbers, dates and booleans stay what they are.
29
+ * Columns with `exportable: false` are left out. For the grid's own rows, filters and sort, use
30
+ * the export feature (`grid.exportXlsx()`).
31
+ */
32
+ export declare function toXlsx<T>(rows: readonly T[], columns: readonly ColumnDef<T>[], options?: ToXlsxOptions): Uint8Array;
33
+ /** The bytes of an .xlsx file with one sheet. */
34
+ export declare function writeXlsx(sheet: XlsxSheet): Uint8Array;
@@ -1,8 +1,10 @@
1
1
  import type { ExportFeature } from '../types';
2
2
  /**
3
- * CSV export and copying: `grid.exportCsv()` downloads the filtered, sorted rows as a CSV file,
4
- * `grid.getCsv()` returns the text, `grid.copyRows()` copies rows as tab-separated text, and
5
- * Ctrl/⌘+C copies the selected rows, else the focused cell, as displayed. Columns can set
6
- * `exportValue` and `exportable: false`. Without it those methods only warn.
3
+ * CSV and Excel export and copying: `grid.exportCsv()` downloads the filtered, sorted rows as a
4
+ * CSV file, `grid.getCsv()` returns the text, `grid.exportXlsx()` / `grid.getXlsx()` write an Excel
5
+ * workbook with typed cells (the writer loads on demand), `grid.print()` prints every matching row
6
+ * as a table with the header on each page, `grid.copyRows()` copies rows as
7
+ * tab-separated text, and Ctrl/⌘+C copies the selected rows, else the focused cell, as displayed.
8
+ * Columns can set `exportValue` and `exportable: false`. Without it those methods only warn.
7
9
  */
8
10
  export declare const exportFeature: ExportFeature;
@@ -12,6 +12,7 @@ export { nextSort, sortRows, compareValues } from './core/sort';
12
12
  export { aggregateRows, aggregateValues } from './core/aggregate';
13
13
  export { groupRows, isRowGroup, type RowGroup, type GroupRowsOptions } from './core/grouping';
14
14
  export { toCsv, toDelimited, plainText, guardFormula, type ToCsvOptions } from './core/csv';
15
+ export { toXlsx, type ToXlsxOptions, type XlsxFormat } from './core/xlsx';
15
16
  export { patchRows, type RowPatches, type PatchRowsOptions } from './core/patch';
16
17
  export type { DataSource, DataSourceResult, GridQuery } from './composables/useDataSource';
17
18
  export { activeFilterCount, emptyFilters, filterTree, foldText, isFilterActive, localFilterStorage, matchesFilter, parseQuickFilter, setKey, type BooleanFilter, type CustomFilter, type DateFilter, type DateFilterOp, type NumberFilter, type NumberFilterOp, type SetFilter, type TextFilter, type TextFilterOp, } from './core/filter';
@@ -1,5 +1,5 @@
1
1
  import { type Component, type ComputedRef, type InjectionKey, type Slots } from 'vue';
2
- import type { Align, CellRendererDefinition, ClassValue, ColumnDef, FlashMode, GridPart, RowKey } from '../types';
2
+ import type { Align, CellRendererDefinition, ClassValue, ColumnDef, FlashMode, GridMessages, GridPart, GridParts, RowKey } from '../types';
3
3
  import type { ColumnFilter, FilterState, FilterType } from '../core/filter';
4
4
  import type { SelectionSummary } from '../core/selection';
5
5
  import type { SubRowEntry } from '../composables/useSubRows';
@@ -24,6 +24,10 @@ export interface ResolvedColumn {
24
24
  export interface GridContext {
25
25
  columns: ComputedRef<ResolvedColumn[]>;
26
26
  slots: Slots;
27
+ /** Built-in text (the grid's over the app's); each use keeps its English default. */
28
+ messages: ComputedRef<GridMessages>;
29
+ /** Built-in parts; a part is on unless `false`. */
30
+ parts: ComputedRef<GridParts>;
27
31
  ui: ComputedRef<Partial<Record<GridPart, ClassValue>>>;
28
32
  getKey(row: any): RowKey;
29
33
  /**
@@ -0,0 +1,16 @@
1
+ import { type ComputedRef, type InjectionKey } from 'vue';
2
+ import type { GridMessages, GridParts } from '../types';
3
+ /** A grid's messages and parts: its own props over `createVueGrid` config. */
4
+ export declare const MESSAGES_KEY: InjectionKey<ComputedRef<GridMessages>>;
5
+ export declare const PARTS_KEY: InjectionKey<ComputedRef<GridParts>>;
6
+ /**
7
+ * The built-in text in effect: the nearest grid's, else the app's (`createVueGrid({ messages })`),
8
+ * for components used on their own (`<VGridPagination>`, `<VGridSearch>`…). Each caller keeps its
9
+ * English default next to the text (`m.value.retry ?? 'Retry'`), so unused features' text
10
+ * tree-shakes away with them.
11
+ */
12
+ export declare function useMessages(): ComputedRef<GridMessages>;
13
+ /** The built-in parts in effect (each `true` unless turned off). */
14
+ export declare function useParts(): ComputedRef<GridParts>;
15
+ /** Is a part on? Parts are on unless set to `false`. */
16
+ export declare const partOn: (parts: GridParts, name: keyof GridParts) => boolean;
@@ -0,0 +1,16 @@
1
+ import type { Align } from '../types';
2
+ /** A table to print: text cells, with the header repeated on every page. */
3
+ export interface PrintTable {
4
+ title?: string;
5
+ header?: readonly string[];
6
+ body: readonly (readonly string[])[];
7
+ /** A last, bold line (the totals row). */
8
+ footer?: readonly string[];
9
+ align: readonly Align[];
10
+ landscape?: boolean;
11
+ }
12
+ /**
13
+ * Prints a table from a hidden frame: the browser's print dialog, with a real `<table>` (so the
14
+ * header repeats on each page), built with DOM calls only. Resolves when printing is over.
15
+ */
16
+ export declare function printTable(t: PrintTable): Promise<void>;
@@ -9,8 +9,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
9
9
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
10
  onCopied?: ((text: string) => any) | undefined;
11
11
  onFailed?: ((text: string) => any) | undefined;
12
- }>, {
13
- label: string;
14
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
13
  declare const _default: typeof __VLS_export;
16
14
  export default _default;