@nocopypaste/vue-grid 0.2.0 → 0.3.1
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.
- package/AGENTS.md +70 -5
- package/CHANGELOG.md +49 -0
- package/README.md +199 -34
- package/agent/api.json +130 -13
- package/agent/api.md +26 -10
- package/agent/grid-config.schema.json +50 -5
- package/dist/agent/api.js +121 -13
- package/dist/agent/requirements.js +12 -3
- package/dist/agent/requirements.js.map +1 -1
- package/dist/agent/validate.js +6 -2
- package/dist/agent/validate.js.map +1 -1
- package/dist/base.css +1 -1
- package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js +498 -414
- package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridCheckbox.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/components/VGridCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridGroupCells.js +6 -0
- package/dist/components/VGridGroupCells.js.map +1 -0
- package/dist/components/VGridGroupCells.vue_vue_type_script_setup_true_lang.js +181 -0
- package/dist/components/VGridGroupCells.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridRows.vue_vue_type_script_setup_true_lang.js +69 -56
- package/dist/components/VGridRows.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridSelectionBanner.js +6 -0
- package/dist/components/VGridSelectionBanner.js.map +1 -0
- package/dist/components/VGridSelectionBanner.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/VGridSelectionBanner.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composables/useGridExport.js +135 -0
- package/dist/composables/useGridExport.js.map +1 -0
- package/dist/composables/useGridKeyboard.js +5 -1
- package/dist/composables/useGridKeyboard.js.map +1 -1
- package/dist/composables/useGridMenus.js +21 -1
- package/dist/composables/useGridMenus.js.map +1 -1
- package/dist/composables/useGridSelection.js +113 -50
- package/dist/composables/useGridSelection.js.map +1 -1
- package/dist/composables/useRowGrouping.js +103 -0
- package/dist/composables/useRowGrouping.js.map +1 -0
- package/dist/composables/useVirtualRows.js +5 -5
- package/dist/composables/useVirtualRows.js.map +1 -1
- package/dist/core/csv.js +28 -0
- package/dist/core/csv.js.map +1 -0
- package/dist/core/grouping.js +66 -0
- package/dist/core/grouping.js.map +1 -0
- package/dist/core.css +1 -1
- package/dist/features/export.js +9 -0
- package/dist/features/export.js.map +1 -0
- package/dist/features/index.js +25 -21
- package/dist/features/index.js.map +1 -1
- package/dist/features/rowGrouping.js +11 -0
- package/dist/features/rowGrouping.js.map +1 -0
- package/dist/features/selection.js +5 -3
- package/dist/features/selection.js.map +1 -1
- package/dist/index.js +55 -51
- package/dist/internal/anchor.js +20 -21
- package/dist/internal/anchor.js.map +1 -1
- package/dist/internal/clipboard.js +8 -2
- package/dist/internal/clipboard.js.map +1 -1
- package/dist/internal/context.js.map +1 -1
- package/dist/internal/features.js.map +1 -1
- package/dist/internal/supports.js +2 -2
- package/dist/internal/supports.js.map +1 -1
- package/dist/renderers/index.js +94 -83
- package/dist/renderers/index.js.map +1 -1
- package/dist/renderers/plainText.js +34 -0
- package/dist/renderers/plainText.js.map +1 -0
- package/dist/theme.css +1 -1
- package/dist/types/agent/requirements.d.ts +1 -1
- package/dist/types/components/VGrid.vue.d.ts +42 -4
- package/dist/types/components/VGridCheckbox.vue.d.ts +2 -2
- package/dist/types/components/VGridGroupCells.vue.d.ts +14 -0
- package/dist/types/components/VGridMenu.vue.d.ts +2 -2
- package/dist/types/components/VGridPagination.vue.d.ts +1 -1
- package/dist/types/components/VGridSelectionBanner.vue.d.ts +18 -0
- package/dist/types/composables/useGridExport.d.ts +49 -0
- package/dist/types/composables/useGridMenus.d.ts +8 -0
- package/dist/types/composables/useGridSelection.d.ts +26 -2
- package/dist/types/composables/useRowGrouping.d.ts +50 -0
- package/dist/types/composables/useVirtualRows.d.ts +2 -0
- package/dist/types/core/csv.d.ts +25 -0
- package/dist/types/core/grouping.d.ts +51 -0
- package/dist/types/features/export.d.ts +8 -0
- package/dist/types/features/index.d.ts +3 -1
- package/dist/types/features/rowGrouping.d.ts +8 -0
- package/dist/types/features/selection.d.ts +3 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/internal/anchor.d.ts +10 -2
- package/dist/types/internal/clipboard.d.ts +5 -1
- package/dist/types/internal/context.d.ts +8 -1
- package/dist/types/internal/features.d.ts +3 -1
- package/dist/types/internal/supports.d.ts +0 -5
- package/dist/types/renderers/plainText.d.ts +17 -0
- package/dist/types/types.d.ts +81 -3
- package/dist/vue-grid.css +1 -1
- package/llms-full.txt +295 -49
- package/llms.txt +1 -1
- package/package.json +1 -1
|
@@ -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"],"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 { filteringFeature } from './filtering'\nimport { keyboardNavigationFeature } from './keyboardNavigation'\nimport { menusFeature } from './menus'\nimport { paginationFeature } from './pagination'\nimport { rowPinningFeature } from './rowPinning'\nimport { selectionFeature } from './selection'\nimport { serverDataFeature } from './serverData'\nimport { sortingFeature } from './sorting'\nimport { subGridsFeature } from './subGrids'\nimport { virtualScrollingFeature } from './virtualScrolling'\n\nexport {\n aggregationFeature,\n columnGroupsFeature,\n columnPinningFeature,\n columnReorderFeature,\n columnResizingFeature,\n columnVisibilityFeature,\n filteringFeature,\n keyboardNavigationFeature,\n menusFeature,\n paginationFeature,\n rowPinningFeature,\n selectionFeature,\n serverDataFeature,\n sortingFeature,\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]\n"],"mappings":"
|
|
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"],"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 { 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 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]\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0CA,IAAaA,IAAsC;CACjDC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;CACAC;AACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import e from "../components/VGridGroupCells.js";
|
|
2
|
+
import { useRowGrouping as t } from "../composables/useRowGrouping.js";
|
|
3
|
+
// src/features/rowGrouping.ts
|
|
4
|
+
var n = {
|
|
5
|
+
feature: "rowGrouping",
|
|
6
|
+
useRowGrouping: t,
|
|
7
|
+
GroupCells: e
|
|
8
|
+
};
|
|
9
|
+
export { n as rowGroupingFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=rowGrouping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rowGrouping.js","names":["VGridGroupCells","VGridGroupCells_default","rowGroupingFeature"],"sources":["../../src/features/rowGrouping.ts"],"sourcesContent":["import VGridGroupCells from '../components/VGridGroupCells.vue'\nimport { useRowGrouping } from '../composables/useRowGrouping'\nimport type { RowGroupingFeature } from '../types'\n\n/**\n * Row grouping: `v-model:group-by=\"['region', 'status']\"` groups the rows by those columns into\n * collapsible group rows with their value, row count and the aggregates of columns with an\n * `aggregate`. Columns with `groupable: true` get Group by / Ungroup items in the header menu.\n * Without it, `group-by` is ignored.\n */\nexport const rowGroupingFeature: RowGroupingFeature = { feature: 'rowGrouping', useRowGrouping, GroupCells: VGridGroupCells }\n"],"mappings":";;;AAUA,IAAaE,IAAyC;CAAE,SAAS;CAAe;CAAgB,YAAYF;AAAgB"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import e from "../components/VGridCheckbox.js";
|
|
2
2
|
import { useGridSelection as t } from "../composables/useGridSelection.js";
|
|
3
|
+
import { defineAsyncComponent as n } from "vue";
|
|
3
4
|
// src/features/selection.ts
|
|
4
|
-
var
|
|
5
|
+
var r = {
|
|
5
6
|
feature: "selection",
|
|
6
7
|
useSelection: t,
|
|
7
|
-
Checkbox: e
|
|
8
|
+
Checkbox: e,
|
|
9
|
+
Banner: /*#__PURE__*/ n(() => import("../components/VGridSelectionBanner.js"))
|
|
8
10
|
};
|
|
9
|
-
export {
|
|
11
|
+
export { r as selectionFeature };
|
|
10
12
|
|
|
11
13
|
//# sourceMappingURL=selection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection.js","names":["VGridCheckbox","VGridCheckbox_default","selectionFeature","useGridSelection"],"sources":["../../src/features/selection.ts"],"sourcesContent":["import VGridCheckbox from '../components/VGridCheckbox.vue'\nimport { useGridSelection } from '../composables/useGridSelection'\nimport type { SelectionFeature } from '../types'\n\n/**\n * Row selection: the `selectable` prop (multi or single), `v-model:selected`, `selection-mode`\n * (cascade through sub-grids), `is-row-selectable`, Space on a row
|
|
1
|
+
{"version":3,"file":"selection.js","names":["VGridCheckbox","VGridCheckbox_default","selectionFeature","useGridSelection"],"sources":["../../src/features/selection.ts"],"sourcesContent":["import { defineAsyncComponent } from 'vue'\nimport VGridCheckbox from '../components/VGridCheckbox.vue'\nimport { useGridSelection } from '../composables/useGridSelection'\nimport type { SelectionFeature } from '../types'\n\n/**\n * Row selection: the `selectable` prop (multi or single), `v-model:selected`, `selection-mode`\n * (cascade through sub-grids), `is-row-selectable`, Space on a row, shift-click (or Shift+Space)\n * for a range, the select-all checkbox, `prune-selection`, and with server data a \"select all\n * N matching rows\" banner (`v-model:select-all-matching`; it loads on demand, its own chunk).\n */\nexport const selectionFeature: SelectionFeature = {\n feature: 'selection',\n useSelection: useGridSelection,\n Checkbox: VGridCheckbox,\n Banner: /*#__PURE__*/ defineAsyncComponent(() => import('../components/VGridSelectionBanner.vue')),\n}\n"],"mappings":";;;;AAWA,IAAaE,IAAqC;CAChD,SAAS;CACT,cAAcC;CACd,UAAUH;CACV,QAAsB,sBAA2B,OAAO,wCAAyC;AACnG"}
|
package/dist/index.js
CHANGED
|
@@ -14,54 +14,58 @@ import { getByPath as N, getCellValue as P, resolveRowKey as F } from "./core/va
|
|
|
14
14
|
import { effectivePin as I, moveColumn as L, moveColumnRelative as R, normalizeColumnState as z, setColumnHidden as B, setColumnPinned as V, visibleColumns as H } from "./core/columns.js";
|
|
15
15
|
import { compareValues as U, nextSort as W, sortRows as G } from "./core/sort.js";
|
|
16
16
|
import { aggregateRows as K, aggregateValues as q } from "./core/aggregate.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
|
|
17
|
+
import { groupRows as J, isRowGroup as Y } from "./core/grouping.js";
|
|
18
|
+
import { guardFormula as X, plainText as Z, toCsv as Q, toDelimited as $ } from "./core/csv.js";
|
|
19
|
+
import { patchRows as ee } from "./core/patch.js";
|
|
20
|
+
import { activeFilterCount as te, emptyFilters as ne, filterTree as re, foldText as ie, isFilterActive as ae, localFilterStorage as oe, matchesFilter as se, parseQuickFilter as ce, setKey as le } from "./core/filter.js";
|
|
21
|
+
import { localStorageAdapter as ue } from "./core/storage.js";
|
|
22
|
+
import { pageItems as de } from "./core/pagination.js";
|
|
23
|
+
import { createColumnHelper as fe } from "./core/helpers.js";
|
|
24
|
+
import pe from "./renderers/ActionButtonCell.js";
|
|
25
|
+
import me from "./renderers/ActionsMenuCell.js";
|
|
26
|
+
import he from "./renderers/BooleanCell.js";
|
|
27
|
+
import ge from "./renderers/ChangeCell.js";
|
|
28
|
+
import _e from "./renderers/CurrencyCell.js";
|
|
29
|
+
import ve from "./renderers/DateCell.js";
|
|
30
|
+
import ye from "./renderers/DateTimeCell.js";
|
|
31
|
+
import be from "./renderers/IconCell.js";
|
|
32
|
+
import xe from "./renderers/JsonCell.js";
|
|
33
|
+
import Se from "./renderers/JsonTreeCell.js";
|
|
34
|
+
import Ce from "./renderers/LinkCell.js";
|
|
35
|
+
import we from "./renderers/NumberCell.js";
|
|
36
|
+
import Te from "./renderers/StatusCell.js";
|
|
37
|
+
import Ee from "./renderers/ToggleTextCell.js";
|
|
38
|
+
import De from "./renderers/ButtonGroupCell.js";
|
|
39
|
+
import Oe from "./renderers/CheckboxCell.js";
|
|
40
|
+
import ke from "./renderers/ChipCell.js";
|
|
41
|
+
import Ae from "./renderers/CodeCell.js";
|
|
42
|
+
import je from "./renderers/CopyCell.js";
|
|
43
|
+
import Me from "./renderers/DetailsCell.js";
|
|
44
|
+
import Ne from "./renderers/EditCell.js";
|
|
45
|
+
import Pe from "./renderers/IconToggleCell.js";
|
|
46
|
+
import Fe from "./renderers/ImageCell.js";
|
|
47
|
+
import Ie from "./renderers/ListCell.js";
|
|
48
|
+
import Le from "./renderers/MultiLineCell.js";
|
|
49
|
+
import Re from "./renderers/RadioCell.js";
|
|
50
|
+
import ze from "./renderers/SwitchCell.js";
|
|
51
|
+
import { actionButtonRenderer as Be, actionsMenuRenderer as Ve, allRenderers as He, booleanRenderer as Ue, buttonGroupRenderer as We, changeRenderer as Ge, checkboxRenderer as Ke, chipRenderer as qe, codeRenderer as Je, copyRenderer as Ye, currencyRenderer as Xe, dateRenderer as Ze, dateTimeRenderer as Qe, detailsRenderer as $e, editRenderer as et, iconRenderer as tt, iconToggleRenderer as nt, imageRenderer as rt, jsonRenderer as it, jsonTreeRenderer as at, linkRenderer as ot, listRenderer as st, multiLineRenderer as ct, numberRenderer as lt, radioRenderer as ut, signedNumberRenderer as dt, statusRenderer as ft, switchRenderer as pt, toggleTextRenderer as mt } from "./renderers/index.js";
|
|
52
|
+
import { aggregationFeature as ht } from "./features/aggregation.js";
|
|
53
|
+
import { columnGroupsFeature as gt } from "./features/columnGroups.js";
|
|
54
|
+
import { columnPinningFeature as _t } from "./features/columnPinning.js";
|
|
55
|
+
import { columnResizingFeature as vt } from "./features/columnResizing.js";
|
|
56
|
+
import { columnReorderFeature as yt } from "./features/columnReorder.js";
|
|
57
|
+
import { columnVisibilityFeature as bt } from "./features/columnVisibility.js";
|
|
58
|
+
import { exportFeature as xt } from "./features/export.js";
|
|
59
|
+
import { filteringFeature as St } from "./features/filtering.js";
|
|
60
|
+
import { keyboardNavigationFeature as Ct } from "./features/keyboardNavigation.js";
|
|
61
|
+
import { menusFeature as wt } from "./features/menus.js";
|
|
62
|
+
import { paginationFeature as Tt } from "./features/pagination.js";
|
|
63
|
+
import { rowGroupingFeature as Et } from "./features/rowGrouping.js";
|
|
64
|
+
import { rowPinningFeature as Dt } from "./features/rowPinning.js";
|
|
65
|
+
import { selectionFeature as Ot } from "./features/selection.js";
|
|
66
|
+
import { serverDataFeature as kt } from "./features/serverData.js";
|
|
67
|
+
import { sortingFeature as At } from "./features/sorting.js";
|
|
68
|
+
import { subGridsFeature as jt } from "./features/subGrids.js";
|
|
69
|
+
import { virtualScrollingFeature as Mt } from "./features/virtualScrolling.js";
|
|
70
|
+
import { allFeatures as Nt } from "./features/index.js";
|
|
71
|
+
export { pe as ActionButtonCell, me as ActionsMenuCell, he as BooleanCell, De as ButtonGroupCell, ge as ChangeCell, Oe as CheckboxCell, ke as ChipCell, Ae as CodeCell, je as CopyCell, _e as CurrencyCell, d as DATE_DEFAULT, ve as DateCell, ye as DateTimeCell, Me as DetailsCell, Ne as EditCell, D as GRID_CONFIG_KEY, be as IconCell, Pe as IconToggleCell, Fe as ImageCell, xe as JsonCell, Se as JsonTreeCell, Ce as LinkCell, Ie as ListCell, Le as MultiLineCell, we as NumberCell, Re as RadioCell, Te as StatusCell, ze as SwitchCell, f as TIME_DEFAULT, l as TextCell, Ee as ToggleTextCell, e as VGrid, n as VGridColumnMenu, r as VGridMenu, t as VGridPagination, i as VGridSearch, Be as actionButtonRenderer, Ve as actionsMenuRenderer, te as activeFilterCount, K as aggregateRows, q as aggregateValues, ht as aggregationFeature, Nt as allFeatures, He as allRenderers, T as anchorNameFor, Ue as booleanRenderer, We as buttonGroupRenderer, Ge as changeRenderer, Ke as checkboxRenderer, qe as chipRenderer, Je as codeRenderer, gt as columnGroupsFeature, _t as columnPinningFeature, yt as columnReorderFeature, vt as columnResizingFeature, bt as columnVisibilityFeature, U as compareValues, Ye as copyRenderer, fe as createColumnHelper, A as createRendererRegistry, O as createVueGrid, Xe as currencyRenderer, Ze as dateRenderer, Qe as dateTimeRenderer, j as defineCellRenderer, $e as detailsRenderer, et as editRenderer, I as effectivePin, ne as emptyFilters, xt as exportFeature, re as filterTree, St as filteringFeature, ie 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, tt as iconRenderer, nt as iconToggleRenderer, rt as imageRenderer, ae as isFilterActive, M as isRendererDefinition, Y as isRowGroup, it as jsonRenderer, at as jsonTreeRenderer, Ct as keyboardNavigationFeature, ot as linkRenderer, st as listRenderer, oe as localFilterStorage, ue as localStorageAdapter, a as lookup, se as matchesFilter, wt as menusFeature, L as moveColumn, R as moveColumnRelative, ct as multiLineRenderer, W as nextSort, z as normalizeColumnState, lt as numberRenderer, de as pageItems, Tt as paginationFeature, _ as parseJsonish, ce as parseQuickFilter, ee as patchRows, Z as plainText, ut as radioRenderer, v as readableTextColor, y as resolveImageSrc, o as resolveOption, F as resolveRowKey, s as resolveTone, Et as rowGroupingFeature, Dt as rowPinningFeature, b as safeHref, c as safeTone, Ot as selectionFeature, kt as serverDataFeature, B as setColumnHidden, V as setColumnPinned, le as setKey, dt as signedNumberRenderer, G as sortRows, At as sortingFeature, ft as statusRenderer, x as stringifyJson, jt as subGridsFeature, E as supportsAnchorPositioning, pt as switchRenderer, u as textRenderer, Q as toCsv, S as toDate, $ as toDelimited, C as toNumber, mt as toggleTextRenderer, w as tokenizeJson, k as useGridContext, Mt as virtualScrollingFeature, H as visibleColumns };
|
package/dist/internal/anchor.js
CHANGED
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
import { supportsAnchorVisibility as e } from "./supports.js";
|
|
2
1
|
// src/internal/anchor.ts
|
|
3
|
-
var
|
|
4
|
-
function
|
|
5
|
-
return
|
|
2
|
+
var e;
|
|
3
|
+
function t() {
|
|
4
|
+
return e ??= typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("anchor-name: --vg"), e;
|
|
6
5
|
}
|
|
7
|
-
function
|
|
6
|
+
function n(e) {
|
|
8
7
|
return `--vg-anchor-${e.replace(/[^\w-]/g, "_")}`;
|
|
9
8
|
}
|
|
10
|
-
function
|
|
9
|
+
function r(e, t, n) {
|
|
11
10
|
let r = t instanceof HTMLElement ? t.getBoundingClientRect() : new DOMRect(t.x, t.y, 0, 0), i = e.getBoundingClientRect(), a = window.innerWidth, o = window.innerHeight, s = n === "bottom-end" ? r.right - i.width : r.left;
|
|
12
11
|
s + i.width > a - 4 && (s = n === "point" ? r.left - i.width : a - 4 - i.width), s = Math.max(4, s);
|
|
13
12
|
let c = r.bottom + (n === "point" ? 0 : 4);
|
|
14
13
|
c + i.height > o - 4 && (c = r.top - (n === "point" ? 0 : 4) - i.height), c = Math.max(4, c), e.style.left = `${s}px`, e.style.top = `${c}px`;
|
|
15
14
|
}
|
|
16
|
-
function
|
|
17
|
-
let
|
|
18
|
-
if (!
|
|
19
|
-
let
|
|
20
|
-
cancelAnimationFrame(
|
|
15
|
+
function i(e, n, i) {
|
|
16
|
+
let a = [];
|
|
17
|
+
if (!t()) {
|
|
18
|
+
let t = 0, o = () => {
|
|
19
|
+
cancelAnimationFrame(t), t = requestAnimationFrame(() => r(e, n, i));
|
|
21
20
|
};
|
|
22
|
-
|
|
21
|
+
r(e, n, i), window.addEventListener("scroll", o, {
|
|
23
22
|
capture: !0,
|
|
24
23
|
passive: !0
|
|
25
|
-
}), window.addEventListener("resize",
|
|
26
|
-
cancelAnimationFrame(
|
|
24
|
+
}), window.addEventListener("resize", o, { passive: !0 }), a.push(() => {
|
|
25
|
+
cancelAnimationFrame(t), window.removeEventListener("scroll", o, { capture: !0 }), window.removeEventListener("resize", o);
|
|
27
26
|
});
|
|
28
27
|
}
|
|
29
|
-
if (
|
|
30
|
-
let
|
|
31
|
-
|
|
28
|
+
if (n instanceof HTMLElement && typeof IntersectionObserver < "u") {
|
|
29
|
+
let t = new IntersectionObserver(([t]) => {
|
|
30
|
+
e.toggleAttribute("data-vg-anchor-hidden", !!t && !t.isIntersecting);
|
|
32
31
|
});
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
t.observe(n), a.push(() => {
|
|
33
|
+
t.disconnect(), e.removeAttribute("data-vg-anchor-hidden");
|
|
35
34
|
});
|
|
36
35
|
}
|
|
37
|
-
return () =>
|
|
36
|
+
return () => a.splice(0).forEach((e) => e());
|
|
38
37
|
}
|
|
39
|
-
export {
|
|
38
|
+
export { n as anchorNameFor, r as placeWithoutAnchorSupport, t as supportsAnchorPositioning, i as trackAnchor };
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=anchor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor.js","names":["supported","supportsAnchorPositioning","anchorNameFor","id","placeWithoutAnchorSupport","rect","target","pop","floating","vw","vh","left","placement","top","trackAnchor","cleanups","frame","place","
|
|
1
|
+
{"version":3,"file":"anchor.js","names":["supported","supportsAnchorPositioning","anchorNameFor","id","placeWithoutAnchorSupport","rect","target","pop","floating","vw","vh","left","placement","top","trackAnchor","cleanups","frame","place","io","entry","fn"],"sources":["../../src/internal/anchor.ts"],"sourcesContent":["/**\n * Helpers for CSS anchor positioning. Popovers are placed purely in CSS (`position-anchor` +\n * `position-area` + `position-try-fallbacks`); this module only provides unique anchor names and a\n * JS fallback for browsers without anchor positioning.\n */\n\nlet supported: boolean | undefined\n\nexport function supportsAnchorPositioning(): boolean {\n supported ??= typeof CSS !== 'undefined' && typeof CSS.supports === 'function' && CSS.supports('anchor-name: --vg')\n return supported\n}\n\n/** A dashed-ident anchor name derived from a Vue `useId()` value. */\nexport function anchorNameFor(id: string): string {\n return `--vg-anchor-${id.replace(/[^\\w-]/g, '_')}`\n}\n\nexport type AnchorTarget = HTMLElement | { x: number; y: number }\n\nexport type Placement = 'bottom-start' | 'bottom-end' | 'point'\n\n/** JS placement used only when CSS anchor positioning is unavailable. Flips to stay in the viewport. */\nexport function placeWithoutAnchorSupport(floating: HTMLElement, target: AnchorTarget, placement: Placement) {\n const gap = 4\n const rect =\n target instanceof HTMLElement\n ? target.getBoundingClientRect()\n : new DOMRect(target.x, target.y, 0, 0)\n const pop = floating.getBoundingClientRect()\n const vw = window.innerWidth\n const vh = window.innerHeight\n\n let left = placement === 'bottom-end' ? rect.right - pop.width : placement === 'point' ? rect.left : rect.left\n if (left + pop.width > vw - gap) left = placement === 'point' ? rect.left - pop.width : vw - gap - pop.width\n left = Math.max(gap, left)\n\n let top = rect.bottom + (placement === 'point' ? 0 : gap)\n if (top + pop.height > vh - gap) top = rect.top - (placement === 'point' ? 0 : gap) - pop.height\n top = Math.max(gap, top)\n\n floating.style.left = `${left}px`\n floating.style.top = `${top}px`\n}\n\n/**\n * JS fallbacks for an open anchored popover, each only where CSS can't do the job:\n * - no CSS anchor positioning → place it now and again on scroll / resize, so it follows its anchor;\n * - hide it (`data-vg-anchor-hidden`) while the anchor element is clipped by a scroll container\n * (IntersectionObserver applies ancestor clipping). Always, next to CSS\n * `position-visibility: anchor-visible`: Firefox 159 only parses an older value, and WebKit\n * (Safari 27) reports support but doesn't hide a popover whose anchor is clipped by the grid's\n * own scroll container — feature detection can't tell.\n * Returns a cleanup function; call it when the popover closes.\n */\nexport function trackAnchor(floating: HTMLElement, target: AnchorTarget, placement: Placement): () => void {\n const cleanups: (() => void)[] = []\n\n if (!supportsAnchorPositioning()) {\n let frame = 0\n const place = () => {\n cancelAnimationFrame(frame)\n frame = requestAnimationFrame(() => placeWithoutAnchorSupport(floating, target, placement))\n }\n placeWithoutAnchorSupport(floating, target, placement)\n window.addEventListener('scroll', place, { capture: true, passive: true })\n window.addEventListener('resize', place, { passive: true })\n cleanups.push(() => {\n cancelAnimationFrame(frame)\n window.removeEventListener('scroll', place, { capture: true })\n window.removeEventListener('resize', place)\n })\n }\n\n if (target instanceof HTMLElement && typeof IntersectionObserver !== 'undefined') {\n const io = new IntersectionObserver(([entry]) => {\n floating.toggleAttribute('data-vg-anchor-hidden', !!entry && !entry.isIntersecting)\n })\n io.observe(target)\n cleanups.push(() => {\n io.disconnect()\n floating.removeAttribute('data-vg-anchor-hidden')\n })\n }\n\n return () => cleanups.splice(0).forEach((fn) => fn())\n}\n"],"mappings":";AAMA,IAAIA;AAEJ,SAAgBC,IAAqC;CAEnD,OADA,MAAc,OAAO,MAAQ,OAAe,OAAO,IAAI,YAAa,cAAc,IAAI,SAAS,mBAAmB,GAC3GD;AACT;AAGA,SAAgBE,EAAc,GAAoB;CAChD,OAAO,eAAeC,EAAG,QAAQ,WAAW,GAAG;AACjD;AAOA,SAAgBC,EAA0B,GAAuB,GAAsB,GAAsB;CAC3G,IACMC,IACJC,aAAkB,cACdA,EAAO,sBAAsB,IAC7B,IAAI,QAAQA,EAAO,GAAGA,EAAO,GAAG,GAAG,CAAC,GACpCC,IAAMC,EAAS,sBAAsB,GACrCC,IAAK,OAAO,YACZC,IAAK,OAAO,aAEdC,IAAOC,MAAc,eAAeP,EAAK,QAAQE,EAAI,QAAgCF,EAAK;CAE9F,AADIM,IAAOJ,EAAI,QAAQE,IAAK,MAAK,IAAOG,MAAc,UAAUP,EAAK,OAAOE,EAAI,QAAQE,IAAK,IAAMF,EAAI,QACvG,IAAO,KAAK,IAAI,GAAKI,CAAI;CAEzB,IAAIE,IAAMR,EAAK,UAAUO,MAAc,UAAU,IAAI;CAKrD,AAJIC,IAAMN,EAAI,SAASG,IAAK,MAAK,IAAML,EAAK,OAAOO,MAAc,UAAU,IAAI,KAAOL,EAAI,SAC1F,IAAM,KAAK,IAAI,GAAKM,CAAG,GAEvB,EAAS,MAAM,OAAO,GAAGF,EAAK,KAC9B,EAAS,MAAM,MAAM,GAAGE,EAAI;AAC9B;AAYA,SAAgBC,EAAY,GAAuB,GAAsB,GAAkC;CACzG,IAAMC,IAA2B,CAAC;CAElC,IAAI,CAACd,EAA0B,GAAG;EAChC,IAAIe,IAAQ,GACNC,UAAc;GAElB,AADA,qBAAqBD,CAAK,GAC1B,IAAQ,4BAA4BZ,EAA0BI,GAAUF,GAAQM,CAAS,CAAC;EAC5F;EAIA,AAHAR,EAA0BI,GAAUF,GAAQM,CAAS,GACrD,OAAO,iBAAiB,UAAUK,GAAO;GAAE,SAAS;GAAM,SAAS;EAAK,CAAC,GACzE,OAAO,iBAAiB,UAAUA,GAAO,EAAE,SAAS,GAAK,CAAC,GAC1DF,EAAS,WAAW;GAGlB,AAFA,qBAAqBC,CAAK,GAC1B,OAAO,oBAAoB,UAAUC,GAAO,EAAE,SAAS,GAAK,CAAC,GAC7D,OAAO,oBAAoB,UAAUA,CAAK;EAC5C,CAAC;CACH;CAEA,IAAIX,aAAkB,eAAe,OAAO,uBAAyB,KAAa;EAChF,IAAMY,IAAK,IAAI,sBAAsB,CAACC,OAAW;GAC/C,EAAS,gBAAgB,yBAAyB,CAAC,CAACA,KAAS,CAACA,EAAM,cAAc;EACpF,CAAC;EAED,AADAD,EAAG,QAAQZ,CAAM,GACjBS,EAAS,WAAW;GAElB,AADAG,EAAG,WAAW,GACdV,EAAS,gBAAgB,uBAAuB;EAClD,CAAC;CACH;CAEA,aAAaO,EAAS,OAAO,CAAC,CAAC,CAAC,SAAS,MAAOK,EAAG,CAAC;AACtD"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
// src/internal/clipboard.ts
|
|
2
2
|
async function e(e) {
|
|
3
3
|
try {
|
|
4
|
-
return
|
|
4
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
5
5
|
} catch {
|
|
6
|
-
|
|
6
|
+
let t = document.activeElement, n = document.createElement("textarea");
|
|
7
|
+
n.value = e, n.style.cssText = "position:fixed;top:0;opacity:0", document.body.append(n), n.focus({ preventScroll: !0 }), n.select();
|
|
8
|
+
let r = !1;
|
|
9
|
+
try {
|
|
10
|
+
r = document.execCommand("copy");
|
|
11
|
+
} catch {}
|
|
12
|
+
return n.remove(), t?.focus({ preventScroll: !0 }), r;
|
|
7
13
|
}
|
|
8
14
|
}
|
|
9
15
|
export { e as copyText };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipboard.js","names":["copyText","text"],"sources":["../../src/internal/clipboard.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"clipboard.js","names":["copyText","text","active","area","ok"],"sources":["../../src/internal/clipboard.ts"],"sourcesContent":["/**\n * Writes text to the clipboard. Uses the Clipboard API, and falls back to `execCommand('copy')`\n * where that API is missing or refused (pages served over plain http, browsers that deny it\n * without a permission). Resolves `false` when neither worked.\n */\nexport async function copyText(text: string): Promise<boolean> {\n try {\n await navigator.clipboard.writeText(text)\n return true\n } catch {\n // missing or refused: copy through a hidden textarea, then give focus back\n const active = document.activeElement as HTMLElement | null\n const area = document.createElement('textarea')\n area.value = text\n area.style.cssText = 'position:fixed;top:0;opacity:0'\n document.body.append(area)\n area.focus({ preventScroll: true })\n area.select()\n let ok = false\n try {\n ok = document.execCommand('copy')\n } catch {\n // unsupported\n }\n area.remove()\n active?.focus({ preventScroll: true })\n return ok\n }\n}\n"],"mappings":";AAKA,eAAsBA,EAAS,GAAgC;CAC7D,IAAI;EAEF,OADA,MAAM,UAAU,UAAU,UAAUC,CAAI,GACjC;CACT,QAAQ;EAEN,IAAMC,IAAS,SAAS,eAClBC,IAAO,SAAS,cAAc,UAAU;EAK9C,AAJA,EAAK,QAAQF,GACb,EAAK,MAAM,UAAU,kCACrB,SAAS,KAAK,OAAOE,CAAI,GACzBA,EAAK,MAAM,EAAE,eAAe,GAAK,CAAC,GAClCA,EAAK,OAAO;EACZ,IAAIC,IAAK;EACT,IAAI;GACF,IAAK,SAAS,YAAY,MAAM;EAClC,QAAQ,CAER;EAGA,OAFAD,EAAK,OAAO,GACZD,GAAQ,MAAM,EAAE,eAAe,GAAK,CAAC,GAC9BE;CACT;AACF"}
|
|
@@ -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 { Align, CellRendererDefinition, ClassValue, ColumnDef, FlashMode, GridPart, RowKey } 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 // expansion\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 toggleRow(row: any): 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(row: any, key: RowKey, column: ResolvedColumn, event: MouseEvent | KeyboardEvent): void\n onCellAction(row: any, key: RowKey, column: ResolvedColumn, name: string, payload: unknown): void\n onCellContextMenu(row: any, key: RowKey, column: ResolvedColumn, event: MouseEvent, el: HTMLElement): 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?(row: any, key: RowKey, column: ResolvedColumn, event: PointerEvent, el: HTMLElement): 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":";;AASA,IAAaA,IAAoB,
|
|
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 { Align, CellRendererDefinition, ClassValue, ColumnDef, FlashMode, GridPart, RowKey } 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(row: any, key: RowKey, column: ResolvedColumn, event: MouseEvent | KeyboardEvent): void\n onCellAction(row: any, key: RowKey, column: ResolvedColumn, name: string, payload: unknown): void\n onCellContextMenu(row: any, key: RowKey, column: ResolvedColumn, event: MouseEvent, el: HTMLElement): 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?(row: any, key: RowKey, column: ResolvedColumn, event: PointerEvent, el: HTMLElement): 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":";;AASA,IAAaA,IAAoB,eA6HpBC,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 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 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}\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":";
|
|
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 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}\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":";AA6CA,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"}
|
|
@@ -4,7 +4,7 @@ function t(t, n) {
|
|
|
4
4
|
let r = e.get(t);
|
|
5
5
|
return r === void 0 && (r = typeof CSS > "u" || typeof CSS.supports != "function" || n(), e.set(t, r)), r;
|
|
6
6
|
}
|
|
7
|
-
var n = () => t("has", () => CSS.supports("selector(:has(+ *))")), r = () => t("scroll-state", () => CSS.supports("container-type: scroll-state")), i = () => t("
|
|
8
|
-
export {
|
|
7
|
+
var n = () => t("has", () => CSS.supports("selector(:has(+ *))")), r = () => t("scroll-state", () => CSS.supports("container-type: scroll-state")), i = () => t("relative-color", () => CSS.supports("color: oklch(from red l c h)"));
|
|
8
|
+
export { n as supportsHas, i as supportsRelativeColor, r as supportsScrollState };
|
|
9
9
|
|
|
10
10
|
//# sourceMappingURL=supports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supports.js","names":["cache","check","v","id","test","supportsHas","supportsScrollState","
|
|
1
|
+
{"version":3,"file":"supports.js","names":["cache","check","v","id","test","supportsHas","supportsScrollState","supportsRelativeColor"],"sources":["../../src/internal/supports.ts"],"sourcesContent":["/**\n * CSS feature checks deciding when a JS fallback is needed. Everything the grid can do in CSS it does\n * in CSS; these only gate the fallbacks. All return `true` during SSR (no `CSS` global), so the\n * server never renders fallback state.\n */\nconst cache = new Map<string, boolean>()\n\nfunction check(id: string, test: () => boolean): boolean {\n let v = cache.get(id)\n if (v === undefined) {\n v = typeof CSS === 'undefined' || typeof CSS.supports !== 'function' ? true : test()\n cache.set(id, v)\n }\n return v\n}\n\n/** `:has()` — used to find the pinned-column edge in CSS. */\nexport const supportsHas = () => check('has', () => CSS.supports('selector(:has(+ *))'))\n\n/** Scroll-state container queries — show pin shadows only while content is scrolled under them. */\nexport const supportsScrollState = () =>\n check('scroll-state', () => CSS.supports('container-type: scroll-state'))\n\n\n/** Relative colour syntax — picks readable chip text in CSS. */\nexport const supportsRelativeColor = () =>\n check('relative-color', () => CSS.supports('color: oklch(from red l c h)'))\n"],"mappings":";AAKA,IAAMA,oBAAQ,IAAI,IAAqB;AAEvC,SAASC,EAAM,GAAY,GAA8B;CACvD,IAAIC,IAAIF,EAAM,IAAIG,CAAE;CAKpB,OAJID,MAAM,KAAA,MACR,IAAI,OAAO,MAAQ,OAAe,OAAO,IAAI,YAAa,cAAoBE,EAAK,GACnFJ,EAAM,IAAIG,GAAID,CAAC,IAEVA;AACT;AAGA,IAAaG,UAAoBJ,EAAM,aAAa,IAAI,SAAS,qBAAqB,CAAC,GAG1EK,UACXL,EAAM,sBAAsB,IAAI,SAAS,8BAA8B,CAAC,GAI7DM,UACXN,EAAM,wBAAwB,IAAI,SAAS,8BAA8B,CAAC"}
|