Skip to content

v1.4.0

Choose a tag to compare

@EightKK EightKK released this 23 Nov 01:04
· 118 commits to main since this release
a37a9fb

Adds TreeGrid, an editable tree grid and matrix, and core helpers for relation-aware graph walks, keyed graph expansion, structure diffs, row-tree projections and time bucket tables, plus entity-initiated linked selection for views of your own. The examples, showcases and API reference move to a new bilingual documentation site (English and Japanese) at https://eightkk.github.io/vue-weave/. Every change is backward compatible.

Added

  • TreeGrid, an opt-in controlled tree grid and matrix: a row tree against columns, with cells from column accessors (value(row)) or a sparse cells list. Cells keep a value (including 0), known none, unknown, not applicable and not loaded apart (missingCell, cell status). Rows and columns are virtualized together, the focused cell stays rendered and focused outside the window, and the ARIA treegrid keys reach every cell. Children can load on demand (childStatus, expand-request, a status line). Expansion and the active cell are controlled (v-model:expanded-ids, v-model:active-cell). row-activate and cell-activate report entities, for linking through useLinkedSelection().selectEntities and matchTreeGridEntities. Opt-in editing proposes cell-edit with typed editors (text, number, select, checkbox, date and time; IME-safe), spreadsheet proposes one sheet-edit per paste, fill (Ctrl+D or the fill handle), clear or cut, and rowsEditable proposes row-create, row-delete and row-move (keyboard and pointer). Each proposal has a synchronous validator, -rejected events and edit-cancel. Core helpers createTreeGridIndex, flattenTreeGrid, applyTreeGridEdits, insertTreeGridRow, deleteTreeGridRows and the window and key functions, the --vw-tree-grid-* theme variables, right-to-left, forced-colors and print support, server rendering, and a "Tree grid" demo.
  • useLinkedSelection gains selectEntities(entities, { source }?) and selectionSource, so views without a LinkedViewName (an application's own table or list) can start a linked selection through entity references. The selection has no owner, every view only highlights the bound targets, selectedEntities keeps the given entities in input order (unbound ones included, listed in unknown), and repeating the same entities from the same source is a no-op that does not call onSelect. ViewTarget and LinkedViewName are unchanged. The linked planning demo has an external task list.
  • Core: diffStructure(before, after, { key, fields?, parentKey?, equals? }) compares two versions of a flat or tree-shaped keyed collection, such as two revisions of a bill of materials, a WBS or a product hierarchy. It returns added keys (in after order), removed keys and changed items with each changed field's before and after values, and, with parentKey, the moved items whose parent differs (in before order). key and parentKey take a property name or a function. The default fields are the own properties of both items, without the key and parent properties; values compare with Object.is unless you pass equals. Keys follow the shared ID rule (Duplicate item ID: a (before)); unknown parents and cycles throw an Error. It uses loops only and never changes its inputs. New types: StructureDiffOptions, StructureKeyAccessor, StructureDiff, StructureChange, StructureFieldChange and StructureMove.
  • Core: projectTimelineRows(input, state) is the row part of projectTimelineView, for applications that show rows in their own tree table. It applies the search and column filters (matches keep their ancestors), sorts siblings stably by sort rules or columns, and drops collapsed IDs that name no row. It returns rows, matchedRowIds, wbs, collapsedIds and the row diagnostics (unknown-row, unknown-column, unknown-sort-rule). bars are optional: with them, the search reads bar labels and columns receive row summaries. projectTimelineView now uses it, and its output is unchanged. New types: TimelineRowsInput, TimelineRowViewState and TimelineRowsProjection.
  • traverseGraph takes opt-in edgeFilter(edge, direction) to follow only some relations (it is told the walk direction), maxNodes to cap the result nearest first (starts count and are always kept; with 'both' the two walks advance hop by hop together and a node counts once), and paths. With any of them the result adds truncated ({ nodeId, direction, reason: 'max-hops' | 'max-nodes' }[], where a limit stopped a walk); with paths: true it adds via (one Map per walk from each reached node to its first step { edgeId, previousId }) and multiplyReachedIds. Without the new options results are unchanged. New types: GraphWalkDirection, GraphTraversalTruncation, GraphTraversalStep, GraphTraversalVia, GraphTracedPath.
  • graphTracePath(result, nodeId, { direction }?) rebuilds the nodes and edges from a start to a node from a traverseGraph result made with paths: true, using the fewest-hops path within one walk.
  • resolveTimeRangeTargets and useLinkedSelection timeRange.traversal accept the new edgeFilter and maxNodes.
  • Keyed graph expansion: beginGraphExpansion, cancelGraphExpansion, mergeGraphExpansionPage and graphExpansionView take an optional { key } (GraphExpansionKeyOptions), for example 'forward', 'backward' or a relation name, kept in the new optional state fields expandedIdsByKey and pendingIdsByKey. graphExpansionView(state, { key }) returns the frontier of that key. An unkeyed merge still marks a node expanded for every key, and calls without a key behave as before.
  • Time bucket tables in the core: createTimeBucketColumns turns sorted, non-overlapping half-open periods (gaps allowed; calendarBands days or weeks in an IANA zone work as they are) into column descriptors { id, label, width, start, end } with deterministic IDs, and aggregateTimeBuckets aggregates time-stamped instants or intervals (placed by start, overlap or prorated share) into one sparse cell { rowId, columnId, value, status, count } per row and bucket, with the rules sum, count, min, max, first, last, ratio (numerator and denominator, never averaged percentages), precomputed (server values as-is) or a custom reducer, per row. Buckets outside an optional loaded coverage (ranges, or a function such as windowedCoverage) are unloaded with a null value instead of 0, loaded buckets without items are loaded-empty, and carryForward opts last rows into running balances. timeBucketIndex and timeBucketIndexRange find buckets by binary search, so a period table can follow GanttChart's TimelineVisibleWindow. See Time bucket tables.
  • Core treeGridCellsFromTimeBuckets(cells) and treeGridCellContentFromTimeBucket(cell, extra?) turn aggregateTimeBuckets cells into TreeGrid cells: a loaded value stays a value (a sum of nothing is 0), a loaded bucket without a value is none, and buckets that are not loaded keep their unloaded, loading or failed status instead of showing 0.

Fixed

  • A server-rendered EventCalendar hydrates without a mismatch: Node.js formats the week title (Intl.DateTimeFormat#formatRange) with thin spaces around the dash where browsers write plain spaces. Formatted dates and times in the library (the EventCalendar title and event names, intlTimeFormatter, calendarZoomPresets and locale-aware calendarBands labels) now write thin, narrow no-break and no-break spaces (U+2009, U+202F, U+00A0) as plain spaces, so the server and the browser render the same text. The default English output is unchanged apart from those spaces.
  • Documentation: types and placeholders with angle brackets in docs/ (such as ReadonlySet<string> or Edit <column> for <row>) are in code spans, so GitHub and npm show them instead of dropping them as HTML tags.

Demo

  • New "Tree grid" demo: about 3,000 products against 30 columns with editing, spreadsheet operations, row structure editing, a lazily loaded group, undo and redo, linked to a NetworkGraph through selectEntities.
  • New "Period table" demo: a TreeGrid of sites, items and measures against day or week columns (calendarBands, createTimeBucketColumns, aggregateTimeBuckets with sum, last + carryForward, min and ratio). Days that are not loaded show their load state, never 0, and a mid-week shortage is marked inside a positive week. Columns follow a GanttChart's visible window (timeBucketIndexRange), demand cells are editable with undo, and selecting a cell highlights the orders that feed it.
  • The example gallery (gallery.html) is retired: every example and showcase is on the documentation site, and gallery.html forwards old links (?demo=<id>, #<id>) to the matching page, or to the example index. The production demo links to the example index.
  • The Calendar views showcase marks Ascension Day (Berlin) and Corpus Christi (Lisbon) instead of a Labour Day closure, whose header label was drawn over the Golden Week label.
  • A new design gallery showcase, BOM editor: a multi-level bill of materials with shared subassemblies, edited in TreeGrid and linked to an item graph, with where-used walks (traverseGraph with edgeFilter, maxNodes and graphTracePath), a revision comparison with diffStructure, search with projectTimelineRows and a quantity rollup.

Documentation

  • A documentation website built with VitePress, in English with a Japanese version under /ja/: getting started, an examples index by category with a page per example (live demo, source code tabs, related API), a showcase gallery, and an API reference whose pages are built from docs/*.md (overviews in both languages, detail tables in English) plus a type reference generated with TypeDoc for both entry points. Every example and showcase shows its own text and the components' labels in Japanese on Japanese pages. The site replaces the demo homepage and the example gallery; the production planning app stays at /vue-weave/demo/.
  • README.md and README.ja.md are shorter and point to the website.

Development

  • npm run build:demo builds the site (with the generated type reference) into preview/ and checks every internal link and anchor; npm run dev starts the site's dev server and npm run dev:demo the standalone demo. The site build (about 2,000 pages with the type reference in both languages) needs more than Node's default heap on machines with little memory, so build:demo and dev run VitePress with a 6 GiB heap limit. scripts/serve.mjs, npm start, Start.cmd, the Playwright tests and the offline demo archive serve the site under /vue-weave/. New development dependencies: vitepress (2.0 prerelease, which uses Vite 8), typedoc, typedoc-plugin-markdown and typedoc-vitepress-theme, with an npm overrides entry for TypeDoc's minimatch. The package contents and runtime dependencies are unchanged.