Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ release notes before you move the pin.

```json
"dependencies": {
"data-explorer-view": "github:mathworks/data-explorer-view#v1.9.0",
"data-explorer-view": "github:mathworks/data-explorer-view#v1.10.0",
"data-explorer-core": "github:mathworks/data-explorer-core#v1.59.0",
"lit": "^3.2.0"
}
Expand Down
4 changes: 2 additions & 2 deletions custom-elements.json
Original file line number Diff line number Diff line change
Expand Up @@ -8139,7 +8139,7 @@
"declarations": [
{
"kind": "class",
"description": "The tree table: a document's rows as a tree, with a search bar, sortable, resizable and\nreorderable columns (the Columns menu shows, hides and orders them, each within its group, and\nadds a column for any property the user names, from the rows' `_props`; a right-click on a\nheader filters on that column), cell editors, row drag and drop, links, matrix glyphs, an\n`+ Add` gallery and virtual scrolling for very large documents. Data comes in by properties\n(`rows` above all) and every user action goes out as a `dex-*` event; it never changes the\ndocument itself. Its defaults are a full editor; `readonly`, `canAdd` and `rowDrag` turn parts\nof that off.",
"description": "The tree table: a document's rows as a tree, with a search bar, sortable, resizable and\nreorderable columns (the Columns menu shows, hides and orders them, each within its group, by\ndrag or Alt+↑/↓, folds each group and shows or hides it whole, and adds a column for any\nproperty the user names, from the rows' `_props`; a right-click on a header filters on that\ncolumn), cell editors, row drag and drop, links, matrix glyphs, an\n`+ Add` gallery and virtual scrolling for very large documents. Data comes in by properties\n(`rows` above all) and every user action goes out as a `dex-*` event; it never changes the\ndocument itself. Its defaults are a full editor; `readonly`, `canAdd` and `rowDrag` turn parts\nof that off.",
"name": "DexTreeTable",
"members": [
{
Expand Down Expand Up @@ -8187,7 +8187,7 @@
"text": "Record<string, string> | null"
},
"default": "null",
"description": "The group heading each column sits under in the Columns menu, by column key. The columns are\nshown group by group, and the user moves a column within its group only, in the menu and by\nits header. Default null: no headings. Property only."
"description": "The group heading each column sits under in the Columns menu, by column key. The columns are\nshown group by group, and the user moves a column within its group only, in the menu (by drag\nor Alt+↑/↓) and by its header. Each heading folds its group, opening expanded when the group\nshows a column, and its box shows or hides the group's columns at once. Default null: no\nheadings. Property only."
},
{
"kind": "field",
Expand Down
43 changes: 42 additions & 1 deletion dist/model/rows/propertyCells.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
// derived from one), each top-level property by its name, where the value is one a property
// column shows: text, a number, a logical, a list of those, or a typed scalar (MATLAB's rule
// for these columns). Not a nested object (`CoderInfo`, `LoggingInfo`), whose own properties
// are not columns, nor a `*_internal` or envelope key.
// are not columns, nor a `*_internal` or envelope key;
// - and, for a name the bag has no top-level property of, the attribute of that name of the
// object's storage class (`CoderInfo.CustomAttributes.GetFunction` as `GetFunction`), as the
// in-MATLAB data explorer reads a custom column (its design's G8).
//
// A property the row already has a cell for (Value, Description, `complexity` for `Complexity`)
// is left out: the menu shows that column for its name instead, so its text here would be a
Expand Down Expand Up @@ -62,9 +65,47 @@ export function propertyCells(n, row) {
if (text !== null)
put(name, text);
}
// Then its storage class's attributes, each by its short name, for a name the object has no
// top-level property of: a top-level property of the name wins whatever its value, an object
// one included, and a built-in column's name never reads one (MATLAB's G8).
const attributes = customAttributes(bag);
if (attributes) {
for (const name of Object.keys(attributes)) {
if (!PROPERTY_NAME.test(name) || name.endsWith('_internal') || name in bag || BUILT_IN_DATA.has(name))
continue;
const text = primitiveText(attributes[name]);
if (text !== null)
put(name, text);
}
}
}
return props;
}
// The built-in data columns, by the property each shows, which never read a storage class
// attribute of the same name, even on an object that lacks the property: MATLAB's list
// (COLUMN_CUSTOMIZATION_DESIGN.md 11.7), with this table's own code-generation columns.
const BUILT_IN_DATA = new Set([
'Value', 'DataType', 'Description', 'Dimensions', 'DimensionsMode', 'Complexity', 'Min', 'Max', 'Unit',
'StorageClass', 'HeaderFile', 'Alignment', 'DefinitionFile', 'PreStatement', 'PostStatement', 'Qualifier',
]);
// The attributes of the object's storage class, `CoderInfo.CustomAttributes`, or null.
function customAttributes(bag) {
const coderInfo = objectProperties(bag.CoderInfo);
return coderInfo ? objectProperties(coderInfo.CustomAttributes) : null;
}
// A nested object's own properties, or null. A text dictionary keeps them as the object's
// `_properties`; a binary one keeps the object as a 1x1 object array, whose one element has them.
function objectProperties(v) {
if (!isPlainObject(v))
return null;
if (isPlainObject(v._properties))
return v._properties;
const elements = v._elements;
if (Array.isArray(elements) && elements.length === 1 && isPlainObject(elements[0]) && isPlainObject(elements[0]._properties)) {
return elements[0]._properties;
}
return null;
}
// A MATLAB property name: a letter, then letters, digits and underscores.
const PROPERTY_NAME = /^[A-Za-z][A-Za-z0-9_]*$/;
// Whether the row has a cell for `name`: under its own key, or under the lower-camel key a schema
Expand Down
2 changes: 1 addition & 1 deletion dist/model/version.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2026 The MathWorks, Inc.
// GENERATED by scripts/gen-version.mjs from package.json. Do not edit.
/** This package's version, as its package.json says: what an app's About shows for data-explorer-view. */
export const VIEW_VERSION = '1.9.0';
export const VIEW_VERSION = '1.10.0';
26 changes: 21 additions & 5 deletions dist/widgets/tree-table/dex-tree-table.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ export interface TableScrolledDetail {
}
/**
* The tree table: a document's rows as a tree, with a search bar, sortable, resizable and
* reorderable columns (the Columns menu shows, hides and orders them, each within its group, and
* adds a column for any property the user names, from the rows' `_props`; a right-click on a
* header filters on that column), cell editors, row drag and drop, links, matrix glyphs, an
* reorderable columns (the Columns menu shows, hides and orders them, each within its group, by
* drag or Alt+↑/↓, folds each group and shows or hides it whole, and adds a column for any
* property the user names, from the rows' `_props`; a right-click on a header filters on that
* column), cell editors, row drag and drop, links, matrix glyphs, an
* `+ Add` gallery and virtual scrolling for very large documents. Data comes in by properties
* (`rows` above all) and every user action goes out as a `dex-*` event; it never changes the
* document itself. Its defaults are a full editor; `readonly`, `canAdd` and `rowDrag` turn parts
Expand Down Expand Up @@ -150,8 +151,10 @@ export declare class DexTreeTable extends LitElement {
columnLabels: Record<string, string> | null;
/**
* The group heading each column sits under in the Columns menu, by column key. The columns are
* shown group by group, and the user moves a column within its group only, in the menu and by
* its header. Default null: no headings. Property only.
* shown group by group, and the user moves a column within its group only, in the menu (by drag
* or Alt+↑/↓) and by its header. Each heading folds its group, opening expanded when the group
* shows a column, and its box shows or hides the group's columns at once. Default null: no
* headings. Property only.
*/
columnGroups: Record<string, string> | null;
/**
Expand Down Expand Up @@ -367,6 +370,7 @@ export declare class DexTreeTable extends LitElement {
private _columnMenuX;
private _columnMenuY;
private _columnMenuMaxHeight;
private _columnMenuAnnouncement;
private _menuDragCol;
private _menuDragOverCol;
private _menuDragOverSide;
Expand Down Expand Up @@ -443,6 +447,17 @@ export declare class DexTreeTable extends LitElement {
*/
beginRename(rowId: string): boolean;
private _onColumnsButtonClick;
private _focusColumnMenu;
private _columnMenuRuns;
private _columnMenuGroups;
private _groupStateKey;
private _isGroupExpanded;
private _keepGroupsExpanded;
private _toggleGroupFold;
private _checkGroup;
private _onMenuItemKeyDown;
private _menuRunOf;
private _onColumnMenuKeyDown;
private _openColumnFilter;
private _onHeaderContextMenu;
private _onFunnelClick;
Expand Down Expand Up @@ -634,6 +649,7 @@ export declare class DexTreeTable extends LitElement {
private _renderColumnsButton;
private _renderColumnFilterPopup;
private _renderColumnMenu;
private _renderColumnMenuGroupHeader;
private _renderColumnMenuItem;
}
/**
Expand Down
Loading
Loading