@nocopypaste/vue-grid 0.0.0-stage → 0.3.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 +350 -0
- package/CHANGELOG.md +70 -0
- package/README.md +1046 -2
- package/agent/api.json +2453 -0
- package/agent/api.md +648 -0
- package/agent/grid-config.schema.json +654 -0
- package/dist/agent/api.js +2409 -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 +66 -0
- package/dist/agent/requirements.js.map +1 -0
- package/dist/agent/validate.js +185 -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 +843 -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 +44 -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/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/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 +191 -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/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/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/useGridExport.js +135 -0
- package/dist/composables/useGridExport.js.map +1 -0
- package/dist/composables/useGridFilters.js +125 -0
- package/dist/composables/useGridFilters.js.map +1 -0
- package/dist/composables/useGridKeyboard.js +115 -0
- package/dist/composables/useGridKeyboard.js.map +1 -0
- package/dist/composables/useGridMenus.js +234 -0
- package/dist/composables/useGridMenus.js.map +1 -0
- package/dist/composables/useGridSelection.js +138 -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/useRowGrouping.js +103 -0
- package/dist/composables/useRowGrouping.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/csv.js +28 -0
- package/dist/core/csv.js.map +1 -0
- package/dist/core/filter.js +218 -0
- package/dist/core/filter.js.map +1 -0
- package/dist/core/grouping.js +66 -0
- package/dist/core/grouping.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/export.js +9 -0
- package/dist/features/export.js.map +1 -0
- package/dist/features/filtering.js +13 -0
- package/dist/features/filtering.js.map +1 -0
- package/dist/features/index.js +42 -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/rowGrouping.js +11 -0
- package/dist/features/rowGrouping.js.map +1 -0
- package/dist/features/rowPinning.js +11 -0
- package/dist/features/rowPinning.js.map +1 -0
- package/dist/features/selection.js +13 -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 +71 -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 +17 -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 +199 -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/plainText.js +34 -0
- package/dist/renderers/plainText.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 +243 -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/VGridGroupCells.vue.d.ts +14 -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/VGridSelectionBanner.vue.d.ts +18 -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/useGridExport.d.ts +49 -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 +63 -0
- package/dist/types/composables/useGridSelection.d.ts +51 -0
- package/dist/types/composables/usePinnedOffsets.d.ts +22 -0
- package/dist/types/composables/usePinnedRows.d.ts +26 -0
- package/dist/types/composables/useRowGrouping.d.ts +50 -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 +74 -0
- package/dist/types/core/aggregate.d.ts +9 -0
- package/dist/types/core/columns.d.ts +35 -0
- package/dist/types/core/csv.d.ts +25 -0
- package/dist/types/core/filter.d.ts +85 -0
- package/dist/types/core/grouping.d.ts +51 -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/export.d.ts +8 -0
- package/dist/types/features/filtering.d.ts +7 -0
- package/dist/types/features/index.d.ts +22 -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/rowGrouping.d.ts +8 -0
- package/dist/types/features/rowPinning.d.ts +8 -0
- package/dist/types/features/selection.d.ts +8 -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 +23 -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 +6 -0
- package/dist/types/internal/context.d.ts +130 -0
- package/dist/types/internal/dev.d.ts +1 -0
- package/dist/types/internal/features.d.ts +24 -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/plainText.d.ts +17 -0
- package/dist/types/renderers/text.d.ts +3 -0
- package/dist/types/types.d.ts +461 -0
- package/dist/vue-grid.css +1 -0
- package/llms-full.txt +2052 -0
- package/llms.txt +23 -0
- package/package.json +74 -4
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { lookup as e, resolveOption as t, resolveTone as n } from "./options.js";
|
|
2
|
+
import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createTextVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, toDisplayString as d } from "vue";
|
|
3
|
+
// src/renderers/StatusCell.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var f = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "vg-status-dot",
|
|
7
|
+
"aria-hidden": "true"
|
|
8
|
+
}, p = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "vg-status-dot",
|
|
11
|
+
"aria-hidden": "true"
|
|
12
|
+
}, m = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "vg-text vg-text-muted"
|
|
15
|
+
}, h = /*@__PURE__*/ c({
|
|
16
|
+
__name: "StatusCell",
|
|
17
|
+
props: {
|
|
18
|
+
value: {},
|
|
19
|
+
row: {},
|
|
20
|
+
rowKey: {},
|
|
21
|
+
rowIndex: {},
|
|
22
|
+
depth: {},
|
|
23
|
+
column: {},
|
|
24
|
+
options: {}
|
|
25
|
+
},
|
|
26
|
+
emits: ["action"],
|
|
27
|
+
setup(c, { emit: h }) {
|
|
28
|
+
let g = c, _ = h, v = i(() => n(g.options.tone, g.value, g.row) ?? "neutral"), y = i(() => {
|
|
29
|
+
let t = g.options.label;
|
|
30
|
+
if (typeof t == "function") return t(g.value, g.row);
|
|
31
|
+
let n = g.value === null || g.value === void 0 ? "" : String(g.value);
|
|
32
|
+
return (t && e(t, n)) ?? n;
|
|
33
|
+
}), b = i(() => !!t(g.options.clickable, g.value, g.row)), x = i(() => [
|
|
34
|
+
"vg-status-badge",
|
|
35
|
+
`vg-tone-${v.value}`,
|
|
36
|
+
`vg-status-${g.options.variant ?? "soft"}`
|
|
37
|
+
]);
|
|
38
|
+
return (e, t) => y.value ? (u(), o(r, { key: 0 }, [b.value ? (u(), o("button", {
|
|
39
|
+
key: 0,
|
|
40
|
+
type: "button",
|
|
41
|
+
class: l([x.value, "vg-status-button"]),
|
|
42
|
+
onClick: t[0] ||= (e) => _("action", "click", c.value)
|
|
43
|
+
}, [c.options.dot === !1 ? a("", !0) : (u(), o("span", f)), s(" " + d(y.value), 1)], 2)) : (u(), o("span", {
|
|
44
|
+
key: 1,
|
|
45
|
+
class: l(x.value)
|
|
46
|
+
}, [c.options.dot === !1 ? a("", !0) : (u(), o("span", p)), s(" " + d(y.value), 1)], 2))], 64)) : c.options.placeholder ? (u(), o("span", m, d(c.options.placeholder), 1)) : a("", !0);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export { h as default };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=StatusCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_Fragment","_normalizeClass","_createTextVNode","_toDisplayString","_hoisted_1","_hoisted_2","_hoisted_3","StatusCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","tone","computed","resolveTone","label","l","raw","lookup","clickable","resolveOption","classes","openBlock","createElementBlock","Fragment","normalizeClass","_cache","createCommentVNode","createTextVNode","toDisplayString"],"sources":["../../src/renderers/StatusCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { CellRendererEmits, CellRendererProps } from '../types'\nimport { lookup, resolveOption, resolveTone, type StatusOptions } from './options'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, StatusOptions>>()\nconst emit = defineEmits<CellRendererEmits>()\n\nconst tone = computed(() => resolveTone(props.options.tone, props.value, props.row) ?? 'neutral')\nconst label = computed(() => {\n const l = props.options.label\n if (typeof l === 'function') return l(props.value, props.row)\n const raw = props.value === null || props.value === undefined ? '' : String(props.value)\n return (l && lookup(l, raw)) ?? raw\n})\nconst clickable = computed(() => !!resolveOption(props.options.clickable, props.value, props.row))\nconst classes = computed(() => ['vg-status-badge', `vg-tone-${tone.value}`, `vg-status-${props.options.variant ?? 'soft'}`])\n</script>\n\n<template>\n <template v-if=\"label\">\n <button v-if=\"clickable\" type=\"button\" :class=\"[classes, 'vg-status-button']\" @click=\"emit('action', 'click', value)\">\n <span v-if=\"options.dot !== false\" class=\"vg-status-dot\" aria-hidden=\"true\" />\n {{ label }}\n </button>\n <span v-else :class=\"classes\">\n <span v-if=\"options.dot !== false\" class=\"vg-status-dot\" aria-hidden=\"true\" />\n {{ label }}\n </span>\n </template>\n <span v-else-if=\"options.placeholder\" class=\"vg-text vg-text-muted\">{{ options.placeholder }}</span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAKA,IAAMW,IAAQC,GACRC,IAAOH,GAEPI,IAAOC,QAAeC,EAAYL,EAAM,QAAQ,MAAMA,EAAM,OAAOA,EAAM,GAAG,KAAK,SAAS,GAC1FM,IAAQF,QAAe;GAC3B,IAAMG,IAAIP,EAAM,QAAQ;GACxB,IAAI,OAAOO,KAAM,YAAY,OAAOA,EAAEP,EAAM,OAAOA,EAAM,GAAG;GAC5D,IAAMQ,IAAMR,EAAM,UAAU,QAAQA,EAAM,UAAU,KAAA,IAAY,KAAK,OAAOA,EAAM,KAAK;GACvF,QAAQO,KAAKE,EAAOF,GAAGC,CAAG,MAAMA;EAClC,CAAC,GACKE,IAAYN,QAAe,CAAC,CAACO,EAAcX,EAAM,QAAQ,WAAWA,EAAM,OAAOA,EAAM,GAAG,CAAC,GAC3FY,IAAUR,QAAe;GAAC;GAAmB,WAAWD,EAAK;GAAS,aAAaH,EAAM,QAAQ,WAAW;EAAQ,CAAC;E,iBAIzGM,EAAA,SAAhBjB,EAAA,GAAAC,EASWC,GAAA,EAAA,KAAA,EAAA,GAAA,CARKmB,EAAA,SAAdrB,EAAA,GAAAC,EAGS,UAAA;;GAHgB,MAAK;GAAU,OAAKE,EAAA,CAAGoB,EAAA,OAAO,kBAAA,CAAA;GAAwB,SAAK,AAAAK,EAAA,QAAA,MAAEf,EAAI,UAAA,SAAoBD,EAAA,KAAK;E,IACrGA,EAAA,QAAQ,QAAG,K,aAAvBZ,EAAA,GAAAC,EAA8E,QAA9EK,CAA8E,IAAAF,EAAA,MAC9EC,EAAGY,EAAA,KAAK,GAAA,CAAA,C,UAEVjB,EAAA,GAAAC,EAGO,QAAA;;GAHO,OAAKE,EAAEoB,EAAA,KAAO;E,IACdX,EAAA,QAAQ,QAAG,K,aAAvBZ,EAAA,GAAAC,EAA8E,QAA9EM,CAA8E,IAAAH,EAAA,MAC9EC,EAAGY,EAAA,KAAK,GAAA,CAAA,C,gBAGKL,EAAA,QAAQ,eAAzBZ,EAAA,GAAAC,EAAoG,QAApGO,GAAoGH,EAA7BO,EAAA,QAAQ,WAAW,GAAA,CAAA,K"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwitchCell.js","names":["SwitchCell_vue_vue_type_script_setup_true_lang_default","SwitchCell_default"],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useToggleControl as e } from "./parts/useToggleControl.js";
|
|
2
|
+
import { createElementBlock as t, createElementVNode as n, defineComponent as r, openBlock as i, unref as a, withModifiers as o } from "vue";
|
|
3
|
+
// src/renderers/SwitchCell.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var s = ["title"], c = [
|
|
5
|
+
"aria-checked",
|
|
6
|
+
"aria-label",
|
|
7
|
+
"disabled"
|
|
8
|
+
], l = /*@__PURE__*/ r({
|
|
9
|
+
__name: "SwitchCell",
|
|
10
|
+
props: {
|
|
11
|
+
value: {},
|
|
12
|
+
row: {},
|
|
13
|
+
rowKey: {},
|
|
14
|
+
rowIndex: {},
|
|
15
|
+
depth: {},
|
|
16
|
+
column: {},
|
|
17
|
+
options: {}
|
|
18
|
+
},
|
|
19
|
+
emits: ["action"],
|
|
20
|
+
setup(r, { emit: l }) {
|
|
21
|
+
let u = r, d = l, { checked: f, disabled: p, reason: m, label: h } = e(u);
|
|
22
|
+
return (e, r) => (i(), t("span", {
|
|
23
|
+
class: "vg-control",
|
|
24
|
+
title: a(m)
|
|
25
|
+
}, [n("button", {
|
|
26
|
+
type: "button",
|
|
27
|
+
role: "switch",
|
|
28
|
+
class: "vg-switch",
|
|
29
|
+
"aria-checked": a(f),
|
|
30
|
+
"aria-label": a(h),
|
|
31
|
+
disabled: a(p),
|
|
32
|
+
onClick: r[0] ||= o((e) => d("action", "change", !a(f)), ["stop"])
|
|
33
|
+
}, [...r[1] ||= [n("span", {
|
|
34
|
+
class: "vg-switch-thumb",
|
|
35
|
+
"aria-hidden": "true"
|
|
36
|
+
}, null, -1)]], 8, c)], 8, s));
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export { l as default };
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=SwitchCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwitchCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_unref","_createElementVNode","_withModifiers","_hoisted_1","_hoisted_2","SwitchCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","useToggleControl","openBlock","createElementBlock","unref","reason","createElementVNode","checked","label","disabled","_cache","withModifiers"],"sources":["../../src/renderers/SwitchCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CellRendererEmits, CellRendererProps } from '../types'\nimport type { SwitchOptions } from './options'\nimport { useToggleControl } from './parts/useToggleControl'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, SwitchOptions>>()\nconst emit = defineEmits<CellRendererEmits>()\nconst { checked, disabled, reason, label } = useToggleControl(props)\n</script>\n\n<template>\n <span class=\"vg-control\" :title=\"reason\">\n <button\n type=\"button\"\n role=\"switch\"\n class=\"vg-switch\"\n :aria-checked=\"checked\"\n :aria-label=\"label\"\n :disabled=\"disabled\"\n @click.stop=\"emit('action', 'change', !checked)\"\n >\n <span class=\"vg-switch-thumb\" aria-hidden=\"true\" />\n </button>\n </span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAKA,IAAMS,IAAQC,GACRC,IAAOH,GACP,EAAE,YAAS,aAAU,WAAQ,aAAUI,EAAiBH,CAAK;E,kBAIjET,EAAA,GAAAC,EAYO,QAAA;GAZD,OAAM;GAAc,OAAOC,EAAAc,CAAA;E,IAC/Bb,EAUS,UAAA;GATP,MAAK;GACL,MAAK;GACL,OAAM;GACL,gBAAcD,EAAAgB,CAAA;GACd,cAAYhB,EAAAiB,CAAA;GACZ,UAAUjB,EAAAkB,CAAA;GACV,SAAK,AAAAC,EAAA,OAAAjB,GAAA,MAAOO,EAAI,UAAA,UAAA,CAAsBT,EAAAgB,CAAA,CAAO,GAAA,CAAA,MAAA,CAAA;E,iBAE9Cf,EAAmD,QAAA;GAA7C,OAAM;GAAkB,eAAY"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextCell.js","names":["TextCell_vue_vue_type_script_setup_true_lang_default","TextCell_default"],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { resolveOption as e } from "./options.js";
|
|
2
|
+
import t from "./parts/CopyButton.js";
|
|
3
|
+
import n from "./parts/ValueBadge.js";
|
|
4
|
+
import { computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, openBlock as f, resolveDynamicComponent as p, toDisplayString as m, toRaw as h } from "vue";
|
|
5
|
+
// src/renderers/TextCell.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var g = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "vg-text-adorned"
|
|
9
|
+
}, _ = [
|
|
10
|
+
"role",
|
|
11
|
+
"aria-label",
|
|
12
|
+
"aria-hidden",
|
|
13
|
+
"title"
|
|
14
|
+
], v = ["title"], y = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "vg-text-secondary"
|
|
17
|
+
}, b = ["title"], x = /*@__PURE__*/ l({
|
|
18
|
+
__name: "TextCell",
|
|
19
|
+
props: {
|
|
20
|
+
value: {},
|
|
21
|
+
row: {},
|
|
22
|
+
rowKey: {},
|
|
23
|
+
rowIndex: {},
|
|
24
|
+
depth: {},
|
|
25
|
+
column: {},
|
|
26
|
+
options: {}
|
|
27
|
+
},
|
|
28
|
+
emits: ["action"],
|
|
29
|
+
setup(l, { emit: x }) {
|
|
30
|
+
let S = l, C = x, w = r(() => S.value === null || S.value === void 0 || S.value === ""), T = r(() => {
|
|
31
|
+
let e = S.value;
|
|
32
|
+
return w.value ? S.options.placeholder ?? "" : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
33
|
+
}), E = r(() => w.value ? null : S.options.secondary?.(S.value, S.row)), D = r(() => E.value ? `${T.value} ${E.value}` : T.value), O = r(() => {
|
|
34
|
+
let e = S.options.tooltip;
|
|
35
|
+
return typeof e == "function" ? e(S.value, S.row) : e || S.options.ellipsis ? D.value : void 0;
|
|
36
|
+
}), k = r(() => e(S.options.tone, S.value, S.row)), A = r(() => ["vg-text", {
|
|
37
|
+
"vg-text-ellipsis": S.options.ellipsis,
|
|
38
|
+
"vg-text-clamp": S.options.lines,
|
|
39
|
+
"vg-text-pre": S.options.preserveNewlines,
|
|
40
|
+
"vg-text-muted": w.value && !!S.options.placeholder,
|
|
41
|
+
"vg-text-bold": e(S.options.bold, S.value, S.row),
|
|
42
|
+
"vg-text-fill": k.value && S.options.toneMode === "fill",
|
|
43
|
+
[`vg-tone-${k.value}`]: k.value
|
|
44
|
+
}]), j = r(() => ({
|
|
45
|
+
maxWidth: S.options.maxWidth,
|
|
46
|
+
"--vg-text-lines": S.options.lines
|
|
47
|
+
})), M = r(() => S.options.badge?.(S.value, S.row) || null), N = r(() => {
|
|
48
|
+
let e = S.options.icon?.(S.value, S.row);
|
|
49
|
+
return e ? {
|
|
50
|
+
...e,
|
|
51
|
+
icon: h(e.icon)
|
|
52
|
+
} : null;
|
|
53
|
+
}), P = r(() => S.options.copyable && !w.value ? S.options.copyValue?.(S.value, S.row) ?? D.value : ""), F = r(() => !!(M.value || N.value || E.value || P.value));
|
|
54
|
+
return (e, r) => F.value ? (f(), o("span", g, [
|
|
55
|
+
N.value ? (f(), o("span", {
|
|
56
|
+
key: 0,
|
|
57
|
+
class: u(["vg-text-icon", N.value.tone && `vg-tone-${N.value.tone}`]),
|
|
58
|
+
role: N.value.label ? "img" : void 0,
|
|
59
|
+
"aria-label": N.value.label,
|
|
60
|
+
"aria-hidden": N.value.label ? void 0 : "true",
|
|
61
|
+
title: N.value.label
|
|
62
|
+
}, [(f(), i(p(N.value.icon)))], 10, _)) : a("", !0),
|
|
63
|
+
M.value && l.options.badgePosition !== "end" ? (f(), i(n, {
|
|
64
|
+
key: 1,
|
|
65
|
+
badge: M.value
|
|
66
|
+
}, null, 8, ["badge"])) : a("", !0),
|
|
67
|
+
s("span", {
|
|
68
|
+
class: u(A.value),
|
|
69
|
+
style: d(j.value),
|
|
70
|
+
title: O.value
|
|
71
|
+
}, [c(m(T.value), 1), E.value ? (f(), o("span", y, m(" " + E.value), 1)) : a("", !0)], 14, v),
|
|
72
|
+
M.value && l.options.badgePosition === "end" ? (f(), i(n, {
|
|
73
|
+
key: 2,
|
|
74
|
+
badge: M.value
|
|
75
|
+
}, null, 8, ["badge"])) : a("", !0),
|
|
76
|
+
P.value ? (f(), i(t, {
|
|
77
|
+
key: 3,
|
|
78
|
+
text: P.value,
|
|
79
|
+
onCopied: r[0] ||= (e) => C("action", "copy", e),
|
|
80
|
+
onFailed: r[1] ||= (e) => C("action", "copy-error", e)
|
|
81
|
+
}, null, 8, ["text"])) : a("", !0)
|
|
82
|
+
])) : (f(), o("span", {
|
|
83
|
+
key: 1,
|
|
84
|
+
class: u(A.value),
|
|
85
|
+
style: d(j.value),
|
|
86
|
+
title: O.value
|
|
87
|
+
}, m(T.value), 15, b));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export { x as default };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=TextCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createBlock","_resolveDynamicComponent","ValueBadge","_createElementVNode","_normalizeStyle","_createTextVNode","_toDisplayString","CopyButton","CopyButton_default","ValueBadge_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","TextCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","isEmpty","computed","text","v","secondary","fullText","tooltip","t","tone","resolveOption","textClass","textStyle","badge","icon","spec","toRaw","copyText","adorned","openBlock","createElementBlock","normalizeClass","createBlock","resolveDynamicComponent","createCommentVNode","createElementVNode","normalizeStyle","createTextVNode","toDisplayString","_cache","$event"],"sources":["../../src/renderers/TextCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRaw } from 'vue'\nimport type { CellRendererEmits, CellRendererProps } from '../types'\nimport { resolveOption, type TextOptions } from './options'\nimport CopyButton from './parts/CopyButton.vue'\nimport ValueBadge from './parts/ValueBadge.vue'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, TextOptions>>()\nconst emit = defineEmits<CellRendererEmits>()\n\nconst isEmpty = computed(() => props.value === null || props.value === undefined || props.value === '')\nconst text = computed(() => {\n const v = props.value\n if (isEmpty.value) return props.options.placeholder ?? ''\n return typeof v === 'object' ? JSON.stringify(v) : String(v)\n})\n\nconst secondary = computed(() => (isEmpty.value ? null : props.options.secondary?.(props.value, props.row)))\nconst fullText = computed(() => (secondary.value ? `${text.value} ${secondary.value}` : text.value))\n\nconst tooltip = computed(() => {\n const t = props.options.tooltip\n if (typeof t === 'function') return t(props.value, props.row)\n return t || props.options.ellipsis ? fullText.value : undefined\n})\n\nconst tone = computed(() => resolveOption(props.options.tone, props.value, props.row))\nconst textClass = computed(() => [\n 'vg-text',\n {\n 'vg-text-ellipsis': props.options.ellipsis,\n 'vg-text-clamp': props.options.lines,\n 'vg-text-pre': props.options.preserveNewlines,\n 'vg-text-muted': isEmpty.value && !!props.options.placeholder,\n 'vg-text-bold': resolveOption(props.options.bold, props.value, props.row),\n 'vg-text-fill': tone.value && props.options.toneMode === 'fill',\n [`vg-tone-${tone.value}`]: tone.value,\n },\n])\nconst textStyle = computed(() => ({ maxWidth: props.options.maxWidth, '--vg-text-lines': props.options.lines }))\n\nconst badge = computed(() => props.options.badge?.(props.value, props.row) || null)\nconst icon = computed(() => {\n const spec = props.options.icon?.(props.value, props.row)\n return spec ? { ...spec, icon: toRaw(spec.icon) } : null\n})\nconst copyText = computed(() =>\n props.options.copyable && !isEmpty.value ? (props.options.copyValue?.(props.value, props.row) ?? fullText.value) : '',\n)\n// Plain text keeps a single span; adornments (icon, badge, secondary text, copy) wrap it.\nconst adorned = computed(() => !!(badge.value || icon.value || secondary.value || copyText.value))\n</script>\n\n<template>\n <span v-if=\"adorned\" class=\"vg-text-adorned\">\n <span\n v-if=\"icon\"\n :class=\"['vg-text-icon', icon.tone && `vg-tone-${icon.tone}`]\"\n :role=\"icon.label ? 'img' : undefined\"\n :aria-label=\"icon.label\"\n :aria-hidden=\"icon.label ? undefined : 'true'\"\n :title=\"icon.label\"\n ><component :is=\"icon.icon\"\n /></span>\n <ValueBadge v-if=\"badge && options.badgePosition !== 'end'\" :badge=\"badge\" />\n <span :class=\"textClass\" :style=\"textStyle\" :title=\"tooltip\"\n >{{ text }}<span v-if=\"secondary\" class=\"vg-text-secondary\">{{ ' ' + secondary }}</span></span\n >\n <ValueBadge v-if=\"badge && options.badgePosition === 'end'\" :badge=\"badge\" />\n <CopyButton\n v-if=\"copyText\"\n :text=\"copyText\"\n @copied=\"emit('action', 'copy', $event)\"\n @failed=\"emit('action', 'copy-error', $event)\"\n />\n </span>\n <span v-else :class=\"textClass\" :style=\"textStyle\" :title=\"tooltip\">{{ text }}</span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOA,IAAMoB,IAAQC,GACRC,IAAOH,GAEPI,IAAUC,QAAeJ,EAAM,UAAU,QAAQA,EAAM,UAAU,KAAA,KAAaA,EAAM,UAAU,EAAE,GAChGK,IAAOD,QAAe;GAC1B,IAAME,IAAIN,EAAM;GAEhB,OADIG,EAAQ,QAAcH,EAAM,QAAQ,eAAe,KAChD,OAAOM,KAAM,WAAW,KAAK,UAAUA,CAAC,IAAI,OAAOA,CAAC;EAC7D,CAAC,GAEKC,IAAYH,QAAgBD,EAAQ,QAAQ,OAAOH,EAAM,QAAQ,YAAYA,EAAM,OAAOA,EAAM,GAAG,CAAE,GACrGQ,IAAWJ,QAAgBG,EAAU,QAAQ,GAAGF,EAAK,MAAM,GAAGE,EAAU,UAAUF,EAAK,KAAM,GAE7FI,IAAUL,QAAe;GAC7B,IAAMM,IAAIV,EAAM,QAAQ;GAExB,OADI,OAAOU,KAAM,aAAmBA,EAAEV,EAAM,OAAOA,EAAM,GAAG,IACrDU,KAAKV,EAAM,QAAQ,WAAWQ,EAAS,QAAQ,KAAA;EACxD,CAAC,GAEKG,IAAOP,QAAeQ,EAAcZ,EAAM,QAAQ,MAAMA,EAAM,OAAOA,EAAM,GAAG,CAAC,GAC/Ea,IAAYT,QAAe,CAC/B,WACA;GACE,oBAAoBJ,EAAM,QAAQ;GAClC,iBAAiBA,EAAM,QAAQ;GAC/B,eAAeA,EAAM,QAAQ;GAC7B,iBAAiBG,EAAQ,SAAS,CAAC,CAACH,EAAM,QAAQ;GAClD,gBAAgBY,EAAcZ,EAAM,QAAQ,MAAMA,EAAM,OAAOA,EAAM,GAA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B,EAAE2B,EAAA,KAAS;IAAG,OAAOL,EAAA;G,IAC9CrB,EAAAC,EAAAgB,EAAA,KAAI,GAAA,CAAA,GAAeE,EAAA,SAAZ3B,EAAA,GAAAC,EAA6E,QAA7Ee,GAA6EP,EAAA,MAAnBkB,EAAA,KAAS,GAAA,CAAA,K;GAE9DQ,EAAA,SAASd,EAAA,QAAQ,kBAAa,SAAhDrB,EAAA,GAAAG,EAA6EE,GAAA;;IAAhB,OAAO8B,EAAA;;GAE5DI,EAAA,SADRvC,EAAA,GAAAG,EAKEO,GAAA;;IAHC,MAAM6B,EAAA;IACN,UAAM,AAAAY,EAAA,QAAA,MAAE7B,EAAI,UAAA,QAAmB8B,CAAM;IACrC,UAAM,AAAAD,EAAA,QAAA,MAAE7B,EAAI,UAAA,cAAyB8B,CAAM;;E,OAGhDpD,EAAA,GAAAC,EAAqF,QAAA;;GAAvE,OAAKC,EAAE+B,EAAA,KAAS;GAAG,OAAK1B,EAAE2B,EAAA,KAAS;GAAG,OAAOL,EAAA;EAAY,GAAApB,EAAAgB,EAAA,KAAI,GAAA,IAAAR,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleTextCell.js","names":["ToggleTextCell_vue_vue_type_script_setup_true_lang_default","ToggleTextCell_default"],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { resolveOption as e } from "./options.js";
|
|
2
|
+
import { computed as t, createElementBlock as n, defineComponent as r, normalizeClass as i, openBlock as a, toDisplayString as o } from "vue";
|
|
3
|
+
// src/renderers/ToggleTextCell.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var s = ["aria-pressed"], c = /*@__PURE__*/ r({
|
|
5
|
+
__name: "ToggleTextCell",
|
|
6
|
+
props: {
|
|
7
|
+
value: {},
|
|
8
|
+
row: {},
|
|
9
|
+
rowKey: {},
|
|
10
|
+
rowIndex: {},
|
|
11
|
+
depth: {},
|
|
12
|
+
column: {},
|
|
13
|
+
options: {}
|
|
14
|
+
},
|
|
15
|
+
emits: ["action"],
|
|
16
|
+
setup(r, { emit: c }) {
|
|
17
|
+
let l = r, u = c, d = t(() => l.value === null || l.value === void 0 || l.value === "" ? l.options.placeholder ?? "" : String(l.value)), f = t(() => !!e(l.options.clickable, l.value, l.row)), p = t(() => !!e(l.options.highlighted, l.value, l.row));
|
|
18
|
+
return (e, t) => f.value ? (a(), n("button", {
|
|
19
|
+
key: 0,
|
|
20
|
+
type: "button",
|
|
21
|
+
class: i([
|
|
22
|
+
"vg-toggle-text",
|
|
23
|
+
"vg-link-button",
|
|
24
|
+
{ "vg-toggle-text-on": p.value }
|
|
25
|
+
]),
|
|
26
|
+
"aria-pressed": p.value,
|
|
27
|
+
onClick: t[0] ||= (e) => u("action", "toggle", r.value)
|
|
28
|
+
}, o(d.value), 11, s)) : (a(), n("span", {
|
|
29
|
+
key: 1,
|
|
30
|
+
class: i(["vg-toggle-text", { "vg-toggle-text-on": p.value }])
|
|
31
|
+
}, o(d.value), 3));
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export { c as default };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=ToggleTextCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleTextCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_toDisplayString","_hoisted_1","ToggleTextCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","text","computed","clickable","resolveOption","highlighted","openBlock","createElementBlock","normalizeClass","_cache","toDisplayString"],"sources":["../../src/renderers/ToggleTextCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { CellRendererEmits, CellRendererProps } from '../types'\nimport { resolveOption, type ToggleTextOptions } from './options'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, ToggleTextOptions>>()\nconst emit = defineEmits<CellRendererEmits>()\n\nconst text = computed(() =>\n props.value === null || props.value === undefined || props.value === ''\n ? (props.options.placeholder ?? '')\n : String(props.value),\n)\nconst clickable = computed(() => !!resolveOption(props.options.clickable, props.value, props.row))\nconst highlighted = computed(() => !!resolveOption(props.options.highlighted, props.value, props.row))\n</script>\n\n<template>\n <button\n v-if=\"clickable\"\n type=\"button\"\n :class=\"['vg-toggle-text', 'vg-link-button', { 'vg-toggle-text-on': highlighted }]\"\n :aria-pressed=\"highlighted\"\n @click=\"emit('action', 'toggle', value)\"\n >\n {{ text }}\n </button>\n <span v-else :class=\"['vg-toggle-text', { 'vg-toggle-text-on': highlighted }]\">{{ text }}</span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAKA,IAAMO,IAAQC,GACRC,IAAOH,GAEPI,IAAOC,QACXJ,EAAM,UAAU,QAAQA,EAAM,UAAU,KAAA,KAAaA,EAAM,UAAU,KAChEA,EAAM,QAAQ,eAAe,KAC9B,OAAOA,EAAM,KAAK,CACxB,GACMK,IAAYD,QAAe,CAAC,CAACE,EAAcN,EAAM,QAAQ,WAAWA,EAAM,OAAOA,EAAM,GAAG,CAAC,GAC3FO,IAAcH,QAAe,CAAC,CAACE,EAAcN,EAAM,QAAQ,aAAaA,EAAM,OAAOA,EAAM,GAAG,CAAC;E,iBAK3FK,EAAA,SADRZ,EAAA,GAAAC,EAQS,UAAA;;GANP,MAAK;GACJ,OAAKC,EAAA;IAAA;IAAA;IAAA,EAAA,qBAA8DY,EAAA,MAAW;GAAA,CAAA;GAC9E,gBAAcA,EAAA;GACd,SAAK,AAAAI,EAAA,QAAA,MAAET,EAAI,UAAA,UAAqBD,EAAA,KAAK;EAEnC,GAAAL,EAAAO,EAAA,KAAI,GAAA,IAAAN,CAAA,MAETJ,EAAA,GAAAC,EAAgG,QAAA;;GAAlF,OAAKC,EAAA,CAAA,kBAAA,EAAA,qBAA4CY,EAAA,MAAW,CAAA,CAAA;EAAQ,GAAAX,EAAAO,EAAA,KAAI,GAAA,CAAA"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// src/renderers/format.ts
|
|
2
|
+
var e = /* @__PURE__ */ new Map();
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
let r = `n|${t}|${JSON.stringify(n)}`, i = e.get(r);
|
|
5
|
+
return i || e.set(r, i = new Intl.NumberFormat(t, n)), i;
|
|
6
|
+
}
|
|
7
|
+
function n(t, n) {
|
|
8
|
+
let r = `d|${t}|${JSON.stringify(n)}`, i = e.get(r);
|
|
9
|
+
return i || e.set(r, i = new Intl.DateTimeFormat(t, n)), i;
|
|
10
|
+
}
|
|
11
|
+
function r(e) {
|
|
12
|
+
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
13
|
+
if (typeof e == "bigint") return Number(e);
|
|
14
|
+
if (typeof e == "string" && e.trim() !== "") {
|
|
15
|
+
let t = Number(e);
|
|
16
|
+
return Number.isFinite(t) ? t : null;
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
function i(e) {
|
|
21
|
+
if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e;
|
|
22
|
+
if (typeof e == "string" || typeof e == "number") {
|
|
23
|
+
if (e === "") return null;
|
|
24
|
+
let t = new Date(e);
|
|
25
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
function a(e, n, i = {}) {
|
|
30
|
+
let a = r(e);
|
|
31
|
+
return a === null ? "" : t(n.locale, i).format(a);
|
|
32
|
+
}
|
|
33
|
+
function o(e, t, n = {}) {
|
|
34
|
+
return a(e, t, {
|
|
35
|
+
signDisplay: "exceptZero",
|
|
36
|
+
...n
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function s(e, t, n, r = {}) {
|
|
40
|
+
return a(e, t, {
|
|
41
|
+
style: "currency",
|
|
42
|
+
currency: n ?? t.currency,
|
|
43
|
+
...r
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function c(e, t, r = {}) {
|
|
47
|
+
let a = i(e);
|
|
48
|
+
if (!a) return "";
|
|
49
|
+
let o = { ...r };
|
|
50
|
+
return typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e.trim()) ? o.timeZone = "UTC" : t.timeZone && !o.timeZone && (o.timeZone = t.timeZone), n(t.locale, o).format(a);
|
|
51
|
+
}
|
|
52
|
+
var l = {
|
|
53
|
+
year: "numeric",
|
|
54
|
+
month: "2-digit",
|
|
55
|
+
day: "2-digit"
|
|
56
|
+
}, u = {
|
|
57
|
+
hour: "2-digit",
|
|
58
|
+
minute: "2-digit",
|
|
59
|
+
second: "2-digit"
|
|
60
|
+
};
|
|
61
|
+
function d(e) {
|
|
62
|
+
if (typeof e != "string") return;
|
|
63
|
+
let t = e.replace(/^[\u0000- ]+|[\u0000- ]+$/g, "").replace(/[\t\n\r]/g, "");
|
|
64
|
+
if (!t) return;
|
|
65
|
+
let n = /^([a-z][a-z0-9+.-]*):/i.exec(t)?.[1]?.toLowerCase();
|
|
66
|
+
return n ? [
|
|
67
|
+
"http",
|
|
68
|
+
"https",
|
|
69
|
+
"mailto",
|
|
70
|
+
"tel"
|
|
71
|
+
].includes(n) ? t : void 0 : t;
|
|
72
|
+
}
|
|
73
|
+
function f(e) {
|
|
74
|
+
if (typeof e != "string") return e;
|
|
75
|
+
try {
|
|
76
|
+
return JSON.parse(e);
|
|
77
|
+
} catch {
|
|
78
|
+
return e;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function p(e) {
|
|
82
|
+
let t, n, r, i = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim())?.[1], a = /^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/i.exec(e.trim());
|
|
83
|
+
if (i) {
|
|
84
|
+
let e = i.length === 3 ? [...i].map((e) => e + e).join("") : i;
|
|
85
|
+
[t, n, r] = [
|
|
86
|
+
0,
|
|
87
|
+
2,
|
|
88
|
+
4
|
|
89
|
+
].map((t) => parseInt(e.slice(t, t + 2), 16));
|
|
90
|
+
} else if (a) [t, n, r] = [
|
|
91
|
+
a[1],
|
|
92
|
+
a[2],
|
|
93
|
+
a[3]
|
|
94
|
+
].map(Number);
|
|
95
|
+
else return "#fff";
|
|
96
|
+
let o = (e) => {
|
|
97
|
+
let t = e / 255;
|
|
98
|
+
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
99
|
+
};
|
|
100
|
+
return .2126 * o(t) + .7152 * o(n) + .0722 * o(r) > .4 ? "#000" : "#fff";
|
|
101
|
+
}
|
|
102
|
+
function m(e, t) {
|
|
103
|
+
if (typeof e != "string" || !e.trim()) return;
|
|
104
|
+
let n = e.trim();
|
|
105
|
+
return /^data:image\//i.test(n) ? n : /^[a-z][a-z0-9+.-]*:/i.test(n) || n.startsWith("//") ? /^https?:/i.test(n) ? n : void 0 : t ? `${t.replace(/\/+$/, "")}/${n.replace(/^\/+/, "")}` : n;
|
|
106
|
+
}
|
|
107
|
+
function h(e) {
|
|
108
|
+
let t = [], n = /("(?:\\.|[^"\\])*")(\s*:)?|\b(true|false)\b|\bnull\b|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g, r = 0;
|
|
109
|
+
for (let i = n.exec(e); i; i = n.exec(e)) i.index > r && t.push({
|
|
110
|
+
type: "punct",
|
|
111
|
+
text: e.slice(r, i.index)
|
|
112
|
+
}), i[1] ? (t.push({
|
|
113
|
+
type: i[2] ? "key" : "string",
|
|
114
|
+
text: i[1]
|
|
115
|
+
}), i[2] && t.push({
|
|
116
|
+
type: "punct",
|
|
117
|
+
text: i[2]
|
|
118
|
+
})) : i[3] ? t.push({
|
|
119
|
+
type: "boolean",
|
|
120
|
+
text: i[0]
|
|
121
|
+
}) : i[0] === "null" ? t.push({
|
|
122
|
+
type: "null",
|
|
123
|
+
text: i[0]
|
|
124
|
+
}) : t.push({
|
|
125
|
+
type: "number",
|
|
126
|
+
text: i[0]
|
|
127
|
+
}), r = n.lastIndex;
|
|
128
|
+
return r < e.length && t.push({
|
|
129
|
+
type: "punct",
|
|
130
|
+
text: e.slice(r)
|
|
131
|
+
}), t;
|
|
132
|
+
}
|
|
133
|
+
function g(e) {
|
|
134
|
+
try {
|
|
135
|
+
return JSON.stringify(f(e), null, 2) ?? String(e);
|
|
136
|
+
} catch {
|
|
137
|
+
return String(e);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
export { l as DATE_DEFAULT, u as TIME_DEFAULT, s as formatCurrency, c as formatDate, a as formatNumber, o as formatSigned, f as parseJsonish, p as readableTextColor, m as resolveImageSrc, d as safeHref, g as stringifyJson, i as toDate, r as toNumber, h as tokenizeJson };
|
|
141
|
+
|
|
142
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","names":["cache","numberFormat","id","locale","options","f","dateFormat","toNumber","value","n","toDate","d","formatNumber","ctx","formatSigned","formatCurrency","currency","formatDate","opts","DATE_DEFAULT","TIME_DEFAULT","safeHref","href","cleaned","scheme","parseJsonish","readableTextColor","r","g","b","hex","color","rgb","full","c","i","lin","s","resolveImageSrc","src","baseUrl","tokenizeJson","out","re","last","m","text","stringifyJson"],"sources":["../../src/renderers/format.ts"],"sourcesContent":["import type { FormatContext } from '../types'\n\nconst cache = new Map<string, Intl.NumberFormat | Intl.DateTimeFormat>()\n\nfunction numberFormat(locale: string, options: Intl.NumberFormatOptions): Intl.NumberFormat {\n const id = `n|${locale}|${JSON.stringify(options)}`\n let f = cache.get(id) as Intl.NumberFormat | undefined\n if (!f) cache.set(id, (f = new Intl.NumberFormat(locale, options)))\n return f\n}\n\nfunction dateFormat(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n const id = `d|${locale}|${JSON.stringify(options)}`\n let f = cache.get(id) as Intl.DateTimeFormat | undefined\n if (!f) cache.set(id, (f = new Intl.DateTimeFormat(locale, options)))\n return f\n}\n\nexport function toNumber(value: unknown): number | null {\n if (typeof value === 'number') return Number.isFinite(value) ? value : null\n if (typeof value === 'bigint') return Number(value)\n if (typeof value === 'string' && value.trim() !== '') {\n const n = Number(value)\n return Number.isFinite(n) ? n : null\n }\n return null\n}\n\nexport function toDate(value: unknown): Date | null {\n if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value\n if (typeof value === 'string' || typeof value === 'number') {\n if (value === '') return null\n const d = new Date(value)\n return Number.isNaN(d.getTime()) ? null : d\n }\n return null\n}\n\nexport function formatNumber(value: unknown, ctx: FormatContext, options: Intl.NumberFormatOptions = {}): string {\n const n = toNumber(value)\n return n === null ? '' : numberFormat(ctx.locale, options).format(n)\n}\n\nexport function formatSigned(value: unknown, ctx: FormatContext, options: Intl.NumberFormatOptions = {}): string {\n return formatNumber(value, ctx, { signDisplay: 'exceptZero', ...options })\n}\n\nexport function formatCurrency(\n value: unknown,\n ctx: FormatContext,\n currency?: string,\n options: Intl.NumberFormatOptions = {},\n): string {\n return formatNumber(value, ctx, { style: 'currency', currency: currency ?? ctx.currency, ...options })\n}\n\nexport function formatDate(value: unknown, ctx: FormatContext, options: Intl.DateTimeFormatOptions = {}): string {\n const d = toDate(value)\n if (!d) return ''\n const opts: Intl.DateTimeFormatOptions = { ...options }\n // `2026-01-05` parses as UTC midnight: show it in UTC, or it reads as the 4th west of Greenwich.\n if (typeof value === 'string' && /^\\d{4}-\\d{2}-\\d{2}$/.test(value.trim())) opts.timeZone = 'UTC'\n else if (ctx.timeZone && !opts.timeZone) opts.timeZone = ctx.timeZone\n return dateFormat(ctx.locale, opts).format(d)\n}\n\nexport const DATE_DEFAULT: Intl.DateTimeFormatOptions = { year: 'numeric', month: '2-digit', day: '2-digit' }\nexport const TIME_DEFAULT: Intl.DateTimeFormatOptions = { hour: '2-digit', minute: '2-digit', second: '2-digit' }\n\n/** Only http(s), mailto, tel and relative URLs are rendered as links (blocks `javascript:` etc.). */\nexport function safeHref(href: unknown): string | undefined {\n if (typeof href !== 'string') return undefined\n // Clean the URL the way browsers do before parsing it (WHATWG URL): drop leading/trailing C0\n // controls and spaces, and every tab or newline — otherwise `java\\tscript:` slips past the check.\n const cleaned = href.replace(/^[\\u0000- ]+|[\\u0000- ]+$/g, '').replace(/[\\t\\n\\r]/g, '')\n if (!cleaned) return undefined\n const scheme = /^([a-z][a-z0-9+.-]*):/i.exec(cleaned)?.[1]?.toLowerCase()\n if (!scheme) return cleaned\n return ['http', 'https', 'mailto', 'tel'].includes(scheme) ? cleaned : undefined\n}\n\n/** Parses JSON strings; other values are returned as-is. */\nexport function parseJsonish(value: unknown): unknown {\n if (typeof value !== 'string') return value\n try {\n return JSON.parse(value)\n } catch {\n return value\n }\n}\n\n/**\n * Black or white, whichever reads better on `color`. Understands hex (#rgb, #rrggbb) and rgb()/rgba();\n * anything else (named colours, var(), hsl()) gets white.\n */\nexport function readableTextColor(color: string): '#000' | '#fff' {\n let r: number, g: number, b: number\n const hex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(color.trim())?.[1]\n const rgb = /^rgba?\\(\\s*(\\d+)[\\s,]+(\\d+)[\\s,]+(\\d+)/i.exec(color.trim())\n if (hex) {\n const full = hex.length === 3 ? [...hex].map((c) => c + c).join('') : hex\n ;[r, g, b] = [0, 2, 4].map((i) => parseInt(full.slice(i, i + 2), 16)) as [number, number, number]\n } else if (rgb) {\n ;[r, g, b] = [rgb[1], rgb[2], rgb[3]].map(Number) as [number, number, number]\n } else {\n return '#fff'\n }\n // WCAG relative luminance\n const lin = (c: number) => {\n const s = c / 255\n return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4\n }\n const lum = 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b)\n return lum > 0.4 ? '#000' : '#fff'\n}\n\n/** Image URL with an optional base for relative paths; only http(s), relative and `data:image/` are allowed. */\nexport function resolveImageSrc(src: unknown, baseUrl?: string): string | undefined {\n if (typeof src !== 'string' || !src.trim()) return undefined\n const s = src.trim()\n if (/^data:image\\//i.test(s)) return s\n if (/^[a-z][a-z0-9+.-]*:/i.test(s) || s.startsWith('//')) return /^https?:/i.test(s) ? s : undefined\n if (!baseUrl) return s\n return `${baseUrl.replace(/\\/+$/, '')}/${s.replace(/^\\/+/, '')}`\n}\n\nexport type JsonTokenType = 'key' | 'string' | 'number' | 'boolean' | 'null' | 'punct'\n\n/** Splits pretty-printed JSON into typed tokens (rendered as text nodes, never as HTML). */\nexport function tokenizeJson(text: string): { type: JsonTokenType; text: string }[] {\n const out: { type: JsonTokenType; text: string }[] = []\n const re = /(\"(?:\\\\.|[^\"\\\\])*\")(\\s*:)?|\\b(true|false)\\b|\\bnull\\b|-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?/g\n let last = 0\n for (let m = re.exec(text); m; m = re.exec(text)) {\n if (m.index > last) out.push({ type: 'punct', text: text.slice(last, m.index) })\n if (m[1]) {\n out.push({ type: m[2] ? 'key' : 'string', text: m[1] })\n if (m[2]) out.push({ type: 'punct', text: m[2] })\n } else if (m[3]) out.push({ type: 'boolean', text: m[0] })\n else if (m[0] === 'null') out.push({ type: 'null', text: m[0] })\n else out.push({ type: 'number', text: m[0] })\n last = re.lastIndex\n }\n if (last < text.length) out.push({ type: 'punct', text: text.slice(last) })\n return out\n}\n\nexport function stringifyJson(value: unknown): string {\n try {\n return JSON.stringify(parseJsonish(value), null, 2) ?? String(value)\n } catch {\n return String(value)\n }\n}\n"],"mappings":";AAEA,IAAMA,oBAAQ,IAAI,IAAqD;AAEvE,SAASC,EAAa,GAAgB,GAAsD;CAC1F,IAAMC,IAAK,KAAKC,EAAO,GAAG,KAAK,UAAUC,CAAO,KAC5CC,IAAIL,EAAM,IAAIE,CAAE;CAEpB,OADKG,KAAGL,EAAM,IAAIE,GAAK,IAAI,IAAI,KAAK,aAAaC,GAAQC,CAAO,CAAE,GAC3DC;AACT;AAEA,SAASC,EAAW,GAAgB,GAA0D;CAC5F,IAAMJ,IAAK,KAAKC,EAAO,GAAG,KAAK,UAAUC,CAAO,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