@nocopypaste/vue-grid 0.0.0-stage → 0.2.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.
- package/AGENTS.md +285 -0
- package/CHANGELOG.md +31 -0
- package/README.md +881 -2
- package/agent/api.json +2336 -0
- package/agent/api.md +632 -0
- package/agent/grid-config.schema.json +609 -0
- package/dist/agent/api.js +2301 -0
- package/dist/agent/api.js.map +1 -0
- package/dist/agent/index.js +8 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/requirements.js +57 -0
- package/dist/agent/requirements.js.map +1 -0
- package/dist/agent/validate.js +181 -0
- package/dist/agent/validate.js.map +1 -0
- package/dist/base.css +1 -0
- package/dist/components/VGrid.js +6 -0
- package/dist/components/VGrid.js.map +1 -0
- package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js +759 -0
- package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridCell.js +6 -0
- package/dist/components/VGridCell.js.map +1 -0
- package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js +167 -0
- package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridCheckbox.js +6 -0
- package/dist/components/VGridCheckbox.js.map +1 -0
- package/dist/components/VGridCheckbox.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/components/VGridCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridColumnMenu.js +6 -0
- package/dist/components/VGridColumnMenu.js.map +1 -0
- package/dist/components/VGridColumnMenu.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/VGridColumnMenu.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridFilterInput.js +6 -0
- package/dist/components/VGridFilterInput.js.map +1 -0
- package/dist/components/VGridFilterInput.vue_vue_type_script_setup_true_lang.js +89 -0
- package/dist/components/VGridFilterInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridFilterPanel.js +6 -0
- package/dist/components/VGridFilterPanel.js.map +1 -0
- package/dist/components/VGridFilterPanel.vue_vue_type_script_setup_true_lang.js +248 -0
- package/dist/components/VGridFilterPanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridFilterPopover.js +6 -0
- package/dist/components/VGridFilterPopover.js.map +1 -0
- package/dist/components/VGridFilterPopover.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/components/VGridFilterPopover.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridGroupRow.js +6 -0
- package/dist/components/VGridGroupRow.js.map +1 -0
- package/dist/components/VGridGroupRow.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/components/VGridGroupRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridHeader.js +6 -0
- package/dist/components/VGridHeader.js.map +1 -0
- package/dist/components/VGridHeader.vue_vue_type_script_setup_true_lang.js +130 -0
- package/dist/components/VGridHeader.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridMenu.js +6 -0
- package/dist/components/VGridMenu.js.map +1 -0
- package/dist/components/VGridMenu.vue_vue_type_script_setup_true_lang.js +133 -0
- package/dist/components/VGridMenu.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridPagination.js +6 -0
- package/dist/components/VGridPagination.js.map +1 -0
- package/dist/components/VGridPagination.vue_vue_type_script_setup_true_lang.js +102 -0
- package/dist/components/VGridPagination.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridPinnedRows.js +6 -0
- package/dist/components/VGridPinnedRows.js.map +1 -0
- package/dist/components/VGridPinnedRows.vue_vue_type_script_setup_true_lang.js +75 -0
- package/dist/components/VGridPinnedRows.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridResizeHandle.js +6 -0
- package/dist/components/VGridResizeHandle.js.map +1 -0
- package/dist/components/VGridResizeHandle.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/components/VGridResizeHandle.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridRows.js +6 -0
- package/dist/components/VGridRows.js.map +1 -0
- package/dist/components/VGridRows.vue_vue_type_script_setup_true_lang.js +178 -0
- package/dist/components/VGridRows.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridSearch.js +6 -0
- package/dist/components/VGridSearch.js.map +1 -0
- package/dist/components/VGridSearch.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/components/VGridSearch.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridTotalCell.js +6 -0
- package/dist/components/VGridTotalCell.js.map +1 -0
- package/dist/components/VGridTotalCell.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/components/VGridTotalCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composables/useColumnDrag.js +79 -0
- package/dist/composables/useColumnDrag.js.map +1 -0
- package/dist/composables/useColumnResize.js +68 -0
- package/dist/composables/useColumnResize.js.map +1 -0
- package/dist/composables/useDataSource.js +47 -0
- package/dist/composables/useDataSource.js.map +1 -0
- package/dist/composables/useGridFilters.js +125 -0
- package/dist/composables/useGridFilters.js.map +1 -0
- package/dist/composables/useGridKeyboard.js +111 -0
- package/dist/composables/useGridKeyboard.js.map +1 -0
- package/dist/composables/useGridMenus.js +214 -0
- package/dist/composables/useGridMenus.js.map +1 -0
- package/dist/composables/useGridSelection.js +75 -0
- package/dist/composables/useGridSelection.js.map +1 -0
- package/dist/composables/usePinnedOffsets.js +61 -0
- package/dist/composables/usePinnedOffsets.js.map +1 -0
- package/dist/composables/usePinnedRows.js +58 -0
- package/dist/composables/usePinnedRows.js.map +1 -0
- package/dist/composables/useScrollEdges.js +27 -0
- package/dist/composables/useScrollEdges.js.map +1 -0
- package/dist/composables/useSubRows.js +101 -0
- package/dist/composables/useSubRows.js.map +1 -0
- package/dist/composables/useTotals.js +30 -0
- package/dist/composables/useTotals.js.map +1 -0
- package/dist/composables/useVirtualRows.js +160 -0
- package/dist/composables/useVirtualRows.js.map +1 -0
- package/dist/core/aggregate.js +39 -0
- package/dist/core/aggregate.js.map +1 -0
- package/dist/core/columns.js +106 -0
- package/dist/core/columns.js.map +1 -0
- package/dist/core/filter.js +218 -0
- package/dist/core/filter.js.map +1 -0
- package/dist/core/helpers.js +7 -0
- package/dist/core/helpers.js.map +1 -0
- package/dist/core/pagination.js +25 -0
- package/dist/core/pagination.js.map +1 -0
- package/dist/core/patch.js +41 -0
- package/dist/core/patch.js.map +1 -0
- package/dist/core/selection.js +15 -0
- package/dist/core/selection.js.map +1 -0
- package/dist/core/sort.js +36 -0
- package/dist/core/sort.js.map +1 -0
- package/dist/core/storage.js +36 -0
- package/dist/core/storage.js.map +1 -0
- package/dist/core/value.js +19 -0
- package/dist/core/value.js.map +1 -0
- package/dist/core/virtual.js +83 -0
- package/dist/core/virtual.js.map +1 -0
- package/dist/core.css +1 -0
- package/dist/features/aggregation.js +11 -0
- package/dist/features/aggregation.js.map +1 -0
- package/dist/features/columnGroups.js +9 -0
- package/dist/features/columnGroups.js.map +1 -0
- package/dist/features/columnPinning.js +11 -0
- package/dist/features/columnPinning.js.map +1 -0
- package/dist/features/columnReorder.js +12 -0
- package/dist/features/columnReorder.js.map +1 -0
- package/dist/features/columnResizing.js +11 -0
- package/dist/features/columnResizing.js.map +1 -0
- package/dist/features/columnVisibility.js +9 -0
- package/dist/features/columnVisibility.js.map +1 -0
- package/dist/features/filtering.js +13 -0
- package/dist/features/filtering.js.map +1 -0
- package/dist/features/index.js +38 -0
- package/dist/features/index.js.map +1 -0
- package/dist/features/keyboardNavigation.js +9 -0
- package/dist/features/keyboardNavigation.js.map +1 -0
- package/dist/features/menus.js +11 -0
- package/dist/features/menus.js.map +1 -0
- package/dist/features/pagination.js +9 -0
- package/dist/features/pagination.js.map +1 -0
- package/dist/features/rowPinning.js +11 -0
- package/dist/features/rowPinning.js.map +1 -0
- package/dist/features/selection.js +11 -0
- package/dist/features/selection.js.map +1 -0
- package/dist/features/serverData.js +9 -0
- package/dist/features/serverData.js.map +1 -0
- package/dist/features/sorting.js +9 -0
- package/dist/features/sorting.js.map +1 -0
- package/dist/features/subGrids.js +9 -0
- package/dist/features/subGrids.js.map +1 -0
- package/dist/features/virtualScrolling.js +9 -0
- package/dist/features/virtualScrolling.js.map +1 -0
- package/dist/index.js +67 -0
- package/dist/internal/RenderSlot.js +6 -0
- package/dist/internal/RenderSlot.js.map +1 -0
- package/dist/internal/anchor.js +41 -0
- package/dist/internal/anchor.js.map +1 -0
- package/dist/internal/clipboard.js +11 -0
- package/dist/internal/clipboard.js.map +1 -0
- package/dist/internal/context.js +11 -0
- package/dist/internal/context.js.map +1 -0
- package/dist/internal/dev.js +8 -0
- package/dist/internal/dev.js.map +1 -0
- package/dist/internal/features.js +9 -0
- package/dist/internal/features.js.map +1 -0
- package/dist/internal/supports.js +10 -0
- package/dist/internal/supports.js.map +1 -0
- package/dist/internal/touchHold.js +43 -0
- package/dist/internal/touchHold.js.map +1 -0
- package/dist/registry/plugin.js +25 -0
- package/dist/registry/plugin.js.map +1 -0
- package/dist/registry/registry.js +15 -0
- package/dist/registry/registry.js.map +1 -0
- package/dist/renderers/ActionButtonCell.js +6 -0
- package/dist/renderers/ActionButtonCell.js.map +1 -0
- package/dist/renderers/ActionButtonCell.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/renderers/ActionButtonCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/ActionsMenuCell.js +6 -0
- package/dist/renderers/ActionsMenuCell.js.map +1 -0
- package/dist/renderers/ActionsMenuCell.vue_vue_type_script_setup_true_lang.js +75 -0
- package/dist/renderers/ActionsMenuCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/BooleanCell.js +6 -0
- package/dist/renderers/BooleanCell.js.map +1 -0
- package/dist/renderers/BooleanCell.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/renderers/BooleanCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/ButtonGroupCell.js +6 -0
- package/dist/renderers/ButtonGroupCell.js.map +1 -0
- package/dist/renderers/ButtonGroupCell.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/renderers/ButtonGroupCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/ChangeCell.js +6 -0
- package/dist/renderers/ChangeCell.js.map +1 -0
- package/dist/renderers/ChangeCell.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/renderers/ChangeCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/CheckboxCell.js +6 -0
- package/dist/renderers/CheckboxCell.js.map +1 -0
- package/dist/renderers/CheckboxCell.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/renderers/CheckboxCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/ChipCell.js +6 -0
- package/dist/renderers/ChipCell.js.map +1 -0
- package/dist/renderers/ChipCell.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/renderers/ChipCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/CodeCell.js +6 -0
- package/dist/renderers/CodeCell.js.map +1 -0
- package/dist/renderers/CodeCell.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/renderers/CodeCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/CopyCell.js +6 -0
- package/dist/renderers/CopyCell.js.map +1 -0
- package/dist/renderers/CopyCell.vue_vue_type_script_setup_true_lang.js +51 -0
- package/dist/renderers/CopyCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/CurrencyCell.js +6 -0
- package/dist/renderers/CurrencyCell.js.map +1 -0
- package/dist/renderers/CurrencyCell.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/renderers/CurrencyCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/DateCell.js +6 -0
- package/dist/renderers/DateCell.js.map +1 -0
- package/dist/renderers/DateCell.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/renderers/DateCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/DateTimeCell.js +6 -0
- package/dist/renderers/DateTimeCell.js.map +1 -0
- package/dist/renderers/DateTimeCell.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/renderers/DateTimeCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/DetailsCell.js +6 -0
- package/dist/renderers/DetailsCell.js.map +1 -0
- package/dist/renderers/DetailsCell.vue_vue_type_script_setup_true_lang.js +82 -0
- package/dist/renderers/DetailsCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/EditCell.js +6 -0
- package/dist/renderers/EditCell.js.map +1 -0
- package/dist/renderers/EditCell.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/renderers/EditCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/IconCell.js +6 -0
- package/dist/renderers/IconCell.js.map +1 -0
- package/dist/renderers/IconCell.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/renderers/IconCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/IconToggleCell.js +6 -0
- package/dist/renderers/IconToggleCell.js.map +1 -0
- package/dist/renderers/IconToggleCell.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/renderers/IconToggleCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/ImageCell.js +6 -0
- package/dist/renderers/ImageCell.js.map +1 -0
- package/dist/renderers/ImageCell.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/renderers/ImageCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/JsonCell.js +6 -0
- package/dist/renderers/JsonCell.js.map +1 -0
- package/dist/renderers/JsonCell.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/renderers/JsonCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/JsonTreeCell.js +6 -0
- package/dist/renderers/JsonTreeCell.js.map +1 -0
- package/dist/renderers/JsonTreeCell.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/renderers/JsonTreeCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/JsonTreeNode.js +6 -0
- package/dist/renderers/JsonTreeNode.js.map +1 -0
- package/dist/renderers/JsonTreeNode.vue_vue_type_script_setup_true_lang.js +80 -0
- package/dist/renderers/JsonTreeNode.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/LinkCell.js +6 -0
- package/dist/renderers/LinkCell.js.map +1 -0
- package/dist/renderers/LinkCell.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/renderers/LinkCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/ListCell.js +6 -0
- package/dist/renderers/ListCell.js.map +1 -0
- package/dist/renderers/ListCell.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/renderers/ListCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/MultiLineCell.js +6 -0
- package/dist/renderers/MultiLineCell.js.map +1 -0
- package/dist/renderers/MultiLineCell.vue_vue_type_script_setup_true_lang.js +102 -0
- package/dist/renderers/MultiLineCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/NumberCell.js +6 -0
- package/dist/renderers/NumberCell.js.map +1 -0
- package/dist/renderers/NumberCell.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/renderers/NumberCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/RadioCell.js +6 -0
- package/dist/renderers/RadioCell.js.map +1 -0
- package/dist/renderers/RadioCell.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/renderers/RadioCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/StatusCell.js +6 -0
- package/dist/renderers/StatusCell.js.map +1 -0
- package/dist/renderers/StatusCell.vue_vue_type_script_setup_true_lang.js +51 -0
- package/dist/renderers/StatusCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/SwitchCell.js +6 -0
- package/dist/renderers/SwitchCell.js.map +1 -0
- package/dist/renderers/SwitchCell.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/renderers/SwitchCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/TextCell.js +6 -0
- package/dist/renderers/TextCell.js.map +1 -0
- package/dist/renderers/TextCell.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/renderers/TextCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/ToggleTextCell.js +6 -0
- package/dist/renderers/ToggleTextCell.js.map +1 -0
- package/dist/renderers/ToggleTextCell.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/renderers/ToggleTextCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/format.js +142 -0
- package/dist/renderers/format.js.map +1 -0
- package/dist/renderers/index.js +188 -0
- package/dist/renderers/index.js.map +1 -0
- package/dist/renderers/options.js +17 -0
- package/dist/renderers/options.js.map +1 -0
- package/dist/renderers/parts/CopyButton.js +6 -0
- package/dist/renderers/parts/CopyButton.js.map +1 -0
- package/dist/renderers/parts/CopyButton.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/renderers/parts/CopyButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/parts/NumberValue.js +6 -0
- package/dist/renderers/parts/NumberValue.js.map +1 -0
- package/dist/renderers/parts/NumberValue.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/renderers/parts/NumberValue.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/parts/ValueBadge.js +6 -0
- package/dist/renderers/parts/ValueBadge.js.map +1 -0
- package/dist/renderers/parts/ValueBadge.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/renderers/parts/ValueBadge.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/renderers/parts/icons.js +27 -0
- package/dist/renderers/parts/icons.js.map +1 -0
- package/dist/renderers/parts/routerLink.js +9 -0
- package/dist/renderers/parts/routerLink.js.map +1 -0
- package/dist/renderers/parts/useToggleControl.js +15 -0
- package/dist/renderers/parts/useToggleControl.js.map +1 -0
- package/dist/renderers/text.js +10 -0
- package/dist/renderers/text.js.map +1 -0
- package/dist/renderers.css +1 -0
- package/dist/theme.css +1 -0
- package/dist/types/agent/index.d.ts +50 -0
- package/dist/types/agent/requirements.d.ts +17 -0
- package/dist/types/agent/validate.d.ts +33 -0
- package/dist/types/components/VGrid.vue.d.ts +205 -0
- package/dist/types/components/VGridCell.vue.d.ts +19 -0
- package/dist/types/components/VGridCheckbox.vue.d.ts +14 -0
- package/dist/types/components/VGridColumnMenu.vue.d.ts +22 -0
- package/dist/types/components/VGridFilterInput.vue.d.ts +17 -0
- package/dist/types/components/VGridFilterPanel.vue.d.ts +20 -0
- package/dist/types/components/VGridFilterPopover.vue.d.ts +12 -0
- package/dist/types/components/VGridGroupRow.vue.d.ts +3 -0
- package/dist/types/components/VGridHeader.vue.d.ts +26 -0
- package/dist/types/components/VGridMenu.vue.d.ts +42 -0
- package/dist/types/components/VGridPagination.vue.d.ts +27 -0
- package/dist/types/components/VGridPinnedRows.vue.d.ts +15 -0
- package/dist/types/components/VGridResizeHandle.vue.d.ts +8 -0
- package/dist/types/components/VGridRows.vue.d.ts +28 -0
- package/dist/types/components/VGridSearch.vue.d.ts +22 -0
- package/dist/types/components/VGridTotalCell.vue.d.ts +13 -0
- package/dist/types/composables/useColumnDrag.d.ts +26 -0
- package/dist/types/composables/useColumnResize.d.ts +29 -0
- package/dist/types/composables/useDataSource.d.ts +39 -0
- package/dist/types/composables/useGridFilters.d.ts +45 -0
- package/dist/types/composables/useGridKeyboard.d.ts +16 -0
- package/dist/types/composables/useGridMenus.d.ts +55 -0
- package/dist/types/composables/useGridSelection.d.ts +27 -0
- package/dist/types/composables/usePinnedOffsets.d.ts +22 -0
- package/dist/types/composables/usePinnedRows.d.ts +26 -0
- package/dist/types/composables/useScrollEdges.d.ts +8 -0
- package/dist/types/composables/useSubRows.d.ts +38 -0
- package/dist/types/composables/useTotals.d.ts +17 -0
- package/dist/types/composables/useVirtualRows.d.ts +72 -0
- package/dist/types/core/aggregate.d.ts +9 -0
- package/dist/types/core/columns.d.ts +35 -0
- package/dist/types/core/filter.d.ts +85 -0
- package/dist/types/core/helpers.d.ts +3 -0
- package/dist/types/core/pagination.d.ts +3 -0
- package/dist/types/core/patch.d.ts +23 -0
- package/dist/types/core/selection.d.ts +8 -0
- package/dist/types/core/sort.d.ts +10 -0
- package/dist/types/core/storage.d.ts +6 -0
- package/dist/types/core/value.d.ts +6 -0
- package/dist/types/core/virtual.d.ts +72 -0
- package/dist/types/features/aggregation.d.ts +8 -0
- package/dist/types/features/columnGroups.d.ts +7 -0
- package/dist/types/features/columnPinning.d.ts +7 -0
- package/dist/types/features/columnReorder.d.ts +7 -0
- package/dist/types/features/columnResizing.d.ts +8 -0
- package/dist/types/features/columnVisibility.d.ts +7 -0
- package/dist/types/features/filtering.d.ts +7 -0
- package/dist/types/features/index.d.ts +20 -0
- package/dist/types/features/keyboardNavigation.d.ts +10 -0
- package/dist/types/features/menus.d.ts +8 -0
- package/dist/types/features/pagination.d.ts +8 -0
- package/dist/types/features/rowPinning.d.ts +8 -0
- package/dist/types/features/selection.d.ts +6 -0
- package/dist/types/features/serverData.d.ts +6 -0
- package/dist/types/features/sorting.d.ts +6 -0
- package/dist/types/features/subGrids.d.ts +6 -0
- package/dist/types/features/virtualScrolling.d.ts +8 -0
- package/dist/types/index.d.ts +21 -0
- package/dist/types/internal/RenderSlot.d.ts +6 -0
- package/dist/types/internal/anchor.d.ts +18 -0
- package/dist/types/internal/clipboard.d.ts +2 -0
- package/dist/types/internal/context.d.ts +123 -0
- package/dist/types/internal/dev.d.ts +1 -0
- package/dist/types/internal/features.d.ts +22 -0
- package/dist/types/internal/supports.d.ts +11 -0
- package/dist/types/internal/touchHold.d.ts +19 -0
- package/dist/types/registry/plugin.d.ts +18 -0
- package/dist/types/registry/registry.d.ts +18 -0
- package/dist/types/renderers/ActionButtonCell.vue.d.ts +10 -0
- package/dist/types/renderers/ActionsMenuCell.vue.d.ts +10 -0
- package/dist/types/renderers/BooleanCell.vue.d.ts +6 -0
- package/dist/types/renderers/ButtonGroupCell.vue.d.ts +10 -0
- package/dist/types/renderers/ChangeCell.vue.d.ts +6 -0
- package/dist/types/renderers/CheckboxCell.vue.d.ts +10 -0
- package/dist/types/renderers/ChipCell.vue.d.ts +6 -0
- package/dist/types/renderers/CodeCell.vue.d.ts +6 -0
- package/dist/types/renderers/CopyCell.vue.d.ts +10 -0
- package/dist/types/renderers/CurrencyCell.vue.d.ts +10 -0
- package/dist/types/renderers/DateCell.vue.d.ts +6 -0
- package/dist/types/renderers/DateTimeCell.vue.d.ts +6 -0
- package/dist/types/renderers/DetailsCell.vue.d.ts +6 -0
- package/dist/types/renderers/EditCell.vue.d.ts +10 -0
- package/dist/types/renderers/IconCell.vue.d.ts +6 -0
- package/dist/types/renderers/IconToggleCell.vue.d.ts +10 -0
- package/dist/types/renderers/ImageCell.vue.d.ts +6 -0
- package/dist/types/renderers/JsonCell.vue.d.ts +6 -0
- package/dist/types/renderers/JsonTreeCell.vue.d.ts +6 -0
- package/dist/types/renderers/JsonTreeNode.vue.d.ts +14 -0
- package/dist/types/renderers/LinkCell.vue.d.ts +10 -0
- package/dist/types/renderers/ListCell.vue.d.ts +10 -0
- package/dist/types/renderers/MultiLineCell.vue.d.ts +10 -0
- package/dist/types/renderers/NumberCell.vue.d.ts +12 -0
- package/dist/types/renderers/RadioCell.vue.d.ts +10 -0
- package/dist/types/renderers/StatusCell.vue.d.ts +10 -0
- package/dist/types/renderers/SwitchCell.vue.d.ts +10 -0
- package/dist/types/renderers/TextCell.vue.d.ts +10 -0
- package/dist/types/renderers/ToggleTextCell.vue.d.ts +10 -0
- package/dist/types/renderers/format.d.ts +27 -0
- package/dist/types/renderers/index.d.ts +132 -0
- package/dist/types/renderers/options.d.ts +325 -0
- package/dist/types/renderers/parts/CopyButton.vue.d.ts +16 -0
- package/dist/types/renderers/parts/NumberValue.vue.d.ts +12 -0
- package/dist/types/renderers/parts/ValueBadge.vue.d.ts +7 -0
- package/dist/types/renderers/parts/icons.d.ts +21 -0
- package/dist/types/renderers/parts/routerLink.d.ts +7 -0
- package/dist/types/renderers/parts/useToggleControl.d.ts +12 -0
- package/dist/types/renderers/text.d.ts +3 -0
- package/dist/types/types.d.ts +383 -0
- package/dist/vue-grid.css +1 -0
- package/llms-full.txt +1806 -0
- package/llms.txt +23 -0
- package/package.json +74 -4
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { useInternalGrid as e } from "../internal/context.js";
|
|
2
|
+
import { RenderSlot as t } from "../internal/RenderSlot.js";
|
|
3
|
+
import { Fragment as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, defineComponent as c, normalizeClass as l, normalizeStyle as u, openBlock as d, renderList as f, resolveDynamicComponent as p, toDisplayString as m, unref as h } from "vue";
|
|
4
|
+
// src/components/VGridHeader.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var g = [
|
|
6
|
+
"tabindex",
|
|
7
|
+
"data-col-key",
|
|
8
|
+
"aria-sort",
|
|
9
|
+
"title",
|
|
10
|
+
"onPointerdown",
|
|
11
|
+
"onContextmenu"
|
|
12
|
+
], _ = ["tabindex", "onClick"], v = { class: "vg-header-label" }, y = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "vg-header-label"
|
|
15
|
+
}, b = /*@__PURE__*/ c({
|
|
16
|
+
__name: "VGridHeader",
|
|
17
|
+
props: {
|
|
18
|
+
sort: {},
|
|
19
|
+
allState: {},
|
|
20
|
+
hasSelectableRows: { type: Boolean },
|
|
21
|
+
dragging: {},
|
|
22
|
+
dropTarget: {},
|
|
23
|
+
canReorder: { type: Function }
|
|
24
|
+
},
|
|
25
|
+
emits: [
|
|
26
|
+
"sort",
|
|
27
|
+
"toggleAll",
|
|
28
|
+
"dragStart",
|
|
29
|
+
"headerClick"
|
|
30
|
+
],
|
|
31
|
+
setup(c, { emit: b }) {
|
|
32
|
+
let x = c, S = b, C = e();
|
|
33
|
+
function w(e) {
|
|
34
|
+
if (C.sortable(e.def)) return x.sort?.key === e.key ? x.sort.dir === "asc" ? "ascending" : "descending" : "none";
|
|
35
|
+
}
|
|
36
|
+
return (e, b) => (d(), a("div", {
|
|
37
|
+
role: "row",
|
|
38
|
+
class: l(["vg-header", h(C).ui.value.header]),
|
|
39
|
+
onClickCapture: b[1] ||= (e) => S("headerClick", e)
|
|
40
|
+
}, [(d(!0), a(n, null, f(h(C).columns.value, (e) => (d(), a("div", {
|
|
41
|
+
key: e.key,
|
|
42
|
+
role: "columnheader",
|
|
43
|
+
tabindex: h(C).rovingTabindex,
|
|
44
|
+
"data-col-key": e.key,
|
|
45
|
+
"aria-sort": w(e),
|
|
46
|
+
title: e.def.headerTooltip,
|
|
47
|
+
class: l([
|
|
48
|
+
"vg-header-cell",
|
|
49
|
+
`vg-align-${e.align}`,
|
|
50
|
+
{
|
|
51
|
+
"vg-header-select": e.kind === "select",
|
|
52
|
+
"vg-sorted": h(C).sortable(e.def) && c.sort?.key === e.key,
|
|
53
|
+
"vg-reorderable": e.kind === "data" && c.canReorder(e.key),
|
|
54
|
+
"vg-dragging": c.dragging === e.key,
|
|
55
|
+
"vg-drop-before": c.dropTarget?.key === e.key && c.dropTarget.side === "before",
|
|
56
|
+
"vg-drop-after": c.dropTarget?.key === e.key && c.dropTarget.side === "after",
|
|
57
|
+
[`vg-pin-${e.pinned}`]: e.pinned,
|
|
58
|
+
"vg-pin-edge": e.pinEdge,
|
|
59
|
+
"vg-filtered": e.kind === "data" && h(C).filters?.isActive(e.key),
|
|
60
|
+
"vg-has-filter-row": h(C).filters?.filterRow.value,
|
|
61
|
+
"vg-col-sized": e.kind === "data" && h(C).resize?.isSized(e.key)
|
|
62
|
+
},
|
|
63
|
+
e.def.headerClass,
|
|
64
|
+
h(C).ui.value.headerCell
|
|
65
|
+
]),
|
|
66
|
+
style: u(h(C).pinStyle(e.key)),
|
|
67
|
+
onPointerdown: (t) => e.kind === "data" && S("dragStart", t, e.key),
|
|
68
|
+
onContextmenu: (t) => e.kind === "data" && h(C).onHeaderContextMenu(e, t, t.currentTarget)
|
|
69
|
+
}, [e.kind === "select" ? (d(), a(n, { key: 0 }, [h(C).selectMode.value === "multi" ? (d(), r(p(h(C).Checkbox), {
|
|
70
|
+
key: 0,
|
|
71
|
+
checked: c.allState === "all",
|
|
72
|
+
indeterminate: c.allState === "some",
|
|
73
|
+
disabled: !c.hasSelectableRows,
|
|
74
|
+
label: "Select all rows",
|
|
75
|
+
onToggle: b[0] ||= (e) => S("toggleAll")
|
|
76
|
+
}, null, 40, [
|
|
77
|
+
"checked",
|
|
78
|
+
"indeterminate",
|
|
79
|
+
"disabled"
|
|
80
|
+
])) : i("", !0)], 64)) : (d(), a(n, { key: 1 }, [
|
|
81
|
+
h(C).sortable(e.def) ? (d(), a("button", {
|
|
82
|
+
key: 0,
|
|
83
|
+
type: "button",
|
|
84
|
+
class: "vg-sort",
|
|
85
|
+
tabindex: h(C).rovingTabindex,
|
|
86
|
+
onClick: (t) => S("sort", e.key)
|
|
87
|
+
}, [o("span", v, [h(C).slots[`header-${e.key}`] ? (d(), r(h(t), {
|
|
88
|
+
key: 0,
|
|
89
|
+
fn: h(C).slots[`header-${e.key}`],
|
|
90
|
+
scope: { column: e.def }
|
|
91
|
+
}, null, 8, ["fn", "scope"])) : (d(), a(n, { key: 1 }, [s(m(e.def.header ?? e.key), 1)], 64))]), b[2] ||= o("svg", {
|
|
92
|
+
class: "vg-sort-icon",
|
|
93
|
+
viewBox: "0 0 16 16",
|
|
94
|
+
"aria-hidden": "true"
|
|
95
|
+
}, [o("path", {
|
|
96
|
+
class: "vg-sort-up",
|
|
97
|
+
d: "M4.5 6.5 8 3l3.5 3.5"
|
|
98
|
+
}), o("path", {
|
|
99
|
+
class: "vg-sort-down",
|
|
100
|
+
d: "M4.5 9.5 8 13l3.5-3.5"
|
|
101
|
+
})], -1)], 8, _)) : (d(), a("span", y, [h(C).slots[`header-${e.key}`] ? (d(), r(h(t), {
|
|
102
|
+
key: 0,
|
|
103
|
+
fn: h(C).slots[`header-${e.key}`],
|
|
104
|
+
scope: { column: e.def }
|
|
105
|
+
}, null, 8, ["fn", "scope"])) : (d(), a(n, { key: 1 }, [s(m(e.def.header ?? e.key), 1)], 64))])),
|
|
106
|
+
h(C).filters && e.def.filterable ? (d(), a(n, { key: 2 }, [(d(), r(p(h(C).filters.FilterButton), { column: e }, null, 8, ["column"])), h(C).filters.filterRow.value ? (d(), r(p(h(C).filters.FilterInput), {
|
|
107
|
+
key: 0,
|
|
108
|
+
column: e.def,
|
|
109
|
+
type: h(C).filters.typeOf(e.def),
|
|
110
|
+
"model-value": h(C).filters.state.value.columns[e.key],
|
|
111
|
+
"onUpdate:modelValue": (t) => h(C).filters.setColumnFilter(e.key, t),
|
|
112
|
+
onOpen: (t) => h(C).filters.open(e.key)
|
|
113
|
+
}, null, 40, [
|
|
114
|
+
"column",
|
|
115
|
+
"type",
|
|
116
|
+
"model-value",
|
|
117
|
+
"onUpdate:modelValue",
|
|
118
|
+
"onOpen"
|
|
119
|
+
])) : i("", !0)], 64)) : i("", !0),
|
|
120
|
+
h(C).resize?.can(e.def) ? (d(), r(p(h(C).resize.Handle), {
|
|
121
|
+
key: 3,
|
|
122
|
+
"column-key": e.key,
|
|
123
|
+
label: e.def.header ?? e.key
|
|
124
|
+
}, null, 8, ["column-key", "label"])) : i("", !0)
|
|
125
|
+
], 64))], 46, g))), 128))], 34));
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
export { b as default };
|
|
129
|
+
|
|
130
|
+
//# sourceMappingURL=VGridHeader.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VGridHeader.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_Fragment","_renderList","_normalizeStyle","_createBlock","_resolveDynamicComponent","_createElementVNode","_createTextVNode","_toDisplayString","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","VGridHeader_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","grid","useInternalGrid","ariaSort","col","openBlock","createElementBlock","normalizeClass","unref","_cache","$event","Fragment","renderList","normalizeStyle","createBlock","resolveDynamicComponent","createCommentVNode","createElementVNode","RenderSlot","createTextVNode","toDisplayString"],"sources":["../../src/components/VGridHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { SelectionSummary } from '../core/selection'\nimport { useInternalGrid, type ResolvedColumn } from '../internal/context'\nimport { RenderSlot } from '../internal/RenderSlot'\nimport type { SortState } from '../types'\n\nconst props = defineProps<{\n sort: SortState | null | undefined\n allState: SelectionSummary\n hasSelectableRows: boolean\n dragging: string | null\n dropTarget: { key: string; side: 'before' | 'after' } | null\n canReorder: (key: string) => boolean\n}>()\n\nconst emit = defineEmits<{\n sort: [key: string]\n toggleAll: []\n dragStart: [event: PointerEvent, key: string]\n headerClick: [event: MouseEvent]\n}>()\n\nconst grid = useInternalGrid()\n\nfunction ariaSort(col: ResolvedColumn) {\n if (!grid.sortable(col.def)) return undefined\n if (props.sort?.key !== col.key) return 'none'\n return props.sort.dir === 'asc' ? 'ascending' : 'descending'\n}\n</script>\n\n<template>\n <div role=\"row\" :class=\"['vg-header', grid.ui.value.header]\" @click.capture=\"emit('headerClick', $event)\">\n <div\n v-for=\"col in grid.columns.value\"\n :key=\"col.key\"\n role=\"columnheader\"\n :tabindex=\"grid.rovingTabindex\"\n :data-col-key=\"col.key\"\n :aria-sort=\"ariaSort(col)\"\n :title=\"col.def.headerTooltip\"\n :class=\"[\n 'vg-header-cell',\n `vg-align-${col.align}`,\n {\n 'vg-header-select': col.kind === 'select',\n 'vg-sorted': grid.sortable(col.def) && sort?.key === col.key,\n 'vg-reorderable': col.kind === 'data' && canReorder(col.key),\n 'vg-dragging': dragging === col.key,\n 'vg-drop-before': dropTarget?.key === col.key && dropTarget.side === 'before',\n 'vg-drop-after': dropTarget?.key === col.key && dropTarget.side === 'after',\n [`vg-pin-${col.pinned}`]: col.pinned,\n 'vg-pin-edge': col.pinEdge,\n 'vg-filtered': col.kind === 'data' && grid.filters?.isActive(col.key),\n 'vg-has-filter-row': grid.filters?.filterRow.value,\n 'vg-col-sized': col.kind === 'data' && grid.resize?.isSized(col.key),\n },\n col.def.headerClass,\n grid.ui.value.headerCell,\n ]\"\n :style=\"grid.pinStyle(col.key)\"\n @pointerdown=\"col.kind === 'data' && emit('dragStart', $event, col.key)\"\n @contextmenu=\"col.kind === 'data' && grid.onHeaderContextMenu(col, $event, $event.currentTarget as HTMLElement)\"\n >\n <template v-if=\"col.kind === 'select'\">\n <component\n :is=\"grid.Checkbox\"\n v-if=\"grid.selectMode.value === 'multi'\"\n :checked=\"allState === 'all'\"\n :indeterminate=\"allState === 'some'\"\n :disabled=\"!hasSelectableRows\"\n label=\"Select all rows\"\n @toggle=\"emit('toggleAll')\"\n />\n </template>\n <template v-else>\n <button\n v-if=\"grid.sortable(col.def)\"\n type=\"button\"\n class=\"vg-sort\"\n :tabindex=\"grid.rovingTabindex\"\n @click=\"emit('sort', col.key)\"\n >\n <span class=\"vg-header-label\">\n <RenderSlot v-if=\"grid.slots[`header-${col.key}`]\" :fn=\"grid.slots[`header-${col.key}`]\" :scope=\"{ column: col.def }\" />\n <template v-else>{{ col.def.header ?? col.key }}</template>\n </span>\n <svg class=\"vg-sort-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path class=\"vg-sort-up\" d=\"M4.5 6.5 8 3l3.5 3.5\" />\n <path class=\"vg-sort-down\" d=\"M4.5 9.5 8 13l3.5-3.5\" />\n </svg>\n </button>\n <span v-else class=\"vg-header-label\">\n <RenderSlot v-if=\"grid.slots[`header-${col.key}`]\" :fn=\"grid.slots[`header-${col.key}`]\" :scope=\"{ column: col.def }\" />\n <template v-else>{{ col.def.header ?? col.key }}</template>\n </span>\n <template v-if=\"grid.filters && col.def.filterable\">\n <component :is=\"grid.filters.FilterButton\" :column=\"col\" />\n <component\n :is=\"grid.filters.FilterInput\"\n v-if=\"grid.filters.filterRow.value\"\n :column=\"col.def\"\n :type=\"grid.filters.typeOf(col.def)\"\n :model-value=\"grid.filters.state.value.columns[col.key]\"\n @update:model-value=\"grid.filters.setColumnFilter(col.key, $event)\"\n @open=\"grid.filters.open(col.key)\"\n />\n </template>\n <component\n :is=\"grid.resize.Handle\"\n v-if=\"grid.resize?.can(col.def)\"\n :column-key=\"col.key\"\n :label=\"col.def.header ?? col.key\"\n />\n </template>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA,IAAMkB,IAAQC,GASRC,IAAOH,GAOPI,IAAOC,EAAgB;EAE7B,SAASC,EAAS,GAAqB;GACrC,IAAKF,EAAK,SAASG,EAAI,GAAG,GAE1B,OADIN,EAAM,MAAM,QAAQM,EAAI,MACrBN,EAAM,KAAK,QAAQ,QAAQ,cAAc,eADR;EAE1C;E,kBAIElB,EAAA,GAAAC,EAoFM,OAAA;GApFD,MAAK;GAAO,OAAKC,EAAA,CAAA,aAAgBC,EAAAkB,CAAA,CAAI,CAAC,GAAG,MAAM,MAAM,CAAA;GAAmB,gBAAA,AAAAQ,EAAA,QAAA,MAAAT,EAAI,eAAgBU,CAAM;E,KACrG9B,EAAA,EAAA,GAAAC,EAkFMG,GAAA,MAAAC,EAjFUF,EAAAkB,CAAA,CAAI,CAAC,QAAQ,QAApB,OADTrB,EAAA,GAAAC,EAkFM,OAAA;GAhFH,KAAKuB,EAAI;GACV,MAAK;GACJ,UAAUrB,EAAAkB,CAAA,CAAI,CAAC;GACf,gBAAcG,EAAI;GAClB,aAAWD,EAASC,CAAG;GACvB,OAAOA,EAAI,IAAI;GACf,OAAKtB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AAI,IAAI,UAAUA,EAAI,GAAG,GAAA,CAAA,C;GAE/BrB,EAAAkB,CAAA,CAAI,CAAC,WAAWG,EAAI,IAAI,cAAxCxB,EAAA,GAAAC,EAWWG,GAAA,EAAA,KAAA,EAAA,GAAA,EAVTJ,EAAA,GAAAO,EAA2DC,EAA3CL,EAAAkB,CAAA,CAAI,CAAC,QAAQ,YAAY,GAAA,EAAG,QAAQG,EAAG,GAAA,MAAA,GAAA,CAAA,QAAA,CAAA,IAG/CrB,EAAAkB,CAAA,CAAI,CAAC,QAAQ,UAAU,SAF/BrB,EAAA,GAAAO,EAQEC,EAPKL,EAAAkB,CAAA,CAAI,CAAC,QAAQ,WAAW,GAAA;;IAE5B,QAAQG,EAAI;IACZ,MAAMrB,EAAAkB,CAAA,CAAI,CAAC,QAAQ,OAAOG,EAAI,GAAG;IACjC,eAAarB,EAAAkB,CAAA,CAAI,CAAC,QAAQ,MAAM,MAAM,QAAQG,EAAI;IAClD,wBAAkB,MAAErB,EAAAkB,CAAA,CAAI,CAAC,QAAQ,gBAAgBG,EAAI,KAAKM,CAAM;IAChE,SAAI,MAAE3B,EAAAkB,CAAA,CAAI,CAAC,QAAQ,KAAKG,EAAI,GAAG;;;;;;;;GAK5BrB,EAAAkB,CAAA,CAAI,CAAC,QAAQ,IAAIG,EAAI,GAAG,KAFhCxB,EAAA,GAAAO,EAKEC,EAJKL,EAAAkB,CAAA,CAAI,CAAC,OAAO,MAAM,GAAA;;IAEtB,cAAYG,EAAI;IAChB,OAAOA,EAAI,IAAI,UAAUA,EAAI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VGridMenu.js","names":["VGridMenu_vue_vue_type_script_setup_true_lang_default","VGridMenu_default"],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { anchorNameFor as e, trackAnchor as t } from "../internal/anchor.js";
|
|
2
|
+
import { Fragment as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, nextTick as c, normalizeClass as l, normalizeStyle as u, onBeforeUnmount as d, openBlock as f, ref as p, renderList as m, resolveDynamicComponent as h, shallowRef as g, toDisplayString as _, toRaw as v, unref as y, useId as b, withModifiers as x } from "vue";
|
|
3
|
+
// src/components/VGridMenu.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var S = [
|
|
5
|
+
"id",
|
|
6
|
+
"aria-label",
|
|
7
|
+
"data-placement"
|
|
8
|
+
], C = {
|
|
9
|
+
key: 0,
|
|
10
|
+
role: "separator",
|
|
11
|
+
class: "vg-menu-separator"
|
|
12
|
+
}, w = ["disabled", "onClick"], T = { class: "vg-menu-label" }, E = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "vg-menu-hint"
|
|
15
|
+
}, D = /*@__PURE__*/ s({
|
|
16
|
+
__name: "VGridMenu",
|
|
17
|
+
props: {
|
|
18
|
+
items: {},
|
|
19
|
+
label: { default: "Menu" },
|
|
20
|
+
placement: { default: "bottom-end" },
|
|
21
|
+
id: {},
|
|
22
|
+
anchorName: {}
|
|
23
|
+
},
|
|
24
|
+
emits: [
|
|
25
|
+
"select",
|
|
26
|
+
"open",
|
|
27
|
+
"close"
|
|
28
|
+
],
|
|
29
|
+
setup(s, { expose: D, emit: O }) {
|
|
30
|
+
let k = s, A = O, j = b(), M = k.id ?? `vg-menu-${j}`, N = e(j), P = `${N}-pt`, F = g(), I = p(null), L = p(k.placement), R = p(k.anchorName ?? N), z = p(!1), B = null, V = null, H = null, U = () => {};
|
|
31
|
+
d(() => U());
|
|
32
|
+
let W = (e) => !("separator" in e), G = () => Array.from(F.value?.querySelectorAll("[role=\"menuitem\"]:not(:disabled)") ?? []);
|
|
33
|
+
function K() {
|
|
34
|
+
B?.style.getPropertyValue("anchor-name") === N && B.style.removeProperty("anchor-name"), B = null;
|
|
35
|
+
}
|
|
36
|
+
async function q(e, t) {
|
|
37
|
+
z.value && F.value?.hidePopover?.(), K(), H = t ?? document.activeElement, V = e, e instanceof HTMLElement ? (I.value = null, e.style.setProperty("anchor-name", N), B = e, R.value = N, L.value = k.placement === "point" ? "bottom-start" : k.placement) : (I.value = {
|
|
38
|
+
x: e.x,
|
|
39
|
+
y: e.y
|
|
40
|
+
}, R.value = P, L.value = "point"), await c(), F.value?.showPopover?.();
|
|
41
|
+
}
|
|
42
|
+
function J() {
|
|
43
|
+
F.value?.hidePopover?.();
|
|
44
|
+
}
|
|
45
|
+
function Y(e) {
|
|
46
|
+
let n = e.newState === "open";
|
|
47
|
+
if (z.value = n, n) {
|
|
48
|
+
if (!V) {
|
|
49
|
+
let e = document.querySelector(`[popovertarget="${CSS.escape(M)}"]`);
|
|
50
|
+
H = e, V = e, R.value = k.anchorName ?? N, L.value = k.placement;
|
|
51
|
+
}
|
|
52
|
+
V && F.value && (U = t(F.value, V, L.value)), c(() => G()[0]?.focus({ preventScroll: !0 })), A("open");
|
|
53
|
+
} else (!document.activeElement || document.activeElement === document.body || F.value?.contains(document.activeElement)) && H?.isConnected && H.focus({ preventScroll: !0 }), U(), K(), I.value = null, V = null, H = null, A("close");
|
|
54
|
+
}
|
|
55
|
+
function X(e) {
|
|
56
|
+
let t = G(), n = t.indexOf(document.activeElement), r = (e) => t[(e + t.length) % t.length]?.focus({ preventScroll: !0 });
|
|
57
|
+
switch (e.key) {
|
|
58
|
+
case "ArrowDown":
|
|
59
|
+
r(n + 1);
|
|
60
|
+
break;
|
|
61
|
+
case "ArrowUp":
|
|
62
|
+
r(n - 1);
|
|
63
|
+
break;
|
|
64
|
+
case "Home":
|
|
65
|
+
r(0);
|
|
66
|
+
break;
|
|
67
|
+
case "End":
|
|
68
|
+
r(t.length - 1);
|
|
69
|
+
break;
|
|
70
|
+
case "Tab":
|
|
71
|
+
J();
|
|
72
|
+
return;
|
|
73
|
+
default: {
|
|
74
|
+
if (e.key.length !== 1 || e.ctrlKey || e.metaKey || e.altKey) return;
|
|
75
|
+
let r = e.key.toLowerCase();
|
|
76
|
+
[...t.slice(n + 1), ...t.slice(0, n + 1)].find((e) => e.textContent?.trim().toLowerCase().startsWith(r))?.focus({ preventScroll: !0 });
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
e.preventDefault(), e.stopPropagation();
|
|
80
|
+
}
|
|
81
|
+
function Z(e) {
|
|
82
|
+
J(), A("select", e);
|
|
83
|
+
}
|
|
84
|
+
return D({
|
|
85
|
+
id: M,
|
|
86
|
+
openAt: q,
|
|
87
|
+
close: J,
|
|
88
|
+
isOpen: z
|
|
89
|
+
}), (e, t) => (f(), a(n, null, [I.value ? (f(), a("span", {
|
|
90
|
+
key: 0,
|
|
91
|
+
class: "vg-menu-point",
|
|
92
|
+
"aria-hidden": "true",
|
|
93
|
+
style: u({
|
|
94
|
+
left: `${I.value.x}px`,
|
|
95
|
+
top: `${I.value.y}px`,
|
|
96
|
+
"anchor-name": P
|
|
97
|
+
})
|
|
98
|
+
}, null, 4)) : i("", !0), o("div", {
|
|
99
|
+
id: y(M),
|
|
100
|
+
ref_key: "menu",
|
|
101
|
+
ref: F,
|
|
102
|
+
popover: "auto",
|
|
103
|
+
role: "menu",
|
|
104
|
+
"aria-label": s.label,
|
|
105
|
+
class: "vg-menu",
|
|
106
|
+
"data-placement": L.value,
|
|
107
|
+
style: u({ "position-anchor": R.value }),
|
|
108
|
+
onToggle: Y,
|
|
109
|
+
onKeydown: X,
|
|
110
|
+
onClick: t[0] ||= x(() => {}, ["stop"]),
|
|
111
|
+
onContextmenu: t[1] ||= x(() => {}, ["prevent"])
|
|
112
|
+
}, [(f(!0), a(n, null, m(s.items, (e, t) => (f(), a(n, { key: W(e) ? e.name : `sep-${t}` }, [W(e) ? (f(), a("button", {
|
|
113
|
+
key: 1,
|
|
114
|
+
type: "button",
|
|
115
|
+
role: "menuitem",
|
|
116
|
+
tabindex: "-1",
|
|
117
|
+
disabled: e.disabled,
|
|
118
|
+
class: l(["vg-menu-item", e.tone && `vg-tone-${e.tone}`]),
|
|
119
|
+
onClick: (t) => Z(e)
|
|
120
|
+
}, [
|
|
121
|
+
e.icon ? (f(), r(h(v(e.icon)), {
|
|
122
|
+
key: 0,
|
|
123
|
+
class: "vg-menu-icon",
|
|
124
|
+
"aria-hidden": "true"
|
|
125
|
+
})) : i("", !0),
|
|
126
|
+
o("span", T, _(e.label), 1),
|
|
127
|
+
e.hint ? (f(), a("span", E, _(e.hint), 1)) : i("", !0)
|
|
128
|
+
], 10, w)) : (f(), a("div", C))], 64))), 128))], 44, S)], 64));
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
export { D as default };
|
|
132
|
+
|
|
133
|
+
//# sourceMappingURL=VGridMenu.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VGridMenu.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_Fragment","_normalizeStyle","_createElementVNode","_unref","_withModifiers","_renderList","_normalizeClass","_createBlock","_resolveDynamicComponent","_toDisplayString","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","VGridMenu_vue_vue_type_script_setup_true_lang_default","__expose","__emit","props","__props","emit","uid","useId","menuId","ownAnchor","anchorNameFor","pointAnchor","menu","shallowRef","point","ref","placement","anchorName","isOpen","anchoredElement","fallbackTarget","returnFocus","stopTracking","isAction","item","enabledItems","releaseAnchor","openAt","focusAfterClose","target","nextTick","close","onToggle","open","event","invoker","trackAnchor","onKeydown","list","index","move","i","ch","b","choose","openBlock","createElementBlock","Fragment","normalizeStyle","createCommentVNode","createElementVNode","unref","_cache","withModifiers","renderList","normalizeClass","createBlock","resolveDynamicComponent","toRaw","toDisplayString"],"sources":["../../src/components/VGridMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { nextTick, onBeforeUnmount, ref, shallowRef, toRaw, useId } from 'vue'\nimport { anchorNameFor, trackAnchor, type AnchorTarget, type Placement } from '../internal/anchor'\nimport type { MenuAction, MenuItem } from '../types'\n\n/**\n * Accessible menu rendered with the Popover API (top layer: never clipped by the grid's overflow;\n * light-dismiss on outside click / Esc) and placed with CSS anchor positioning.\n *\n * Two ways to open it:\n * - declaratively: a trigger with `popovertarget=\"<id>\"` and `style=\"anchor-name: <anchorName>\"`\n * (pass the same `anchor-name` prop) — see the `actions-menu` renderer;\n * - imperatively: `openAt(element | { x, y })` — used for context menus.\n */\nconst props = withDefaults(\n defineProps<{\n items: readonly MenuItem[]\n label?: string\n placement?: Placement\n /** Popover id (for `popovertarget`). Generated when omitted. */\n id?: string\n /** `anchor-name` set on an external trigger (declarative mode). */\n anchorName?: string\n }>(),\n { label: 'Menu', placement: 'bottom-end' },\n)\n\nconst emit = defineEmits<{\n select: [item: MenuAction]\n open: []\n close: []\n}>()\n\nconst uid = useId()\nconst menuId = props.id ?? `vg-menu-${uid}`\nconst ownAnchor = anchorNameFor(uid)\nconst pointAnchor = `${ownAnchor}-pt`\n\nconst menu = shallowRef<HTMLElement>()\nconst point = ref<{ x: number; y: number } | null>(null)\nconst placement = ref<Placement>(props.placement)\nconst anchorName = ref(props.anchorName ?? ownAnchor)\nconst isOpen = ref(false)\nlet anchoredElement: HTMLElement | null = null\nlet fallbackTarget: AnchorTarget | null = null\nlet returnFocus: HTMLElement | null = null\nlet stopTracking = () => {}\nonBeforeUnmount(() => stopTracking())\n\nconst isAction = (item: MenuItem): item is MenuAction => !('separator' in item)\nconst enabledItems = () =>\n Array.from(menu.value?.querySelectorAll<HTMLButtonElement>('[role=\"menuitem\"]:not(:disabled)') ?? [])\n\nfunction releaseAnchor() {\n if (anchoredElement?.style.getPropertyValue('anchor-name') === ownAnchor) {\n anchoredElement.style.removeProperty('anchor-name')\n }\n anchoredElement = null\n}\n\n/** Opens the menu anchored to an element (keyboard / cell) or a viewport point (pointer). */\nasync function openAt(target: AnchorTarget, focusAfterClose?: HTMLElement | null) {\n if (isOpen.value) menu.value?.hidePopover?.()\n releaseAnchor()\n returnFocus = focusAfterClose ?? (document.activeElement as HTMLElement | null)\n fallbackTarget = target\n if (target instanceof HTMLElement) {\n point.value = null\n target.style.setProperty('anchor-name', ownAnchor)\n anchoredElement = target\n anchorName.value = ownAnchor\n placement.value = props.placement === 'point' ? 'bottom-start' : props.placement\n } else {\n point.value = { x: target.x, y: target.y }\n anchorName.value = pointAnchor\n placement.value = 'point'\n }\n await nextTick() // render the point anchor / new anchor name before showing\n menu.value?.showPopover?.()\n}\n\nfunction close() {\n menu.value?.hidePopover?.()\n}\n\nfunction onToggle(event: Event) {\n const open = (event as ToggleEvent).newState === 'open'\n isOpen.value = open\n if (open) {\n if (!fallbackTarget) {\n // Declarative mode: opened by a `popovertarget` trigger.\n const invoker = document.querySelector<HTMLElement>(`[popovertarget=\"${CSS.escape(menuId)}\"]`)\n returnFocus = invoker\n fallbackTarget = invoker\n anchorName.value = props.anchorName ?? ownAnchor\n placement.value = props.placement\n }\n // Placed, followed and hidden by CSS; JS only where the browser can't (see trackAnchor).\n if (fallbackTarget && menu.value) stopTracking = trackAnchor(menu.value, fallbackTarget, placement.value)\n nextTick(() => enabledItems()[0]?.focus({ preventScroll: true }))\n emit('open')\n } else {\n const focusInside = !document.activeElement || document.activeElement === document.body || menu.value?.contains(document.activeElement)\n if (focusInside && returnFocus?.isConnected) returnFocus.focus({ preventScroll: true })\n stopTracking()\n releaseAnchor()\n point.value = null\n fallbackTarget = null\n returnFocus = null\n emit('close')\n }\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n const list = enabledItems()\n const index = list.indexOf(document.activeElement as HTMLButtonElement)\n const move = (i: number) => list[(i + list.length) % list.length]?.focus({ preventScroll: true })\n switch (event.key) {\n case 'ArrowDown':\n move(index + 1)\n break\n case 'ArrowUp':\n move(index - 1)\n break\n case 'Home':\n move(0)\n break\n case 'End':\n move(list.length - 1)\n break\n case 'Tab':\n close()\n return\n default: {\n // Typeahead: jump to the next item starting with the typed character.\n if (event.key.length !== 1 || event.ctrlKey || event.metaKey || event.altKey) return\n const ch = event.key.toLowerCase()\n const order = [...list.slice(index + 1), ...list.slice(0, index + 1)]\n order.find((b) => b.textContent?.trim().toLowerCase().startsWith(ch))?.focus({ preventScroll: true })\n }\n }\n event.preventDefault()\n event.stopPropagation()\n}\n\nfunction choose(item: MenuAction) {\n close()\n emit('select', item)\n}\n\ndefineExpose({ id: menuId, openAt, close, isOpen })\n</script>\n\n<template>\n <span\n v-if=\"point\"\n class=\"vg-menu-point\"\n aria-hidden=\"true\"\n :style=\"{ left: `${point.x}px`, top: `${point.y}px`, 'anchor-name': pointAnchor }\"\n />\n <div\n :id=\"menuId\"\n ref=\"menu\"\n popover=\"auto\"\n role=\"menu\"\n :aria-label=\"label\"\n class=\"vg-menu\"\n :data-placement=\"placement\"\n :style=\"{ 'position-anchor': anchorName }\"\n @toggle=\"onToggle\"\n @keydown=\"onKeydown\"\n @click.stop\n @contextmenu.prevent\n >\n <template v-for=\"(item, i) in items\" :key=\"isAction(item) ? item.name : `sep-${i}`\">\n <div v-if=\"!isAction(item)\" role=\"separator\" class=\"vg-menu-separator\" />\n <button\n v-else\n type=\"button\"\n role=\"menuitem\"\n tabindex=\"-1\"\n :disabled=\"item.disabled\"\n :class=\"['vg-menu-item', item.tone && `vg-tone-${item.tone}`]\"\n @click=\"choose(item)\"\n >\n <component :is=\"toRaw(item.icon)\" v-if=\"item.icon\" class=\"vg-menu-icon\" aria-hidden=\"true\" />\n <span class=\"vg-menu-label\">{{ item.label }}</span>\n <span v-if=\"item.hint\" class=\"vg-menu-hint\">{{ item.hint }}</span>\n </button>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,IAAMoB,IAAQC,GAaRC,IAAOH,GAMPI,IAAMC,EAAM,GACZC,IAASL,EAAM,MAAM,WAAWG,KAChCG,IAAYC,EAAcJ,CAAG,GAC7BK,IAAc,GAAGF,EAAU,MAE3BG,IAAOC,EAAwB,GAC/BC,IAAQC,EAAqC,IAAI,GACjDC,IAAYD,EAAeZ,EAAM,SAAS,GAC1Cc,IAAaF,EAAIZ,EAA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zC,EAAA,GAAAC,EAAkE,QAAlEe,GAAkEL,EAAnB8B,EAAK,IAAI,GAAA,CAAA,K;E,cAZ1DzC,EAAA,GAAAC,EAAyE,OAAzEY,CAAyE,E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VGridPagination.js","names":["VGridPagination_vue_vue_type_script_setup_true_lang_default","VGridPagination_default"],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { pageItems as e } from "../core/pagination.js";
|
|
2
|
+
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, mergeModels as s, openBlock as c, renderList as l, toDisplayString as u, useModel as d } from "vue";
|
|
3
|
+
// src/components/VGridPagination.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var f = ["aria-label"], p = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "vg-pagination-summary"
|
|
7
|
+
}, m = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "vg-pagination-size"
|
|
10
|
+
}, h = ["value"], g = ["value"], _ = { class: "vg-pagination-pages" }, v = ["disabled"], y = ["disabled"], b = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "vg-page-ellipsis",
|
|
13
|
+
"aria-hidden": "true"
|
|
14
|
+
}, x = [
|
|
15
|
+
"aria-current",
|
|
16
|
+
"aria-label",
|
|
17
|
+
"onClick"
|
|
18
|
+
], S = ["disabled"], C = ["disabled"], w = /*@__PURE__*/ o({
|
|
19
|
+
__name: "VGridPagination",
|
|
20
|
+
props: /*@__PURE__*/ s({
|
|
21
|
+
total: {},
|
|
22
|
+
pageSizes: {},
|
|
23
|
+
siblings: { default: 1 },
|
|
24
|
+
ariaLabel: { default: "Pagination" },
|
|
25
|
+
summary: { default: "{from}–{to} of {total}" }
|
|
26
|
+
}, {
|
|
27
|
+
page: { default: 1 },
|
|
28
|
+
pageModifiers: {},
|
|
29
|
+
pageSize: { default: 25 },
|
|
30
|
+
pageSizeModifiers: {}
|
|
31
|
+
}),
|
|
32
|
+
emits: ["update:page", "update:pageSize"],
|
|
33
|
+
setup(o) {
|
|
34
|
+
let s = o, w = d(o, "page"), T = d(o, "pageSize"), E = n(() => Math.max(1, Math.ceil(s.total / Math.max(1, T.value)))), D = n(() => Math.min(Math.max(1, w.value), E.value)), O = n(() => e(D.value, E.value, s.siblings)), k = n(() => {
|
|
35
|
+
if (!s.summary || s.total <= 0) return "";
|
|
36
|
+
let e = (D.value - 1) * T.value + 1, t = Math.min(s.total, D.value * T.value);
|
|
37
|
+
return s.summary.replace("{from}", String(e)).replace("{to}", String(t)).replace("{total}", String(s.total));
|
|
38
|
+
});
|
|
39
|
+
function A(e) {
|
|
40
|
+
let t = Math.min(Math.max(1, e), E.value);
|
|
41
|
+
t !== w.value && (w.value = t);
|
|
42
|
+
}
|
|
43
|
+
function j(e) {
|
|
44
|
+
T.value = Number(e.target.value), w.value = 1;
|
|
45
|
+
}
|
|
46
|
+
return (e, n) => (c(), i("nav", {
|
|
47
|
+
class: "vg-pagination",
|
|
48
|
+
"aria-label": o.ariaLabel
|
|
49
|
+
}, [
|
|
50
|
+
k.value ? (c(), i("span", p, u(k.value), 1)) : r("", !0),
|
|
51
|
+
o.pageSizes?.length ? (c(), i("label", m, [n[4] ||= a("span", { class: "vg-sr-only" }, "Rows per page", -1), a("select", {
|
|
52
|
+
class: "vg-select",
|
|
53
|
+
value: T.value,
|
|
54
|
+
onChange: j
|
|
55
|
+
}, [(c(!0), i(t, null, l(o.pageSizes, (e) => (c(), i("option", {
|
|
56
|
+
key: e,
|
|
57
|
+
value: e
|
|
58
|
+
}, u(e) + " / page", 9, g))), 128))], 40, h)])) : r("", !0),
|
|
59
|
+
a("div", _, [
|
|
60
|
+
a("button", {
|
|
61
|
+
type: "button",
|
|
62
|
+
class: "vg-page vg-page-nav vg-page-first",
|
|
63
|
+
disabled: D.value <= 1,
|
|
64
|
+
"aria-label": "First page",
|
|
65
|
+
onClick: n[0] ||= (e) => A(1)
|
|
66
|
+
}, "«", 8, v),
|
|
67
|
+
a("button", {
|
|
68
|
+
type: "button",
|
|
69
|
+
class: "vg-page vg-page-nav",
|
|
70
|
+
disabled: D.value <= 1,
|
|
71
|
+
"aria-label": "Previous page",
|
|
72
|
+
onClick: n[1] ||= (e) => A(D.value - 1)
|
|
73
|
+
}, "‹", 8, y),
|
|
74
|
+
(c(!0), i(t, null, l(O.value, (e, n) => (c(), i(t, { key: e === "ellipsis" ? `e${n}` : e }, [e === "ellipsis" ? (c(), i("span", b, "…")) : (c(), i("button", {
|
|
75
|
+
key: 1,
|
|
76
|
+
type: "button",
|
|
77
|
+
class: "vg-page",
|
|
78
|
+
"aria-current": e === D.value ? "page" : void 0,
|
|
79
|
+
"aria-label": `Page ${e}`,
|
|
80
|
+
onClick: (t) => A(e)
|
|
81
|
+
}, u(e), 9, x))], 64))), 128)),
|
|
82
|
+
a("button", {
|
|
83
|
+
type: "button",
|
|
84
|
+
class: "vg-page vg-page-nav",
|
|
85
|
+
disabled: D.value >= E.value,
|
|
86
|
+
"aria-label": "Next page",
|
|
87
|
+
onClick: n[2] ||= (e) => A(D.value + 1)
|
|
88
|
+
}, "›", 8, S),
|
|
89
|
+
a("button", {
|
|
90
|
+
type: "button",
|
|
91
|
+
class: "vg-page vg-page-nav vg-page-last",
|
|
92
|
+
disabled: D.value >= E.value,
|
|
93
|
+
"aria-label": "Last page",
|
|
94
|
+
onClick: n[3] ||= (e) => A(E.value)
|
|
95
|
+
}, "»", 8, C)
|
|
96
|
+
])
|
|
97
|
+
], 8, f));
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
export { w as default };
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=VGridPagination.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VGridPagination.vue_vue_type_script_setup_true_lang.js","names":["_useModel","_openBlock","_createElementBlock","_toDisplayString","_createElementVNode","_Fragment","_renderList","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","VGridPagination_vue_vue_type_script_setup_true_lang_default","\"page\"","\"pageModifiers\"","\"pageSize\"","\"pageSizeModifiers\"","props","__props","page","useModel","pageSize","pageCount","computed","current","items","pageItems","summaryText","from","to","go","next","target","onSizeChange","event","openBlock","createElementBlock","toDisplayString","createCommentVNode","_cache","createElementVNode","Fragment","renderList","size","item","i"],"sources":["../../src/components/VGridPagination.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { pageItems } from '../core/pagination'\n\nconst props = withDefaults(\n defineProps<{\n total: number\n /** Page-size choices; renders a selector when given. */\n pageSizes?: number[]\n siblings?: number\n ariaLabel?: string\n /** Use `{from}`, `{to}` and `{total}` placeholders; empty string hides the summary. */\n summary?: string\n }>(),\n { siblings: 1, ariaLabel: 'Pagination', summary: '{from}–{to} of {total}' },\n)\n\nconst page = defineModel<number>('page', { default: 1 })\nconst pageSize = defineModel<number>('pageSize', { default: 25 })\n\nconst pageCount = computed(() => Math.max(1, Math.ceil(props.total / Math.max(1, pageSize.value))))\nconst current = computed(() => Math.min(Math.max(1, page.value), pageCount.value))\nconst items = computed(() => pageItems(current.value, pageCount.value, props.siblings))\nconst summaryText = computed(() => {\n if (!props.summary || props.total <= 0) return ''\n const from = (current.value - 1) * pageSize.value + 1\n const to = Math.min(props.total, current.value * pageSize.value)\n return props.summary\n .replace('{from}', String(from))\n .replace('{to}', String(to))\n .replace('{total}', String(props.total))\n})\n\nfunction go(target: number) {\n const next = Math.min(Math.max(1, target), pageCount.value)\n if (next !== page.value) page.value = next\n}\n\nfunction onSizeChange(event: Event) {\n pageSize.value = Number((event.target as HTMLSelectElement).value)\n page.value = 1\n}\n</script>\n\n<template>\n <nav class=\"vg-pagination\" :aria-label=\"ariaLabel\">\n <span v-if=\"summaryText\" class=\"vg-pagination-summary\">{{ summaryText }}</span>\n <label v-if=\"pageSizes?.length\" class=\"vg-pagination-size\">\n <span class=\"vg-sr-only\">Rows per page</span>\n <select class=\"vg-select\" :value=\"pageSize\" @change=\"onSizeChange\">\n <option v-for=\"size in pageSizes\" :key=\"size\" :value=\"size\">{{ size }} / page</option>\n </select>\n </label>\n <div class=\"vg-pagination-pages\">\n <button type=\"button\" class=\"vg-page vg-page-nav vg-page-first\" :disabled=\"current <= 1\" aria-label=\"First page\" @click=\"go(1)\">«</button>\n <button type=\"button\" class=\"vg-page vg-page-nav\" :disabled=\"current <= 1\" aria-label=\"Previous page\" @click=\"go(current - 1)\">‹</button>\n <template v-for=\"(item, i) in items\" :key=\"item === 'ellipsis' ? `e${i}` : item\">\n <span v-if=\"item === 'ellipsis'\" class=\"vg-page-ellipsis\" aria-hidden=\"true\">…</span>\n <button\n v-else\n type=\"button\"\n class=\"vg-page\"\n :aria-current=\"item === current ? 'page' : undefined\"\n :aria-label=\"`Page ${item}`\"\n @click=\"go(item)\"\n >\n {{ item }}\n </button>\n </template>\n <button type=\"button\" class=\"vg-page vg-page-nav\" :disabled=\"current >= pageCount\" aria-label=\"Next page\" @click=\"go(current + 1)\">›</button>\n <button type=\"button\" class=\"vg-page vg-page-nav vg-page-last\" :disabled=\"current >= pageCount\" aria-label=\"Last page\" @click=\"go(pageCount)\">»</button>\n </div>\n </nav>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIA,IAAMwB,IAAQC,GAaRC,IAAO1B,EAAmByB,GAAC,MAAsB,GACjDG,IAAW5B,EAAmByB,GAAC,UAA2B,GAE1DI,IAAYC,QAAe,KAAK,IAAI,GAAG,KAAK,KAAKN,EAAM,QAAQ,KAAK,IAAI,GAAGI,EAAS,KAAK,CAAC,CAAC,CAAC,GAC5FG,IAAUD,QAAe,KAAK,IAAI,KAAK,IAAI,GAAGJ,EAAK,KAAK,GAAGG,EAAU,KAAK,CAAC,GAC3EG,IAAQF,QAAeG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nedRows.js","names":["VGridPinnedRows_vue_vue_type_script_setup_true_lang_default","VGridPinnedRows_default"],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useInternalGrid as e } from "../internal/context.js";
|
|
2
|
+
import t from "./VGridCell.js";
|
|
3
|
+
import n from "./VGridTotalCell.js";
|
|
4
|
+
import { Fragment as r, createBlock as i, createElementBlock as a, defineComponent as o, normalizeClass as s, onBeforeUnmount as c, openBlock as l, renderList as u, shallowRef as d, unref as f, watch as p } from "vue";
|
|
5
|
+
// src/components/VGridPinnedRows.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var m = [
|
|
7
|
+
"data-pinned-key",
|
|
8
|
+
"aria-rowindex",
|
|
9
|
+
"aria-label"
|
|
10
|
+
], h = /*@__PURE__*/ o({
|
|
11
|
+
__name: "VGridPinnedRows",
|
|
12
|
+
props: {
|
|
13
|
+
position: {},
|
|
14
|
+
items: {},
|
|
15
|
+
ariaStart: {}
|
|
16
|
+
},
|
|
17
|
+
setup(o) {
|
|
18
|
+
let h = o, g = e(), _ = d(), v, y = null, b = () => `--vg-pinned-${h.position}-height`;
|
|
19
|
+
return p(_, (e) => {
|
|
20
|
+
if (v?.disconnect(), y = e?.closest(".vg") ?? null, !e || !y || typeof ResizeObserver > "u") return;
|
|
21
|
+
let t = y, n = h.position === "top" ? t.querySelector(":scope > .vg-header > .vg-header-cell") : null, r = () => {
|
|
22
|
+
t.style.setProperty(b(), `${e.offsetHeight}px`), n && t.style.setProperty("--vg-header-height", `${n.offsetHeight}px`);
|
|
23
|
+
};
|
|
24
|
+
v = new ResizeObserver(r), v.observe(e), n && v.observe(n), r();
|
|
25
|
+
}, { flush: "post" }), c(() => {
|
|
26
|
+
v?.disconnect(), y?.style.removeProperty(b()), h.position === "top" && y?.style.removeProperty("--vg-header-height");
|
|
27
|
+
}), (e, c) => (l(), a("div", {
|
|
28
|
+
ref_key: "section",
|
|
29
|
+
ref: _,
|
|
30
|
+
role: "rowgroup",
|
|
31
|
+
class: s(["vg-pinned-rows", `vg-pinned-${o.position}`])
|
|
32
|
+
}, [(l(!0), a(r, null, u(o.items, (e, c) => (l(), a("div", {
|
|
33
|
+
key: e.id,
|
|
34
|
+
role: "row",
|
|
35
|
+
class: s([
|
|
36
|
+
"vg-row",
|
|
37
|
+
"vg-row-pinned",
|
|
38
|
+
e.kind === "total" ? "vg-row-total" : [
|
|
39
|
+
{
|
|
40
|
+
"vg-row-selected": f(g).selectMode.value && e.selectable && f(g).rowCheckState(e.row) === "all",
|
|
41
|
+
"vg-row-highlighted": f(g).isHighlighted(e.key),
|
|
42
|
+
"vg-row-clickable": f(g).rowClickable.value
|
|
43
|
+
},
|
|
44
|
+
f(g).rowClass(e.row, c),
|
|
45
|
+
f(g).ui.value.row
|
|
46
|
+
]
|
|
47
|
+
]),
|
|
48
|
+
"data-pinned-key": e.kind === "total" ? void 0 : String(e.key),
|
|
49
|
+
"aria-rowindex": o.ariaStart === void 0 ? void 0 : o.ariaStart + c,
|
|
50
|
+
"aria-label": e.kind === "total" ? f(g).totals?.label.value : void 0
|
|
51
|
+
}, [e.kind === "total" ? (l(!0), a(r, { key: 0 }, u(f(g).columns.value, (t) => (l(), i(n, {
|
|
52
|
+
key: t.key,
|
|
53
|
+
column: t,
|
|
54
|
+
row: e.row
|
|
55
|
+
}, null, 8, ["column", "row"]))), 128)) : (l(!0), a(r, { key: 1 }, u(f(g).columns.value, (n) => (l(), i(t, {
|
|
56
|
+
key: n.key,
|
|
57
|
+
row: e.row,
|
|
58
|
+
"row-key": e.key,
|
|
59
|
+
"row-index": c,
|
|
60
|
+
depth: 0,
|
|
61
|
+
column: n,
|
|
62
|
+
pinned: "",
|
|
63
|
+
selectable: e.selectable
|
|
64
|
+
}, null, 8, [
|
|
65
|
+
"row",
|
|
66
|
+
"row-key",
|
|
67
|
+
"row-index",
|
|
68
|
+
"column",
|
|
69
|
+
"selectable"
|
|
70
|
+
]))), 128))], 10, m))), 128))], 2));
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
export { h as default };
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=VGridPinnedRows.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VGridPinnedRows.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_Fragment","_renderList","_unref","_createBlock","VGridTotalCell","VGridCell","VGridCell_default","VGridTotalCell_default","_hoisted_1","VGridPinnedRows_vue_vue_type_script_setup_true_lang_default","props","__props","grid","useInternalGrid","section","shallowRef","observer","host","heightVar","watch","el","header","publish","onBeforeUnmount","openBlock","createElementBlock","normalizeClass","Fragment","renderList","item","unref","i","createBlock","column"],"sources":["../../src/components/VGridPinnedRows.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onBeforeUnmount, shallowRef, watch } from 'vue'\nimport { useInternalGrid, type PinnedRowItem } from '../internal/context'\nimport VGridCell from './VGridCell.vue'\nimport VGridTotalCell from './VGridTotalCell.vue'\n\n/**\n * A sticky section of pinned rows above or below the body (row pinning, and the totals row of the\n * aggregation feature). One `subgrid` container: its rows share the grid's columns, and it sticks\n * as one piece, so any number of rows stays in view without measuring each.\n */\nconst props = defineProps<{\n position: 'top' | 'bottom'\n items: readonly PinnedRowItem[]\n /** Virtual mode: `aria-rowindex` of the first row (the grid then names every row's position). */\n ariaStart?: number\n}>()\n\nconst grid = useInternalGrid()\n\n// The top section sticks right under the header, and both keep focused rows clear of themselves\n// (`scroll-padding`): publish the header's and the section's heights on the scroll container.\nconst section = shallowRef<HTMLElement>()\nlet observer: ResizeObserver | undefined\nlet host: HTMLElement | null = null\nconst heightVar = () => `--vg-pinned-${props.position}-height`\nwatch(\n section,\n (el) => {\n observer?.disconnect()\n host = el?.closest<HTMLElement>('.vg') ?? null\n if (!el || !host || typeof ResizeObserver === 'undefined') return\n const grid = host\n const header = props.position === 'top' ? grid.querySelector<HTMLElement>(':scope > .vg-header > .vg-header-cell') : null\n const publish = () => {\n grid.style.setProperty(heightVar(), `${el.offsetHeight}px`)\n if (header) grid.style.setProperty('--vg-header-height', `${header.offsetHeight}px`)\n }\n observer = new ResizeObserver(publish)\n observer.observe(el)\n if (header) observer.observe(header)\n publish()\n },\n { flush: 'post' },\n)\nonBeforeUnmount(() => {\n observer?.disconnect()\n host?.style.removeProperty(heightVar())\n if (props.position === 'top') host?.style.removeProperty('--vg-header-height')\n})\n</script>\n\n<template>\n <div ref=\"section\" role=\"rowgroup\" :class=\"['vg-pinned-rows', `vg-pinned-${position}`]\">\n <div\n v-for=\"(item, i) in items\"\n :key=\"item.id\"\n role=\"row\"\n :class=\"[\n 'vg-row',\n 'vg-row-pinned',\n item.kind === 'total'\n ? 'vg-row-total'\n : [\n {\n 'vg-row-selected': grid.selectMode.value && item.selectable && grid.rowCheckState(item.row) === 'all',\n 'vg-row-highlighted': grid.isHighlighted(item.key),\n 'vg-row-clickable': grid.rowClickable.value,\n },\n grid.rowClass(item.row, i),\n grid.ui.value.row,\n ],\n ]\"\n :data-pinned-key=\"item.kind === 'total' ? undefined : String(item.key)\"\n :aria-rowindex=\"ariaStart !== undefined ? ariaStart + i : undefined\"\n :aria-label=\"item.kind === 'total' ? grid.totals?.label.value : undefined\"\n >\n <template v-if=\"item.kind === 'total'\">\n <VGridTotalCell v-for=\"column in grid.columns.value\" :key=\"column.key\" :column=\"column\" :row=\"item.row\" />\n </template>\n <template v-else>\n <VGridCell\n v-for=\"column in grid.columns.value\"\n :key=\"column.key\"\n :row=\"item.row\"\n :row-key=\"item.key\"\n :row-index=\"i\"\n :depth=\"0\"\n :column=\"column\"\n pinned\n :selectable=\"item.selectable\"\n />\n </template>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAWA,IAAMa,IAAQC,GAORC,IAAOC,EAAgB,GAIvBC,IAAUC,EAAwB,GACpCC,GACAC,IAA2B,MACzBC,UAAkB,eAAeR,EAAM,SAAS;E,OACtDS,EACE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AA,CAAI,CAAC,SAASiB,EAAK,KAAKE,CAAC;KAAiB7B,EAAAU,CAAA,CAAI,CAAC,GAAG,MAAM;;;GAe1d,mBAAiBiB,EAAK,SAAI,UAAe,KAAA,IAAY,OAAOA,EAAK,GAAG;GACpE,iBAAelB,EAAA,cAAc,KAAA,IAA4B,KAAA,IAAhBA,EAAA,YAAYoB;GACrD,cAAYF,EAAK,SAAI,UAAe3B,EAAAU,CAAA,CAAI,CAAC,QAAQ,MAAM,QAAQ,KAAA;E,IAEhDiB,EAAK,SAAI,WACvBhC,EAAA,EAAA,GAAAC,EAA0GE,GAAA,EAAA,KAAA,EAAA,GAAAC,EAAzEC,EAAAU,CAAA,CAAI,CAAC,QAAQ,QAAvB,OAAvBf,EAAA,GAAAM,EAA0GC,GAAA;GAApD,KAAK6B,EAAO;GAAc;GAAS,KAAKJ,EAAK;E,2CAGnGhC,EAAA,EAAA,GAAAC,EAUEE,GAAA,EAAA,KAAA,EAAA,GAAAC,EATiBC,EAAAU,CAAA,CAAI,CAAC,QAAQ,QAAvB,OADTf,EAAA,GAAAM,EAUEE,GAAA;GARC,KAAK4B,EAAO;GACZ,KAAKJ,EAAK;GACV,WAASA,EAAK;GACd,aAAWE;GACX,OAAO;GACC;GACT,QAAA;GACC,YAAYF,EAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VGridResizeHandle.js","names":["VGridResizeHandle_vue_vue_type_script_setup_true_lang_default","VGridResizeHandle_default"],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useInternalGrid as e } from "../internal/context.js";
|
|
2
|
+
import { createElementBlock as t, defineComponent as n, openBlock as r, unref as i, withModifiers as a } from "vue";
|
|
3
|
+
// src/components/VGridResizeHandle.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var o = ["aria-label", "tabindex"], s = /*@__PURE__*/ n({
|
|
5
|
+
__name: "VGridResizeHandle",
|
|
6
|
+
props: {
|
|
7
|
+
columnKey: {},
|
|
8
|
+
label: {}
|
|
9
|
+
},
|
|
10
|
+
setup(n) {
|
|
11
|
+
let s = n, c = e(), l = c.resize;
|
|
12
|
+
function u(e) {
|
|
13
|
+
let t = getComputedStyle(e.currentTarget).direction === "rtl", n = e.shiftKey ? 64 : 16;
|
|
14
|
+
if (e.key === "ArrowRight" || e.key === "ArrowLeft") l.step(s.columnKey, (e.key === "ArrowRight" === t ? -1 : 1) * n);
|
|
15
|
+
else if (e.key === "Enter") l.autosize(s.columnKey);
|
|
16
|
+
else return;
|
|
17
|
+
e.preventDefault(), e.stopPropagation();
|
|
18
|
+
}
|
|
19
|
+
return (e, s) => (r(), t("span", {
|
|
20
|
+
class: "vg-resize-handle",
|
|
21
|
+
role: "separator",
|
|
22
|
+
"aria-orientation": "vertical",
|
|
23
|
+
"aria-label": `Resize ${n.label}`,
|
|
24
|
+
tabindex: i(c).keyboardNav ? -1 : 0,
|
|
25
|
+
onPointerdown: s[0] ||= (e) => i(l).start(e, n.columnKey),
|
|
26
|
+
onClick: s[1] ||= a(() => {}, ["stop"]),
|
|
27
|
+
onDblclick: s[2] ||= a((e) => i(l).autosize(n.columnKey), ["stop"]),
|
|
28
|
+
onKeydown: u
|
|
29
|
+
}, null, 40, o));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export { s as default };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=VGridResizeHandle.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VGridResizeHandle.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_unref","_withModifiers","_hoisted_1","VGridResizeHandle_vue_vue_type_script_setup_true_lang_default","props","__props","grid","useInternalGrid","resize","onKeyDown","rtl","event","step","openBlock","createElementBlock","unref","_cache","$event","withModifiers"],"sources":["../../src/components/VGridResizeHandle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useInternalGrid } from '../internal/context'\n\n/** The grip on a header's end edge (column resizing feature): drag, double-click, or ←/→ when focused. */\nconst props = defineProps<{ columnKey: string; label: string }>()\nconst grid = useInternalGrid()\n// Rendered by the resizing feature only, so the grid always has it here.\nconst resize = grid.resize!\n\n/** ←/→ (Shift: bigger steps); Enter fits the content. */\nfunction onKeyDown(event: KeyboardEvent) {\n const rtl = getComputedStyle(event.currentTarget as Element).direction === 'rtl'\n const step = event.shiftKey ? 64 : 16\n if (event.key === 'ArrowRight' || event.key === 'ArrowLeft') {\n resize.step(props.columnKey, ((event.key === 'ArrowRight') !== rtl ? 1 : -1) * step)\n } else if (event.key === 'Enter') {\n resize.autosize(props.columnKey)\n } else return\n event.preventDefault()\n event.stopPropagation()\n}\n</script>\n\n<template>\n <span\n class=\"vg-resize-handle\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n :aria-label=\"`Resize ${label}`\"\n :tabindex=\"grid.keyboardNav ? -1 : 0\"\n @pointerdown=\"resize.start($event, columnKey)\"\n @click.stop\n @dblclick.stop=\"resize.autosize(columnKey)\"\n @keydown=\"onKeyDown\"\n />\n</template>\n"],"mappings":";;;;;;;;;;EAIA,IAAMM,IAAQC,GACRC,IAAOC,EAAgB,GAEvBC,IAASF,EAAK;EAGpB,SAASG,EAAU,GAAsB;GACvC,IAAMC,IAAM,iBAAiBC,EAAM,aAAwB,CAAC,CAAC,cAAc,OACrEC,IAAOD,EAAM,WAAW,KAAK;GACnC,IAAIA,EAAM,QAAQ,gBAAgBA,EAAM,QAAQ,aAC9C,EAAO,KAAKP,EAAM,YAAaO,EAAM,QAAQ,iBAAkBD,IAAU,KAAJ,KAAUE,CAAI;QAC9E,IAAID,EAAM,QAAQ,SACvB,EAAO,SAASP,EAAM,SAAS;QAC1B;GAEP,AADAO,EAAM,eAAe,GACrBA,EAAM,gBAAgB;EACxB;E,kBAIEb,EAAA,GAAAC,EAUE,QAAA;GATA,OAAM;GACN,MAAK;GACL,oBAAiB;GAChB,cAAU,UAAYM,EAAA;GACtB,UAAUL,EAAAM,CAAA,CAAI,CAAC,cAAW,KAAA;GAC1B,eAAW,AAAAU,EAAA,QAAA,MAAEhB,EAAAQ,CAAA,CAAM,CAAC,MAAMS,GAAQZ,EAAA,SAAS;GAC3C,SAAK,AAAAW,EAAA,OAAAf,QAAN,CAAA,GAAW,CAAA,MAAA,CAAA;GACV,YAAQ,AAAAe,EAAA,OAAAf,GAAA,MAAOD,EAAAQ,CAAA,CAAM,CAAC,SAASH,EAAA,SAAS,GAAA,CAAA,MAAA,CAAA;GACxC,WAASI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VGridRows.js","names":["VGridRows_vue_vue_type_script_setup_true_lang_default","VGridRows_default"],"sources":[],"mappings":""}
|