@nocopypaste/vue-grid 0.6.0 → 0.8.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 (113) hide show
  1. package/AGENTS.md +33 -24
  2. package/CHANGELOG.md +44 -0
  3. package/README.md +214 -79
  4. package/agent/api.json +68 -10
  5. package/agent/api.md +17 -7
  6. package/agent/grid-config.schema.json +15 -11
  7. package/dist/agent/api.js +66 -10
  8. package/dist/agent/requirements.js +1 -0
  9. package/dist/agent/requirements.js.map +1 -1
  10. package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js +583 -522
  11. package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js +4 -3
  13. package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  14. package/dist/components/VGridColumnMenu.vue_vue_type_script_setup_true_lang.js +58 -53
  15. package/dist/components/VGridColumnMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  16. package/dist/components/VGridFilterInput.vue_vue_type_script_setup_true_lang.js +50 -49
  17. package/dist/components/VGridFilterInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  18. package/dist/components/VGridFilterPanel.vue_vue_type_script_setup_true_lang.js +151 -146
  19. package/dist/components/VGridFilterPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  20. package/dist/components/VGridFilterPopover.vue_vue_type_script_setup_true_lang.js +44 -43
  21. package/dist/components/VGridFilterPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
  22. package/dist/components/VGridGroupCells.vue_vue_type_script_setup_true_lang.js +12 -10
  23. package/dist/components/VGridGroupCells.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/components/VGridHeader.vue_vue_type_script_setup_true_lang.js +62 -57
  25. package/dist/components/VGridHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  26. package/dist/components/VGridMenu.vue_vue_type_script_setup_true_lang.js +59 -58
  27. package/dist/components/VGridMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  28. package/dist/components/VGridPagination.vue_vue_type_script_setup_true_lang.js +62 -55
  29. package/dist/components/VGridPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/VGridResizeHandle.vue_vue_type_script_setup_true_lang.js +1 -1
  31. package/dist/components/VGridResizeHandle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  32. package/dist/components/VGridRows.vue_vue_type_script_setup_true_lang.js +60 -59
  33. package/dist/components/VGridRows.vue_vue_type_script_setup_true_lang.js.map +1 -1
  34. package/dist/components/VGridSearch.vue_vue_type_script_setup_true_lang.js +27 -26
  35. package/dist/components/VGridSearch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  36. package/dist/components/VGridSelectionBanner.vue_vue_type_script_setup_true_lang.js +12 -11
  37. package/dist/components/VGridSelectionBanner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  38. package/dist/components/VGridStatusBar.vue_vue_type_script_setup_true_lang.js +37 -30
  39. package/dist/components/VGridStatusBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/composables/useDataSource.js +21 -19
  41. package/dist/composables/useDataSource.js.map +1 -1
  42. package/dist/composables/useGridExport.js +22 -7
  43. package/dist/composables/useGridExport.js.map +1 -1
  44. package/dist/composables/useGridMenus.js +41 -41
  45. package/dist/composables/useGridMenus.js.map +1 -1
  46. package/dist/composables/useRowGrouping.js +103 -74
  47. package/dist/composables/useRowGrouping.js.map +1 -1
  48. package/dist/composables/useServerGroups.js +106 -0
  49. package/dist/composables/useServerGroups.js.map +1 -0
  50. package/dist/composables/useStatusBar.js +9 -0
  51. package/dist/composables/useStatusBar.js.map +1 -1
  52. package/dist/core/grouping.js +41 -24
  53. package/dist/core/grouping.js.map +1 -1
  54. package/dist/features/export.js.map +1 -1
  55. package/dist/features/index.js +12 -10
  56. package/dist/features/index.js.map +1 -1
  57. package/dist/features/serverGrouping.js +9 -0
  58. package/dist/features/serverGrouping.js.map +1 -0
  59. package/dist/index.js +7 -6
  60. package/dist/internal/context.js.map +1 -1
  61. package/dist/internal/features.js.map +1 -1
  62. package/dist/internal/messages.js +20 -0
  63. package/dist/internal/messages.js.map +1 -0
  64. package/dist/internal/print.js +51 -0
  65. package/dist/internal/print.js.map +1 -0
  66. package/dist/renderers/ActionsMenuCell.vue_vue_type_script_setup_true_lang.js +31 -30
  67. package/dist/renderers/ActionsMenuCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  68. package/dist/renderers/ChangeCell.vue_vue_type_script_setup_true_lang.js +28 -27
  69. package/dist/renderers/ChangeCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  70. package/dist/renderers/CopyCell.vue_vue_type_script_setup_true_lang.js +22 -21
  71. package/dist/renderers/CopyCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  72. package/dist/renderers/DetailsCell.vue_vue_type_script_setup_true_lang.js +37 -36
  73. package/dist/renderers/DetailsCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  74. package/dist/renderers/EditCell.vue_vue_type_script_setup_true_lang.js +16 -15
  75. package/dist/renderers/EditCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  76. package/dist/renderers/IconToggleCell.vue_vue_type_script_setup_true_lang.js +19 -18
  77. package/dist/renderers/IconToggleCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  78. package/dist/renderers/JsonCell.vue_vue_type_script_setup_true_lang.js +21 -20
  79. package/dist/renderers/JsonCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  80. package/dist/renderers/JsonTreeCell.vue_vue_type_script_setup_true_lang.js +21 -20
  81. package/dist/renderers/JsonTreeCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  82. package/dist/renderers/ListCell.vue_vue_type_script_setup_true_lang.js +18 -17
  83. package/dist/renderers/ListCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  84. package/dist/renderers/MultiLineCell.vue_vue_type_script_setup_true_lang.js +35 -34
  85. package/dist/renderers/MultiLineCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  86. package/dist/renderers/parts/CopyButton.vue_vue_type_script_setup_true_lang.js +19 -18
  87. package/dist/renderers/parts/CopyButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  88. package/dist/types/agent/requirements.d.ts +1 -1
  89. package/dist/types/components/VGrid.vue.d.ts +45 -9
  90. package/dist/types/components/VGridColumnMenu.vue.d.ts +4 -5
  91. package/dist/types/components/VGridMenu.vue.d.ts +1 -1
  92. package/dist/types/components/VGridPagination.vue.d.ts +8 -3
  93. package/dist/types/components/VGridSearch.vue.d.ts +2 -2
  94. package/dist/types/composables/useDataSource.d.ts +33 -2
  95. package/dist/types/composables/useGridExport.d.ts +4 -1
  96. package/dist/types/composables/useGridMenus.d.ts +3 -1
  97. package/dist/types/composables/useRowGrouping.d.ts +12 -1
  98. package/dist/types/composables/useServerGroups.d.ts +37 -0
  99. package/dist/types/composables/useStatusBar.d.ts +7 -0
  100. package/dist/types/core/grouping.d.ts +26 -0
  101. package/dist/types/features/export.d.ts +2 -1
  102. package/dist/types/features/index.d.ts +2 -1
  103. package/dist/types/features/serverGrouping.d.ts +9 -0
  104. package/dist/types/index.d.ts +1 -1
  105. package/dist/types/internal/context.d.ts +5 -1
  106. package/dist/types/internal/features.d.ts +2 -1
  107. package/dist/types/internal/messages.d.ts +16 -0
  108. package/dist/types/internal/print.d.ts +16 -0
  109. package/dist/types/renderers/parts/CopyButton.vue.d.ts +1 -3
  110. package/dist/types/types.d.ts +305 -1
  111. package/llms-full.txt +264 -110
  112. package/llms.txt +1 -1
  113. package/package.json +1 -1
@@ -13,22 +13,23 @@ import { rowGroupingFeature as d } from "./rowGrouping.js";
13
13
  import { rowPinningFeature as f } from "./rowPinning.js";
14
14
  import { selectionFeature as p } from "./selection.js";
15
15
  import { serverDataFeature as m } from "./serverData.js";
16
- import { sortingFeature as h } from "./sorting.js";
17
- import { statusBarFeature as g } from "./statusBar.js";
18
- import { subGridsFeature as _ } from "./subGrids.js";
19
- import { virtualScrollingFeature as v } from "./virtualScrolling.js";
16
+ import { serverGroupingFeature as h } from "./serverGrouping.js";
17
+ import { sortingFeature as g } from "./sorting.js";
18
+ import { statusBarFeature as _ } from "./statusBar.js";
19
+ import { subGridsFeature as v } from "./subGrids.js";
20
+ import { virtualScrollingFeature as y } from "./virtualScrolling.js";
20
21
  // src/features/index.ts
