@bigpixelrocket/uiok 0.2.2 → 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/CHANGELOG.md +62 -1
- package/dist/button/TextLink.d.ts +27 -0
- package/dist/button/TextLink.js +15 -0
- package/dist/button/button.css +48 -0
- package/dist/button/index.d.ts +2 -1
- package/dist/button/index.js +2 -1
- package/dist/charts/Sparkline.d.ts +20 -0
- package/dist/charts/Sparkline.js +12 -0
- package/dist/charts/Sparkline.logic.d.ts +9 -0
- package/dist/charts/Sparkline.logic.js +27 -0
- package/dist/charts/charts.css +17 -0
- package/dist/charts/index.d.ts +2 -0
- package/dist/charts/index.js +2 -0
- package/dist/dialog/ConfirmDialog.d.ts +17 -1
- package/dist/dialog/ConfirmDialog.js +10 -4
- package/dist/dialog/DialogLists.d.ts +8 -1
- package/dist/dialog/DialogLists.js +3 -2
- package/dist/dialog/ModalDialog.d.ts +8 -0
- package/dist/dialog/ModalDialog.js +4 -2
- package/dist/dialog/ProgressDialog.d.ts +34 -0
- package/dist/dialog/ProgressDialog.js +40 -0
- package/dist/dialog/TypedNameDialog.d.ts +36 -0
- package/dist/dialog/TypedNameDialog.js +17 -0
- package/dist/dialog/index.d.ts +5 -2
- package/dist/dialog/index.js +4 -1
- package/dist/field/Switch.d.ts +26 -0
- package/dist/field/Switch.js +20 -0
- package/dist/field/field.css +110 -2
- package/dist/field/index.d.ts +3 -2
- package/dist/field/index.js +3 -2
- package/dist/filter/filter.css +16 -0
- package/dist/frame/AppRoot.d.ts +44 -0
- package/dist/frame/AppRoot.js +26 -0
- package/dist/frame/Dock.d.ts +88 -0
- package/dist/frame/Dock.js +129 -0
- package/dist/frame/FilterChips.d.ts +28 -0
- package/dist/frame/FilterChips.js +14 -0
- package/dist/frame/PageParts.d.ts +69 -0
- package/dist/frame/PageParts.js +60 -0
- package/dist/frame/PaneSplit.d.ts +74 -0
- package/dist/frame/PaneSplit.js +197 -0
- package/dist/frame/SidebarResizer.d.ts +35 -0
- package/dist/frame/SidebarResizer.js +43 -0
- package/dist/frame/StatusNotice.d.ts +20 -0
- package/dist/frame/StatusNotice.js +13 -0
- package/dist/frame/Tree.d.ts +140 -0
- package/dist/frame/Tree.js +141 -0
- package/dist/frame/TreeToggle.d.ts +18 -0
- package/dist/frame/TreeToggle.js +17 -0
- package/dist/frame/WindowFrame.d.ts +57 -0
- package/dist/frame/WindowFrame.js +19 -0
- package/dist/frame/frame.css +801 -0
- package/dist/frame/index.d.ts +22 -0
- package/dist/frame/index.js +22 -0
- package/dist/frame/sharedRef.d.ts +8 -0
- package/dist/frame/sharedRef.js +26 -0
- package/dist/grid/DataGrid.d.ts +10 -2
- package/dist/grid/DataGrid.js +47 -13
- package/dist/grid/DataGrid.logic.d.ts +16 -0
- package/dist/grid/DataGrid.logic.js +28 -0
- package/dist/grid/grid.css +128 -4
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/labels/UiokLabels.d.ts +6 -0
- package/dist/labels/UiokLabels.js +5 -1
- package/dist/labels/dialog.d.ts +12 -0
- package/dist/labels/dialog.js +7 -1
- package/dist/labels/index.d.ts +2 -0
- package/dist/labels/index.js +2 -0
- package/dist/labels/keys.js +2 -0
- package/dist/labels/paneTabs.d.ts +27 -0
- package/dist/labels/paneTabs.js +10 -0
- package/dist/labels/selectAll.d.ts +4 -1
- package/dist/labels/selectAll.js +1 -1
- package/dist/labels/settings.d.ts +46 -0
- package/dist/labels/settings.js +29 -0
- package/dist/legend/KeyLegendStrip.d.ts +9 -1
- package/dist/legend/KeyLegendStrip.js +119 -5
- package/dist/legend/legend.css +52 -0
- package/dist/listing/EmptyState.d.ts +40 -0
- package/dist/listing/EmptyState.js +14 -0
- package/dist/listing/Listing.d.ts +23 -5
- package/dist/listing/Listing.js +11 -8
- package/dist/listing/index.d.ts +3 -1
- package/dist/listing/index.js +3 -1
- package/dist/listing/listing.css +172 -5
- package/dist/log/LogWell.d.ts +34 -0
- package/dist/log/LogWell.js +39 -0
- package/dist/log/LogWell.logic.d.ts +16 -0
- package/dist/log/LogWell.logic.js +26 -0
- package/dist/log/index.d.ts +8 -0
- package/dist/log/index.js +8 -0
- package/dist/log/log.css +57 -0
- package/dist/pane/Pane.d.ts +49 -0
- package/dist/pane/Pane.js +17 -0
- package/dist/pane/PaneActions.d.ts +3 -1
- package/dist/pane/PaneActions.js +6 -5
- package/dist/pane/PaneKeys.d.ts +10 -3
- package/dist/pane/PaneKeys.js +26 -7
- package/dist/pane/PaneTabs.d.ts +92 -0
- package/dist/pane/PaneTabs.js +326 -0
- package/dist/pane/PaneTabs.logic.d.ts +97 -0
- package/dist/pane/PaneTabs.logic.js +158 -0
- package/dist/pane/index.d.ts +7 -1
- package/dist/pane/index.js +7 -1
- package/dist/pane/panetabs.css +408 -0
- package/dist/pane/usePaneKeys.js +9 -11
- package/dist/pane/useTabDrag.d.ts +49 -0
- package/dist/pane/useTabDrag.js +306 -0
- package/dist/segmented/SegmentedChoice.d.ts +8 -1
- package/dist/segmented/SegmentedChoice.js +7 -4
- package/dist/shell/AboutWindow.d.ts +21 -0
- package/dist/shell/AboutWindow.js +10 -0
- package/dist/shell/LanguageChoice.d.ts +27 -0
- package/dist/shell/LanguageChoice.js +17 -0
- package/dist/shell/LoadFailure.d.ts +22 -0
- package/dist/shell/LoadFailure.js +15 -0
- package/dist/shell/Lockup.d.ts +52 -0
- package/dist/shell/Lockup.js +30 -0
- package/dist/shell/SettingsDialog.d.ts +97 -0
- package/dist/shell/SettingsDialog.js +219 -0
- package/dist/shell/SettingsDialog.logic.d.ts +33 -0
- package/dist/shell/SettingsDialog.logic.js +42 -0
- package/dist/shell/SettingsFiles.d.ts +55 -0
- package/dist/shell/SettingsFiles.js +30 -0
- package/dist/shell/SettingsPageKeys.d.ts +42 -0
- package/dist/shell/SettingsPageKeys.js +70 -0
- package/dist/shell/SettingsSubsection.d.ts +34 -0
- package/dist/shell/SettingsSubsection.js +30 -0
- package/dist/shell/SignIn.d.ts +61 -0
- package/dist/shell/SignIn.js +36 -0
- package/dist/shell/ThemePicker.d.ts +74 -0
- package/dist/shell/ThemePicker.js +96 -0
- package/dist/shell/ThemePicker.logic.d.ts +13 -0
- package/dist/shell/ThemePicker.logic.js +26 -0
- package/dist/shell/TitleBar.d.ts +44 -0
- package/dist/shell/TitleBar.js +23 -0
- package/dist/shell/UpdatePill.d.ts +26 -0
- package/dist/shell/UpdatePill.js +17 -0
- package/dist/shell/Updates.d.ts +99 -0
- package/dist/shell/Updates.js +72 -0
- package/dist/shell/index.d.ts +27 -0
- package/dist/shell/index.js +27 -0
- package/dist/shell/shell.css +243 -4
- package/dist/styles.css +10 -0
- package/dist/surface/GroupSwatch.d.ts +22 -0
- package/dist/surface/GroupSwatch.js +15 -0
- package/dist/surface/Tag.d.ts +26 -0
- package/dist/surface/Tag.js +12 -0
- package/dist/surface/index.d.ts +7 -0
- package/dist/surface/index.js +7 -0
- package/dist/surface/surface.css +116 -1
- package/dist/themes/catalog.js +4 -0
- package/dist/themes/themes.generated.css +244 -0
- package/dist/themes/tokens.d.ts +17 -5
- package/dist/themes/tokens.js +75 -1
- package/dist/tokens.css +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The window frame, every part of it a component: the app's root and its
|
|
3
|
+
* content panel (`AppRoot`, `SpacePanel`), the window's grid
|
|
4
|
+
* (`WindowFrame`, with the `SidebarResizer`), the sidebar's tree
|
|
5
|
+
* (`TreePane`, `TreeList`, `TreeRow` with its `TreeToggle`, `TreeTool`,
|
|
6
|
+
* `TreeFilterInput`, `SidebarEmpty`), a pane's quick row of `FilterChips`
|
|
7
|
+
* and its `PaneWarning`, a pane status line's `StatusNotice`, the `Dock`
|
|
8
|
+
* with its log and input, the splitter between a list and the pane under
|
|
9
|
+
* it (`usePaneSplit`, `PaneSplitter`, `SplitDetail`), and a page's parts
|
|
10
|
+
* (`PageSlot`, `PanePage`, `Toolbar`, `PageNote`, `SectionHead`, and the
|
|
11
|
+
* rest). Their look is `frame.css` in `@bigpixelrocket/uiok/styles.css`.
|
|
12
|
+
*/
|
|
13
|
+
export { AppRoot, PageSlot, SpacePanel, type AppRootProps, type PageSlotProps, type SpacePanelProps } from './AppRoot.js';
|
|
14
|
+
export { Dock, dockHeight, DockInput, DockLog, DockLogEntry, type DockInputProps, type DockLogEntryProps, type DockLogProps, type DockProps } from './Dock.js';
|
|
15
|
+
export { FilterChips, type FilterChip, type FilterChipsProps } from './FilterChips.js';
|
|
16
|
+
export { EmptyAction, FootBar, PageFilter, PageNote, PanePage, PaneWarning, SectionHead, ShowSidebarButton, Toolbar, ToolbarGap, ToolbarGrow, type PageNoteProps, type PagePartProps, type SectionHeadProps, type ShowSidebarButtonProps, type ToolbarProps } from './PageParts.js';
|
|
17
|
+
export { cutRowDepth, heldSplitHeight, PaneSplitter, SplitDetail, usePaneSplit, type PaneSplit, type PaneSplitterProps, type SplitDetailProps } from './PaneSplit.js';
|
|
18
|
+
export { draggedWidth, SidebarResizer, type SidebarResizerProps } from './SidebarResizer.js';
|
|
19
|
+
export { StatusNotice, type StatusNoticeProps, type StatusNoticeTone } from './StatusNotice.js';
|
|
20
|
+
export { SidebarEmpty, TreeFilterInput, TreeList, TreePane, TreeRow, TreeTool, type SidebarEmptyProps, type TreeFilterInputProps, type TreeListProps, type TreePaneProps, type TreeRowKind, type TreeRowProps, type TreeRowToggle, type TreeToolKind, type TreeToolProps } from './Tree.js';
|
|
21
|
+
export { TreeToggle, type TreeToggleProps } from './TreeToggle.js';
|
|
22
|
+
export { WindowFrame, type WindowFrameGroup, type WindowFrameProps } from './WindowFrame.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The window frame, every part of it a component: the app's root and its
|
|
3
|
+
* content panel (`AppRoot`, `SpacePanel`), the window's grid
|
|
4
|
+
* (`WindowFrame`, with the `SidebarResizer`), the sidebar's tree
|
|
5
|
+
* (`TreePane`, `TreeList`, `TreeRow` with its `TreeToggle`, `TreeTool`,
|
|
6
|
+
* `TreeFilterInput`, `SidebarEmpty`), a pane's quick row of `FilterChips`
|
|
7
|
+
* and its `PaneWarning`, a pane status line's `StatusNotice`, the `Dock`
|
|
8
|
+
* with its log and input, the splitter between a list and the pane under
|
|
9
|
+
* it (`usePaneSplit`, `PaneSplitter`, `SplitDetail`), and a page's parts
|
|
10
|
+
* (`PageSlot`, `PanePage`, `Toolbar`, `PageNote`, `SectionHead`, and the
|
|
11
|
+
* rest). Their look is `frame.css` in `@bigpixelrocket/uiok/styles.css`.
|
|
12
|
+
*/
|
|
13
|
+
export { AppRoot, PageSlot, SpacePanel } from './AppRoot.js';
|
|
14
|
+
export { Dock, dockHeight, DockInput, DockLog, DockLogEntry } from './Dock.js';
|
|
15
|
+
export { FilterChips } from './FilterChips.js';
|
|
16
|
+
export { EmptyAction, FootBar, PageFilter, PageNote, PanePage, PaneWarning, SectionHead, ShowSidebarButton, Toolbar, ToolbarGap, ToolbarGrow } from './PageParts.js';
|
|
17
|
+
export { cutRowDepth, heldSplitHeight, PaneSplitter, SplitDetail, usePaneSplit } from './PaneSplit.js';
|
|
18
|
+
export { draggedWidth, SidebarResizer } from './SidebarResizer.js';
|
|
19
|
+
export { StatusNotice } from './StatusNotice.js';
|
|
20
|
+
export { SidebarEmpty, TreeFilterInput, TreeList, TreePane, TreeRow, TreeTool } from './Tree.js';
|
|
21
|
+
export { TreeToggle } from './TreeToggle.js';
|
|
22
|
+
export { WindowFrame } from './WindowFrame.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Ref, type RefCallback, type RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A component's own ref to its element, shared with the ref its host
|
|
4
|
+
* passes: the callback hands the element to both, and its cleanup clears
|
|
5
|
+
* both, running the cleanup a host's callback ref returned (React 19) or
|
|
6
|
+
* calling it with null when it returned none. Internal to the frame area.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useSharedRef<T>(ref: Ref<T> | undefined): readonly [RefObject<T | null>, RefCallback<T>];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A component's own ref to its element, shared with the ref its host
|
|
4
|
+
* passes: the callback hands the element to both, and its cleanup clears
|
|
5
|
+
* both, running the cleanup a host's callback ref returned (React 19) or
|
|
6
|
+
* calling it with null when it returned none. Internal to the frame area.
|
|
7
|
+
*/
|
|
8
|
+
export function useSharedRef(ref) {
|
|
9
|
+
const own = useRef(null);
|
|
10
|
+
const attach = useCallback((element) => {
|
|
11
|
+
own.current = element;
|
|
12
|
+
const cleanup = typeof ref === 'function' ? ref(element) : undefined;
|
|
13
|
+
if (typeof ref !== 'function' && ref !== null && ref !== undefined)
|
|
14
|
+
ref.current = element;
|
|
15
|
+
return () => {
|
|
16
|
+
own.current = null;
|
|
17
|
+
if (typeof cleanup === 'function')
|
|
18
|
+
cleanup();
|
|
19
|
+
else if (typeof ref === 'function')
|
|
20
|
+
ref(null);
|
|
21
|
+
else if (ref !== null && ref !== undefined)
|
|
22
|
+
ref.current = null;
|
|
23
|
+
};
|
|
24
|
+
}, [ref]);
|
|
25
|
+
return [own, attach];
|
|
26
|
+
}
|
package/dist/grid/DataGrid.d.ts
CHANGED
|
@@ -86,6 +86,13 @@ export interface DataGridProps {
|
|
|
86
86
|
readonly rowLead?: (row: number) => ReactNode;
|
|
87
87
|
/** The width of the lead's column, the same on every row, in pixels. */
|
|
88
88
|
readonly leadWidth?: number;
|
|
89
|
+
/**
|
|
90
|
+
* How many leading columns stay in view while the grid scrolls sideways
|
|
91
|
+
* (a key, a name), after the row's lead, which stays with them; a hairline
|
|
92
|
+
* marks the pin edge, and a header dragged to a new place never crosses
|
|
93
|
+
* it. None when absent or 0.
|
|
94
|
+
*/
|
|
95
|
+
readonly pinnedColumns?: number;
|
|
89
96
|
/** A control at a row's end, after its cells (Stop on a list of running jobs). */
|
|
90
97
|
readonly rowAction?: (row: number) => ReactNode;
|
|
91
98
|
/** The width of the row's end column, in pixels; as wide as it asks when absent. */
|
|
@@ -155,7 +162,8 @@ export interface DataGridProps {
|
|
|
155
162
|
* What a caller adds, each only where it passes its handler: headers that
|
|
156
163
|
* sort (Shift adds a column to the sort, Option or Control takes it out),
|
|
157
164
|
* that drag to a new place, that copy their name on a double-click, and
|
|
158
|
-
* that mark their column on a click;
|
|
165
|
+
* that mark their column on a click; leading columns pinned in view while
|
|
166
|
+
* the rest scroll sideways (`pinnedColumns`); controls at each row's start and end;
|
|
159
167
|
* rows that mark on a click or Space; the row under the pointer lit; and
|
|
160
168
|
* inline edit: a click or a double-click on an editable cell (`editTrigger`),
|
|
161
169
|
* or Return on the cursor cell when it holds no link, asks to edit it
|
|
@@ -163,4 +171,4 @@ export interface DataGridProps {
|
|
|
163
171
|
* a double-click starting an edit, a link cell's single click waits a
|
|
164
172
|
* moment, so a double-click edits it rather than following it.
|
|
165
173
|
*/
|
|
166
|
-
export declare function DataGrid({ label, columns, rowCount, cell, copyText, onNeedRows, rowLead, leadWidth, rowAction, actionWidth, sort, sorts, onSort, onReorder, onHeaderDoubleClick, markedColumns, onMarkColumn, rowMarked, onMarkRow, pointer, maxHeight, editable, editTrigger, onEdit, editor, editorContainer, empty }: DataGridProps): ReactElement;
|
|
174
|
+
export declare function DataGrid({ label, columns, rowCount, cell, copyText, onNeedRows, rowLead, leadWidth, pinnedColumns, rowAction, actionWidth, sort, sorts, onSort, onReorder, onHeaderDoubleClick, markedColumns, onMarkColumn, rowMarked, onMarkRow, pointer, maxHeight, editable, editTrigger, onEdit, editor, editorContainer, empty }: DataGridProps): ReactElement;
|
package/dist/grid/DataGrid.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useId, useLayoutEffect, useReducer, useRef, useState } from 'react';
|
|
3
3
|
import { ChevronDown, ChevronUp } from 'lucide-react';
|
|
4
4
|
import { createPortal, flushSync } from 'react-dom';
|
|
5
|
-
import { dropPlace, editorLeft, gridMove, initialWidth, movedCell, resizedWidth, visibleRows, windowHolds } from './DataGrid.logic.js';
|
|
5
|
+
import { dropPlace, editorLeft, gridMove, initialWidth, movedCell, pinnedDropPlace, resizedWidth, revealedScrollLeft, visibleRows, windowHolds } from './DataGrid.logic.js';
|
|
6
6
|
import { ICON_SM } from '../icon/index.js';
|
|
7
7
|
import { cutTooltip, describedTooltip } from '../tooltip/Tooltip.logic.js';
|
|
8
8
|
/** Every row's height, so the grid can place any row without measuring it. */
|
|
@@ -45,7 +45,8 @@ const FADE_MIN_OVERFLOW = 12;
|
|
|
45
45
|
* What a caller adds, each only where it passes its handler: headers that
|
|
46
46
|
* sort (Shift adds a column to the sort, Option or Control takes it out),
|
|
47
47
|
* that drag to a new place, that copy their name on a double-click, and
|
|
48
|
-
* that mark their column on a click;
|
|
48
|
+
* that mark their column on a click; leading columns pinned in view while
|
|
49
|
+
* the rest scroll sideways (`pinnedColumns`); controls at each row's start and end;
|
|
49
50
|
* rows that mark on a click or Space; the row under the pointer lit; and
|
|
50
51
|
* inline edit: a click or a double-click on an editable cell (`editTrigger`),
|
|
51
52
|
* or Return on the cursor cell when it holds no link, asks to edit it
|
|
@@ -53,7 +54,7 @@ const FADE_MIN_OVERFLOW = 12;
|
|
|
53
54
|
* a double-click starting an edit, a link cell's single click waits a
|
|
54
55
|
* moment, so a double-click edits it rather than following it.
|
|
55
56
|
*/
|
|
56
|
-
export function DataGrid({ label, columns, rowCount, cell, copyText, onNeedRows, rowLead, leadWidth = 0, rowAction, actionWidth, sort, sorts, onSort, onReorder, onHeaderDoubleClick, markedColumns, onMarkColumn, rowMarked, onMarkRow, pointer = false, maxHeight = 420, editable, editTrigger = 'double-click', onEdit, editor = null, editorContainer, empty }) {
|
|
57
|
+
export function DataGrid({ label, columns, rowCount, cell, copyText, onNeedRows, rowLead, leadWidth = 0, pinnedColumns = 0, rowAction, actionWidth, sort, sorts, onSort, onReorder, onHeaderDoubleClick, markedColumns, onMarkColumn, rowMarked, onMarkRow, pointer = false, maxHeight = 420, editable, editTrigger = 'double-click', onEdit, editor = null, editorContainer, empty }) {
|
|
57
58
|
const id = useId();
|
|
58
59
|
const viewport = useRef(null);
|
|
59
60
|
/** The frame around the scrolling well, which an editor's layer keeps inside. */
|
|
@@ -111,6 +112,22 @@ export function DataGrid({ label, columns, rowCount, cell, copyText, onNeedRows,
|
|
|
111
112
|
.filter((part) => part !== null)
|
|
112
113
|
.join(' ');
|
|
113
114
|
const page = Math.max(1, Math.floor(viewportHeight / ROW_HEIGHT) - 1);
|
|
115
|
+
/** The columns pinned, never more than there are. */
|
|
116
|
+
const pinned = Math.max(0, Math.min(Math.floor(pinnedColumns), columns.length));
|
|
117
|
+
/** Where each column starts from the rows' start, the lead included, and where the last ends. */
|
|
118
|
+
const starts = columns.reduce((edges, column, index) => [...edges, (edges[index] ?? 0) + widthOf(column, index)], [rowLead === undefined ? 0 : leadWidth]);
|
|
119
|
+
/** How wide the part that stays in view is: the lead and the pinned columns. */
|
|
120
|
+
const pinnedWidth = pinned === 0 ? 0 : (starts[pinned] ?? 0);
|
|
121
|
+
/** A pinned column's or lead's class and sticky offset; nothing for one that scrolls. */
|
|
122
|
+
const pinning = (index) => {
|
|
123
|
+
if (pinned === 0 || (index !== 'lead' && index >= pinned))
|
|
124
|
+
return { className: '' };
|
|
125
|
+
return {
|
|
126
|
+
className: index === pinned - 1 ? 'pinned pin-edge' : 'pinned',
|
|
127
|
+
style: { insetInlineStart: index === 'lead' ? 0 : starts[index] }
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
const leadPin = pinning('lead');
|
|
114
131
|
// A column that does not sort shows no mark, whatever the sort names, and is not counted.
|
|
115
132
|
const marks = (sorts ?? (sort === null || sort === undefined ? [] : [{ ...sort, position: 1 }])).filter((mark) => columns[mark.column]?.sortable !== false);
|
|
116
133
|
useLayoutEffect(() => {
|
|
@@ -232,11 +249,21 @@ export function DataGrid({ label, columns, rowCount, cell, copyText, onNeedRows,
|
|
|
232
249
|
: editorLeft(editorBox.left - 1, layer.getBoundingClientRect().width, editorBox.well, EDITOR_MARGIN);
|
|
233
250
|
setEditorShift((held) => (held === next ? held : next));
|
|
234
251
|
}, [editorBox, editor]);
|
|
235
|
-
/**
|
|
236
|
-
|
|
252
|
+
/**
|
|
253
|
+
* Scrolls a cell into the viewport: its row below the header, its column
|
|
254
|
+
* past the pinned ones. The sideways scroll is measured from the rows'
|
|
255
|
+
* start: a right-to-left well's scrollLeft runs from 0 down, so it is
|
|
256
|
+
* read and written with its sign turned.
|
|
257
|
+
*/
|
|
258
|
+
const reveal = (row, column) => {
|
|
237
259
|
const element = viewport.current;
|
|
238
260
|
if (element === null)
|
|
239
261
|
return;
|
|
262
|
+
const sign = getComputedStyle(element).direction === 'rtl' ? -1 : 1;
|
|
263
|
+
const from = sign * element.scrollLeft;
|
|
264
|
+
const to = revealedScrollLeft(from, element.clientWidth, starts[column] ?? 0, starts[column + 1] ?? 0, pinnedWidth);
|
|
265
|
+
if (to !== from)
|
|
266
|
+
element.scrollLeft = sign * to;
|
|
240
267
|
const top = row * ROW_HEIGHT;
|
|
241
268
|
const shown = element.clientHeight - ROW_HEIGHT;
|
|
242
269
|
if (top < element.scrollTop)
|
|
@@ -273,7 +300,7 @@ export function DataGrid({ label, columns, rowCount, cell, copyText, onNeedRows,
|
|
|
273
300
|
return;
|
|
274
301
|
event.preventDefault();
|
|
275
302
|
setCursor(next);
|
|
276
|
-
reveal(next.row);
|
|
303
|
+
reveal(next.row, next.column);
|
|
277
304
|
};
|
|
278
305
|
const onResizeStart = (event, column) => {
|
|
279
306
|
if (event.button !== 0)
|
|
@@ -315,7 +342,10 @@ export function DataGrid({ label, columns, rowCount, cell, copyText, onNeedRows,
|
|
|
315
342
|
moving = true;
|
|
316
343
|
target.setPointerCapture(event.pointerId);
|
|
317
344
|
}
|
|
318
|
-
setDragging({
|
|
345
|
+
setDragging({
|
|
346
|
+
from: column,
|
|
347
|
+
to: pinnedDropPlace(dropPlace(move.clientX, headingEdges(), column), column, pinned)
|
|
348
|
+
});
|
|
319
349
|
};
|
|
320
350
|
const onUp = (up) => {
|
|
321
351
|
target.removeEventListener('pointermove', onMove);
|
|
@@ -325,7 +355,7 @@ export function DataGrid({ label, columns, rowCount, cell, copyText, onNeedRows,
|
|
|
325
355
|
return;
|
|
326
356
|
dragged.current = true;
|
|
327
357
|
setDragging(null);
|
|
328
|
-
const place = dropPlace(up.clientX, headingEdges(), column);
|
|
358
|
+
const place = pinnedDropPlace(dropPlace(up.clientX, headingEdges(), column), column, pinned);
|
|
329
359
|
if (place !== column)
|
|
330
360
|
onReorder(column, place);
|
|
331
361
|
};
|
|
@@ -351,8 +381,9 @@ export function DataGrid({ label, columns, rowCount, cell, copyText, onNeedRows,
|
|
|
351
381
|
const rows = [];
|
|
352
382
|
for (let row = from; row < to; row += 1) {
|
|
353
383
|
const marked = rowMarked?.(row) ?? false;
|
|
354
|
-
rows.push(_jsxs("div", { "aria-rowindex": row + 2, "aria-selected": onMarkRow === undefined ? undefined : marked, className: marked ? 'data-grid-row marked' : 'data-grid-row', role: "row", style: { gridTemplateColumns: template, transform: `translateY(${row * ROW_HEIGHT}px)` }, children: [rowLead !== undefined && _jsx("div", { className:
|
|
384
|
+
rows.push(_jsxs("div", { "aria-rowindex": row + 2, "aria-selected": onMarkRow === undefined ? undefined : marked, className: marked ? 'data-grid-row marked' : 'data-grid-row', role: "row", style: { gridTemplateColumns: template, transform: `translateY(${row * ROW_HEIGHT}px)` }, children: [rowLead !== undefined && (_jsx("div", { className: ['data-grid-lead', leadPin.className].filter(Boolean).join(' '), style: leadPin.style, children: rowLead(row) })), columns.map((column, index) => {
|
|
355
385
|
const shown = cell(row, index);
|
|
386
|
+
const pin = pinning(index);
|
|
356
387
|
const current = cursor?.row === row && cursor.column === index;
|
|
357
388
|
const editing = editor !== null && editor.row === row && editor.column === index;
|
|
358
389
|
const edits = canEdit(row, index);
|
|
@@ -362,6 +393,7 @@ export function DataGrid({ label, columns, rowCount, cell, copyText, onNeedRows,
|
|
|
362
393
|
current ? 'cursor' : '',
|
|
363
394
|
markedColumns?.has(index) === true ? 'marked' : '',
|
|
364
395
|
editing ? 'editing' : '',
|
|
396
|
+
pin.className,
|
|
365
397
|
shown?.className ?? ''
|
|
366
398
|
]
|
|
367
399
|
.filter(Boolean)
|
|
@@ -377,7 +409,7 @@ export function DataGrid({ label, columns, rowCount, cell, copyText, onNeedRows,
|
|
|
377
409
|
window.clearTimeout(pendingLink.current);
|
|
378
410
|
pendingLink.current = null;
|
|
379
411
|
onEdit?.(row, index);
|
|
380
|
-
}, onPointerDown: () => setCursor({ row, column: index }), role: "gridcell", ...describedTooltip(shown?.tip ?? null), children: [shown?.content !== undefined ? (shown.content) : shown?.onOpen === undefined ? ((shown?.text ?? '')) : (_jsx("button", { className: "data-grid-link", onClick: (event) => {
|
|
412
|
+
}, onPointerDown: () => setCursor({ row, column: index }), role: "gridcell", style: pin.style, ...describedTooltip(shown?.tip ?? null), children: [shown?.content !== undefined ? (shown.content) : shown?.onOpen === undefined ? ((shown?.text ?? '')) : (_jsx("button", { className: "data-grid-link", onClick: (event) => {
|
|
381
413
|
event.stopPropagation();
|
|
382
414
|
const open = shown.onOpen;
|
|
383
415
|
if (edits && editTrigger === 'double-click') {
|
|
@@ -416,8 +448,9 @@ export function DataGrid({ label, columns, rowCount, cell, copyText, onNeedRows,
|
|
|
416
448
|
// by the fade's width) never erases them.
|
|
417
449
|
return (_jsx("div", { className: pointer ? 'data-grid pointer' : 'data-grid', ref: frame,
|
|
418
450
|
// The frame's own height, border included; the well fills what is left.
|
|
419
|
-
style: { maxHeight: maxHeight }, children: _jsxs("div", { "aria-activedescendant": cursor === null ? undefined : cellId(cursor.row, cursor.column), "aria-colcount": columns.length, "aria-label": label, "aria-multiselectable": onMarkRow === undefined ? undefined : true, "aria-rowcount": rowCount + 1, className: fades ? 'data-grid-scroll scroll-fade-x' : 'data-grid-scroll', onKeyDown: onKeyDown, ref: viewport, role: "grid", tabIndex: 0, children: [_jsxs("div", { "aria-rowindex": 1, className: "data-grid-header", ref: header, role: "row", style: { gridTemplateColumns: template }, children: [rowLead !== undefined && _jsx("div", { className:
|
|
451
|
+
style: { maxHeight: maxHeight }, children: _jsxs("div", { "aria-activedescendant": cursor === null ? undefined : cellId(cursor.row, cursor.column), "aria-colcount": columns.length, "aria-label": label, "aria-multiselectable": onMarkRow === undefined ? undefined : true, "aria-rowcount": rowCount + 1, className: fades ? 'data-grid-scroll scroll-fade-x' : 'data-grid-scroll', onKeyDown: onKeyDown, ref: viewport, role: "grid", tabIndex: 0, children: [_jsxs("div", { "aria-rowindex": 1, className: "data-grid-header", ref: header, role: "row", style: { gridTemplateColumns: template }, children: [rowLead !== undefined && (_jsx("div", { className: ['data-grid-lead', leadPin.className].filter(Boolean).join(' '), style: leadPin.style })), columns.map((column, index) => {
|
|
420
452
|
const sortable = sortsBy(column);
|
|
453
|
+
const pin = pinning(index);
|
|
421
454
|
const mark = marks.find((entry) => entry.column === index);
|
|
422
455
|
return (_jsxs("div", { "aria-colindex": index + 1, "aria-sort": mark?.direction, className: [
|
|
423
456
|
'data-grid-heading',
|
|
@@ -429,14 +462,15 @@ export function DataGrid({ label, columns, rowCount, cell, copyText, onNeedRows,
|
|
|
429
462
|
? 'drop-before'
|
|
430
463
|
: 'drop-after'
|
|
431
464
|
: '',
|
|
432
|
-
onReorder === undefined ? '' : 'draggable'
|
|
465
|
+
onReorder === undefined ? '' : 'draggable',
|
|
466
|
+
pin.className
|
|
433
467
|
]
|
|
434
468
|
.filter(Boolean)
|
|
435
469
|
.join(' '), onClick: (event) => {
|
|
436
470
|
if (draggedClick(event))
|
|
437
471
|
return;
|
|
438
472
|
onMarkColumn?.(index);
|
|
439
|
-
}, onDoubleClick: () => onHeaderDoubleClick?.(index), onPointerDown: (event) => onHeadingPointerDown(event, index), role: "columnheader", ...(column.tip === undefined
|
|
473
|
+
}, onDoubleClick: () => onHeaderDoubleClick?.(index), onPointerDown: (event) => onHeadingPointerDown(event, index), role: "columnheader", style: pin.style, ...(column.tip === undefined
|
|
440
474
|
? sortable
|
|
441
475
|
? {}
|
|
442
476
|
: cutTooltip(column.label)
|
|
@@ -57,6 +57,22 @@ export declare function dropPlace(x: number, edges: readonly {
|
|
|
57
57
|
readonly left: number;
|
|
58
58
|
readonly right: number;
|
|
59
59
|
}[], from: number): number;
|
|
60
|
+
/**
|
|
61
|
+
* Where a header dragged from `from` may land, given `place` under the
|
|
62
|
+
* pointer, in a grid whose first `pinned` columns stay in view: a pinned
|
|
63
|
+
* column stays among the pinned ones and any other among the rest, so a
|
|
64
|
+
* reorder never crosses the pin edge.
|
|
65
|
+
*/
|
|
66
|
+
export declare function pinnedDropPlace(place: number, from: number, pinned: number): number;
|
|
67
|
+
/**
|
|
68
|
+
* Where a well scrolled sideways to `scrollLeft`, `width` pixels wide, scrolls
|
|
69
|
+
* to show a column spanning `left` to `right` (from the rows' start), when
|
|
70
|
+
* the first `pinned` pixels stay in view over whatever scrolls under them:
|
|
71
|
+
* the least scroll that shows the column whole past the pinned ones, its
|
|
72
|
+
* start first when it is wider than the room. A column inside the pinned
|
|
73
|
+
* part, or one already in view, leaves the scroll where it is.
|
|
74
|
+
*/
|
|
75
|
+
export declare function revealedScrollLeft(scrollLeft: number, width: number, left: number, right: number, pinned?: number): number;
|
|
60
76
|
/**
|
|
61
77
|
* Where the inline editor's layer starts, in window pixels: over its cell
|
|
62
78
|
* (`left`), unless a layer wider than the cell would cross the well's right
|
|
@@ -121,6 +121,34 @@ export function dropPlace(x, edges, from) {
|
|
|
121
121
|
return at;
|
|
122
122
|
return x < (edges[0]?.left ?? 0) ? 0 : edges.length - 1;
|
|
123
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Where a header dragged from `from` may land, given `place` under the
|
|
126
|
+
* pointer, in a grid whose first `pinned` columns stay in view: a pinned
|
|
127
|
+
* column stays among the pinned ones and any other among the rest, so a
|
|
128
|
+
* reorder never crosses the pin edge.
|
|
129
|
+
*/
|
|
130
|
+
export function pinnedDropPlace(place, from, pinned) {
|
|
131
|
+
if (pinned <= 0)
|
|
132
|
+
return place;
|
|
133
|
+
return from < pinned ? Math.min(place, pinned - 1) : Math.max(place, pinned);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Where a well scrolled sideways to `scrollLeft`, `width` pixels wide, scrolls
|
|
137
|
+
* to show a column spanning `left` to `right` (from the rows' start), when
|
|
138
|
+
* the first `pinned` pixels stay in view over whatever scrolls under them:
|
|
139
|
+
* the least scroll that shows the column whole past the pinned ones, its
|
|
140
|
+
* start first when it is wider than the room. A column inside the pinned
|
|
141
|
+
* part, or one already in view, leaves the scroll where it is.
|
|
142
|
+
*/
|
|
143
|
+
export function revealedScrollLeft(scrollLeft, width, left, right, pinned = 0) {
|
|
144
|
+
if (width <= 0 || left < pinned)
|
|
145
|
+
return scrollLeft;
|
|
146
|
+
if (left < scrollLeft + pinned)
|
|
147
|
+
return Math.max(0, left - pinned);
|
|
148
|
+
if (right > scrollLeft + width)
|
|
149
|
+
return Math.max(0, Math.min(left - pinned, right - width));
|
|
150
|
+
return scrollLeft;
|
|
151
|
+
}
|
|
124
152
|
/**
|
|
125
153
|
* Where the inline editor's layer starts, in window pixels: over its cell
|
|
126
154
|
* (`left`), unless a layer wider than the cell would cross the well's right
|
package/dist/grid/grid.css
CHANGED
|
@@ -11,7 +11,12 @@
|
|
|
11
11
|
The frame fills the width it is given, as a desktop table view fills its
|
|
12
12
|
pane: the header band and the rows run on past the last column, which
|
|
13
13
|
leaves the slack as an empty filler. A grid that is a pane's whole body
|
|
14
|
-
drops the frame with one scoped rule of the host's (docs/components/grid.md).
|
|
14
|
+
drops the frame with one scoped rule of the host's (docs/components/grid.md).
|
|
15
|
+
|
|
16
|
+
Pinned columns (pinnedColumns) stick to the well's start while the rest
|
|
17
|
+
scroll under them, so each paints its row's tint over the bare ground
|
|
18
|
+
(--data-grid-row-tint, which each row state sets), and a hairline in
|
|
19
|
+
--border-strong marks the pin edge. */
|
|
15
20
|
.data-grid {
|
|
16
21
|
position: relative;
|
|
17
22
|
display: flex;
|
|
@@ -194,6 +199,8 @@
|
|
|
194
199
|
}
|
|
195
200
|
|
|
196
201
|
.data-grid-row:nth-child(even) {
|
|
202
|
+
--data-grid-row-tint: var(--row-zebra);
|
|
203
|
+
|
|
197
204
|
background: var(--row-zebra);
|
|
198
205
|
}
|
|
199
206
|
|
|
@@ -223,6 +230,37 @@
|
|
|
223
230
|
border-right: none;
|
|
224
231
|
}
|
|
225
232
|
|
|
233
|
+
/* A pinned column, and the lead before it, stand over the columns that
|
|
234
|
+
scroll under them, on an opaque ground: the header's, or the bare ground
|
|
235
|
+
under the row's tint. Each cell state below paints over it. */
|
|
236
|
+
.data-grid-header > .pinned,
|
|
237
|
+
.data-grid-row > .pinned {
|
|
238
|
+
position: sticky;
|
|
239
|
+
z-index: var(--z-raised);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.data-grid-header > .pinned {
|
|
243
|
+
background: var(--surface-header);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.data-grid-row > .pinned {
|
|
247
|
+
background: linear-gradient(
|
|
248
|
+
var(--data-grid-row-tint, transparent),
|
|
249
|
+
var(--data-grid-row-tint, transparent)
|
|
250
|
+
)
|
|
251
|
+
var(--ground);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* The pin edge: a stronger hairline than a column's, down the header and
|
|
255
|
+
every row, so what scrolls is seen to pass under the pinned columns. */
|
|
256
|
+
.data-grid-row > .pin-edge {
|
|
257
|
+
border-right-color: var(--border-strong);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.data-grid-heading.pin-edge .data-grid-resize:not(:hover, :active) {
|
|
261
|
+
border-right-color: var(--border-strong);
|
|
262
|
+
}
|
|
263
|
+
|
|
226
264
|
.data-grid-cell.align-right,
|
|
227
265
|
.data-grid-heading.align-right {
|
|
228
266
|
text-align: right;
|
|
@@ -328,10 +366,14 @@
|
|
|
328
366
|
from the cursor cell's ring and from the zebra rows; the bar is drawn
|
|
329
367
|
over the lead and the first cell, whatever fills them. */
|
|
330
368
|
.data-grid.pointer .data-grid-row:not(.marked):hover {
|
|
369
|
+
--data-grid-row-tint: var(--row-hover);
|
|
370
|
+
|
|
331
371
|
background: var(--row-hover);
|
|
332
372
|
}
|
|
333
373
|
|
|
334
374
|
.data-grid-row.marked {
|
|
375
|
+
--data-grid-row-tint: var(--marked-bg);
|
|
376
|
+
|
|
335
377
|
background: var(--marked-bg);
|
|
336
378
|
}
|
|
337
379
|
|
|
@@ -399,6 +441,34 @@
|
|
|
399
441
|
content: '';
|
|
400
442
|
}
|
|
401
443
|
|
|
444
|
+
/* With pinned columns the bar stays in view on the row's first part (its
|
|
445
|
+
lead or first pinned cell), which would cover a bar on the row itself;
|
|
446
|
+
on a cursor cell there it joins the cursor's ring. */
|
|
447
|
+
.data-grid-row.marked:has(> .pinned)::before {
|
|
448
|
+
content: none;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.data-grid-row.marked > .pinned:first-child {
|
|
452
|
+
box-shadow: inset var(--line-strong) 0 0 var(--data-grid-bar, var(--marked-bar));
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.data-grid-row.marked > .data-grid-cell.pinned.cursor:first-child {
|
|
456
|
+
box-shadow:
|
|
457
|
+
inset var(--line-strong) 0 0 var(--data-grid-bar, var(--marked-bar)),
|
|
458
|
+
inset 0 0 0 var(--line) var(--data-grid-ring, var(--accent));
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.data-grid-row.marked > .pinned:first-child:where([dir='rtl'] *, [dir='rtl']) {
|
|
462
|
+
box-shadow: inset calc(-1 * var(--line-strong)) 0 0 var(--data-grid-bar, var(--marked-bar));
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.data-grid-row.marked
|
|
466
|
+
> .data-grid-cell.pinned.cursor:first-child:where([dir='rtl'] *, [dir='rtl']) {
|
|
467
|
+
box-shadow:
|
|
468
|
+
inset calc(-1 * var(--line-strong)) 0 0 var(--data-grid-bar, var(--marked-bar)),
|
|
469
|
+
inset 0 0 0 var(--line) var(--data-grid-ring, var(--accent));
|
|
470
|
+
}
|
|
471
|
+
|
|
402
472
|
/* A cell whose state replaces its row's paints its tint over the bare
|
|
403
473
|
ground, not over the row's tint, so the text sits on the one ground its
|
|
404
474
|
colour is floored on. */
|
|
@@ -414,15 +484,31 @@
|
|
|
414
484
|
background: var(--accent-wash);
|
|
415
485
|
}
|
|
416
486
|
|
|
487
|
+
/* A pinned marked column lays the same tint over its opaque ground. */
|
|
488
|
+
.data-grid-cell.marked:where(.pinned) {
|
|
489
|
+
background:
|
|
490
|
+
linear-gradient(var(--accent-wash), var(--accent-wash)),
|
|
491
|
+
linear-gradient(var(--data-grid-row-tint, transparent), var(--data-grid-row-tint, transparent))
|
|
492
|
+
var(--ground);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.data-grid-heading.marked:where(.pinned) {
|
|
496
|
+
background: linear-gradient(var(--accent-wash), var(--accent-wash)) var(--surface-header);
|
|
497
|
+
}
|
|
498
|
+
|
|
417
499
|
.data-grid-heading.marked {
|
|
418
500
|
box-shadow: inset 0 calc(-1 * var(--line-strong)) 0 var(--accent);
|
|
419
501
|
color: var(--text);
|
|
420
502
|
}
|
|
421
503
|
|
|
422
|
-
.data-grid-row.marked .data-grid-cell.marked:not(.cursor, .cell-edited) {
|
|
504
|
+
.data-grid-row.marked .data-grid-cell.marked:not(.cursor, .cell-edited, .cell-removed) {
|
|
423
505
|
background: none;
|
|
424
506
|
}
|
|
425
507
|
|
|
508
|
+
.data-grid-row.marked .data-grid-cell.marked.pinned:not(.cursor, .cell-edited, .cell-removed) {
|
|
509
|
+
background: linear-gradient(var(--data-grid-row-tint), var(--data-grid-row-tint)) var(--ground);
|
|
510
|
+
}
|
|
511
|
+
|
|
426
512
|
/* A header that drags to a new place, and where it lands. The pointer
|
|
427
513
|
stays the arrow while it drags, as a desktop table's column does; the
|
|
428
514
|
heading in the hand fades and lifts, and the accent bar marks where it
|
|
@@ -454,6 +540,10 @@
|
|
|
454
540
|
.listing-root:has(.pane.active) .pane:not(.active, .active .pane) .data-grid
|
|
455
541
|
)
|
|
456
542
|
:is(.data-grid-row.marked, .data-grid-cell.marked, .data-grid-heading.marked) {
|
|
543
|
+
--data-grid-row-tint: var(--fill);
|
|
544
|
+
--data-grid-bar: var(--control-border-strong);
|
|
545
|
+
--data-grid-ring: var(--control-border-strong);
|
|
546
|
+
|
|
457
547
|
background: var(--fill);
|
|
458
548
|
}
|
|
459
549
|
|
|
@@ -478,11 +568,24 @@
|
|
|
478
568
|
.listing-root:has(.pane.active) .pane:not(.active, .active .pane) .data-grid
|
|
479
569
|
)
|
|
480
570
|
.data-grid-row
|
|
481
|
-
.data-grid-cell.cursor:not(.cell-edited) {
|
|
571
|
+
.data-grid-cell.cursor:not(.cell-edited, .cell-removed) {
|
|
482
572
|
background: transparent;
|
|
483
573
|
box-shadow: inset 0 0 0 var(--line) var(--control-border-strong);
|
|
484
574
|
}
|
|
485
575
|
|
|
576
|
+
:where(
|
|
577
|
+
:root[data-window-inactive] .data-grid,
|
|
578
|
+
.listing-root:has(.pane.active) .pane:not(.active, .active .pane) .data-grid
|
|
579
|
+
)
|
|
580
|
+
.data-grid-row
|
|
581
|
+
.data-grid-cell.cursor.pinned:not(.cell-edited, .cell-removed) {
|
|
582
|
+
background: linear-gradient(
|
|
583
|
+
var(--data-grid-row-tint, transparent),
|
|
584
|
+
var(--data-grid-row-tint, transparent)
|
|
585
|
+
)
|
|
586
|
+
var(--ground);
|
|
587
|
+
}
|
|
588
|
+
|
|
486
589
|
:where(
|
|
487
590
|
:root[data-window-inactive] .data-grid,
|
|
488
591
|
.listing-root:has(.pane.active) .pane:not(.active, .active .pane) .data-grid
|
|
@@ -600,6 +703,18 @@
|
|
|
600
703
|
linear-gradient(var(--warning-wash-strong), var(--warning-wash-strong)) var(--ground);
|
|
601
704
|
}
|
|
602
705
|
|
|
706
|
+
/* A row a save will delete (a cell whose className holds cell-removed),
|
|
707
|
+
the fourth of the cell-state family: each cell struck out, quiet, on the
|
|
708
|
+
danger wash over the bare ground, whatever row it sits in. The cursor's
|
|
709
|
+
ring and a marked row's bar draw over it. */
|
|
710
|
+
.data-grid-cell.cell-removed,
|
|
711
|
+
.data-grid-row.marked .data-grid-cell.cell-removed {
|
|
712
|
+
background: linear-gradient(var(--danger-wash), var(--danger-wash)) var(--ground);
|
|
713
|
+
color: var(--text-on-surface);
|
|
714
|
+
text-decoration: line-through;
|
|
715
|
+
text-decoration-color: var(--danger);
|
|
716
|
+
}
|
|
717
|
+
|
|
603
718
|
/* Values that are not text: a missing value (SQL NULL) set apart from the
|
|
604
719
|
word, and bytes shown by their kind and size. The classes are hooks a
|
|
605
720
|
caller sets through a cell's className. On a row or cell in a state the
|
|
@@ -612,7 +727,7 @@
|
|
|
612
727
|
|
|
613
728
|
.data-grid.pointer .data-grid-row:hover .data-grid-cell.cell-null,
|
|
614
729
|
.data-grid-row.marked .data-grid-cell.cell-null,
|
|
615
|
-
.data-grid-cell.cell-null:is(.cursor, .marked, .cell-edited) {
|
|
730
|
+
.data-grid-cell.cell-null:is(.cursor, .marked, .cell-edited, .cell-removed) {
|
|
616
731
|
color: var(--text-on-surface);
|
|
617
732
|
}
|
|
618
733
|
|
|
@@ -629,3 +744,12 @@
|
|
|
629
744
|
box-shadow: none;
|
|
630
745
|
color: transparent;
|
|
631
746
|
}
|
|
747
|
+
|
|
748
|
+
/* A pinned cell under an editor keeps its opaque ground. */
|
|
749
|
+
.data-grid .data-grid-row .data-grid-cell.cursor.editing.pinned {
|
|
750
|
+
background: linear-gradient(
|
|
751
|
+
var(--data-grid-row-tint, transparent),
|
|
752
|
+
var(--data-grid-row-tint, transparent)
|
|
753
|
+
)
|
|
754
|
+
var(--ground);
|
|
755
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,12 +12,14 @@ export * from './datetime/index.js';
|
|
|
12
12
|
export * from './dialog/index.js';
|
|
13
13
|
export * from './field/index.js';
|
|
14
14
|
export * from './filter/index.js';
|
|
15
|
+
export * from './frame/index.js';
|
|
15
16
|
export * from './grid/index.js';
|
|
16
17
|
export * from './icon/index.js';
|
|
17
18
|
export * from './keyboard/index.js';
|
|
18
19
|
export * from './keychord/index.js';
|
|
19
20
|
export * from './labels/index.js';
|
|
20
21
|
export * from './legend/index.js';
|
|
22
|
+
export * from './log/index.js';
|
|
21
23
|
export * from './listing/index.js';
|
|
22
24
|
export * from './menu/index.js';
|
|
23
25
|
export * from './namecut/index.js';
|
|
@@ -27,7 +29,9 @@ export * from './pane/index.js';
|
|
|
27
29
|
export * from './run/index.js';
|
|
28
30
|
export * from './segmented/index.js';
|
|
29
31
|
export * from './selectall/index.js';
|
|
32
|
+
export * from './shell/index.js';
|
|
30
33
|
export * from './store/index.js';
|
|
34
|
+
export * from './surface/index.js';
|
|
31
35
|
export * from './tabs/index.js';
|
|
32
36
|
export * from './text/index.js';
|
|
33
37
|
export * from './themes/index.js';
|
package/dist/index.js
CHANGED
|
@@ -12,12 +12,14 @@ export * from './datetime/index.js';
|
|
|
12
12
|
export * from './dialog/index.js';
|
|
13
13
|
export * from './field/index.js';
|
|
14
14
|
export * from './filter/index.js';
|
|
15
|
+
export * from './frame/index.js';
|
|
15
16
|
export * from './grid/index.js';
|
|
16
17
|
export * from './icon/index.js';
|
|
17
18
|
export * from './keyboard/index.js';
|
|
18
19
|
export * from './keychord/index.js';
|
|
19
20
|
export * from './labels/index.js';
|
|
20
21
|
export * from './legend/index.js';
|
|
22
|
+
export * from './log/index.js';
|
|
21
23
|
export * from './listing/index.js';
|
|
22
24
|
export * from './menu/index.js';
|
|
23
25
|
export * from './namecut/index.js';
|
|
@@ -27,7 +29,9 @@ export * from './pane/index.js';
|
|
|
27
29
|
export * from './run/index.js';
|
|
28
30
|
export * from './segmented/index.js';
|
|
29
31
|
export * from './selectall/index.js';
|
|
32
|
+
export * from './shell/index.js';
|
|
30
33
|
export * from './store/index.js';
|
|
34
|
+
export * from './surface/index.js';
|
|
31
35
|
export * from './tabs/index.js';
|
|
32
36
|
export * from './text/index.js';
|
|
33
37
|
export * from './themes/index.js';
|
|
@@ -6,7 +6,9 @@ import { type LegendLabels } from './legend.js';
|
|
|
6
6
|
import { type ListingLabels } from './listing.js';
|
|
7
7
|
import { type PagerLabels } from './pager.js';
|
|
8
8
|
import { type PaletteLabels } from './palette.js';
|
|
9
|
+
import { type PaneTabsLabels } from './paneTabs.js';
|
|
9
10
|
import { type SelectAllLabels } from './selectAll.js';
|
|
11
|
+
import { type SettingsLabels } from './settings.js';
|
|
10
12
|
import { type TerminalLabels } from './terminal.js';
|
|
11
13
|
/**
|
|
12
14
|
* Every chrome string UIOK's components share across instances, grouped by
|
|
@@ -36,6 +38,10 @@ export interface UiokLabels {
|
|
|
36
38
|
readonly selectAll: SelectAllLabels;
|
|
37
39
|
/** A terminal's menu, its failure line, and its input's fallback name (`@bigpixelrocket/uiok/terminal`). */
|
|
38
40
|
readonly terminal: TerminalLabels;
|
|
41
|
+
/** A pane's tab strip: New Tab, close and picked names, and the folded tabs' count and menu (`PaneTabs`). */
|
|
42
|
+
readonly paneTabs: PaneTabsLabels;
|
|
43
|
+
/** The Settings dialog's title, sidebar, and Done, and the Appearance page's words (`SettingsDialog`, `AppearanceSettings`). */
|
|
44
|
+
readonly settings: SettingsLabels;
|
|
39
45
|
}
|
|
40
46
|
/** The English labels every component falls back to without a `UiokProvider`. */
|
|
41
47
|
export declare const DEFAULT_LABELS: UiokLabels;
|
|
@@ -14,7 +14,9 @@ import { DEFAULT_LEGEND_LABELS } from './legend.js';
|
|
|
14
14
|
import { DEFAULT_LISTING_LABELS } from './listing.js';
|
|
15
15
|
import { DEFAULT_PAGER_LABELS } from './pager.js';
|
|
16
16
|
import { DEFAULT_PALETTE_LABELS } from './palette.js';
|
|
17
|
+
import { DEFAULT_PANE_TABS_LABELS } from './paneTabs.js';
|
|
17
18
|
import { DEFAULT_SELECT_ALL_LABELS } from './selectAll.js';
|
|
19
|
+
import { DEFAULT_SETTINGS_LABELS } from './settings.js';
|
|
18
20
|
import { DEFAULT_TERMINAL_LABELS } from './terminal.js';
|
|
19
21
|
/** The English labels every component falls back to without a `UiokProvider`. */
|
|
20
22
|
export const DEFAULT_LABELS = {
|
|
@@ -27,5 +29,7 @@ export const DEFAULT_LABELS = {
|
|
|
27
29
|
pager: DEFAULT_PAGER_LABELS,
|
|
28
30
|
palette: DEFAULT_PALETTE_LABELS,
|
|
29
31
|
selectAll: DEFAULT_SELECT_ALL_LABELS,
|
|
30
|
-
terminal: DEFAULT_TERMINAL_LABELS
|
|
32
|
+
terminal: DEFAULT_TERMINAL_LABELS,
|
|
33
|
+
paneTabs: DEFAULT_PANE_TABS_LABELS,
|
|
34
|
+
settings: DEFAULT_SETTINGS_LABELS
|
|
31
35
|
};
|