21
- var y = [
22
- h,
22
+ var b = [
23
+ g,
23
24
  s,
24
25
  m,
25
26
  u,
26
27
  p,
27
- _,
28
+ v,
28
29
  l,
29
30
  i,
30
31
  n,
31
- v,
32
+ y,
32
33
  a,
33
34
  c,
34
35
  r,
@@ -37,8 +38,9 @@ var y = [
37
38
  e,
38
39
  d,
39
40
  o,
40
- g
41
+ _,
42
+ h
41
43
  ];
42
- export { e as aggregationFeature, y as allFeatures, t as columnGroupsFeature, n as columnPinningFeature, i as columnReorderFeature, r as columnResizingFeature, a as columnVisibilityFeature, o as exportFeature, s as filteringFeature, c as keyboardNavigationFeature, l as menusFeature, u as paginationFeature, d as rowGroupingFeature, f as rowPinningFeature, p as selectionFeature, m as serverDataFeature, h as sortingFeature, g as statusBarFeature, _ as subGridsFeature, v as virtualScrollingFeature };
44
+ export { e as aggregationFeature, b as allFeatures, t as columnGroupsFeature, n as columnPinningFeature, i as columnReorderFeature, r as columnResizingFeature, a as columnVisibilityFeature, o as exportFeature, s as filteringFeature, c as keyboardNavigationFeature, l as menusFeature, u as paginationFeature, d as rowGroupingFeature, f as rowPinningFeature, p as selectionFeature, m as serverDataFeature, h as serverGroupingFeature, g as sortingFeature, _ as statusBarFeature, v as subGridsFeature, y as virtualScrollingFeature };
43
45
 
44
46
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["allFeatures","sortingFeature","filteringFeature","serverDataFeature","paginationFeature","selectionFeature","subGridsFeature","menusFeature","columnReorderFeature","columnPinningFeature","virtualScrollingFeature","columnVisibilityFeature","keyboardNavigationFeature","columnResizingFeature","columnGroupsFeature","rowPinningFeature","aggregationFeature","rowGroupingFeature","exportFeature","statusBarFeature"],"sources":["../../src/features/index.ts"],"sourcesContent":["import type { GridFeature } from '../types'\nimport { aggregationFeature } from './aggregation'\nimport { columnGroupsFeature } from './columnGroups'\nimport { columnPinningFeature } from './columnPinning'\nimport { columnResizingFeature } from './columnResizing'\nimport { columnReorderFeature } from './columnReorder'\nimport { columnVisibilityFeature } from './columnVisibility'\nimport { exportFeature } from './export'\nimport { filteringFeature } from './filtering'\nimport { keyboardNavigationFeature } from './keyboardNavigation'\nimport { menusFeature } from './menus'\nimport { paginationFeature } from './pagination'\nimport { rowGroupingFeature } from './rowGrouping'\nimport { rowPinningFeature } from './rowPinning'\nimport { selectionFeature } from './selection'\nimport { serverDataFeature } from './serverData'\nimport { sortingFeature } from './sorting'\nimport { statusBarFeature } from './statusBar'\nimport { subGridsFeature } from './subGrids'\nimport { virtualScrollingFeature } from './virtualScrolling'\n\nexport {\n aggregationFeature,\n columnGroupsFeature,\n columnPinningFeature,\n columnReorderFeature,\n columnResizingFeature,\n columnVisibilityFeature,\n exportFeature,\n filteringFeature,\n keyboardNavigationFeature,\n menusFeature,\n paginationFeature,\n rowGroupingFeature,\n rowPinningFeature,\n selectionFeature,\n serverDataFeature,\n sortingFeature,\n statusBarFeature,\n subGridsFeature,\n virtualScrollingFeature,\n}\n\n/** Every built-in feature, for apps that want them all: `createVueGrid({ features: allFeatures })`. */\nexport const allFeatures: readonly GridFeature[] = [\n sortingFeature,\n filteringFeature,\n serverDataFeature,\n paginationFeature,\n selectionFeature,\n subGridsFeature,\n menusFeature,\n columnReorderFeature,\n columnPinningFeature,\n virtualScrollingFeature,\n columnVisibilityFeature,\n keyboardNavigationFeature,\n columnResizingFeature,\n columnGroupsFeature,\n rowPinningFeature,\n aggregationFeature,\n rowGroupingFeature,\n exportFeature,\n statusBarFeature,\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4CA,IAAaA,IAAsC;CACjDC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;AACF"}
1
+ {"version":3,"file":"index.js","names":["allFeatures","sortingFeature","filteringFeature","serverDataFeature","paginationFeature","selectionFeature","subGridsFeature","menusFeature","columnReorderFeature","columnPinningFeature","virtualScrollingFeature","columnVisibilityFeature","keyboardNavigationFeature","columnResizingFeature","columnGroupsFeature","rowPinningFeature","aggregationFeature","rowGroupingFeature","exportFeature","statusBarFeature","serverGroupingFeature"],"sources":["../../src/features/index.ts"],"sourcesContent":["import type { GridFeature } from '../types'\nimport { aggregationFeature } from './aggregation'\nimport { columnGroupsFeature } from './columnGroups'\nimport { columnPinningFeature } from './columnPinning'\nimport { columnResizingFeature } from './columnResizing'\nimport { columnReorderFeature } from './columnReorder'\nimport { columnVisibilityFeature } from './columnVisibility'\nimport { exportFeature } from './export'\nimport { filteringFeature } from './filtering'\nimport { keyboardNavigationFeature } from './keyboardNavigation'\nimport { menusFeature } from './menus'\nimport { paginationFeature } from './pagination'\nimport { rowGroupingFeature } from './rowGrouping'\nimport { rowPinningFeature } from './rowPinning'\nimport { selectionFeature } from './selection'\nimport { serverDataFeature } from './serverData'\nimport { serverGroupingFeature } from './serverGrouping'\nimport { sortingFeature } from './sorting'\nimport { statusBarFeature } from './statusBar'\nimport { subGridsFeature } from './subGrids'\nimport { virtualScrollingFeature } from './virtualScrolling'\n\nexport {\n aggregationFeature,\n columnGroupsFeature,\n columnPinningFeature,\n columnReorderFeature,\n columnResizingFeature,\n columnVisibilityFeature,\n exportFeature,\n filteringFeature,\n keyboardNavigationFeature,\n menusFeature,\n paginationFeature,\n rowGroupingFeature,\n rowPinningFeature,\n selectionFeature,\n serverDataFeature,\n serverGroupingFeature,\n sortingFeature,\n statusBarFeature,\n subGridsFeature,\n virtualScrollingFeature,\n}\n\n/** Every built-in feature, for apps that want them all: `createVueGrid({ features: allFeatures })`. */\nexport const allFeatures: readonly GridFeature[] = [\n sortingFeature,\n filteringFeature,\n serverDataFeature,\n paginationFeature,\n selectionFeature,\n subGridsFeature,\n menusFeature,\n columnReorderFeature,\n columnPinningFeature,\n virtualScrollingFeature,\n columnVisibilityFeature,\n keyboardNavigationFeature,\n columnResizingFeature,\n columnGroupsFeature,\n rowPinningFeature,\n aggregationFeature,\n rowGroupingFeature,\n exportFeature,\n statusBarFeature,\n serverGroupingFeature,\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8CA,IAAaA,IAAsC;CACjDC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;AACF"}
@@ -0,0 +1,9 @@
1
+ import { useServerGroups as e } from "../composables/useServerGroups.js";
2
+ // src/features/serverGrouping.ts
3
+ var t = {
4
+ feature: "serverGrouping",
5
+ useServerGroups: e
6
+ };
7
+ export { t as serverGroupingFeature };
8
+
9
+ //# sourceMappingURL=serverGrouping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serverGrouping.js","names":["serverGroupingFeature"],"sources":["../../src/features/serverGrouping.ts"],"sourcesContent":["import { useServerGroups } from '../composables/useServerGroups'\nimport type { ServerGroupingFeature } from '../types'\n\n/**\n * Row grouping with server data: with `group-by` and a `data-source`, the query carries `groupBy` and\n * `groupPath`, the server answers with groups (value, count, aggregates), and each group's contents\n * load when it expands. A group's checkbox selects it by query (`v-model:selected-groups`), without\n * loading its rows. Needs the row grouping and server data features too. Without it, a grouped\n * server grid groups only the rows it has loaded.\n */\nexport const serverGroupingFeature: ServerGroupingFeature = {\n feature: 'serverGrouping',\n useServerGroups,\n}\n"],"mappings":";;AAUA,IAAaA,IAA+C;CAC1D,SAAS;CACT;AACF"}
package/dist/index.js CHANGED
@@ -65,9 +65,10 @@ import { rowGroupingFeature as Dt } from "./features/rowGrouping.js";
65
65
  import { rowPinningFeature as Ot } from "./features/rowPinning.js";
66
66
  import { selectionFeature as kt } from "./features/selection.js";
67
67
  import { serverDataFeature as At } from "./features/serverData.js";
68
- import { sortingFeature as jt } from "./features/sorting.js";
69
- import { statusBarFeature as Mt } from "./features/statusBar.js";
70
- import { subGridsFeature as Nt } from "./features/subGrids.js";
71
- import { virtualScrollingFeature as Pt } from "./features/virtualScrolling.js";
72
- import { allFeatures as Ft } from "./features/index.js";
73
- export { me as ActionButtonCell, he as ActionsMenuCell, ge as BooleanCell, Oe as ButtonGroupCell, _e as ChangeCell, ke as CheckboxCell, Ae as ChipCell, je as CodeCell, Me as CopyCell, ve as CurrencyCell, d as DATE_DEFAULT, ye as DateCell, be as DateTimeCell, Ne as DetailsCell, Pe as EditCell, D as GRID_CONFIG_KEY, xe as IconCell, Fe as IconToggleCell, Ie as ImageCell, Se as JsonCell, Ce as JsonTreeCell, we as LinkCell, Le as ListCell, Re as MultiLineCell, Te as NumberCell, ze as RadioCell, Ee as StatusCell, Be as SwitchCell, f as TIME_DEFAULT, l as TextCell, De as ToggleTextCell, e as VGrid, n as VGridColumnMenu, r as VGridMenu, t as VGridPagination, i as VGridSearch, Ve as actionButtonRenderer, He as actionsMenuRenderer, ne as activeFilterCount, K as aggregateRows, q as aggregateValues, gt as aggregationFeature, Ft as allFeatures, Ue as allRenderers, T as anchorNameFor, We as booleanRenderer, Ge as buttonGroupRenderer, Ke as changeRenderer, qe as checkboxRenderer, Je as chipRenderer, Ye as codeRenderer, _t as columnGroupsFeature, vt as columnPinningFeature, bt as columnReorderFeature, yt as columnResizingFeature, xt as columnVisibilityFeature, U as compareValues, Xe as copyRenderer, pe as createColumnHelper, A as createRendererRegistry, O as createVueGrid, Ze as currencyRenderer, Qe as dateRenderer, $e as dateTimeRenderer, j as defineCellRenderer, et as detailsRenderer, tt as editRenderer, I as effectivePin, re as emptyFilters, St as exportFeature, ie as filterTree, Ct as filteringFeature, ae as foldText, p as formatCurrency, m as formatDate, h as formatNumber, g as formatSigned, N as getByPath, P as getCellValue, J as groupRows, X as guardFormula, nt as iconRenderer, rt as iconToggleRenderer, it as imageRenderer, oe as isFilterActive, M as isRendererDefinition, Y as isRowGroup, at as jsonRenderer, ot as jsonTreeRenderer, wt as keyboardNavigationFeature, st as linkRenderer, ct as listRenderer, se as localFilterStorage, de as localStorageAdapter, a as lookup, ce as matchesFilter, Tt as menusFeature, L as moveColumn, R as moveColumnRelative, lt as multiLineRenderer, W as nextSort, z as normalizeColumnState, ut as numberRenderer, fe as pageItems, Et as paginationFeature, _ as parseJsonish, le as parseQuickFilter, te as patchRows, Z as plainText, dt as radioRenderer, v as readableTextColor, y as resolveImageSrc, o as resolveOption, F as resolveRowKey, s as resolveTone, Dt as rowGroupingFeature, Ot as rowPinningFeature, b as safeHref, c as safeTone, kt as selectionFeature, At as serverDataFeature, B as setColumnHidden, V as setColumnPinned, ue as setKey, ft as signedNumberRenderer, G as sortRows, jt as sortingFeature, Mt as statusBarFeature, pt as statusRenderer, x as stringifyJson, Nt as subGridsFeature, E as supportsAnchorPositioning, mt as switchRenderer, u as textRenderer, Q as toCsv, S as toDate, $ as toDelimited, C as toNumber, ee as toXlsx, ht as toggleTextRenderer, w as tokenizeJson, k as useGridContext, Pt as virtualScrollingFeature, H as visibleColumns };
68
+ import { serverGroupingFeature as jt } from "./features/serverGrouping.js";
69
+ import { sortingFeature as Mt } from "./features/sorting.js";
70
+ import { statusBarFeature as Nt } from "./features/statusBar.js";
71
+ import { subGridsFeature as Pt } from "./features/subGrids.js";
72
+ import { virtualScrollingFeature as Ft } from "./features/virtualScrolling.js";
73
+ import { allFeatures as It } from "./features/index.js";
74
+ export { me as ActionButtonCell, he as ActionsMenuCell, ge as BooleanCell, Oe as ButtonGroupCell, _e as ChangeCell, ke as CheckboxCell, Ae as ChipCell, je as CodeCell, Me as CopyCell, ve as CurrencyCell, d as DATE_DEFAULT, ye as DateCell, be as DateTimeCell, Ne as DetailsCell, Pe as EditCell, D as GRID_CONFIG_KEY, xe as IconCell, Fe as IconToggleCell, Ie as ImageCell, Se as JsonCell, Ce as JsonTreeCell, we as LinkCell, Le as ListCell, Re as MultiLineCell, Te as NumberCell, ze as RadioCell, Ee as StatusCell, Be as SwitchCell, f as TIME_DEFAULT, l as TextCell, De as ToggleTextCell, e as VGrid, n as VGridColumnMenu, r as VGridMenu, t as VGridPagination, i as VGridSearch, Ve as actionButtonRenderer, He as actionsMenuRenderer, ne as activeFilterCount, K as aggregateRows, q as aggregateValues, gt as aggregationFeature, It as allFeatures, Ue as allRenderers, T as anchorNameFor, We as booleanRenderer, Ge as buttonGroupRenderer, Ke as changeRenderer, qe as checkboxRenderer, Je as chipRenderer, Ye as codeRenderer, _t as columnGroupsFeature, vt as columnPinningFeature, bt as columnReorderFeature, yt as columnResizingFeature, xt as columnVisibilityFeature, U as compareValues, Xe as copyRenderer, pe as createColumnHelper, A as createRendererRegistry, O as createVueGrid, Ze as currencyRenderer, Qe as dateRenderer, $e as dateTimeRenderer, j as defineCellRenderer, et as detailsRenderer, tt as editRenderer, I as effectivePin, re as emptyFilters, St as exportFeature, ie as filterTree, Ct as filteringFeature, ae as foldText, p as formatCurrency, m as formatDate, h as formatNumber, g as formatSigned, N as getByPath, P as getCellValue, J as groupRows, X as guardFormula, nt as iconRenderer, rt as iconToggleRenderer, it as imageRenderer, oe as isFilterActive, M as isRendererDefinition, Y as isRowGroup, at as jsonRenderer, ot as jsonTreeRenderer, wt as keyboardNavigationFeature, st as linkRenderer, ct as listRenderer, se as localFilterStorage, de as localStorageAdapter, a as lookup, ce as matchesFilter, Tt as menusFeature, L as moveColumn, R as moveColumnRelative, lt as multiLineRenderer, W as nextSort, z as normalizeColumnState, ut as numberRenderer, fe as pageItems, Et as paginationFeature, _ as parseJsonish, le as parseQuickFilter, te as patchRows, Z as plainText, dt as radioRenderer, v as readableTextColor, y as resolveImageSrc, o as resolveOption, F as resolveRowKey, s as resolveTone, Dt as rowGroupingFeature, Ot as rowPinningFeature, b as safeHref, c as safeTone, kt as selectionFeature, At as serverDataFeature, jt as serverGroupingFeature, B as setColumnHidden, V as setColumnPinned, ue as setKey, ft as signedNumberRenderer, G as sortRows, Mt as sortingFeature, Nt as statusBarFeature, pt as statusRenderer, x as stringifyJson, Pt as subGridsFeature, E as supportsAnchorPositioning, mt as switchRenderer, u as textRenderer, Q as toCsv, S as toDate, $ as toDelimited, C as toNumber, ee as toXlsx, ht as toggleTextRenderer, w as tokenizeJson, k as useGridContext, Ft as virtualScrollingFeature, H as visibleColumns };
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","names":["SELECT_COLUMN_KEY","GRID_CONTEXT_KEY","useInternalGrid","ctx","inject"],"sources":["../../src/internal/context.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any -- rows are an opaque, type-erased T inside the grid internals; the public <VGrid generic=\"T\"> API stays fully typed. */\nimport { inject, type Component, type ComputedRef, type InjectionKey, type Slots } from 'vue'\nimport type {\n Align,\n CellRendererDefinition,\n ClassValue,\n ColumnDef,\n FlashMode,\n GridPart,\n RowKey,\n} from '../types'\nimport type { ColumnFilter, FilterState, FilterType } from '../core/filter'\nimport type { SelectionSummary } from '../core/selection'\nimport type { SubRowEntry } from '../composables/useSubRows'\nimport type { DistinctValue } from '../composables/useGridFilters'\nimport type { VirtualRowsContext } from '../composables/useVirtualRows'\n\nexport const SELECT_COLUMN_KEY = '__vg_select'\n\n/** A visible column with everything the cells need precomputed. */\nexport interface ResolvedColumn {\n key: string\n kind: 'data' | 'select'\n def: ColumnDef\n component: Component | undefined\n definition: CellRendererDefinition | undefined\n options: Record<string, unknown>\n align: Align\n pinned: 'left' | 'right' | undefined\n /** Last left-pinned or first right-pinned column. Only set where CSS `:has()` is unsupported. */\n pinEdge: boolean\n /** First data column — hosts the expander and the depth indent. */\n isTree: boolean\n}\n\nexport interface GridContext {\n columns: ComputedRef<ResolvedColumn[]>\n slots: Slots\n ui: ComputedRef<Partial<Record<GridPart, ClassValue>>>\n getKey(row: any): RowKey\n /**\n * Keyboard navigation (ARIA grid) is on: cells are `gridcell`s and the grid's own controls are\n * `tabindex=\"-1\"` (reached with the arrow keys). Off: an ARIA `table` with tabbable controls.\n */\n keyboardNav: boolean\n /** `gridcell` or `cell`, by `keyboardNav`. */\n cellRole: 'gridcell' | 'cell'\n /** Tabindex for the grid's own controls and cells: `-1` with keyboard navigation, else none. */\n rovingTabindex: -1 | undefined\n /** Filters (client mode) and sorts one level of rows. */\n sortRows(rows: readonly any[]): any[]\n /** The sorting feature is on and the column is `sortable`. */\n sortable(col: ColumnDef): boolean\n /** Only with the column resizing feature. */\n resize?: {\n /** The header edge grip component. */\n Handle: Component\n can(col: ColumnDef): boolean\n start(event: PointerEvent, key: string): void\n autosize(key: string): void\n step(key: string, delta: number): void\n /** Has a resized width (or is being resized): its cells clip their content. */\n isSized(key: string): boolean\n }\n /** Header rows above the body (2 with column groups). */\n headerRows: ComputedRef<number>\n /** Pinned rows (and a totals row) above the body: offsets the body's `aria-rowindex`. */\n pinnedTopCount: ComputedRef<number>\n /** Aggregation feature with a totals row: the values by column key, and the row's label. */\n totals?: {\n values: ComputedRef<Record<string, unknown>>\n label: ComputedRef<string>\n }\n /** Row grouping feature, with rows grouped: renders the cells of group rows. */\n grouping?: { GroupCells: Component; isGroup(row: any): boolean }\n // expansion\n /** Rows nest (sub-grids, or grouped rows): the first column has the expander gutter. */\n treeMode: ComputedRef<boolean>\n hasDetail: ComputedRef<boolean>\n canExpand(row: any): boolean\n isExpanded(key: RowKey): boolean\n toggleExpanded(row: any): void\n children(row: any): any[] | undefined\n subRowState(row: any): SubRowEntry | undefined\n ensureSubRows(row: any): void\n retrySubRows(row: any): void\n // selection\n selectMode: ComputedRef<false | 'multi' | 'single'>\n /** The selection checkbox (from the selection feature; only rendered when `selectMode` is set). */\n Checkbox: Component | undefined\n isRowSelectable(row: any): boolean\n rowCheckState(row: any): SelectionSummary\n /** `range`: Shift was held — select from the last toggled row to this one. */\n toggleRow(row: any, range?: boolean): void\n // presentation & events\n isHighlighted(key: RowKey): boolean\n rowClass(row: any, index: number): ClassValue\n rowClickable: ComputedRef<boolean>\n /** Grid-wide change highlight (columns may override with `flash`). */\n flash: ComputedRef<FlashMode>\n /** Only with the filtering feature. */\n filters?: {\n FilterButton: Component\n FilterInput: Component\n state: ComputedRef<FilterState>\n setSearch(search: string): void\n setColumnFilter(key: string, filter: ColumnFilter | undefined): void\n isActive(key: string): boolean\n typeOf(col: ColumnDef): FilterType | 'custom'\n /** Show the filter row (inputs inside the header cells). */\n filterRow: ComputedRef<boolean>\n /** Distinct values of a column, for its value-list filter. */\n distinct(key: string): DistinctValue[]\n /** DOM id of a column's filter popover. */\n idFor(key: string): string\n /** Opens a column's filter popover (header menu, filter row). */\n open(key: string): void\n }\n virtual: ComputedRef<boolean>\n /** With the virtual scrolling feature: windowing of each level of rows, and measuring. */\n virtualRows?: VirtualRowsContext\n pinStyle(key: string): Record<string, string> | undefined\n onRowClick(row: any, key: RowKey, event: MouseEvent | KeyboardEvent): void\n onCellClick(\n row: any,\n key: RowKey,\n column: ResolvedColumn,\n event: MouseEvent | KeyboardEvent,\n ): void\n onCellAction(row: any, key: RowKey, column: ResolvedColumn, name: string, payload: unknown): void\n onCellContextMenu(\n row: any,\n key: RowKey,\n column: ResolvedColumn,\n event: MouseEvent,\n el: HTMLElement,\n ): void\n onHeaderContextMenu(column: ResolvedColumn, event: MouseEvent, el: HTMLElement): void\n /** Menus feature: a `pointerdown` on a body cell (touch: hold for its menu). */\n onCellPointerDown?(\n row: any,\n key: RowKey,\n column: ResolvedColumn,\n event: PointerEvent,\n el: HTMLElement,\n ): void\n}\n\n/** A row in a pinned section: a pinned data row, or the totals row. */\nexport interface PinnedRowItem {\n /** Unique within the grid's pinned rows. */\n id: string\n kind: 'row' | 'total'\n row: any\n key: RowKey\n /** Shows the selection checkbox (pinned rows of the data, not the app's extra rows). */\n selectable: boolean\n}\n\nexport const GRID_CONTEXT_KEY: InjectionKey<GridContext> = Symbol('vue-grid:context')\n\nexport function useInternalGrid(): GridContext {\n const ctx = inject(GRID_CONTEXT_KEY)\n if (!ctx) throw new Error('[vue-grid] internal component used outside <VGrid>')\n return ctx\n}\n"],"mappings":";;AAiBA,IAAaA,IAAoB,eA8IpBC,IAA8C,OAAO,kBAAkB;AAEpF,SAAgBC,IAA+B;CAC7C,IAAMC,IAAMC,EAAOH,CAAgB;CACnC,IAAI,CAACE,GAAK,MAAU,MAAM,oDAAoD;CAC9E,OAAOA;AACT"}
1
+ {"version":3,"file":"context.js","names":["SELECT_COLUMN_KEY","GRID_CONTEXT_KEY","useInternalGrid","ctx","inject"],"sources":["../../src/internal/context.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any -- rows are an opaque, type-erased T inside the grid internals; the public <VGrid generic=\"T\"> API stays fully typed. */\nimport { inject, type Component, type ComputedRef, type InjectionKey, type Slots } from 'vue'\nimport type {\n Align,\n CellRendererDefinition,\n ClassValue,\n ColumnDef,\n FlashMode,\n GridMessages,\n GridPart,\n GridParts,\n RowKey,\n} from '../types'\nimport type { ColumnFilter, FilterState, FilterType } from '../core/filter'\nimport type { SelectionSummary } from '../core/selection'\nimport type { SubRowEntry } from '../composables/useSubRows'\nimport type { DistinctValue } from '../composables/useGridFilters'\nimport type { VirtualRowsContext } from '../composables/useVirtualRows'\n\nexport const SELECT_COLUMN_KEY = '__vg_select'\n\n/** A visible column with everything the cells need precomputed. */\nexport interface ResolvedColumn {\n key: string\n kind: 'data' | 'select'\n def: ColumnDef\n component: Component | undefined\n definition: CellRendererDefinition | undefined\n options: Record<string, unknown>\n align: Align\n pinned: 'left' | 'right' | undefined\n /** Last left-pinned or first right-pinned column. Only set where CSS `:has()` is unsupported. */\n pinEdge: boolean\n /** First data column — hosts the expander and the depth indent. */\n isTree: boolean\n}\n\nexport interface GridContext {\n columns: ComputedRef<ResolvedColumn[]>\n slots: Slots\n /** Built-in text (the grid's over the app's); each use keeps its English default. */\n messages: ComputedRef<GridMessages>\n /** Built-in parts; a part is on unless `false`. */\n parts: ComputedRef<GridParts>\n ui: ComputedRef<Partial<Record<GridPart, ClassValue>>>\n getKey(row: any): RowKey\n /**\n * Keyboard navigation (ARIA grid) is on: cells are `gridcell`s and the grid's own controls are\n * `tabindex=\"-1\"` (reached with the arrow keys). Off: an ARIA `table` with tabbable controls.\n */\n keyboardNav: boolean\n /** `gridcell` or `cell`, by `keyboardNav`. */\n cellRole: 'gridcell' | 'cell'\n /** Tabindex for the grid's own controls and cells: `-1` with keyboard navigation, else none. */\n rovingTabindex: -1 | undefined\n /** Filters (client mode) and sorts one level of rows. */\n sortRows(rows: readonly any[]): any[]\n /** The sorting feature is on and the column is `sortable`. */\n sortable(col: ColumnDef): boolean\n /** Only with the column resizing feature. */\n resize?: {\n /** The header edge grip component. */\n Handle: Component\n can(col: ColumnDef): boolean\n start(event: PointerEvent, key: string): void\n autosize(key: string): void\n step(key: string, delta: number): void\n /** Has a resized width (or is being resized): its cells clip their content. */\n isSized(key: string): boolean\n }\n /** Header rows above the body (2 with column groups). */\n headerRows: ComputedRef<number>\n /** Pinned rows (and a totals row) above the body: offsets the body's `aria-rowindex`. */\n pinnedTopCount: ComputedRef<number>\n /** Aggregation feature with a totals row: the values by column key, and the row's label. */\n totals?: {\n values: ComputedRef<Record<string, unknown>>\n label: ComputedRef<string>\n }\n /** Row grouping feature, with rows grouped: renders the cells of group rows. */\n grouping?: { GroupCells: Component; isGroup(row: any): boolean }\n // expansion\n /** Rows nest (sub-grids, or grouped rows): the first column has the expander gutter. */\n treeMode: ComputedRef<boolean>\n hasDetail: ComputedRef<boolean>\n canExpand(row: any): boolean\n isExpanded(key: RowKey): boolean\n toggleExpanded(row: any): void\n children(row: any): any[] | undefined\n subRowState(row: any): SubRowEntry | undefined\n ensureSubRows(row: any): void\n retrySubRows(row: any): void\n // selection\n selectMode: ComputedRef<false | 'multi' | 'single'>\n /** The selection checkbox (from the selection feature; only rendered when `selectMode` is set). */\n Checkbox: Component | undefined\n isRowSelectable(row: any): boolean\n rowCheckState(row: any): SelectionSummary\n /** `range`: Shift was held — select from the last toggled row to this one. */\n toggleRow(row: any, range?: boolean): void\n // presentation & events\n isHighlighted(key: RowKey): boolean\n rowClass(row: any, index: number): ClassValue\n rowClickable: ComputedRef<boolean>\n /** Grid-wide change highlight (columns may override with `flash`). */\n flash: ComputedRef<FlashMode>\n /** Only with the filtering feature. */\n filters?: {\n FilterButton: Component\n FilterInput: Component\n state: ComputedRef<FilterState>\n setSearch(search: string): void\n setColumnFilter(key: string, filter: ColumnFilter | undefined): void\n isActive(key: string): boolean\n typeOf(col: ColumnDef): FilterType | 'custom'\n /** Show the filter row (inputs inside the header cells). */\n filterRow: ComputedRef<boolean>\n /** Distinct values of a column, for its value-list filter. */\n distinct(key: string): DistinctValue[]\n /** DOM id of a column's filter popover. */\n idFor(key: string): string\n /** Opens a column's filter popover (header menu, filter row). */\n open(key: string): void\n }\n virtual: ComputedRef<boolean>\n /** With the virtual scrolling feature: windowing of each level of rows, and measuring. */\n virtualRows?: VirtualRowsContext\n pinStyle(key: string): Record<string, string> | undefined\n onRowClick(row: any, key: RowKey, event: MouseEvent | KeyboardEvent): void\n onCellClick(\n row: any,\n key: RowKey,\n column: ResolvedColumn,\n event: MouseEvent | KeyboardEvent,\n ): void\n onCellAction(row: any, key: RowKey, column: ResolvedColumn, name: string, payload: unknown): void\n onCellContextMenu(\n row: any,\n key: RowKey,\n column: ResolvedColumn,\n event: MouseEvent,\n el: HTMLElement,\n ): void\n onHeaderContextMenu(column: ResolvedColumn, event: MouseEvent, el: HTMLElement): void\n /** Menus feature: a `pointerdown` on a body cell (touch: hold for its menu). */\n onCellPointerDown?(\n row: any,\n key: RowKey,\n column: ResolvedColumn,\n event: PointerEvent,\n el: HTMLElement,\n ): void\n}\n\n/** A row in a pinned section: a pinned data row, or the totals row. */\nexport interface PinnedRowItem {\n /** Unique within the grid's pinned rows. */\n id: string\n kind: 'row' | 'total'\n row: any\n key: RowKey\n /** Shows the selection checkbox (pinned rows of the data, not the app's extra rows). */\n selectable: boolean\n}\n\nexport const GRID_CONTEXT_KEY: InjectionKey<GridContext> = Symbol('vue-grid:context')\n\nexport function useInternalGrid(): GridContext {\n const ctx = inject(GRID_CONTEXT_KEY)\n if (!ctx) throw new Error('[vue-grid] internal component used outside <VGrid>')\n return ctx\n}\n"],"mappings":";;AAmBA,IAAaA,IAAoB,eAkJpBC,IAA8C,OAAO,kBAAkB;AAEpF,SAAgBC,IAA+B;CAC7C,IAAMC,IAAMC,EAAOH,CAAgB;CACnC,IAAI,CAACE,GAAK,MAAU,MAAM,oDAAoD;CAC9E,OAAOA;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"features.js","names":["resolveFeatures","lists","set","list","f"],"sources":["../../src/internal/features.ts"],"sourcesContent":["import type {\n AggregationFeature,\n ExportFeature,\n RowGroupingFeature,\n RowPinningFeature,\n ColumnGroupsFeature,\n ColumnPinningFeature,\n ColumnResizingFeature,\n ColumnReorderFeature,\n ColumnVisibilityFeature,\n FilteringFeature,\n KeyboardNavigationFeature,\n GridFeature,\n MenusFeature,\n PaginationFeature,\n SelectionFeature,\n ServerDataFeature,\n SortingFeature,\n StatusBarFeature,\n SubGridsFeature,\n VirtualScrollingFeature,\n} from '../types'\n\n/** The features a grid has, by name. */\nexport interface FeatureSet {\n sorting?: SortingFeature\n filtering?: FilteringFeature\n serverData?: ServerDataFeature\n pagination?: PaginationFeature\n selection?: SelectionFeature\n subGrids?: SubGridsFeature\n menus?: MenusFeature\n columnReorder?: ColumnReorderFeature\n columnPinning?: ColumnPinningFeature\n virtualScrolling?: VirtualScrollingFeature\n columnVisibility?: ColumnVisibilityFeature\n keyboardNavigation?: KeyboardNavigationFeature\n columnResizing?: ColumnResizingFeature\n columnGroups?: ColumnGroupsFeature\n rowPinning?: RowPinningFeature\n aggregation?: AggregationFeature\n rowGrouping?: RowGroupingFeature\n export?: ExportFeature\n statusBar?: StatusBarFeature\n}\n\n/** Merges feature lists (app-wide, then per grid); a later entry with the same name wins. */\nexport function resolveFeatures(...lists: (readonly GridFeature[] | undefined)[]): FeatureSet {\n const set: Record<string, GridFeature> = {}\n for (const list of lists) for (const f of list ?? []) set[f.feature] = f\n return set as FeatureSet\n}\n"],"mappings":";AA+CA,SAAgBA,EAAgB,GAAGC,GAA2D;CAC5F,IAAMC,IAAmC,CAAC;CAC1C,KAAK,IAAMC,KAAQF,GAAO,KAAK,IAAMG,KAAKD,KAAQ,CAAC,GAAG,EAAIC,EAAE,WAAWA;CACvE,OAAOF;AACT"}
1
+ {"version":3,"file":"features.js","names":["resolveFeatures","lists","set","list","f"],"sources":["../../src/internal/features.ts"],"sourcesContent":["import type {\n AggregationFeature,\n ExportFeature,\n RowGroupingFeature,\n RowPinningFeature,\n ColumnGroupsFeature,\n ColumnPinningFeature,\n ColumnResizingFeature,\n ColumnReorderFeature,\n ColumnVisibilityFeature,\n FilteringFeature,\n KeyboardNavigationFeature,\n GridFeature,\n MenusFeature,\n PaginationFeature,\n SelectionFeature,\n ServerDataFeature,\n ServerGroupingFeature,\n SortingFeature,\n StatusBarFeature,\n SubGridsFeature,\n VirtualScrollingFeature,\n} from '../types'\n\n/** The features a grid has, by name. */\nexport interface FeatureSet {\n sorting?: SortingFeature\n filtering?: FilteringFeature\n serverData?: ServerDataFeature\n pagination?: PaginationFeature\n selection?: SelectionFeature\n subGrids?: SubGridsFeature\n menus?: MenusFeature\n columnReorder?: ColumnReorderFeature\n columnPinning?: ColumnPinningFeature\n virtualScrolling?: VirtualScrollingFeature\n columnVisibility?: ColumnVisibilityFeature\n keyboardNavigation?: KeyboardNavigationFeature\n columnResizing?: ColumnResizingFeature\n columnGroups?: ColumnGroupsFeature\n rowPinning?: RowPinningFeature\n aggregation?: AggregationFeature\n rowGrouping?: RowGroupingFeature\n export?: ExportFeature\n statusBar?: StatusBarFeature\n serverGrouping?: ServerGroupingFeature\n}\n\n/** Merges feature lists (app-wide, then per grid); a later entry with the same name wins. */\nexport function resolveFeatures(...lists: (readonly GridFeature[] | undefined)[]): FeatureSet {\n const set: Record<string, GridFeature> = {}\n for (const list of lists) for (const f of list ?? []) set[f.feature] = f\n return set as FeatureSet\n}\n"],"mappings":";AAiDA,SAAgBA,EAAgB,GAAGC,GAA2D;CAC5F,IAAMC,IAAmC,CAAC;CAC1C,KAAK,IAAMC,KAAQF,GAAO,KAAK,IAAMG,KAAKD,KAAQ,CAAC,GAAG,EAAIC,EAAE,WAAWA;CACvE,OAAOF;AACT"}
@@ -0,0 +1,20 @@
1
+ import { GRID_CONFIG_KEY as e } from "../registry/plugin.js";
2
+ import { computed as t, inject as n } from "vue";
3
+ // src/internal/messages.ts
4
+ var r = Symbol("vue-grid:messages"), i = Symbol("vue-grid:parts");
5
+ function a() {
6
+ let i = n(r, void 0);
7
+ if (i) return i;
8
+ let a = n(e, void 0);
9
+ return t(() => a?.messages ?? {});
10
+ }
11
+ function o() {
12
+ let r = n(i, void 0);
13
+ if (r) return r;
14
+ let a = n(e, void 0);
15
+ return t(() => a?.parts ?? {});
16
+ }
17
+ var s = (e, t) => e[t] !== !1;
18
+ export { r as MESSAGES_KEY, i as PARTS_KEY, s as partOn, a as useMessages, o as useParts };
19
+
20
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","names":["MESSAGES_KEY","PARTS_KEY","useMessages","grid","inject","config","GRID_CONFIG_KEY","computed","useParts","partOn","parts","name"],"sources":["../../src/internal/messages.ts"],"sourcesContent":["import { computed, inject, type ComputedRef, type InjectionKey } from 'vue'\nimport { GRID_CONFIG_KEY } from '../registry/plugin'\nimport type { GridMessages, GridParts } from '../types'\n\n/** A grid's messages and parts: its own props over `createVueGrid` config. */\nexport const MESSAGES_KEY: InjectionKey<ComputedRef<GridMessages>> = Symbol('vue-grid:messages')\nexport const PARTS_KEY: InjectionKey<ComputedRef<GridParts>> = Symbol('vue-grid:parts')\n\n/**\n * The built-in text in effect: the nearest grid's, else the app's (`createVueGrid({ messages })`),\n * for components used on their own (`<VGridPagination>`, `<VGridSearch>`…). Each caller keeps its\n * English default next to the text (`m.value.retry ?? 'Retry'`), so unused features' text\n * tree-shakes away with them.\n */\nexport function useMessages(): ComputedRef<GridMessages> {\n const grid = inject(MESSAGES_KEY, undefined)\n if (grid) return grid\n const config = inject(GRID_CONFIG_KEY, undefined)\n return computed(() => config?.messages ?? {})\n}\n\n/** The built-in parts in effect (each `true` unless turned off). */\nexport function useParts(): ComputedRef<GridParts> {\n const grid = inject(PARTS_KEY, undefined)\n if (grid) return grid\n const config = inject(GRID_CONFIG_KEY, undefined)\n return computed(() => config?.parts ?? {})\n}\n\n/** Is a part on? Parts are on unless set to `false`. */\nexport const partOn = (parts: GridParts, name: keyof GridParts) => parts[name] !== false\n"],"mappings":";;;AAKA,IAAaA,IAAwD,OAAO,mBAAmB,GAClFC,IAAkD,OAAO,gBAAgB;AAQtF,SAAgBC,IAAyC;CACvD,IAAMC,IAAOC,EAAOJ,GAAc,KAAA,CAAS;CAC3C,IAAIG,GAAM,OAAOA;CACjB,IAAME,IAASD,EAAOE,GAAiB,KAAA,CAAS;CAChD,OAAOC,QAAeF,GAAQ,YAAY,CAAC,CAAC;AAC9C;AAGA,SAAgBG,IAAmC;CACjD,IAAML,IAAOC,EAAOH,GAAW,KAAA,CAAS;CACxC,IAAIE,GAAM,OAAOA;CACjB,IAAME,IAASD,EAAOE,GAAiB,KAAA,CAAS;CAChD,OAAOC,QAAeF,GAAQ,SAAS,CAAC,CAAC;AAC3C;AAGA,IAAaI,KAAU,GAAkB,MAA0BC,EAAMC,OAAU"}
@@ -0,0 +1,51 @@
1
+ function e(e) {
2
+ return new Promise((t) => {
3
+ let n = document.createElement("iframe");
4
+ n.setAttribute("aria-hidden", "true"), n.tabIndex = -1, n.title = e.title ?? "Print", Object.assign(n.style, {
5
+ position: "fixed",
6
+ insetInlineStart: "-10000px",
7
+ insetBlockStart: "0",
8
+ width: "1000px",
9
+ height: "1000px",
10
+ border: "0"
11
+ }), document.body.appendChild(n);
12
+ let r = n.contentWindow, i = n.contentDocument, a = (e, t, n) => {
13
+ let r = i.createElement(e);
14
+ return t !== void 0 && (r.textContent = t), n && (r.className = n), r;
15
+ }, o = (t) => e.align[t] === "start" ? void 0 : e.align[t];
16
+ i.title = e.title ?? "", i.documentElement.lang = document.documentElement.lang || "en";
17
+ let s = a("style", "\n@page { margin: 12mm; }\n@page landscape { size: landscape; }\nhtml { font: 9.5pt/1.35 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: #111; }\nbody { margin: 0; }\nh1 { font-size: 12pt; margin: 0 0 6pt; }\ntable { border-collapse: collapse; width: 100%; }\nth, td { border: 0.5pt solid #bbb; padding: 2pt 4pt; text-align: start; vertical-align: top;\n overflow-wrap: anywhere; white-space: pre-line; }\nthead th { background: #eef1f5; font-weight: 600; -webkit-print-color-adjust: exact; print-color-adjust: exact; }\n.total td { font-weight: 700; border-top: 1pt solid #666; }\ntr { break-inside: avoid; }\n.end { text-align: end; font-variant-numeric: tabular-nums; }\n.center { text-align: center; }\n" + (e.landscape ? "body { page: landscape; }" : ""));
18
+ i.head.append(s), e.title && i.body.append(a("h1", e.title));
19
+ let c = a("table");
20
+ if (e.header) {
21
+ let t = a("tr");
22
+ e.header.forEach((e, n) => {
23
+ let r = a("th", e, o(n));
24
+ r.scope = "col", t.append(r);
25
+ });
26
+ let n = a("thead");
27
+ n.append(t), c.append(n);
28
+ }
29
+ let l = a("tbody");
30
+ for (let t of e.body) {
31
+ let e = a("tr");
32
+ t.forEach((t, n) => e.append(a("td", t, o(n)))), l.append(e);
33
+ }
34
+ if (c.append(l), e.footer) {
35
+ let t = a("tr");
36
+ e.footer.forEach((e, n) => t.append(a("td", e, o(n)))), t.className = "total", l.append(t);
37
+ }
38
+ i.body.append(c);
39
+ let u = !1, d = () => {
40
+ u || (u = !0, window.removeEventListener("focus", d), n.remove(), t());
41
+ };
42
+ setTimeout(() => {
43
+ r.addEventListener("afterprint", d, { once: !0 }), r.focus();
44
+ let e = Date.now();
45
+ r.print(), Date.now() - e > 250 ? d() : u || window.addEventListener("focus", d, { once: !0 });
46
+ }, 0);
47
+ });
48
+ }
49
+ export { e as printTable };
50
+
51
+ //# sourceMappingURL=print.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"print.js","names":["printTable","frame","t","win","doc","el","node","tag","text","className","cls","i","style","table","row","th","h","thead","body","line","done","finish","resolve","started"],"sources":["../../src/internal/print.ts"],"sourcesContent":["import type { Align } from '../types'\n\n/** A table to print: text cells, with the header repeated on every page. */\nexport interface PrintTable {\n title?: string\n header?: readonly string[]\n body: readonly (readonly string[])[]\n /** A last, bold line (the totals row). */\n footer?: readonly string[]\n align: readonly Align[]\n landscape?: boolean\n}\n\nconst CSS = `\n@page { margin: 12mm; }\n@page landscape { size: landscape; }\nhtml { font: 9.5pt/1.35 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: #111; }\nbody { margin: 0; }\nh1 { font-size: 12pt; margin: 0 0 6pt; }\ntable { border-collapse: collapse; width: 100%; }\nth, td { border: 0.5pt solid #bbb; padding: 2pt 4pt; text-align: start; vertical-align: top;\n overflow-wrap: anywhere; white-space: pre-line; }\nthead th { background: #eef1f5; font-weight: 600; -webkit-print-color-adjust: exact; print-color-adjust: exact; }\n.total td { font-weight: 700; border-top: 1pt solid #666; }\ntr { break-inside: avoid; }\n.end { text-align: end; font-variant-numeric: tabular-nums; }\n.center { text-align: center; }\n`\n\n/**\n * Prints a table from a hidden frame: the browser's print dialog, with a real `<table>` (so the\n * header repeats on each page), built with DOM calls only. Resolves when printing is over.\n */\nexport function printTable(t: PrintTable): Promise<void> {\n return new Promise((resolve) => {\n const frame = document.createElement('iframe')\n frame.setAttribute('aria-hidden', 'true')\n frame.tabIndex = -1\n frame.title = t.title ?? 'Print'\n // Off-screen but laid out: some browsers print an invisible frame blank.\n Object.assign(frame.style, {\n position: 'fixed',\n insetInlineStart: '-10000px',\n insetBlockStart: '0',\n width: '1000px',\n height: '1000px',\n border: '0',\n })\n document.body.appendChild(frame)\n const win = frame.contentWindow!\n const doc = frame.contentDocument!\n const el = <K extends keyof HTMLElementTagNameMap>(\n tag: K,\n text?: string,\n className?: string,\n ) => {\n const node = doc.createElement(tag)\n if (text !== undefined) node.textContent = text\n if (className) node.className = className\n return node\n }\n const cls = (i: number) => (t.align[i] === 'start' ? undefined : t.align[i])\n\n doc.title = t.title ?? ''\n doc.documentElement.lang = document.documentElement.lang || 'en'\n const style = el('style', CSS + (t.landscape ? 'body { page: landscape; }' : ''))\n doc.head.append(style)\n if (t.title) doc.body.append(el('h1', t.title))\n const table = el('table')\n if (t.header) {\n const row = el('tr')\n t.header.forEach((h, i) => {\n const th = el('th', h, cls(i))\n th.scope = 'col'\n row.append(th)\n })\n const thead = el('thead')\n thead.append(row)\n table.append(thead)\n }\n const body = el('tbody')\n for (const line of t.body) {\n const row = el('tr')\n line.forEach((text, i) => row.append(el('td', text, cls(i))))\n body.append(row)\n }\n table.append(body)\n if (t.footer) {\n const row = el('tr')\n t.footer.forEach((text, i) => row.append(el('td', text, cls(i))))\n // A last body row, not a <tfoot>: browsers repeat a table footer on every printed page.\n row.className = 'total'\n body.append(row)\n }\n doc.body.append(table)\n\n let done = false\n const finish = () => {\n if (done) return\n done = true\n window.removeEventListener('focus', finish)\n frame.remove()\n resolve()\n }\n // After layout. `print()` blocks until the dialog closes in most browsers; where it doesn't,\n // `afterprint` (or the page getting focus back) ends it.\n setTimeout(() => {\n win.addEventListener('afterprint', finish, { once: true })\n win.focus()\n const started = Date.now()\n win.print()\n // It blocked while the dialog was open: printing is over.\n if (Date.now() - started > 250) finish()\n else if (!done) window.addEventListener('focus', finish, { once: true })\n }, 0)\n })\n}\n"],"mappings":"AAiCA,SAAgBA,EAAW,GAA8B;CACvD,OAAO,IAAI,SAAS,MAAY;EAC9B,IAAMC,IAAQ,SAAS,cAAc,QAAQ;EAa7C,AAZAA,EAAM,aAAa,eAAe,MAAM,GACxC,EAAM,WAAW,IACjB,EAAM,QAAQC,EAAE,SAAS,SAEzB,OAAO,OAAOD,EAAM,OAAO;GACzB,UAAU;GACV,kBAAkB;GAClB,iBAAiB;GACjB,OAAO;GACP,QAAQ;GACR,QAAQ;EACV,CAAC,GACD,SAAS,KAAK,YAAYA,CAAK;EAC/B,IAAME,IAAMF,EAAM,eACZG,IAAMH,EAAM,iBACZI,KACJ,GACA,GACA,MACG;GACH,IAAMC,IAAOF,EAAI,cAAcG,CAAG;GAGlC,OAFIC,MAAS,KAAA,MAAW,EAAK,cAAcA,IACvCC,MAAW,EAAK,YAAYA,IACzBH;EACT,GACMI,KAAO,MAAeR,EAAE,MAAMS,OAAO,UAAU,KAAA,IAAYT,EAAE,MAAMS;EAGzE,AADA,EAAI,QAAQT,EAAE,SAAS,IACvB,EAAI,gBAAgB,OAAO,SAAS,gBAAgB,QAAQ;EAC5D,IAAMU,IAAQP,EAAG,SAAS,2tBAAOH,EAAE,YAAY,8BAA8B,GAAG;EAEhF,AADAE,EAAI,KAAK,OAAOQ,CAAK,GACjBV,EAAE,SAAOE,EAAI,KAAK,OAAOC,EAAG,MAAMH,EAAE,KAAK,CAAC;EAC9C,IAAMW,IAAQR,EAAG,OAAO;EACxB,IAAIH,EAAE,QAAQ;GACZ,IAAMY,IAAMT,EAAG,IAAI;GACnB,EAAE,OAAO,SAAS,GAAG,MAAM;IACzB,IAAMU,IAAKV,EAAG,MAAMW,GAAGN,EAAIC,CAAC,CAAC;IAE7B,AADA,EAAG,QAAQ,OACXG,EAAI,OAAOC,CAAE;GACf,CAAC;GACD,IAAME,IAAQZ,EAAG,OAAO;GAExB,AADAY,EAAM,OAAOH,CAAG,GAChBD,EAAM,OAAOI,CAAK;EACpB;EACA,IAAMC,IAAOb,EAAG,OAAO;EACvB,KAAK,IAAMc,KAAQjB,EAAE,MAAM;GACzB,IAAMY,IAAMT,EAAG,IAAI;GAEnB,AADAc,EAAK,SAAS,GAAM,MAAML,EAAI,OAAOT,EAAG,MAAMG,GAAME,EAAIC,CAAC,CAAC,CAAC,CAAC,GAC5DO,EAAK,OAAOJ,CAAG;EACjB;EAEA,IADAD,EAAM,OAAOK,CAAI,GACbhB,EAAE,QAAQ;GACZ,IAAMY,IAAMT,EAAG,IAAI;GAInB,AAHAH,EAAE,OAAO,SAAS,GAAM,MAAMY,EAAI,OAAOT,EAAG,MAAMG,GAAME,EAAIC,CAAC,CAAC,CAAC,CAAC,GAEhE,EAAI,YAAY,SAChBO,EAAK,OAAOJ,CAAG;EACjB;EACA,EAAI,KAAK,OAAOD,CAAK;EAErB,IAAIO,IAAO,IACLC,UAAe;GACnB,AAAID,MACJ,IAAO,IACP,OAAO,oBAAoB,SAASC,CAAM,GAC1CpB,EAAM,OAAO,GACbqB,EAAQ;EACV;EAGA,iBAAiB;GAEf,AADAnB,EAAI,iBAAiB,cAAckB,GAAQ,EAAE,MAAM,GAAK,CAAC,GACzDlB,EAAI,MAAM;GACV,IAAMoB,IAAU,KAAK,IAAI;GAGzB,AAFApB,EAAI,MAAM,GAEN,KAAK,IAAI,IAAIoB,IAAU,MAAKF,EAAO,IAC7BD,KAAM,OAAO,iBAAiB,SAASC,GAAQ,EAAE,MAAM,GAAK,CAAC;EACzE,GAAG,CAAC;CACN,CAAC;AACH"}
@@ -1,11 +1,12 @@
1
1
  import e from "../components/VGridMenu.js";
2
2
  import { anchorNameFor as t } from "../internal/anchor.js";
3
- import { computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, normalizeStyle as c, openBlock as l, ref as u, unref as d, useId as f, withModifiers as p } from "vue";
3
+ import { useMessages as n } from "../internal/messages.js";
4
+ import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, normalizeStyle as l, openBlock as u, ref as d, unref as f, useId as p, withModifiers as m } from "vue";
4
5
  // src/renderers/ActionsMenuCell.vue?vue&type=script&setup=true&lang.ts
5
- var m = {
6
+ var h = {
6
7
  key: 0,
7
8
  class: "vg-actions-menu"
8
- }, h = ["aria-label", "aria-expanded"], g = /*@__PURE__*/ s({
9
+ }, g = ["aria-label", "aria-expanded"], _ = /*@__PURE__*/ c({
9
10
  __name: "ActionsMenuCell",
10
11
  props: {
11
12
  value: {},
@@ -17,59 +18,59 @@ var m = {
17
18
  options: {}
18
19
  },
19
20
  emits: ["action"],
20
- setup(s, { emit: g }) {
21
- let _ = s, v = g, y = f(), b = `vg-actions-${y}`, x = t(`actions-${y}`), S = u(!1), C = n(() => {
22
- let e = _.options.actions;
23
- return (typeof e == "function" ? e(_.row) : e) ?? [];
21
+ setup(c, { emit: _ }) {
22
+ let v = c, y = n(), b = _, x = p(), S = `vg-actions-${x}`, C = t(`actions-${x}`), w = d(!1), T = r(() => {
23
+ let e = v.options.actions;
24
+ return (typeof e == "function" ? e(v.row) : e) ?? [];
24
25
  });
25
- function w(e) {
26
- v("action", e.name, e);
26
+ function E(e) {
27
+ b("action", e.name, e);
27
28
  }
28
- return (t, n) => C.value.length ? (l(), i("span", m, [a("button", {
29
+ return (t, n) => T.value.length ? (u(), a("span", h, [o("button", {
29
30
  type: "button",
30
31
  class: "vg-icon-button",
31
- "aria-label": s.options.label ?? "Actions",
32
+ "aria-label": c.options.label ?? f(y).actions ?? "Actions",
32
33
  "aria-haspopup": "menu",
33
- "aria-expanded": S.value,
34
- "aria-controls": b,
35
- popovertarget: b,
36
- style: c({ "anchor-name": d(x) }),
37
- onClick: n[0] ||= p(() => {}, ["stop"])
38
- }, [...n[3] ||= [a("svg", {
34
+ "aria-expanded": w.value,
35
+ "aria-controls": S,
36
+ popovertarget: S,
37
+ style: l({ "anchor-name": f(C) }),
38
+ onClick: n[0] ||= m(() => {}, ["stop"])
39
+ }, [...n[3] ||= [o("svg", {
39
40
  viewBox: "0 0 16 16",
40
41
  "aria-hidden": "true"
41
42
  }, [
42
- a("circle", {
43
+ o("circle", {
43
44
  cx: "8",
44
45
  cy: "3",
45
46
  r: "1.5"
46
47
  }),
47
- a("circle", {
48
+ o("circle", {
48
49
  cx: "8",
49
50
  cy: "8",
50
51
  r: "1.5"
51
52
  }),
52
- a("circle", {
53
+ o("circle", {
53
54
  cx: "8",
54
55
  cy: "13",
55
56
  r: "1.5"
56
57
  })
57
- ], -1)]], 12, h), o(e, {
58
- id: b,
59
- items: C.value,
60
- label: s.options.label ?? "Actions",
61
- "anchor-name": d(x),
58
+ ], -1)]], 12, g), s(e, {
59
+ id: S,
60
+ items: T.value,
61
+ label: c.options.label ?? f(y).actions ?? "Actions",
62
+ "anchor-name": f(C),
62
63
  placement: "bottom-end",
63
- onSelect: w,
64
- onOpen: n[1] ||= (e) => S.value = !0,
65
- onClose: n[2] ||= (e) => S.value = !1
64
+ onSelect: E,
65
+ onOpen: n[1] ||= (e) => w.value = !0,
66
+ onClose: n[2] ||= (e) => w.value = !1
66
67
  }, null, 8, [
67
68
  "items",
68
69
  "label",
69
70
  "anchor-name"
70
- ])])) : r("", !0);
71
+ ])])) : i("", !0);
71
72
  }
72
73
  });
73
- export { g as default };
74
+ export { _ as default };
74
75
 
75
76
  //# sourceMappingURL=ActionsMenuCell.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActionsMenuCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_normalizeStyle","_unref","_withModifiers","_createVNode","VGridMenu","VGridMenu_default","_hoisted_1","_hoisted_2","ActionsMenuCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","uid","useId","menuId","anchor","anchorNameFor","open","ref","items","computed","a","choose","item","openBlock","createElementBlock","createElementVNode","normalizeStyle","unref","_cache","withModifiers","createVNode","createCommentVNode"],"sources":["../../src/renderers/ActionsMenuCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, useId } from 'vue'\nimport VGridMenu from '../components/VGridMenu.vue'\nimport { anchorNameFor } from '../internal/anchor'\nimport type { CellRendererEmits, CellRendererProps, MenuAction, MenuItem } from '../types'\nimport type { ActionsMenuOptions } from './options'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, ActionsMenuOptions>>()\nconst emit = defineEmits<CellRendererEmits>()\n\nconst uid = useId()\nconst menuId = `vg-actions-${uid}`\n// The trigger is the anchor; the menu is positioned against it purely in CSS and follows it\n// while the grid scrolls (no JS placement, no close-on-scroll).\nconst anchor = anchorNameFor(`actions-${uid}`)\nconst open = ref(false)\n\nconst items = computed<MenuItem[]>(() => {\n const a = props.options.actions\n return (typeof a === 'function' ? a(props.row) : a) ?? []\n})\n\nfunction choose(item: MenuAction) {\n emit('action', item.name, item)\n}\n</script>\n\n<template>\n <span v-if=\"items.length\" class=\"vg-actions-menu\">\n <button\n type=\"button\"\n class=\"vg-icon-button\"\n :aria-label=\"options.label ?? 'Actions'\"\n aria-haspopup=\"menu\"\n :aria-expanded=\"open\"\n :aria-controls=\"menuId\"\n :popovertarget=\"menuId\"\n :style=\"{ 'anchor-name': anchor }\"\n @click.stop\n >\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <circle cx=\"8\" cy=\"3\" r=\"1.5\" />\n <circle cx=\"8\" cy=\"8\" r=\"1.5\" />\n <circle cx=\"8\" cy=\"13\" r=\"1.5\" />\n </svg>\n </button>\n <VGridMenu\n :id=\"menuId\"\n :items=\"items\"\n :label=\"options.label ?? 'Actions'\"\n :anchor-name=\"anchor\"\n placement=\"bottom-end\"\n @select=\"choose\"\n @open=\"open = true\"\n @close=\"open = false\"\n />\n </span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAOA,IAAMa,IAAQC,GACRC,IAAOH,GAEPI,IAAMC,EAAM,GACZC,IAAS,cAAcF,KAGvBG,IAASC,EAAc,WAAWJ,GAAK,GACvCK,IAAOC,EAAI,EAAK,GAEhBC,IAAQC,QAA2B;GACvC,IAAMC,IAAIZ,EAAM,QAAQ;GACxB,QAAQ,OAAOY,KAAM,aAAaA,EAAEZ,EAAM,GAAG,IAAIY,MAAM,CAAC;EAC1D,CAAC;EAED,SAASC,EAAO,GAAkB;GAChC,EAAK,UAAUC,EAAK,MAAMA,CAAI;EAChC;E,iBAIcJ,EAAA,MAAM,UAAlBvB,EAAA,GAAAC,EA4BO,QA5BPQ,GA4BO,CA3BLP,EAgBS,UAAA;GAfP,MAAK;GACL,OAAM;GACL,cAAYY,EAAA,QAAQ,SAAK;GAC1B,iBAAc;GACb,iBAAeO,EAAA;GACf,iBAAeH;GACf,eAAeA;GACf,OAAKf,EAAA,EAAA,eAAmBC,EAAAe,CAAA,EAAM,CAAA;GAC9B,SAAK,AAAAc,EAAA,OAAA5B,QAAN,CAAA,GAAW,CAAA,MAAA,CAAA;E,iBAEXH,EAIM,OAAA;GAJD,SAAQ;GAAY,eAAY;;GACnCA,EAAgC,UAAA;IAAxB,IAAG;IAAI,IAAG;IAAI,GAAE;;GACxBA,EAAgC,UAAA;IAAxB,IAAG;IAAI,IAAG;IAAI,GAAE;;GACxBA,EAAiC,UAAA;IAAzB,IAAG;IAAI,IAAG;IAAK,GAAE;;E,kBAG7BI,EASEC,GAAA;GARC,IAAIW;GACJ,OAAOK,EAAA;GACP,OAAOT,EAAA,QAAQ,SAAK;GACpB,eAAaV,EAAAe,CAAA;GACd,WAAU;GACT,UAAQO;GACR,QAAI,AAAAO,EAAA,QAAA,MAAE,EAAA,QAAI;GACV,SAAK,AAAAA,EAAA,QAAA,MAAE,EAAA,QAAI"}
1
+ {"version":3,"file":"ActionsMenuCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_unref","_normalizeStyle","_withModifiers","_createVNode","VGridMenu","VGridMenu_default","_hoisted_1","_hoisted_2","ActionsMenuCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","m","useMessages","emit","uid","useId","menuId","anchor","anchorNameFor","open","ref","items","computed","a","choose","item","openBlock","createElementBlock","createElementVNode","unref","normalizeStyle","_cache","withModifiers","createVNode","createCommentVNode"],"sources":["../../src/renderers/ActionsMenuCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, useId } from 'vue'\nimport VGridMenu from '../components/VGridMenu.vue'\nimport { anchorNameFor } from '../internal/anchor'\nimport type { CellRendererEmits, CellRendererProps, MenuAction, MenuItem } from '../types'\nimport type { ActionsMenuOptions } from './options'\nimport { useMessages } from '../internal/messages'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, ActionsMenuOptions>>()\nconst m = useMessages()\nconst emit = defineEmits<CellRendererEmits>()\n\nconst uid = useId()\nconst menuId = `vg-actions-${uid}`\n// The trigger is the anchor; the menu is positioned against it purely in CSS and follows it\n// while the grid scrolls (no JS placement, no close-on-scroll).\nconst anchor = anchorNameFor(`actions-${uid}`)\nconst open = ref(false)\n\nconst items = computed<MenuItem[]>(() => {\n const a = props.options.actions\n return (typeof a === 'function' ? a(props.row) : a) ?? []\n})\n\nfunction choose(item: MenuAction) {\n emit('action', item.name, item)\n}\n</script>\n\n<template>\n <span v-if=\"items.length\" class=\"vg-actions-menu\">\n <button\n type=\"button\"\n class=\"vg-icon-button\"\n :aria-label=\"options.label ?? m.actions ?? 'Actions'\"\n aria-haspopup=\"menu\"\n :aria-expanded=\"open\"\n :aria-controls=\"menuId\"\n :popovertarget=\"menuId\"\n :style=\"{ 'anchor-name': anchor }\"\n @click.stop\n >\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <circle cx=\"8\" cy=\"3\" r=\"1.5\" />\n <circle cx=\"8\" cy=\"8\" r=\"1.5\" />\n <circle cx=\"8\" cy=\"13\" r=\"1.5\" />\n </svg>\n </button>\n <VGridMenu\n :id=\"menuId\"\n :items=\"items\"\n :label=\"options.label ?? m.actions ?? 'Actions'\"\n :anchor-name=\"anchor\"\n placement=\"bottom-end\"\n @select=\"choose\"\n @open=\"open = true\"\n @close=\"open = false\"\n />\n </span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAQA,IAAMa,IAAQC,GACRC,IAAIC,EAAY,GAChBC,IAAOL,GAEPM,IAAMC,EAAM,GACZC,IAAS,cAAcF,KAGvBG,IAASC,EAAc,WAAWJ,GAAK,GACvCK,IAAOC,EAAI,EAAK,GAEhBC,IAAQC,QAA2B;GACvC,IAAMC,IAAId,EAAM,QAAQ;GACxB,QAAQ,OAAOc,KAAM,aAAaA,EAAEd,EAAM,GAAG,IAAIc,MAAM,CAAC;EAC1D,CAAC;EAED,SAASC,EAAO,GAAkB;GAChC,EAAK,UAAUC,EAAK,MAAMA,CAAI;EAChC;E,iBAIcJ,EAAA,MAAM,UAAlBzB,EAAA,GAAAC,EA4BO,QA5BPQ,GA4BO,CA3BLP,EAgBS,UAAA;GAfP,MAAK;GACL,OAAM;GACL,cAAYY,EAAA,QAAQ,SAASX,EAAAY,CAAA,CAAC,CAAC,WAAO;GACvC,iBAAc;GACb,iBAAeQ,EAAA;GACf,iBAAeH;GACf,eAAeA;GACf,OAAKhB,EAAA,EAAA,eAAmBD,EAAAkB,CAAA,EAAM,CAAA;GAC9B,SAAK,AAAAc,EAAA,OAAA9B,QAAN,CAAA,GAAW,CAAA,MAAA,CAAA;E,iBAEXH,EAIM,OAAA;GAJD,SAAQ;GAAY,eAAY;;GACnCA,EAAgC,UAAA;IAAxB,IAAG;IAAI,IAAG;IAAI,GAAE;;GACxBA,EAAgC,UAAA;IAAxB,IAAG;IAAI,IAAG;IAAI,GAAE;;GACxBA,EAAiC,UAAA;IAAzB,IAAG;IAAI,IAAG;IAAK,GAAE;;E,kBAG7BI,EASEC,GAAA;GARC,IAAIa;GACJ,OAAOK,EAAA;GACP,OAAOX,EAAA,QAAQ,SAASX,EAAAY,CAAA,CAAC,CAAC,WAAO;GACjC,eAAaZ,EAAAkB,CAAA;GACd,WAAU;GACT,UAAQO;GACR,QAAI,AAAAO,EAAA,QAAA,MAAE,EAAA,QAAI;GACV,SAAK,AAAAA,EAAA,QAAA,MAAE,EAAA,QAAI"}
@@ -1,26 +1,27 @@
1
1
  import { useGridContext as e } from "../registry/plugin.js";
2
2
  import { formatCurrency as t, formatNumber as n, toNumber as r } from "./format.js";
3
- import { Fragment as i, computed as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, defineComponent as l, normalizeClass as u, openBlock as d, toDisplayString as f } from "vue";
3
+ import { useMessages as i } from "../internal/messages.js";
4
+ import { Fragment as a, computed as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, toDisplayString as p } from "vue";
4
5
  // src/renderers/ChangeCell.vue?vue&type=script&setup=true&lang.ts
5
- var p = [
6
+ var m = [
6
7
  "title",
7
8
  "role",
8
9
  "aria-label"
9
- ], m = {
10
+ ], h = {
10
11
  key: 0,
11
12
  class: "vg-change-icon",
12
13
  viewBox: "0 0 10 10",
13
14
  "aria-hidden": "true"
14
- }, h = {
15
+ }, g = {
15
16
  key: 0,
16
17
  d: "M5 1.5 9 7.5H1z"
17
- }, g = {
18
+ }, _ = {
18
19
  key: 1,
19
20
  d: "M5 8.5 1 2.5h8z"
20
- }, _ = {
21
+ }, v = {
21
22
  key: 0,
22
23
  class: "vg-sr-only"
23
- }, v = { class: "vg-change-value" }, y = /*@__PURE__*/ l({
24
+ }, y = { class: "vg-change-value" }, b = /*@__PURE__*/ u({
24
25
  __name: "ChangeCell",
25
26
  props: {
26
27
  value: {},
@@ -31,29 +32,29 @@ var p = [
31
32
  column: {},
32
33
  options: {}
33
34
  },
34
- setup(l) {
35
- let y = l, b = e(), x = a(() => {
36
- if (y.options.direction) return y.options.direction(y.value, y.row) ?? "equal";
37
- if (y.value === !0 || y.value === "true") return "up";
38
- if (y.value === !1 || y.value === "false") return "down";
39
- let e = r(y.value);
35
+ setup(u) {
36
+ let b = u, x = i(), S = e(), C = o(() => {
37
+ if (b.options.direction) return b.options.direction(b.value, b.row) ?? "equal";
38
+ if (b.value === !0 || b.value === "true") return "up";
39
+ if (b.value === !1 || b.value === "false") return "down";
40
+ let e = r(b.value);
40
41
  return e === null || e === 0 ? "equal" : e > 0 ? "up" : "down";
41
- }), S = a(() => {
42
- let { currency: e, format: i, placeholder: a } = y.options;
43
- return typeof y.value == "boolean" || y.value === "true" || y.value === "false" ? "" : r(y.value) === null ? y.value === null || y.value === void 0 ? a ?? "" : String(y.value) : e ? t(y.value, b.value, typeof e == "string" ? e : void 0, i) : n(y.value, b.value, i);
44
- }), C = a(() => ({
45
- up: "Increased",
46
- down: "Decreased",
42
+ }), w = o(() => {
43
+ let { currency: e, format: i, placeholder: a } = b.options;
44
+ return typeof b.value == "boolean" || b.value === "true" || b.value === "false" ? "" : r(b.value) === null ? b.value === null || b.value === void 0 ? a ?? "" : String(b.value) : e ? t(b.value, S.value, typeof e == "string" ? e : void 0, i) : n(b.value, S.value, i);
45
+ }), T = o(() => ({
46
+ up: x.value.increased ?? "Increased",
47
+ down: x.value.decreased ?? "Decreased",
47
48
  equal: ""
48
- })[x.value]), w = a(() => y.options.iconOnly || !S.value);
49
- return (e, t) => (d(), s("span", {
50
- class: u(["vg-change", `vg-change-${x.value}`]),
51
- title: w.value ? C.value || void 0 : S.value,
52
- role: w.value && C.value ? "img" : void 0,
53
- "aria-label": w.value && C.value ? [C.value, S.value].filter(Boolean).join(" ") : void 0
54
- }, [x.value === "equal" ? o("", !0) : (d(), s("svg", m, [x.value === "up" ? (d(), s("path", h)) : (d(), s("path", g))])), w.value ? o("", !0) : (d(), s(i, { key: 1 }, [C.value ? (d(), s("span", _, f(C.value), 1)) : o("", !0), c("span", v, f(S.value), 1)], 64))], 10, p));
49
+ })[C.value]), E = o(() => b.options.iconOnly || !w.value);
50
+ return (e, t) => (f(), c("span", {
51
+ class: d(["vg-change", `vg-change-${C.value}`]),
52
+ title: E.value ? T.value || void 0 : w.value,
53
+ role: E.value && T.value ? "img" : void 0,
54
+ "aria-label": E.value && T.value ? [T.value, w.value].filter(Boolean).join(" ") : void 0
55
+ }, [C.value === "equal" ? s("", !0) : (f(), c("svg", h, [C.value === "up" ? (f(), c("path", g)) : (f(), c("path", _))])), E.value ? s("", !0) : (f(), c(a, { key: 1 }, [T.value ? (f(), c("span", v, p(T.value), 1)) : s("", !0), l("span", y, p(w.value), 1)], 64))], 10, m));
55
56
  }
56
57
  });
57
- export { y as default };
58
+ export { b as default };
58
59
 
59
60
  //# sourceMappingURL=ChangeCell.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChangeCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_Fragment","_toDisplayString","_createElementVNode","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","ChangeCell_vue_vue_type_script_setup_true_lang_default","props","__props","ctx","useGridContext","direction","computed","n","toNumber","text","placeholder","currency","formatCurrency","format","formatNumber","srLabel","iconOnly","openBlock","createElementBlock","normalizeClass","createCommentVNode","Fragment","toDisplayString","createElementVNode"],"sources":["../../src/renderers/ChangeCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { useGridContext } from '../registry/plugin'\nimport type { CellRendererProps } from '../types'\nimport { formatCurrency, formatNumber, toNumber } from './format'\nimport type { ChangeOptions } from './options'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, ChangeOptions>>()\nconst ctx = useGridContext()\n\nconst direction = computed(() => {\n if (props.options.direction) return props.options.direction(props.value, props.row) ?? 'equal'\n // Booleans (also as strings, as some APIs send them) are a trend flag.\n if (props.value === true || props.value === 'true') return 'up'\n if (props.value === false || props.value === 'false') return 'down'\n const n = toNumber(props.value)\n return n === null || n === 0 ? 'equal' : n > 0 ? 'up' : 'down'\n})\n\nconst text = computed(() => {\n const { currency, format, placeholder } = props.options\n if (typeof props.value === 'boolean' || props.value === 'true' || props.value === 'false')\n return ''\n if (toNumber(props.value) === null) {\n return props.value === null || props.value === undefined\n ? (placeholder ?? '')\n : String(props.value)\n }\n if (currency)\n return formatCurrency(\n props.value,\n ctx.value,\n typeof currency === 'string' ? currency : undefined,\n format,\n )\n return formatNumber(props.value, ctx.value, format)\n})\n\nconst srLabel = computed(() => ({ up: 'Increased', down: 'Decreased', equal: '' })[direction.value])\nconst iconOnly = computed(() => props.options.iconOnly || !text.value)\n</script>\n\n<template>\n <span\n :class=\"['vg-change', `vg-change-${direction}`]\"\n :title=\"iconOnly ? srLabel || undefined : text\"\n :role=\"iconOnly && srLabel ? 'img' : undefined\"\n :aria-label=\"iconOnly && srLabel ? [srLabel, text].filter(Boolean).join(' ') : undefined\"\n >\n <svg v-if=\"direction !== 'equal'\" class=\"vg-change-icon\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path v-if=\"direction === 'up'\" d=\"M5 1.5 9 7.5H1z\" />\n <path v-else d=\"M5 8.5 1 2.5h8z\" />\n </svg>\n <template v-if=\"!iconOnly\">\n <span v-if=\"srLabel\" class=\"vg-sr-only\">{{ srLabel }}</span>\n <span class=\"vg-change-value\">{{ text }}</span>\n </template>\n </span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOA,IAAMa,IAAQC,GACRC,IAAMC,EAAe,GAErBC,IAAYC,QAAe;GAC/B,IAAIL,EAAM,QAAQ,WAAW,OAAOA,EAAM,QAAQ,UAAUA,EAAM,OAAOA,EAAM,GAAG,KAAK;GAEvF,IAAIA,EAAM,UAAU,MAAQA,EAAM,UAAU,QAAQ,OAAO;GAC3D,IAAIA,EAAM,UAAU,MAASA,EAAM,UAAU,SAAS,OAAO;GAC7D,IAAMM,IAAIC,EAASP,EAAM,KAAK;GAC9B,OAAOM,MAAM,QAAQA,MAAM,IAAI,UAAUA,IAAI,IAAI,OAAO;EAC1D,CAAC,GAEKE,IAAOH,QAAe;GAC1B,IAAM,EAAE,aAAU,WAAQ,mBAAgBL,EAAM;GAehD,OAdI,OAAOA,EAAM,SAAU,aAAaA,EAAM,UAAU,UAAUA,EAAM,UAAU,UACzE,KACLO,EAASP,EAAM,KAAK,MAAM,OACrBA,EAAM,UAAU,QAAQA,EAAM,UAAU,KAAA,IAC1CS,KAAe,KAChB,OAAOT,EAAM,KAAK,IAEpBU,IACKC,EACLX,EAAM,OACNE,EAAI,OACJ,OAAOQ,KAAa,WAAWA,IAAW,KAAA,GAC1CE,CACF,IACKC,EAAab,EAAM,OAAOE,EAAI,OAAOU,CAAM;EACpD,CAAC,GAEKE,IAAUT,SAAgB;GAAE,IAAI;GAAa,MAAM;GAAa,OAAO;EAAG,EAAA,CAAGD,EAAU,MAAM,GAC7FW,IAAWV,QAAeL,EAAM,QAAQ,YAAY,CAACQ,EAAK,KAAK;E,kBAInErB,EAAA,GAAAC,EAcO,QAAA;GAbJ,OAAKC,EAAA,CAAA,aAAA,aAA6Be,EAAA,OAAS,CAAA;GAC3C,OAAOW,EAAA,QAAWD,EAAA,SAAW,KAAA,IAAYN,EAAA;GACzC,MAAMO,EAAA,SAAYD,EAAA,QAAO,QAAW,KAAA;GACpC,cAAYC,EAAA,SAAYD,EAAA,QAAO,CAAIA,EAAA,OAASN,EAAA,KAAI,CAAA,CAAE,OAAO,OAAO,CAAA,CAAE,KAAI,GAAA,IAAQ,KAAA;E,IAEpEJ,EAAA,UAAS,U,aAApBjB,EAAA,GAAAC,EAGM,OAHNM,GAGM,CAFQU,EAAA,UAAS,QAArBjB,EAAA,GAAAC,EAAsD,QAAtDO,CAAsD,MACtDR,EAAA,GAAAC,EAAmC,QAAnCQ,CAAmC,E,KAEpBmB,EAAA,Q,aAAjB5B,EAAA,GAAAC,EAGWE,GAAA,EAAA,KAAA,EAAA,GAAA,CAFGwB,EAAA,SAAZ3B,EAAA,GAAAC,EAA4D,QAA5DS,GAA4DN,EAAjBuB,EAAA,KAAO,GAAA,CAAA,K,WAClDtB,EAA+C,QAA/CM,GAA+CP,EAAdiB,EAAA,KAAI,GAAA,CAAA,C"}
1
+ {"version":3,"file":"ChangeCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_Fragment","_toDisplayString","_createElementVNode","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","ChangeCell_vue_vue_type_script_setup_true_lang_default","props","__props","m","useMessages","ctx","useGridContext","direction","computed","n","toNumber","text","placeholder","currency","formatCurrency","format","formatNumber","srLabel","iconOnly","openBlock","createElementBlock","normalizeClass","createCommentVNode","Fragment","toDisplayString","createElementVNode"],"sources":["../../src/renderers/ChangeCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { useGridContext } from '../registry/plugin'\nimport type { CellRendererProps } from '../types'\nimport { formatCurrency, formatNumber, toNumber } from './format'\nimport type { ChangeOptions } from './options'\nimport { useMessages } from '../internal/messages'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, ChangeOptions>>()\nconst m = useMessages()\nconst ctx = useGridContext()\n\nconst direction = computed(() => {\n if (props.options.direction) return props.options.direction(props.value, props.row) ?? 'equal'\n // Booleans (also as strings, as some APIs send them) are a trend flag.\n if (props.value === true || props.value === 'true') return 'up'\n if (props.value === false || props.value === 'false') return 'down'\n const n = toNumber(props.value)\n return n === null || n === 0 ? 'equal' : n > 0 ? 'up' : 'down'\n})\n\nconst text = computed(() => {\n const { currency, format, placeholder } = props.options\n if (typeof props.value === 'boolean' || props.value === 'true' || props.value === 'false')\n return ''\n if (toNumber(props.value) === null) {\n return props.value === null || props.value === undefined\n ? (placeholder ?? '')\n : String(props.value)\n }\n if (currency)\n return formatCurrency(\n props.value,\n ctx.value,\n typeof currency === 'string' ? currency : undefined,\n format,\n )\n return formatNumber(props.value, ctx.value, format)\n})\n\nconst srLabel = computed(\n () =>\n ({\n up: m.value.increased ?? 'Increased',\n down: m.value.decreased ?? 'Decreased',\n equal: '',\n })[direction.value],\n)\nconst iconOnly = computed(() => props.options.iconOnly || !text.value)\n</script>\n\n<template>\n <span\n :class=\"['vg-change', `vg-change-${direction}`]\"\n :title=\"iconOnly ? srLabel || undefined : text\"\n :role=\"iconOnly && srLabel ? 'img' : undefined\"\n :aria-label=\"iconOnly && srLabel ? [srLabel, text].filter(Boolean).join(' ') : undefined\"\n >\n <svg v-if=\"direction !== 'equal'\" class=\"vg-change-icon\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path v-if=\"direction === 'up'\" d=\"M5 1.5 9 7.5H1z\" />\n <path v-else d=\"M5 8.5 1 2.5h8z\" />\n </svg>\n <template v-if=\"!iconOnly\">\n <span v-if=\"srLabel\" class=\"vg-sr-only\">{{ srLabel }}</span>\n <span class=\"vg-change-value\">{{ text }}</span>\n </template>\n </span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA,IAAMa,IAAQC,GACRC,IAAIC,EAAY,GAChBC,IAAMC,EAAe,GAErBC,IAAYC,QAAe;GAC/B,IAAIP,EAAM,QAAQ,WAAW,OAAOA,EAAM,QAAQ,UAAUA,EAAM,OAAOA,EAAM,GAAG,KAAK;GAEvF,IAAIA,EAAM,UAAU,MAAQA,EAAM,UAAU,QAAQ,OAAO;GAC3D,IAAIA,EAAM,UAAU,MAASA,EAAM,UAAU,SAAS,OAAO;GAC7D,IAAMQ,IAAIC,EAAST,EAAM,KAAK;GAC9B,OAAOQ,MAAM,QAAQA,MAAM,IAAI,UAAUA,IAAI,IAAI,OAAO;EAC1D,CAAC,GAEKE,IAAOH,QAAe;GAC1B,IAAM,EAAE,aAAU,WAAQ,mBAAgBP,EAAM;GAehD,OAdI,OAAOA,EAAM,SAAU,aAAaA,EAAM,UAAU,UAAUA,EAAM,UAAU,UACzE,KACLS,EAAST,EAAM,KAAK,MAAM,OACrBA,EAAM,UAAU,QAAQA,EAAM,UAAU,KAAA,IAC1CW,KAAe,KAChB,OAAOX,EAAM,KAAK,IAEpBY,IACKC,EACLb,EAAM,OACNI,EAAI,OACJ,OAAOQ,KAAa,WAAWA,IAAW,KAAA,GAC1CE,CACF,IACKC,EAAaf,EAAM,OAAOI,EAAI,OAAOU,CAAM;EACpD,CAAC,GAEKE,IAAUT,SAEX;GACC,IAAIL,EAAE,MAAM,aAAa;GACzB,MAAMA,EAAE,MAAM,aAAa;GAC3B,OAAO;EACT,EAAA,CAAGI,EAAU,MACjB,GACMW,IAAWV,QAAeP,EAAM,QAAQ,YAAY,CAACU,EAAK,KAAK;E,kBAInEvB,EAAA,GAAAC,EAcO,QAAA;GAbJ,OAAKC,EAAA,CAAA,aAAA,aAA6BiB,EAAA,OAAS,CAAA;GAC3C,OAAOW,EAAA,QAAWD,EAAA,SAAW,KAAA,IAAYN,EAAA;GACzC,MAAMO,EAAA,SAAYD,EAAA,QAAO,QAAW,KAAA;GACpC,cAAYC,EAAA,SAAYD,EAAA,QAAO,CAAIA,EAAA,OAASN,EAAA,KAAI,CAAA,CAAE,OAAO,OAAO,CAAA,CAAE,KAAI,GAAA,IAAQ,KAAA;E,IAEpEJ,EAAA,UAAS,U,aAApBnB,EAAA,GAAAC,EAGM,OAHNM,GAGM,CAFQY,EAAA,UAAS,QAArBnB,EAAA,GAAAC,EAAsD,QAAtDO,CAAsD,MACtDR,EAAA,GAAAC,EAAmC,QAAnCQ,CAAmC,E,KAEpBqB,EAAA,Q,aAAjB9B,EAAA,GAAAC,EAGWE,GAAA,EAAA,KAAA,EAAA,GAAA,CAFG0B,EAAA,SAAZ7B,EAAA,GAAAC,EAA4D,QAA5DS,GAA4DN,EAAjByB,EAAA,KAAO,GAAA,CAAA,K,WAClDxB,EAA+C,QAA/CM,GAA+CP,EAAdmB,EAAA,KAAI,GAAA,CAAA,C"}
@@ -1,10 +1,11 @@
1
1
  import e from "./parts/CopyButton.js";
2
- import { computed as t, createCommentVNode as n, createElementBlock as r, createVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, toDisplayString as c } from "vue";
2
+ import { useMessages as t } from "../internal/messages.js";
3
+ import { computed as n, createCommentVNode as r, createElementBlock as i, createVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, toDisplayString as l, unref as u } from "vue";
3
4
  // src/renderers/CopyCell.vue?vue&type=script&setup=true&lang.ts
4
- var l = ["title"], u = {
5
+ var d = ["title"], f = {
5
6
  key: 1,
6
7
  class: "vg-text vg-text-muted"
7
- }, d = /*@__PURE__*/ a({
8
+ }, p = /*@__PURE__*/ o({
8
9
  __name: "CopyCell",
9
10
  props: {
10
11
  value: {},
@@ -16,29 +17,29 @@ var l = ["title"], u = {
16
17
  options: {}
17
18
  },
18
19
  emits: ["action"],
19
- setup(a, { emit: d }) {
20
- let f = a, p = d, m = t(() => f.value === null || f.value === void 0 || f.value === ""), h = t(() => {
21
- if (m.value) return "";
22
- if (typeof f.value != "object") return String(f.value);
20
+ setup(o, { emit: p }) {
21
+ let m = o, h = t(), g = p, _ = n(() => m.value === null || m.value === void 0 || m.value === ""), v = n(() => {
22
+ if (_.value) return "";
23
+ if (typeof m.value != "object") return String(m.value);
23
24
  try {
24
- return JSON.stringify(f.value) ?? String(f.value);
25
+ return JSON.stringify(m.value) ?? String(m.value);
25
26
  } catch {
26
- return String(f.value);
27
+ return String(m.value);
27
28
  }
28
- }), g = t(() => f.options.copyValue?.(f.value, f.row) ?? h.value), _ = t(() => f.options.title ? `${f.options.title}: ${g.value}` : g.value);
29
- return (t, d) => m.value ? a.options.placeholder ? (s(), r("span", u, c(a.options.placeholder), 1)) : n("", !0) : (s(), r("span", {
29
+ }), y = n(() => m.options.copyValue?.(m.value, m.row) ?? v.value), b = n(() => m.options.title ? `${m.options.title}: ${y.value}` : y.value);
30
+ return (t, n) => _.value ? o.options.placeholder ? (c(), i("span", f, l(o.options.placeholder), 1)) : r("", !0) : (c(), i("span", {
30
31
  key: 0,
31
- class: o(["vg-copy", { "vg-copy-icon-only": a.options.iconOnly }])
32
- }, [a.options.iconOnly ? n("", !0) : (s(), r("span", {
32
+ class: s(["vg-copy", { "vg-copy-icon-only": o.options.iconOnly }])
33
+ }, [o.options.iconOnly ? r("", !0) : (c(), i("span", {
33
34
  key: 0,
34
35
  class: "vg-text vg-text-ellipsis",
35
- title: _.value
36
- }, c(h.value), 9, l)), i(e, {
37
- text: g.value,
38
- label: a.options.label ?? (a.options.title ? `Copy ${a.options.title}` : "Copy"),
39
- title: _.value,
40
- onCopied: d[0] ||= (e) => p("action", "copy", e),
41
- onFailed: d[1] ||= (e) => p("action", "copy-error", e)
36
+ title: b.value
37
+ }, l(v.value), 9, d)), a(e, {
38
+ text: y.value,
39
+ label: o.options.label ?? (o.options.title ? `${u(h).copy ?? "Copy"} ${o.options.title}` : u(h).copy ?? "Copy"),
40
+ title: b.value,
41
+ onCopied: n[0] ||= (e) => g("action", "copy", e),
42
+ onFailed: n[1] ||= (e) => g("action", "copy-error", e)
42
43
  }, null, 8, [
43
44
  "text",
44
45
  "label",
@@ -46,6 +47,6 @@ var l = ["title"], u = {
46
47
  ])], 2));
47
48
  }
48
49
  });
49
- export { d as default };
50
+ export { p as default };
50
51
 
51
52
  //# sourceMappingURL=CopyCell.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CopyCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_toDisplayString","_createVNode","CopyButton","CopyButton_default","_hoisted_1","_hoisted_2","CopyCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","isEmpty","computed","text","copyValue","tooltip","openBlock","createElementBlock","toDisplayString","createCommentVNode","normalizeClass","createVNode","_cache","$event"],"sources":["../../src/renderers/CopyCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { CellRendererEmits, CellRendererProps } from '../types'\nimport type { CopyOptions } from './options'\nimport CopyButton from './parts/CopyButton.vue'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, CopyOptions>>()\nconst emit = defineEmits<CellRendererEmits>()\n\nconst isEmpty = computed(\n () => props.value === null || props.value === undefined || props.value === '',\n)\nconst text = computed(() => {\n if (isEmpty.value) return ''\n if (typeof props.value !== 'object') return String(props.value)\n try {\n return JSON.stringify(props.value) ?? String(props.value)\n } catch {\n return String(props.value) // cyclic or BigInt inside\n }\n})\nconst copyValue = computed(() => props.options.copyValue?.(props.value, props.row) ?? text.value)\nconst tooltip = computed(() =>\n props.options.title ? `${props.options.title}: ${copyValue.value}` : copyValue.value,\n)\n</script>\n\n<template>\n <span v-if=\"!isEmpty\" :class=\"['vg-copy', { 'vg-copy-icon-only': options.iconOnly }]\">\n <span v-if=\"!options.iconOnly\" class=\"vg-text vg-text-ellipsis\" :title=\"tooltip\">{{\n text\n }}</span>\n <CopyButton\n :text=\"copyValue\"\n :label=\"options.label ?? (options.title ? `Copy ${options.title}` : 'Copy')\"\n :title=\"tooltip\"\n @copied=\"emit('action', 'copy', $event)\"\n @failed=\"emit('action', 'copy-error', $event)\"\n />\n </span>\n <span v-else-if=\"options.placeholder\" class=\"vg-text vg-text-muted\">{{\n options.placeholder\n }}</span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAMA,IAAMW,IAAQC,GACRC,IAAOH,GAEPI,IAAUC,QACRJ,EAAM,UAAU,QAAQA,EAAM,UAAU,KAAA,KAAaA,EAAM,UAAU,EAC7E,GACMK,IAAOD,QAAe;GAC1B,IAAID,EAAQ,OAAO,OAAO;GAC1B,IAAI,OAAOH,EAAM,SAAU,UAAU,OAAO,OAAOA,EAAM,KAAK;GAC9D,IAAI;IACF,OAAO,KAAK,UAAUA,EAAM,KAAK,KAAK,OAAOA,EAAM,KAAK;GAC1D,QAAQ;IACN,OAAO,OAAOA,EAAM,KAAK;GAC3B;EACF,CAAC,GACKM,IAAYF,QAAeJ,EAAM,QAAQ,YAAYA,EAAM,OAAOA,EAAM,GAAG,KAAKK,EAAK,KAAK,GAC1FE,IAAUH,QACdJ,EAAM,QAAQ,QAAQ,GAAGA,EAAM,QAAQ,MAAM,IAAIM,EAAU,UAAUA,EAAU,KACjF;E,iBAIeH,EAAA,QAYIF,EAAA,QAAQ,eAAzBZ,EAAA,GAAAC,EAES,QAFTO,GAESL,EADPS,EAAA,QAAQ,WAAW,GAAA,CAAA,K,aAbrBZ,EAAA,GAAAC,EAWO,QAAA;;GAXgB,OAAKC,EAAA,CAAA,WAAA,EAAA,qBAAqCU,EAAA,QAAQ,SAAQ,CAAA,CAAA;E,IAClEA,EAAA,QAAQ,W,aAArBZ,EAAA,GAAAC,EAES,QAAA;;GAFsB,OAAM;GAA4B,OAAOiB,EAAA;EACtE,GAAAf,EAAAa,EAAA,KAAI,GAAA,GAAAT,CAAA,IAENH,EAMEC,GAAA;GALC,MAAMY,EAAA;GACN,OAAOL,EAAA,QAAQ,UAAUA,EAAA,QAAQ,QAAK,QAAWA,EAAA,QAAQ,UAAK;GAC9D,OAAOM,EAAA;GACP,UAAM,AAAAO,EAAA,QAAA,MAAEZ,EAAI,UAAA,QAAmBa,CAAM;GACrC,UAAM,AAAAD,EAAA,QAAA,MAAEZ,EAAI,UAAA,cAAyBa,CAAM"}
1
+ {"version":3,"file":"CopyCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_toDisplayString","_createVNode","CopyButton","_unref","CopyButton_default","_hoisted_1","_hoisted_2","CopyCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","m","useMessages","emit","isEmpty","computed","text","copyValue","tooltip","openBlock","createElementBlock","toDisplayString","createCommentVNode","normalizeClass","createVNode","unref","_cache","$event"],"sources":["../../src/renderers/CopyCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { CellRendererEmits, CellRendererProps } from '../types'\nimport type { CopyOptions } from './options'\nimport CopyButton from './parts/CopyButton.vue'\nimport { useMessages } from '../internal/messages'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, CopyOptions>>()\nconst m = useMessages()\nconst emit = defineEmits<CellRendererEmits>()\n\nconst isEmpty = computed(\n () => props.value === null || props.value === undefined || props.value === '',\n)\nconst text = computed(() => {\n if (isEmpty.value) return ''\n if (typeof props.value !== 'object') return String(props.value)\n try {\n return JSON.stringify(props.value) ?? String(props.value)\n } catch {\n return String(props.value) // cyclic or BigInt inside\n }\n})\nconst copyValue = computed(() => props.options.copyValue?.(props.value, props.row) ?? text.value)\nconst tooltip = computed(() =>\n props.options.title ? `${props.options.title}: ${copyValue.value}` : copyValue.value,\n)\n</script>\n\n<template>\n <span v-if=\"!isEmpty\" :class=\"['vg-copy', { 'vg-copy-icon-only': options.iconOnly }]\">\n <span v-if=\"!options.iconOnly\" class=\"vg-text vg-text-ellipsis\" :title=\"tooltip\">{{\n text\n }}</span>\n <CopyButton\n :text=\"copyValue\"\n :label=\"\n options.label ??\n (options.title ? `${m.copy ?? 'Copy'} ${options.title}` : (m.copy ?? 'Copy'))\n \"\n :title=\"tooltip\"\n @copied=\"emit('action', 'copy', $event)\"\n @failed=\"emit('action', 'copy-error', $event)\"\n />\n </span>\n <span v-else-if=\"options.placeholder\" class=\"vg-text vg-text-muted\">{{\n options.placeholder\n }}</span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAOA,IAAMY,IAAQC,GACRC,IAAIC,EAAY,GAChBC,IAAOL,GAEPM,IAAUC,QACRN,EAAM,UAAU,QAAQA,EAAM,UAAU,KAAA,KAAaA,EAAM,UAAU,EAC7E,GACMO,IAAOD,QAAe;GAC1B,IAAID,EAAQ,OAAO,OAAO;GAC1B,IAAI,OAAOL,EAAM,SAAU,UAAU,OAAO,OAAOA,EAAM,KAAK;GAC9D,IAAI;IACF,OAAO,KAAK,UAAUA,EAAM,KAAK,KAAK,OAAOA,EAAM,KAAK;GAC1D,QAAQ;IACN,OAAO,OAAOA,EAAM,KAAK;GAC3B;EACF,CAAC,GACKQ,IAAYF,QAAeN,EAAM,QAAQ,YAAYA,EAAM,OAAOA,EAAM,GAAG,KAAKO,EAAK,KAAK,GAC1FE,IAAUH,QACdN,EAAM,QAAQ,QAAQ,GAAGA,EAAM,QAAQ,MAAM,IAAIQ,EAAU,UAAUA,EAAU,KACjF;E,iBAIeH,EAAA,QAeIJ,EAAA,QAAQ,eAAzBb,EAAA,GAAAC,EAES,QAFTQ,GAESN,EADPU,EAAA,QAAQ,WAAW,GAAA,CAAA,K,aAhBrBb,EAAA,GAAAC,EAcO,QAAA;;GAdgB,OAAKC,EAAA,CAAA,WAAA,EAAA,qBAAqCW,EAAA,QAAQ,SAAQ,CAAA,CAAA;E,IAClEA,EAAA,QAAQ,W,aAArBb,EAAA,GAAAC,EAES,QAAA;;GAFsB,OAAM;GAA4B,OAAOoB,EAAA;EACtE,GAAAlB,EAAAgB,EAAA,KAAI,GAAA,GAAAX,CAAA,IAENJ,EASEC,GAAA;GARC,MAAMe,EAAA;GACN,OAAgBP,EAAA,QAAQ,UAAkBA,EAAA,QAAQ,QAAK,GAAMP,EAAAQ,CAAA,CAAC,CAAC,QAAI,OAAA,GAAcD,EAAA,QAAQ,UAAWP,EAAAQ,CAAA,CAAC,CAAC,QAAI;GAI1G,OAAOO,EAAA;GACP,UAAM,AAAAQ,EAAA,QAAA,MAAEb,EAAI,UAAA,QAAmBc,CAAM;GACrC,UAAM,AAAAD,EAAA,QAAA,MAAEb,EAAI,UAAA,cAAyBc,CAAM"}