viewkitjs 0.35.0 → 0.37.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 +112 -0
- package/MIGRATION.md +7 -0
- package/package.json +1 -1
- package/views/dist/atoms/types.d.ts +32 -4
- package/views/dist/contract.d.ts +32 -9
- package/views/dist/contract.js +35 -1
- package/views/dist/controls/avatar/avatar.d.ts +3 -1
- package/views/dist/controls/avatar/avatar.js +2 -2
- package/views/dist/controls/button/own-look-moved.d.ts +11 -0
- package/views/dist/controls/button/own-look-moved.js +3 -0
- package/views/dist/controls/compound-editor/map-parts-body.js +2 -0
- package/views/dist/controls/compound-editor/name-parts.js +1 -1
- package/views/dist/controls/compound-editor/place-parts.js +1 -1
- package/views/dist/controls/compound-editor/range-parts.js +1 -1
- package/views/dist/controls/compound-editor/words.d.ts +3 -0
- package/views/dist/controls/compound-editor/words.js +2 -0
- package/views/dist/controls/customize/customize.d.ts +10 -3
- package/views/dist/controls/customize/customize.js +147 -63
- package/views/dist/controls/customize/items.d.ts +49 -0
- package/views/dist/controls/customize/items.js +104 -0
- package/views/dist/controls/customize/map-customize-body.js +7 -4
- package/views/dist/controls/customize/words.d.ts +2 -0
- package/views/dist/controls/customize/words.js +1 -0
- package/views/dist/controls/date-editor/date-behaviour.d.ts +80 -0
- package/views/dist/controls/date-editor/date-behaviour.js +187 -0
- package/views/dist/controls/date-editor/date-editor.d.ts +3 -2
- package/views/dist/controls/date-editor/date-editor.js +29 -166
- package/views/dist/controls/field/field.d.ts +3 -2
- package/views/dist/controls/field/field.js +7 -2
- package/views/dist/controls/field/looks.d.ts +1 -1
- package/views/dist/controls/field/looks.js +5 -4
- package/views/dist/controls/field.css +4 -0
- package/views/dist/controls/filter-editor/block.js +5 -2
- package/views/dist/controls/filter-editor/filter-editor.d.ts +14 -1
- package/views/dist/controls/filter-editor/filter-editor.js +21 -13
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +3 -2
- package/views/dist/controls/filter-editor/map-filter-body.js +16 -2
- package/views/dist/controls/filter-editor/map-rules.d.ts +9 -2
- package/views/dist/controls/filter-editor/map-rules.js +18 -13
- package/views/dist/controls/filter-editor/parts.d.ts +2 -0
- package/views/dist/controls/filter-editor/parts.js +13 -12
- package/views/dist/controls/filter-editor/rules.d.ts +4 -4
- package/views/dist/controls/filter-editor/rules.js +6 -3
- package/views/dist/controls/filter-editor/words.d.ts +2 -0
- package/views/dist/controls/filter-editor/words.js +1 -0
- package/views/dist/controls/group-editor/group-editor.d.ts +3 -0
- package/views/dist/controls/group-editor/group-editor.js +21 -15
- package/views/dist/controls/group-editor/map-group-body.js +1 -0
- package/views/dist/controls/index.d.ts +4 -2
- package/views/dist/controls/index.js +3 -1
- package/views/dist/controls/inline-input.css +9 -0
- package/views/dist/controls/internal/kit-words.d.ts +11 -0
- package/views/dist/controls/internal/kit-words.js +7 -0
- package/views/dist/controls/internal/map-panel-controls.d.ts +4 -1
- package/views/dist/controls/internal/map-panel-controls.js +14 -1
- package/views/dist/controls/internal/menu-items.d.ts +9 -0
- package/views/dist/controls/internal/menu-items.js +97 -0
- package/views/dist/controls/internal/panel-controls.js +1 -1
- package/views/dist/controls/internal/phone.d.ts +1 -1
- package/views/dist/controls/internal/phone.js +3 -2
- package/views/dist/controls/list/tokens.d.ts +1 -1
- package/views/dist/controls/list/tokens.js +1 -1
- package/views/dist/controls/list.css +5 -2
- package/views/dist/controls/menu/menu.d.ts +1 -1
- package/views/dist/controls/menu/menu.js +1 -1
- package/views/dist/controls/menu-list/menu-list.js +3 -2
- package/views/dist/controls/menu.css +4 -4
- package/views/dist/controls/number-editor/map-number-body.js +2 -0
- package/views/dist/controls/number-editor/number-editor.js +1 -1
- package/views/dist/controls/number-editor/words.d.ts +3 -0
- package/views/dist/controls/number-editor/words.js +2 -0
- package/views/dist/controls/pane.css +1 -1
- package/views/dist/controls/picker/fields-frame.d.ts +5 -0
- package/views/dist/controls/picker/fields-frame.js +30 -0
- package/views/dist/controls/picker/map-fields-body.js +3 -26
- package/views/dist/controls/picker/map-picker.d.ts +2 -1
- package/views/dist/controls/picker/map-picker.js +4 -2
- package/views/dist/controls/picker/picker.js +9 -2
- package/views/dist/controls/picker/rows.d.ts +3 -1
- package/views/dist/controls/picker.css +7 -3
- package/views/dist/controls/popover/looks.d.ts +1 -1
- package/views/dist/controls/popover/looks.js +5 -0
- package/views/dist/controls/popover/tokens.d.ts +13 -1
- package/views/dist/controls/popover/tokens.js +4 -1
- package/views/dist/controls/popover.css +59 -8
- package/views/dist/controls/select/map-select.d.ts +1 -1
- package/views/dist/controls/select/map-select.js +4 -1
- package/views/dist/controls/select/select.d.ts +2 -0
- package/views/dist/controls/select/select.js +4 -2
- package/views/dist/controls/sheet/bottom-sheet.d.ts +6 -1
- package/views/dist/controls/sheet/bottom-sheet.js +3 -3
- package/views/dist/controls/sort-editor/map-sort-body.js +1 -0
- package/views/dist/controls/sort-editor/sort-editor.d.ts +3 -1
- package/views/dist/controls/sort-editor/sort-editor.js +6 -4
- package/views/dist/controls/sort-editor.css +4 -2
- package/views/dist/controls/tag/tag.js +4 -2
- package/views/dist/controls/text-editor/map-text-body.js +4 -1
- package/views/dist/controls/text-editor/text-editor.js +2 -2
- package/views/dist/controls/text-editor/words.d.ts +3 -0
- package/views/dist/controls/text-editor/words.js +1 -1
- package/views/dist/controls/text-editor.css +6 -0
- package/views/dist/controls/toolbar/toolbar.d.ts +12 -4
- package/views/dist/controls/toolbar/toolbar.js +7 -2
- package/views/dist/controls/toolbar-button/atom-toolbar-button.js +1 -1
- package/views/dist/controls/toolbar.css +5 -0
- package/views/dist/controls/tooltip/tokens.d.ts +1 -1
- package/views/dist/controls/tooltip/tokens.js +1 -1
- package/views/dist/controls/tooltip.css +5 -3
- package/views/dist/controls/values-editor.css +20 -5
- package/views/dist/controls/views-list/map-views-list-body.js +9 -1
- package/views/dist/controls/views-list/rules.d.ts +1 -0
- package/views/dist/controls/views-list/rules.js +2 -2
- package/views/dist/controls/views-list/view-menu.js +2 -2
- package/views/dist/controls/views-list/words.d.ts +4 -0
- package/views/dist/controls/views-list/words.js +2 -1
- package/views/dist/display/entity-chip.d.ts +7 -1
- package/views/dist/display/entity-chip.js +2 -1
- package/views/dist/display/option-badges.d.ts +3 -2
- package/views/dist/display/option-badges.js +2 -2
- package/views/dist/field-row/FieldRow.js +12 -8
- package/views/dist/grid/chrome/GridAddColumn.d.ts +7 -2
- package/views/dist/grid/chrome/GridAddColumn.js +5 -4
- package/views/dist/grid/chrome/GridCellEditors.d.ts +4 -1
- package/views/dist/grid/chrome/GridCellEditors.js +3 -2
- package/views/dist/grid/chrome/GridCellOutline.d.ts +3 -5
- package/views/dist/grid/chrome/GridCellOutline.js +3 -5
- package/views/dist/grid/chrome/GridChipsEditor.js +1 -1
- package/views/dist/grid/chrome/GridDateEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridDateEditor.js +1 -1
- package/views/dist/grid/chrome/GridHeader.js +3 -1
- package/views/dist/grid/chrome/GridLongTextEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridLongTextEditor.js +8 -5
- package/views/dist/grid/chrome/GridNameEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridNameEditor.js +1 -1
- package/views/dist/grid/chrome/GridNumberEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridNumberEditor.js +2 -2
- package/views/dist/grid/chrome/GridPlaceEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridPlaceEditor.js +1 -1
- package/views/dist/grid/chrome/GridRangeEditor.d.ts +2 -2
- package/views/dist/grid/chrome/GridRangeEditor.js +1 -1
- package/views/dist/grid/chrome/GridRelationEditor.js +2 -2
- package/views/dist/grid/chrome/GridRow.js +7 -1
- package/views/dist/grid/chrome/GridRowCells.js +6 -5
- package/views/dist/grid/chrome/GridSelectEditor.js +1 -1
- package/views/dist/grid/chrome/GridTable.d.ts +2 -1
- package/views/dist/grid/chrome/GridTable.js +7 -2
- package/views/dist/grid/chrome/GridTableSurface.js +2 -1
- package/views/dist/grid/chrome/GridTextEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridTextEditor.js +2 -2
- package/views/dist/grid/chrome/GridValueListEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridValueListEditor.js +1 -1
- package/views/dist/grid/chrome/grid-body-place.d.ts +7 -2
- package/views/dist/grid/chrome/grid-body-place.js +8 -4
- package/views/dist/grid/chrome/grid-cell-classes.js +2 -2
- package/views/dist/grid/chrome/grid-edit-session.d.ts +4 -0
- package/views/dist/grid/chrome/grid-edit-session.js +10 -1
- package/views/dist/grid/chrome/grid-editor-layer.d.ts +10 -0
- package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +9 -6
- package/views/dist/grid/chrome/grid-fitted-box.js +15 -7
- package/views/dist/grid/chrome/grid-hover.d.ts +3 -3
- package/views/dist/grid/chrome/grid-hover.js +2 -3
- package/views/dist/grid/chrome/grid-row-props.d.ts +6 -2
- package/views/dist/grid/chrome/grid-styles.d.ts +1 -5
- package/views/dist/grid/chrome/grid-styles.js +0 -1
- package/views/dist/grid/chrome/grid-table-props.d.ts +6 -2
- package/views/dist/grid/chrome/useGridKeyboard.d.ts +0 -1
- package/views/dist/grid/chrome/useGridKeyboard.js +2 -10
- package/views/dist/grid/chrome/useGridScaleStyles.d.ts +9 -1
- package/views/dist/grid/chrome/useGridScaleStyles.js +1 -4
- package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +3 -1
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +24 -1
- package/views/dist/grid/core/useGridEditing.d.ts +3 -0
- package/views/dist/grid/core/useGridEditing.js +2 -0
- package/views/dist/grid/grid-format-props.d.ts +1 -1
- package/views/dist/grid/grid-format-props.js +18 -5
- package/views/dist/grid/grid.css +9 -20
- package/views/dist/grid/useGridTablePrefs.d.ts +1 -1
- package/views/dist/grid/useGridTableSettings.d.ts +1 -1
- package/views/dist/internal/screen-forms.d.ts +11 -0
- package/views/dist/internal/screen-forms.js +31 -0
- package/views/dist/list/list.js +4 -3
- package/views/dist/list/menu.d.ts +5 -4
- package/views/dist/list/parts.d.ts +8 -2
- package/views/dist/list/parts.js +31 -7
- package/views/dist/list/toolbar.js +11 -5
- package/views/dist/looks/index.d.ts +1 -0
- package/views/dist/looks/index.js +1 -0
- package/views/dist/panels/customize-body.d.ts +1 -1
- package/views/dist/panels/customize-body.js +8 -1
- package/views/dist/panels/model.d.ts +5 -0
- package/views/dist/panels/react/customize-body.js +11 -2
- package/views/dist/panels/react/customize.d.ts +3 -0
- package/views/dist/panels/react/filter/FilterFieldList.d.ts +3 -1
- package/views/dist/panels/react/filter/FilterFieldList.js +2 -2
- package/views/dist/panels/react/filter/filter-body.js +3 -1
- package/views/dist/panels/react/filter/filter-part-body.d.ts +3 -1
- package/views/dist/panels/react/filter/filter-part-body.js +2 -2
- package/views/dist/panels/react/popover.d.ts +3 -1
- package/views/dist/panels/react/popover.js +2 -2
- package/views/dist/panels/react/sort/SortEditor.js +3 -1
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +15 -4
- package/views/dist/panels/react/toolbar/Toolbar.d.ts +12 -1
- package/views/dist/panels/react/toolbar/Toolbar.js +5 -1
- package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +5 -3
- package/views/dist/panels/react/toolbar/ToolbarButton.js +3 -2
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +1 -3
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +1 -1
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarSave.d.ts +3 -1
- package/views/dist/panels/react/toolbar/ToolbarSave.js +28 -20
- package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
- package/views/dist/panels/react/toolbar/context.d.ts +3 -2
- package/views/dist/panels/react/toolbar/editor-menus.d.ts +8 -0
- package/views/dist/panels/react/toolbar/editor-menus.js +3 -0
- package/views/dist/panels/react/views-row/FoldingViewRow.js +26 -11
- package/views/dist/panels/react/views-row/HScrollRow.d.ts +4 -2
- package/views/dist/panels/react/views-row/HScrollRow.js +6 -2
- package/views/dist/panels/react/views-row/ViewAxes.js +6 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +7 -10
- package/views/dist/panels/react/views-row/more-views.d.ts +2 -0
- package/views/dist/panels/react/views-row/more-views.js +3 -0
- package/views/dist/panels/react/views-row/new-view.d.ts +11 -0
- package/views/dist/panels/react/views-row/new-view.js +21 -0
- package/views/dist/panels/react.d.ts +1 -1
- package/views/dist/panels/toolbar/model.d.ts +2 -2
- package/views/dist/provider/components.d.ts +88 -8
- package/views/dist/provider/desktop.d.ts +2 -1
- package/views/dist/provider/desktop.js +5 -2
- package/views/dist/react.d.ts +1 -1
- package/views/dist/styles.css +198 -84
- package/views/dist/styles.unlayered.css +198 -84
- package/views/docs/contract.md +87 -32
- package/views/docs/controls/list.md +2 -0
- package/views/docs/controls/menu.md +2 -0
- package/views/docs/controls/picker.md +2 -0
- package/views/docs/controls/popover.md +7 -0
- package/views/docs/controls/tooltip.md +2 -0
- package/views/docs/guides/atoms.md +11 -10
- package/views/docs/guides/the-grid.md +7 -5
- package/views/docs/guides/the-provider.md +2 -2
- package/views/docs/reference/controls.md +24 -18
- package/views/docs/reference/display.md +1 -1
- package/views/docs/reference/field-row.md +1 -1
- package/views/docs/reference/grid.md +4 -4
- package/views/docs/reference/list.md +30 -11
- package/views/docs/reference/looks.md +4 -1
- package/views/docs/reference/panels-react.md +7 -6
- package/views/docs/reference/panels.md +2 -2
- package/views/docs/reference/react.md +22 -10
- package/views/docs/reference/views.md +2 -2
- package/views/docs/reshaping.md +2 -2
- package/views/skills/views/SKILL.md +1 -1
|
@@ -35,6 +35,12 @@
|
|
|
35
35
|
width: max(100%, calc(var(--vk-spacing) * 75)); max-width: none; max-height: calc(var(--vk-spacing) * 80);
|
|
36
36
|
box-shadow: var(--vk-shadow-lg), inset 0 0 0 var(--inline-input-ring, 0px) var(--inline-input-colour);
|
|
37
37
|
}
|
|
38
|
+
/* In a grid's cell (data-inline-input-place="cell", inline-input.css), never lifted, grown or long: the cell typed in shows only
|
|
39
|
+
the caret. (0,5,0): over the two lifts above. */
|
|
40
|
+
[data-inline-input-place="cell"] .o-text-editor[data-text-box][data-grown] .o-text-editor-box,
|
|
41
|
+
[data-inline-input-place="cell"] .o-text-editor[data-text-box][data-text-kind="long"] .o-text-editor-box {
|
|
42
|
+
box-shadow: inset 0 0 0 var(--inline-input-ring, 0px) var(--inline-input-colour);
|
|
43
|
+
}
|
|
38
44
|
/* What a line's own width is read by: the box's font, on one line, unseen. */
|
|
39
45
|
.o-text-editor-mirror {
|
|
40
46
|
position: absolute; top: 0; left: 0; width: max-content; height: 0; overflow: hidden; visibility: hidden; pointer-events: none;
|
|
@@ -80,16 +80,22 @@ export interface ToolbarProps extends Omit<BaseToolbar.Root.Props, "className" |
|
|
|
80
80
|
className?: string;
|
|
81
81
|
style?: React.CSSProperties;
|
|
82
82
|
}
|
|
83
|
+
/** What the Toolbar hands an app's own button (⋯, "+N", "+N filters"): a Toolbar button's props, its `style` a plain one, never
|
|
84
|
+
* Base UI's state function, so the app spreads them onto a plain `<button>` with no cast (VK-1060). A button typed with
|
|
85
|
+
* `ToolbarButtonProps` is still taken. */
|
|
86
|
+
export type ToolbarOwnButtonProps = Omit<ToolbarButtonProps, "style"> & {
|
|
87
|
+
style?: React.CSSProperties;
|
|
88
|
+
};
|
|
83
89
|
/** ⋯ as the app draws it: its glyph, its class, or its whole button, handed a Toolbar button's props. */
|
|
84
90
|
export type ToolbarOverflowControl = {
|
|
85
91
|
icon?: React.ReactNode;
|
|
86
92
|
className?: string;
|
|
87
|
-
button?: React.ComponentType<
|
|
93
|
+
button?: React.ComponentType<ToolbarOwnButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
88
94
|
};
|
|
89
95
|
/** "+N" or "+N filters" as the app draws it: its class, or its whole button, handed a Toolbar button's props (VK-1037). */
|
|
90
96
|
export type ToolbarMoreControl = {
|
|
91
97
|
className?: string;
|
|
92
|
-
button?: React.ComponentType<
|
|
98
|
+
button?: React.ComponentType<ToolbarOwnButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
93
99
|
};
|
|
94
100
|
type Step = {
|
|
95
101
|
i: number;
|
|
@@ -112,8 +118,10 @@ export declare function ToolbarFolds({ children }: ToolbarFoldsProps): React.Rea
|
|
|
112
118
|
declare function stepsOf(items: React.ReactElement[]): Step[];
|
|
113
119
|
/** The steps a line takes as it narrows, for a test (stepsOf). */
|
|
114
120
|
export declare const toolbarSteps: typeof stepsOf;
|
|
115
|
-
/** The row and, under it, the filter bar: Base UI's toolbar, one Tab stop for the whole of it, the arrows inside.
|
|
116
|
-
|
|
121
|
+
/** The row and, under it, the filter bar: Base UI's toolbar, one Tab stop for the whole of it, the arrows inside. Server-rendered
|
|
122
|
+
* with no `form` told, outside a PhoneHost and a ComputerHost, it draws the phone's form and the computer's, CSS showing the
|
|
123
|
+
* screen's until the page comes alive (VK-1038). */
|
|
124
|
+
export declare function ToolbarControl(props: ToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
117
125
|
/** A line between what belongs together and what doesn't, across a line. `data-slot`, its public name where a part names it
|
|
118
126
|
* (VK-1023: the bulk bar's `vk-bulk-separator`). */
|
|
119
127
|
export declare function ToolbarSeparatorControl({ className, "data-slot": slot }: {
|
|
@@ -4,11 +4,12 @@ import * as React from "react";
|
|
|
4
4
|
import { flushSync } from "react-dom";
|
|
5
5
|
import { Toolbar as BaseToolbar } from "@base-ui/react/toolbar";
|
|
6
6
|
import { cx as cn } from "../../internal/cx.js";
|
|
7
|
+
import { ScreenForms } from "../../internal/screen-forms.js";
|
|
7
8
|
import { Button, ButtonGroup } from "../button/button.js";
|
|
8
9
|
import { Input, InputGroup, InputGroupAddon, InputGroupButton } from "../input/input.js";
|
|
9
10
|
import { Icon } from "../internal/icons.js";
|
|
10
11
|
import { isAppButton } from "../internal/panel-controls.js";
|
|
11
|
-
import { PhoneHost, usePhone } from "../internal/phone.js";
|
|
12
|
+
import { ComputerHost, PhoneHost, usePhone } from "../internal/phone.js";
|
|
12
13
|
import { watchFrame } from "../internal/watch-frame.js";
|
|
13
14
|
import { Menu } from "../menu/menu.js";
|
|
14
15
|
import { ToggleGroup } from "../toggle/toggle.js";
|
|
@@ -157,7 +158,11 @@ function useGiveWay(line, max, on, holds = false) {
|
|
|
157
158
|
}, [line, on, look]);
|
|
158
159
|
return stage;
|
|
159
160
|
}
|
|
160
|
-
export function ToolbarControl(
|
|
161
|
+
export function ToolbarControl(props) {
|
|
162
|
+
const host = React.useContext(PhoneHost), computer = React.useContext(ComputerHost);
|
|
163
|
+
return (_jsx(ScreenForms, { off: props.form !== undefined || host != null || computer, children: _jsx(ToolbarOnScreen, { ...props }) }));
|
|
164
|
+
}
|
|
165
|
+
function ToolbarOnScreen({ label, children, bar, barLabel: barNamed, words: given, views, settings, search, add, sort, filter, filters, save, quick, added = false, picks: said, size, barSize, spacing, fold = true, overflow, moreViews: ownViews, moreFilters: ownFilters, holds = false, form, onMoreViews, moreViewsOpen, className, style, onKeyDown, ...props }) {
|
|
161
166
|
const spoken = toolbarWords(given), barLabel = barNamed ?? spoken.bar;
|
|
162
167
|
const host = React.useContext(PhoneHost), narrow = usePhone();
|
|
163
168
|
const phone = form ? form === "phone" : host != null || narrow;
|
|
@@ -39,7 +39,7 @@ export function ToolbarButtonAtom({ icon, label, word, count, more, dot, open, c
|
|
|
39
39
|
if (foot)
|
|
40
40
|
return _jsx(Button, { ref: own, kind: "primary", shape: "round", size: "44", icon: icon, "aria-label": label, className: className, disabled: disabled, onClick: onClick, onPointerDown: onPointerDown, ...opens });
|
|
41
41
|
if (edge && !picks.add.startsWith("like")) {
|
|
42
|
-
const alone = word === null || picks.add.endsWith("-icon");
|
|
42
|
+
const alone = word === null || (icon != null && picks.add.endsWith("-icon"));
|
|
43
43
|
const button = (_jsx(Button, { ref: own, kind: picks.add.startsWith("primary") ? "primary" : "outline", size: BUTTON_SIZE[row?.size ?? "32"], icon: icon, shape: alone ? "icon" : undefined, "aria-label": alone ? label : undefined, className: className, disabled: disabled, onClick: onClick, onPointerDown: onPointerDown, ...opens, children: alone ? undefined : (said ?? label) }));
|
|
44
44
|
return row ? _jsx(BaseToolbar.Button, { render: button, disabled: disabled }) : button;
|
|
45
45
|
}
|
|
@@ -62,4 +62,9 @@
|
|
|
62
62
|
/* A holder's own filters or view tabs (ToolbarFolds, KIT-858): a box keeping the whole width of what it holds, so the line measures it
|
|
63
63
|
as it draws, and folds them a step at a time. */
|
|
64
64
|
.o-toolbar-folds { display: inline-flex; flex: none; min-width: max-content; align-items: center; }
|
|
65
|
+
|
|
66
|
+
/* A phone's first paint (VK-1038): server-rendered, the toolbar and the grid stand twice, the phone's form and the computer's
|
|
67
|
+
(`ScreenForms`, internal/screen-forms.tsx), and this shows the screen's at ViewKit's own line, as the inline rules beside them
|
|
68
|
+
do at the app's: here for a page whose policy refuses an inline style. Kept on one line, as screenFormsCss writes it. */
|
|
69
|
+
[data-vk-screen-forms]{display:contents}[data-vk-twin="computer"][data-vk-twin-line="(min-width: 1024px)"]{display:none}@media (min-width: 1024px){[data-vk-twin="computer"][data-vk-twin-line="(min-width: 1024px)"]{display:contents}[data-vk-twin="phone"][data-vk-twin-line="(min-width: 1024px)"]{display:none}}
|
|
65
70
|
}
|
|
@@ -72,4 +72,4 @@ export declare const TOOLTIP_TOKENS: readonly [{
|
|
|
72
72
|
readonly outright: "--toast-duration";
|
|
73
73
|
}];
|
|
74
74
|
/** The prefix of the tooltip's own machinery, set and read by it alone: not public. */
|
|
75
|
-
export declare const TOOLTIP_PRIVATE: readonly ["--tooltip-"];
|
|
75
|
+
export declare const TOOLTIP_PRIVATE: readonly ["--tooltip-", "--transform-origin"];
|
|
@@ -18,4 +18,4 @@ export const TOOLTIP_TOKENS = [
|
|
|
18
18
|
{ name: "--vk-tooltip-warm", kind: "motion", outright: "--tooltip-warm" },
|
|
19
19
|
{ name: "--vk-toast-duration", kind: "motion", outright: "--toast-duration" },
|
|
20
20
|
];
|
|
21
|
-
export const TOOLTIP_PRIVATE = ["--tooltip-"];
|
|
21
|
+
export const TOOLTIP_PRIVATE = ["--tooltip-", "--transform-origin"];
|
|
@@ -16,14 +16,16 @@
|
|
|
16
16
|
background-color: var(--vk-fg); color: var(--vk-ground);
|
|
17
17
|
font-size: var(--vk-font-size-xs); line-height: calc(var(--vk-font-size-xs) * var(--vk-line-height-xs)); font-weight: var(--vk-font-weight-medium);
|
|
18
18
|
pointer-events: none;
|
|
19
|
-
|
|
19
|
+
transform-origin: var(--transform-origin); transition-property: opacity, translate, scale;
|
|
20
|
+
transition-duration: var(--vk-popup-open-duration, var(--vk-duration-fast)); transition-timing-function: var(--vk-popup-open-ease, var(--vk-ease-out));
|
|
20
21
|
}
|
|
21
22
|
.o-tooltip-positioner { z-index: var(--vk-layer-popup); }
|
|
22
23
|
/* What it names hands its script its times, read there so a look set round it reaches them: the wait before it shows, how long a
|
|
23
24
|
tapped reason stays, and a group's warm time. */
|
|
24
25
|
.o-tooltip-trigger { --tooltip-wait: var(--vk-tooltip-delay); --tooltip-tap: var(--vk-toast-duration); --tooltip-warm-now: var(--vk-tooltip-warm); }
|
|
25
|
-
/* It fades in and rises 2px. */
|
|
26
|
-
.o-tooltip
|
|
26
|
+
/* It fades in and rises 2px, half a popup's nudge, in 150ms each way, easing out both ways (popover.css): or as the popup motion names say. */
|
|
27
|
+
.o-tooltip[data-ending-style] { transition-duration: var(--vk-popup-close-duration, var(--vk-duration-fast)); transition-timing-function: var(--vk-popup-close-ease, var(--vk-ease-out)); }
|
|
28
|
+
.o-tooltip:is([data-starting-style], [data-ending-style]) { opacity: 0; translate: 0 calc(var(--vk-popup-nudge, var(--vk-spacing)) * 0.5); scale: var(--vk-popup-scale, none); }
|
|
27
29
|
|
|
28
30
|
/* ── A longer reason: it wraps, at least 200px wide and at most 320px, in the regular weight ────────── */
|
|
29
31
|
.o-tooltip.o-tooltip-reason { width: auto; min-width: calc(var(--vk-spacing) * 50); font-weight: var(--vk-font-weight-normal); }
|
|
@@ -149,16 +149,31 @@
|
|
|
149
149
|
.o-values-editor[data-values-line="plus"] .o-values-editor-prefix { color: var(--vk-fg-subtlest); }
|
|
150
150
|
.o-values-editor[data-values-line="plus"] .o-values-editor-error { margin: var(--vk-spacing) 0 var(--vk-spacing) calc(var(--vk-spacing) * 7); }
|
|
151
151
|
|
|
152
|
-
/* ── Attio's look on a phone (data-values-phone="rows"): one card, rows 48 high at 16, each with its grip, its
|
|
153
|
-
write or open and its trash; the line in the card under a line; a refusal's words under the card
|
|
152
|
+
/* ── Attio's look on a phone (data-values-phone="rows"): one card, rows 48 high at 16, each with its grip, its value over its
|
|
153
|
+
label, its call, write or open and its trash; the line in the card under a line; a refusal's words under the card ────────── */
|
|
154
154
|
.o-values-editor[data-values-phone="rows"] .o-values-editor-card { white-space: normal; }
|
|
155
|
-
/* Its row's inside: the grip at its start's edge, its acts at its end, the computer's row height let go.
|
|
156
|
-
|
|
155
|
+
/* Its row's inside: the grip at its start's edge, its acts at its end, the computer's row height let go. The value takes the whole
|
|
156
|
+
line between them, its label under it (Mihai, 4 Dec 2026), so a phone number reads whole at 375; a value with no label stands
|
|
157
|
+
alone in the middle; a value edited spans both lines. */
|
|
158
|
+
.o-values-editor[data-values-phone="rows"] .o-values-editor-row {
|
|
159
|
+
display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "grip value acts" "grip label acts"; align-items: center;
|
|
160
|
+
gap: 0; height: auto; padding: 0 var(--vk-spacing) 0 calc(var(--vk-spacing) * 0.5); border-radius: 0;
|
|
161
|
+
}
|
|
162
|
+
.o-values-editor[data-values-phone="rows"] .o-values-editor-row > .o-values-editor-grip { grid-area: grip; }
|
|
163
|
+
.o-values-editor[data-values-phone="rows"] .o-values-editor-row > .o-values-editor-value { grid-area: value; justify-self: start; max-width: 100%; }
|
|
164
|
+
.o-values-editor[data-values-phone="rows"] .o-values-editor-row > .o-values-editor-label { grid-area: label; justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
|
|
165
|
+
.o-values-editor[data-values-phone="rows"] .o-values-editor-row > .o-values-editor-acts { grid-area: acts; }
|
|
166
|
+
.o-values-editor[data-values-phone="rows"] .o-values-editor-row > .o-values-editor-edit { grid-column: 2 / -1; grid-row: 1 / -1; }
|
|
167
|
+
/* With a label under it, the value and its label stand together in the row's height, 4 above and below. */
|
|
168
|
+
.o-values-editor[data-values-phone="rows"] .o-values-editor-row:has(> .o-values-editor-label) { padding-block: var(--vk-spacing); }
|
|
169
|
+
.o-values-editor[data-values-phone="rows"] .o-values-editor-row:has(> .o-values-editor-label) > .o-values-editor-value { min-height: 0; align-self: end; }
|
|
170
|
+
.o-values-editor[data-values-phone="rows"] .o-values-editor-row:has(> .o-values-editor-label) > .o-values-editor-label { align-self: start; }
|
|
157
171
|
@media (hover: hover) { .o-values-editor[data-values-phone="rows"] .o-values-editor-row:hover { background-color: transparent; } }
|
|
158
172
|
.o-values-editor[data-values-phone="rows"] .o-values-editor-row[data-lifted] { background-color: var(--vk-overlay); box-shadow: var(--vk-shadow-lg); }
|
|
159
173
|
.o-values-editor[data-values-holds="one"][data-values-phone="rows"] .o-values-editor-row { padding-left: calc(var(--vk-spacing) * 3); }
|
|
160
174
|
.o-values-editor[data-values-phone="rows"] .o-values-editor-value { flex: 0 1 auto; min-width: 0; min-height: calc(var(--vk-spacing) * 11); cursor: text; text-decoration-color: var(--vk-brand-subtler); text-underline-offset: var(--vk-spacing); }
|
|
161
|
-
|
|
175
|
+
/* Its label under it, where it starts. */
|
|
176
|
+
.o-values-editor[data-values-phone="rows"] .o-values-editor-label { margin-left: 0; padding-left: 0; color: var(--vk-fg-subtlest); font-size: var(--vk-font-size-sm); }
|
|
162
177
|
.o-values-editor-acts { display: flex; flex: none; margin-left: auto; }
|
|
163
178
|
.o-values-editor-label + .o-values-editor-acts { margin-left: 0; }
|
|
164
179
|
.o-values-editor[data-values-phone="rows"] .o-values-editor-remove { opacity: 1; }
|
|
@@ -15,6 +15,7 @@ import { PanelHeadButton } from "../internal/head-button.js";
|
|
|
15
15
|
import { PanelControlsFromViews } from "../internal/map-panel-controls.js";
|
|
16
16
|
import { SheetPartsFrom } from "../sheet/sheet-parts.js";
|
|
17
17
|
import { Icon } from "../internal/icons.js";
|
|
18
|
+
import { glyph, X } from "../internal/editor-parts.js";
|
|
18
19
|
export function viewsListWordsOf(say, createLabel) {
|
|
19
20
|
return {
|
|
20
21
|
label: say({ key: "views.panels.views-list" }),
|
|
@@ -102,6 +103,8 @@ export function viewMenuWordsOf(say) {
|
|
|
102
103
|
copyOf: (name) => say({ key: "views.panels.view-copy-name", values: { name } }),
|
|
103
104
|
stay: (records) => say({ key: "views.panels.view-delete-stays", values: { records } }),
|
|
104
105
|
goes: say({ key: "views.panels.view-delete-goes" }),
|
|
106
|
+
goesOwn: say({ key: "views.panels.view-delete-goes-own" }),
|
|
107
|
+
notNow: say({ key: "views.menus.not-now" }),
|
|
105
108
|
columns: (layout) => say({ key: "views.panels.view-columns", values: { layout } }),
|
|
106
109
|
};
|
|
107
110
|
}
|
|
@@ -117,7 +120,12 @@ function useStepHead(step, props) {
|
|
|
117
120
|
const setParts = React.useContext(SheetPartsFrom);
|
|
118
121
|
React.useLayoutEffect(() => { setParts?.(step ? { title: step.title, head: { onBack: step.onBack } } : null); });
|
|
119
122
|
React.useLayoutEffect(() => () => setParts?.(null), [setParts]);
|
|
120
|
-
|
|
123
|
+
const actions = props.actions;
|
|
124
|
+
if (!actions || setParts)
|
|
125
|
+
return null;
|
|
126
|
+
if (step)
|
|
127
|
+
return actions.back ? (_jsx("div", { className: "o-sheet-head", "data-slot": "vk-views-list-head", children: _jsx(HeaderBar, { className: "o-sheet-row", "data-sides": "", title: _jsx("h2", { className: "o-sheet-title", children: step.title }), right: _jsx("span", {}), left: _jsx(PanelHeadButton, { "data-slot": "vk-editor-back", "aria-label": actions.back.label, className: "o-sheet-back", icon: _jsx(Icon, { name: "left" }), onClick: actions.back.onPress }) }) })) : null;
|
|
128
|
+
return (_jsx("div", { className: "o-sheet-head", "data-slot": "vk-views-list-head", children: _jsx(HeaderBar, { className: "o-sheet-row", "data-sides": "", title: _jsx("h2", { className: "o-sheet-title", children: props.label }), right: _jsx("span", {}), left: _jsx(PanelHeadButton, { "data-slot": "vk-editor-close", "aria-label": actions.close.label, icon: glyph(X), onClick: actions.close.onPress }) }) }));
|
|
121
129
|
}
|
|
122
130
|
function Plain(props) {
|
|
123
131
|
const context = React.useContext(ViewsContext);
|
|
@@ -85,6 +85,7 @@ export declare const canDelete: (views: ListView[]) => boolean;
|
|
|
85
85
|
export type DeleteLineWords = {
|
|
86
86
|
stay: (records: string) => string;
|
|
87
87
|
goes: string;
|
|
88
|
+
goesOwn: string;
|
|
88
89
|
};
|
|
89
90
|
/** The delete question's line: the view goes for everyone who uses it (a private view only for its maker), and the records stay. */
|
|
90
91
|
export declare function deleteLine(view: ListView, records: string, words?: DeleteLineWords): string;
|
|
@@ -12,10 +12,10 @@ export function copyName(name, names, copyOf = (n) => `Copy of ${n}`) {
|
|
|
12
12
|
return `${base} ${n}`;
|
|
13
13
|
}
|
|
14
14
|
export const canDelete = (views) => views.length > 1;
|
|
15
|
-
const DELETE_LINE = { stay: (records) => `The ${records} in it stay as they are.`, goes: "The view goes for everyone who uses it." };
|
|
15
|
+
const DELETE_LINE = { stay: (records) => `The ${records} in it stay as they are.`, goes: "The view goes for everyone who uses it.", goesOwn: "The view goes only for you." };
|
|
16
16
|
export function deleteLine(view, records, words = DELETE_LINE) {
|
|
17
17
|
const stay = words.stay(records);
|
|
18
|
-
return view.private ?
|
|
18
|
+
return `${view.private ? words.goesOwn : words.goes} ${stay}`;
|
|
19
19
|
}
|
|
20
20
|
export const columnsLabel = (layoutName, words = (l) => `${l} columns`) => words(layoutName);
|
|
21
21
|
const set = (views, id, change) => views.map((v) => (v.id === id ? { ...v, ...change } : v));
|
|
@@ -107,7 +107,7 @@ export function useViewMenu(props) {
|
|
|
107
107
|
onDone?.();
|
|
108
108
|
say(w.deleted(view.name), () => onChange({ kind: "restore", view, at, open: wasOpen }));
|
|
109
109
|
};
|
|
110
|
-
const lineOf = (v) => deleteLine(
|
|
110
|
+
const lineOf = (v) => deleteLine(v, records, { stay: w.stay, goes: w.goes, goesOwn: w.goesOwn });
|
|
111
111
|
const askDelete = (id) => {
|
|
112
112
|
const v = viewOf(id);
|
|
113
113
|
if (!stepping && askPort && v) {
|
|
@@ -150,7 +150,7 @@ export function useViewMenu(props) {
|
|
|
150
150
|
];
|
|
151
151
|
return props.reshape ? props.reshape(all, id) : all;
|
|
152
152
|
};
|
|
153
|
-
const entries = (id) => menuEntries(items(id),
|
|
153
|
+
const entries = (id) => menuEntries(items(id), w.notNow, "vk-view-menu-row");
|
|
154
154
|
const where = props.container ?? undefined, standing = props.standing;
|
|
155
155
|
const target = asked && (asked.what === "rename" || asked.what === "delete" || asked.what === "menu") ? viewOf(asked.id) : undefined;
|
|
156
156
|
const asking = shown;
|
|
@@ -72,6 +72,10 @@ export interface ViewMenuWords {
|
|
|
72
72
|
copyOf: (name: string) => string;
|
|
73
73
|
stay: (records: string) => string;
|
|
74
74
|
goes: string;
|
|
75
|
+
/** The delete question's line on a person's own view (VK-959). */
|
|
76
|
+
goesOwn: string;
|
|
77
|
+
/** Why a row that can't be used, and gives no reason of its own, can't be (VK-997). */
|
|
78
|
+
notNow: string;
|
|
75
79
|
columns: (layout: string) => string;
|
|
76
80
|
}
|
|
77
81
|
/** A view's menu's words in English. */
|
|
@@ -8,5 +8,6 @@ export const VIEW_MENU_WORDS = {
|
|
|
8
8
|
thisView: "This view", renameTitle: "Rename view", save: "Save", newView: "New view", createView: "Create view", layout: "Layout", name: "Name",
|
|
9
9
|
cancel: "Cancel", close: "Close", failed: "That didn't go through. Nothing changed.", tryAgain: "Try again",
|
|
10
10
|
deleteTitle: (name) => `Delete ${name}?`, deleted: (name) => `${name} was deleted`, copyOf: (name) => `Copy of ${name}`,
|
|
11
|
-
stay: (records) => `The ${records} in it stay as they are.`, goes: "The view goes for everyone who uses it.",
|
|
11
|
+
stay: (records) => `The ${records} in it stay as they are.`, goes: "The view goes for everyone who uses it.", goesOwn: "The view goes only for you.", notNow: "Not now",
|
|
12
|
+
columns: (layout) => `${layout} columns`,
|
|
12
13
|
};
|
|
@@ -11,7 +11,13 @@ import type { ReactNode } from "react";
|
|
|
11
11
|
* the data (`avatarUrl` rides the relation value), so "should this show the
|
|
12
12
|
* picture?" is never re-decided per surface.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* The mark stands in one slot the photo's size (16px), whatever draws in it: the
|
|
15
|
+
* photo, an app's own mark, or a 12px glyph centred. So in a column of chips,
|
|
16
|
+
* a person with a photo above an import with a glyph, every label starts at the
|
|
17
|
+
* same x (VK-1073). The slot sheds the same 2px of line as the photo, so a chip
|
|
18
|
+
* stands no taller than before.
|
|
19
|
+
*
|
|
20
|
+
* Renders a fragment (mark slot + label as siblings) — the CALLER owns the flex
|
|
15
21
|
* container, its gap, and the interactivity around it. That is what lets the
|
|
16
22
|
* grid chip, with its own hover/link contract, and the feed link, with its
|
|
17
23
|
* primary-colored label, share one identity without sharing chrome.
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cx } from "../internal/cx.js";
|
|
4
4
|
import { useViews } from "../provider/context.js";
|
|
5
|
+
const MARK_SLOT = "inline-flex h-4 w-4 -my-0.5 shrink-0 items-center justify-center";
|
|
5
6
|
export function EntityChipIdentity({ label, avatarUrl, kind, iconOverride, fallbackIcon, labelClassName, }) {
|
|
6
7
|
const { Avatar } = useViews().atoms;
|
|
7
|
-
return (_jsxs(_Fragment, { children: [_jsx(Avatar, { label: label, avatarUrl: avatarUrl, kind: kind, size: "chip", fallback: iconOverride ?? fallbackIcon ?? null }), _jsx("span", { className: cx("min-w-0", labelClassName), children: label })] }));
|
|
8
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: MARK_SLOT, children: _jsx(Avatar, { label: label, avatarUrl: avatarUrl, kind: kind, size: "chip", fallback: iconOverride ?? fallbackIcon ?? null }) }), _jsx("span", { className: cx("min-w-0", labelClassName), children: label })] }));
|
|
8
9
|
}
|
|
@@ -8,9 +8,10 @@ export declare function OptionStatus({ slot, label, icon, place, }: {
|
|
|
8
8
|
icon?: string;
|
|
9
9
|
place?: ViewsStatusPlace;
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
/** A category option as its cell draws it
|
|
12
|
-
export declare function OptionCategory({ label, color, icon }: {
|
|
11
|
+
/** A category option as its cell draws it; handed a remove, as an editor draws it held, with its ×. */
|
|
12
|
+
export declare function OptionCategory({ label, color, icon, onRemove }: {
|
|
13
13
|
label: string;
|
|
14
14
|
color: CategoryColor;
|
|
15
15
|
icon?: string;
|
|
16
|
+
onRemove?: () => void;
|
|
16
17
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,7 +5,7 @@ export function OptionStatus({ slot, label, icon, place, }) {
|
|
|
5
5
|
const { atoms: { StatusBadge }, components: { AppIcon }, } = useViews();
|
|
6
6
|
return (_jsx(StatusBadge, { slot: slot, label: label, place: place, size: "row", className: "border-0", leading: icon ? _jsx(AppIcon, { name: icon, className: "size-3 shrink-0" }) : undefined }));
|
|
7
7
|
}
|
|
8
|
-
export function OptionCategory({ label, color, icon }) {
|
|
8
|
+
export function OptionCategory({ label, color, icon, onRemove }) {
|
|
9
9
|
const { atoms: { Tag }, components: { AppIcon }, } = useViews();
|
|
10
|
-
return (_jsx(Tag, { label: label, color: color, leading: icon ? _jsx(AppIcon, { name: icon, className: "size-3 shrink-0" }) : undefined }));
|
|
10
|
+
return (_jsx(Tag, { label: label, color: color, leading: icon ? _jsx(AppIcon, { name: icon, className: "size-3 shrink-0" }) : undefined, ...(onRemove ? { onRemove } : {}) }));
|
|
11
11
|
}
|
|
@@ -11,6 +11,7 @@ import { ROW_INTERACTIVE_SELECTOR as OWN_PRESS } from "../selection/row-click.js
|
|
|
11
11
|
import { ELEMENT_RESET } from "../internal/reset.js";
|
|
12
12
|
import { tabbable } from "../editors/tab-ends.js";
|
|
13
13
|
import { useViews } from "../provider/context.js";
|
|
14
|
+
import { ScreenForms } from "../internal/screen-forms.js";
|
|
14
15
|
import { useDesktop } from "../provider/desktop.js";
|
|
15
16
|
import { RowEditor, rowOpensSheet } from "./editors/RowEditor.js";
|
|
16
17
|
import { drawnText } from "./drawn-text.js";
|
|
@@ -23,7 +24,8 @@ import { OpenValueAction, isOpenableType } from "../editors/open-value.js";
|
|
|
23
24
|
import { FIELD_ROW_TARGET as TARGET } from "./row-target.js";
|
|
24
25
|
import { settlementAttributes, useRowSettlement } from "./useRowSettlement.js";
|
|
25
26
|
import { EditLeaveContext, useEditLeaveScope } from "../editors/leave-scope.js";
|
|
26
|
-
const FIELD_ROW_FRAME_READS = "gap-x-(--vk-field-row-gap,calc(var(--spacing)*3)) min-h-(--vk-field-row-h,auto) py-(--vk-field-row-py,calc(var(--spacing)*2.5)) border-b-(length:--vk-field-row-line-w,1px) border-(color:--vk-field-row-line,var(--vk-border)) last:border-0"
|
|
27
|
+
const FIELD_ROW_FRAME_READS = "gap-x-(--vk-field-row-gap,calc(var(--spacing)*3)) min-h-(--vk-field-row-h,auto) py-(--vk-field-row-py,calc(var(--spacing)*2.5)) border-b-(length:--vk-field-row-line-w,1px) border-(color:--vk-field-row-line,var(--vk-border)) last:border-0 " +
|
|
28
|
+
"[[data-vk-screen-forms]:last-child>&]:border-0 [[data-vk-twin=computer]:has(+[data-vk-twin=phone]:last-child)>&]:border-0";
|
|
27
29
|
const EDITOR_PANEL = '[data-slot="vk-editor-panel"]';
|
|
28
30
|
function tabOn(from, by) {
|
|
29
31
|
const root = from.closest('[role="dialog"], [aria-modal="true"]') ?? from.ownerDocument.body;
|
|
@@ -49,6 +51,7 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
|
|
|
49
51
|
const views = useViews();
|
|
50
52
|
const desktop = useDesktop();
|
|
51
53
|
const inRows = inCard && !desktop;
|
|
54
|
+
const form = inRows ? "rows" : desktop ? "computer" : "phone";
|
|
52
55
|
const { atoms, components, conventions, icons, messages, oneValue } = views;
|
|
53
56
|
const { CommandMenu } = atoms;
|
|
54
57
|
const { AppIcon } = components;
|
|
@@ -280,18 +283,19 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
|
|
|
280
283
|
open(false);
|
|
281
284
|
};
|
|
282
285
|
const sheet = inRows && writable && shownDef.type !== "boolean" && !hasMenu && !unread && rowOpensSheet(field, oneValue);
|
|
283
|
-
return (_jsx(EditLeaveContext.Provider, { value: leaveScope, children: _jsxs("div", { ref: rowRef, className: cx(inRows
|
|
286
|
+
return (_jsx(EditLeaveContext.Provider, { value: leaveScope, children: _jsxs("div", { ref: rowRef, "data-form": form, className: cx(inRows
|
|
284
287
|
?
|
|
285
288
|
cx("o-field-row py-3", pressOpens && "cursor-pointer")
|
|
286
|
-
:
|
|
287
|
-
|
|
288
|
-
: "grid grid-cols-[auto_minmax(0,1fr)_auto] content-center items-start gap-y-1", !inRows && FIELD_ROW_FRAME_READS), "aria-busy": pending ? "true" : undefined, onClick: inRows ? onRowPress : undefined, onPointerDown: inRows
|
|
289
|
+
:
|
|
290
|
+
"group/field-row grid content-center items-start data-[form=computer]:grid-cols-[auto_var(--vk-field-row-label-w,calc(var(--spacing)*32))_minmax(0,1fr)_auto] data-[form=computer]:in-data-[field-row-icon=off]:grid-cols-[var(--vk-field-row-label-w,calc(var(--spacing)*32))_minmax(0,1fr)_auto] data-[form=phone]:grid-cols-[auto_minmax(0,1fr)_auto] data-[form=phone]:gap-y-1", !inRows && FIELD_ROW_FRAME_READS), "aria-busy": pending ? "true" : undefined, onClick: inRows ? onRowPress : undefined, onPointerDown: inRows
|
|
289
291
|
? () => {
|
|
290
292
|
downWhileEditing.current = editing;
|
|
291
293
|
}
|
|
292
|
-
: undefined, children: [_jsx("span", { className: inRows
|
|
294
|
+
: undefined, children: [_jsx("span", { className: inRows
|
|
295
|
+
? "o-field-row-glyph"
|
|
296
|
+
: "flex h-5 w-3.5 shrink-0 items-center justify-center group-data-[form=computer]/field-row:in-data-[field-row-icon=off]:hidden", children: glyph }), _jsx("span", { className: inRows
|
|
293
297
|
? "o-field-row-label"
|
|
294
|
-
: "text-sm leading-5 text-(color:--vk-field-row-label-fg,var(--vk-fg-subtle))", children: field.label }), _jsxs("div", { className: cx(inRows ? "min-w-0 flex-1" : "min-w-0 flex-1 text-sm leading-5 text-(color:--vk-fg)", !
|
|
298
|
+
: "text-sm leading-5 text-(color:--vk-field-row-label-fg,var(--vk-fg-subtle))", children: field.label }), _jsxs("div", { className: cx(inRows ? "min-w-0 flex-1" : "min-w-0 flex-1 text-sm leading-5 text-(color:--vk-fg)", !inRows && "group-data-[form=phone]/field-row:col-span-2 group-data-[form=phone]/field-row:col-start-2 group-data-[form=phone]/field-row:row-start-2", settlement.requested && "italic opacity-80"), ...settlementAttributes(settlement.requested, field.provenance, conventions), children: [editing ? (_jsx("div", { children: _jsx(RowEditor, { binding: binding, row: row, initial: retryDraft ? retryDraft.commit : editValue, refused: retryDraft?.reason, shown: shown, conversion: convertedFrom ? body : undefined, anchor: inRows ? (_jsx("span", { className: "flex min-w-0", children: valueNode })) : (_jsx("span", { className: cx(TARGET, "bg-(color:--vk-neutral)"), children: valueNode })), onAttempt: (resolution) => {
|
|
295
299
|
watchLeaving();
|
|
296
300
|
const answer = attempt(resolution);
|
|
297
301
|
if (answer.accepted && leaving.current)
|
|
@@ -313,6 +317,6 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
|
|
|
313
317
|
}
|
|
314
318
|
function FieldRowPlace(props) {
|
|
315
319
|
const inCard = useContext(FieldRowsCardContext) !== null;
|
|
316
|
-
return _jsx(OutOfFieldRows, { children: _jsx(FieldRowImpl, { ...props, inCard: inCard }) });
|
|
320
|
+
return (_jsx(ScreenForms, { off: inCard, children: _jsx(OutOfFieldRows, { children: _jsx(FieldRowImpl, { ...props, inCard: inCard }) }) }));
|
|
317
321
|
}
|
|
318
322
|
export const FieldRow = memo(FieldRowPlace);
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
+
import type { ViewsMenuItem } from "../../provider/components.js";
|
|
2
3
|
import type { ListColumnsConfig } from "../../model/column-state.js";
|
|
3
4
|
/** An app's own "+ Add column": a node, `null` for none, anything else falsy for the grid's own. */
|
|
4
5
|
type RenderAddColumn = ((columns: ListColumnsConfig) => ReactNode) | undefined;
|
|
6
|
+
/** The app's function from + Add column's rows to the rows it shows (`menus.addColumn`, its columns already handed). */
|
|
7
|
+
type Reshape = (items: ViewsMenuItem[]) => ViewsMenuItem[];
|
|
5
8
|
/** Whether the header row ends in an Add column: not where the app's own answers `null`. */
|
|
6
9
|
export declare function gridAddColumnDrawn(render: RenderAddColumn, columns: ListColumnsConfig): boolean;
|
|
7
10
|
/** The header's Add column: the app's own, none where it answers `null`, else the grid's own, drawn for where it
|
|
8
11
|
* stands (`at`: the row's last cell, or a lone + in the title column's header). */
|
|
9
|
-
export declare function gridAddColumnNode(render: RenderAddColumn, columns: ListColumnsConfig, at?: "end" | "title"): ReactNode | null;
|
|
12
|
+
export declare function gridAddColumnNode(render: RenderAddColumn, columns: ListColumnsConfig, at?: "end" | "title", reshape?: Reshape): ReactNode | null;
|
|
10
13
|
/**
|
|
11
14
|
* "+ ADD COLUMN" ON EVERY GRID: the header row's last cell, for anyone who reads the list. It lists the columns
|
|
12
15
|
* this view hides and can show, and shows the one picked: a choice about the reader's own view, never a change
|
|
@@ -15,8 +18,10 @@ export declare function gridAddColumnNode(render: RenderAddColumn, columns: List
|
|
|
15
18
|
* the host's instead (a relation's ›, Create new field), in the same look. Hiding is a column's own menu, the
|
|
16
19
|
* order is dragging the header, and the whole list is the host's column list.
|
|
17
20
|
*/
|
|
18
|
-
export declare function GridAddColumn({ columns, at, }: {
|
|
21
|
+
export declare function GridAddColumn({ columns, at, reshape, }: {
|
|
19
22
|
columns: ListColumnsConfig;
|
|
23
|
+
/** The app's function from its rows to the rows it shows (`menus.addColumn`). */
|
|
24
|
+
reshape?: Reshape;
|
|
20
25
|
/** Where it stands: the header row's last cell, its words beside the +, or the title column's header, a lone
|
|
21
26
|
* round + at its right edge (`addColumnAt`). */
|
|
22
27
|
at?: "end" | "title";
|
|
@@ -8,13 +8,13 @@ import { returnGridFocus, useGridMenuPress } from "./grid-menu-focus.js";
|
|
|
8
8
|
export function gridAddColumnDrawn(render, columns) {
|
|
9
9
|
return render?.(columns) !== null;
|
|
10
10
|
}
|
|
11
|
-
export function gridAddColumnNode(render, columns, at = "end") {
|
|
11
|
+
export function gridAddColumnNode(render, columns, at = "end", reshape) {
|
|
12
12
|
const own = render?.(columns);
|
|
13
13
|
if (own === null)
|
|
14
14
|
return null;
|
|
15
|
-
return own || _jsx(GridAddColumn, { columns: columns, at: at });
|
|
15
|
+
return own || _jsx(GridAddColumn, { columns: columns, at: at, ...(reshape && { reshape }) });
|
|
16
16
|
}
|
|
17
|
-
export function GridAddColumn({ columns, at = "end", }) {
|
|
17
|
+
export function GridAddColumn({ columns, at = "end", reshape, }) {
|
|
18
18
|
const inTitle = at === "title";
|
|
19
19
|
const [open, setOpen] = useState(false);
|
|
20
20
|
const [anchor, setAnchor] = useState(null);
|
|
@@ -31,7 +31,8 @@ export function GridAddColumn({ columns, at = "end", }) {
|
|
|
31
31
|
if (anchor && reason !== "outside-press" && reason !== "focus-out")
|
|
32
32
|
returnGridFocus(anchor);
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const built = open ? gridAddColumnItems(columns, { messages, close: () => close("item-press") }) : null;
|
|
35
|
+
const items = built ? (reshape ? reshape(built) : built) : leaving;
|
|
35
36
|
return (_jsxs(_Fragment, { children: [drawGridButton(views, {
|
|
36
37
|
ref: setAnchor,
|
|
37
38
|
tabIndex: -1,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import { type FieldType } from "viewkitjs/fields";
|
|
2
|
+
import { type CloseReason, type FieldType } from "viewkitjs/fields";
|
|
3
3
|
import type { GridEditorId } from "../../model/column-types.js";
|
|
4
4
|
import { type ListSettingsConfig } from "../../model/column-capabilities.js";
|
|
5
5
|
import type { ListColumn, ListSelectColor } from "../../model/column-schema.js";
|
|
@@ -37,6 +37,9 @@ export type GridCellEditorContext<Row> = {
|
|
|
37
37
|
overlay?: GridCommitOverlay;
|
|
38
38
|
}) => void;
|
|
39
39
|
onCancel: () => void;
|
|
40
|
+
/** Told the moment the editor starts to close (its session accepted an answer), with the reason, before its exit
|
|
41
|
+
* plays: the cell stops wearing `data-editing` then, and a press away lets the pick go. */
|
|
42
|
+
onClosing?: (reason: CloseReason | null) => void;
|
|
40
43
|
onTab: (backwards: boolean) => void;
|
|
41
44
|
onEnter: () => void;
|
|
42
45
|
};
|
|
@@ -19,6 +19,7 @@ import { gridTextOpensBox, isLongTextColumn } from "../../model/column-inspect.j
|
|
|
19
19
|
import { gridClearRefusal, gridColumnEffectiveClearable, gridColumnLocked, gridEditRefusal, gridNormalizeWrite, } from "../../model/column-capabilities.js";
|
|
20
20
|
import { useViews } from "../../provider/context.js";
|
|
21
21
|
import { EditFieldTypeContext, EditOpensListContext } from "../../editors/escape-rule.js";
|
|
22
|
+
import { GridEditClosingContext } from "./grid-edit-session.js";
|
|
22
23
|
import { gridRelationSource } from "../../model/column-types.js";
|
|
23
24
|
import { gridPartWrite } from "../../model/part-write.js";
|
|
24
25
|
function useCellRefusal(col, listConfig, region, row) {
|
|
@@ -35,7 +36,7 @@ function useCellRefusal(col, listConfig, region, row) {
|
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
export function GridCellInlineEditor({ ctx }) {
|
|
38
|
-
return (_jsx(EditFieldTypeContext.Provider, { value: gridEscapeType(ctx.col), children: _jsx(EditOpensListContext.Provider, { value: ctx.editorKind === "values", children: _jsx(InlineEditor, { ctx: ctx }) }) }));
|
|
39
|
+
return (_jsx(EditFieldTypeContext.Provider, { value: gridEscapeType(ctx.col), children: _jsx(EditOpensListContext.Provider, { value: ctx.editorKind === "values", children: _jsx(GridEditClosingContext.Provider, { value: ctx.onClosing ?? null, children: _jsx(InlineEditor, { ctx: ctx }) }) }) }));
|
|
39
40
|
}
|
|
40
41
|
export function gridEscapeType(col) {
|
|
41
42
|
if (col.field)
|
|
@@ -65,7 +66,7 @@ function InlineEditor({ ctx }) {
|
|
|
65
66
|
return null;
|
|
66
67
|
}
|
|
67
68
|
export function GridCellAnchoredEditor({ ctx, }) {
|
|
68
|
-
return (_jsx(EditFieldTypeContext.Provider, { value: gridEscapeType(ctx.col), children: _jsx(EditOpensListContext.Provider, { value: ctx.editorKind === "values", children: _jsx(AnchoredEditor, { ctx: ctx }) }) }));
|
|
69
|
+
return (_jsx(EditFieldTypeContext.Provider, { value: gridEscapeType(ctx.col), children: _jsx(EditOpensListContext.Provider, { value: ctx.editorKind === "values", children: _jsx(GridEditClosingContext.Provider, { value: ctx.onClosing ?? null, children: _jsx(AnchoredEditor, { ctx: ctx }) }) }) }));
|
|
69
70
|
}
|
|
70
71
|
function AnchoredEditor({ ctx }) {
|
|
71
72
|
const { row, rowId, col, baseline, onCommitCell, onCancel } = ctx;
|
|
@@ -48,8 +48,6 @@ export declare const GRID_CELL_HOVER_SHADOW = "hover:shadow-[var(--vk-outline-ho
|
|
|
48
48
|
* consumer (hairlines ratchet).
|
|
49
49
|
*/
|
|
50
50
|
export declare const GRID_CELL_HOVER_RING = "hover:after:pointer-events-none hover:after:absolute hover:after:inset-0 hover:after:z-1 hover:after:rounded-(--vk-outline-radius,var(--radius-sm)) hover:after:border hover:after:border-(color:--vk-outline-hover,var(--vk-border-bold))";
|
|
51
|
-
/** The selection ring, in the same geometry the hover ring draws.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
editing?: boolean;
|
|
55
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
/** The selection ring, in the same geometry the hover ring draws. Drawn on a selected cell, never while its editor is
|
|
52
|
+
* open: an open editor shows no ring, no lift and no tint on its cell. */
|
|
53
|
+
export declare function GridCellOutline(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cx } from "../../internal/cx.js";
|
|
3
|
-
import {
|
|
3
|
+
import { GRID_GROUND, GRID_GROUND_WHILE_SCROLLED } from "./grid-styles.js";
|
|
4
4
|
const GRID_FROZEN_HOVER = "group-hover/gridrow:bg-[linear-gradient(var(--vk-hovered),var(--vk-hovered))] group-data-hovered/gridrow:bg-[linear-gradient(var(--vk-hovered),var(--vk-hovered))]";
|
|
5
5
|
const GRID_FROZEN_BG_SELECTED = "bg-[linear-gradient(var(--vk-brand-subtlest),var(--vk-brand-subtlest))]";
|
|
6
6
|
const GRID_FROZEN_BG_SELECTED_HOVER = "group-hover/gridrow:bg-[linear-gradient(color-mix(in_oklab,_var(--vk-brand)_10%,_transparent),color-mix(in_oklab,_var(--vk-brand)_10%,_transparent)),linear-gradient(var(--vk-brand-subtlest),var(--vk-brand-subtlest))] group-data-hovered/gridrow:bg-[linear-gradient(color-mix(in_oklab,_var(--vk-brand)_10%,_transparent),color-mix(in_oklab,_var(--vk-brand)_10%,_transparent)),linear-gradient(var(--vk-brand-subtlest),var(--vk-brand-subtlest))]";
|
|
@@ -39,8 +39,6 @@ export function gridFrozenBg(selected, on, highlight = "hover") {
|
|
|
39
39
|
}
|
|
40
40
|
export const GRID_CELL_HOVER_SHADOW = "hover:shadow-[var(--vk-outline-hover-shadow,0_1px_2px_rgb(0_0_0/0.05))] dark:hover:shadow-[var(--vk-outline-hover-shadow,0_1px_2px_rgb(0_0_0/0.22))]";
|
|
41
41
|
export const GRID_CELL_HOVER_RING = "hover:after:pointer-events-none hover:after:absolute hover:after:inset-0 hover:after:z-1 hover:after:rounded-(--vk-outline-radius,var(--radius-sm)) hover:after:border hover:after:border-(color:--vk-outline-hover,var(--vk-border-bold))";
|
|
42
|
-
export function GridCellOutline(
|
|
43
|
-
return (_jsx("span", { "aria-hidden": true, "data-slot": "vk-grid-outline", className: cx("pointer-events-none absolute inset-0 z-1 rounded-(--vk-outline-radius,var(--radius-sm)) border",
|
|
44
|
-
? "border-(color:--vk-outline-active,var(--vk-border-brand))"
|
|
45
|
-
: "border-(color:--vk-outline,var(--vk-fg-subtle)) group-hover/gridcell:border-(color:--vk-outline-active,var(--vk-border-brand))", editing && GRID_EDITING_SHADOW) }));
|
|
42
|
+
export function GridCellOutline() {
|
|
43
|
+
return (_jsx("span", { "aria-hidden": true, "data-slot": "vk-grid-outline", className: cx("pointer-events-none absolute inset-0 z-1 rounded-(--vk-outline-radius,var(--radius-sm)) border", "border-(color:--vk-outline,var(--vk-fg-subtle)) group-hover/gridcell:border-(color:--vk-outline-active,var(--vk-border-brand))") }));
|
|
46
44
|
}
|
|
@@ -36,5 +36,5 @@ export function GridChipsEditor({ column, title, values, suggestions, optionColo
|
|
|
36
36
|
(column.field ? (optionFor(column.field, value)?.label ?? value) : prettifyOptionValue(value)),
|
|
37
37
|
color: resolveCategoryColor(value, column.options, optionColors),
|
|
38
38
|
});
|
|
39
|
-
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place, initialFocus: false, panelData: { "data-slot": "vk-grid-editor", ...panel.data }, onPanelClick: (event) => event.stopPropagation(), chrome: "menu", className: panel.className, children: _jsx(ChipsEditor, { ref: editorRef, values: values, suggestions: offered, resolve: resolve, normalize: column.chips?.normalize, creatable: open, seed: seed, addOption: field ? column.addOption : undefined, onRequestClose: close, label: typeof title === "string" ? title : undefined }) })] }));
|
|
39
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place.sideOffset, alignOffset: place.alignOffset, initialFocus: false, panelData: { "data-slot": "vk-grid-editor", ...panel.data }, onPanelClick: (event) => event.stopPropagation(), chrome: "menu", className: panel.className, children: _jsx(ChipsEditor, { ref: editorRef, values: values, suggestions: offered, resolve: resolve, normalize: column.chips?.normalize, creatable: open, seed: seed, addOption: field ? column.addOption : undefined, onRequestClose: close, label: typeof title === "string" ? title : undefined }) })] }));
|
|
40
40
|
}
|
|
@@ -38,6 +38,6 @@ export declare function GridDateEditor({ title, initial, dayOnly, browserClock,
|
|
|
38
38
|
refuse?: (value: string) => string | null;
|
|
39
39
|
/** After a Tab out of the panel saves: move to the next cell, or the one before on Shift-Tab. */
|
|
40
40
|
onTab?: (backwards: boolean) => void;
|
|
41
|
-
/** After an Enter saves:
|
|
41
|
+
/** After an Enter saves: the grid's answer, which keeps the cell, as a text or number cell's Enter does. */
|
|
42
42
|
onEnter?: () => void;
|
|
43
43
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -23,5 +23,5 @@ export function GridDateEditor({ title, initial, dayOnly = false, browserClock =
|
|
|
23
23
|
onTab,
|
|
24
24
|
onEnter,
|
|
25
25
|
});
|
|
26
|
-
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place, initialFocus: false, panelData: { "data-slot": "vk-grid-editor" }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: "z-90 w-auto", children: _jsx(EditorClockContext.Provider, { value: browserClock ? "browser" : "conventions", children: _jsx(DateEditorHost, { ref: editorRef, label: typeof title === "string" ? title : undefined, initial: initial, dayOnly: dayOnly, clearable: clearable, seed: seed, focusDate: !sheet, onRequestClose: close }) }) })] }));
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place.sideOffset, alignOffset: place.alignOffset, initialFocus: false, panelData: { "data-slot": "vk-grid-editor" }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: "z-90 w-auto", children: _jsx(EditorClockContext.Provider, { value: browserClock ? "browser" : "conventions", children: _jsx(DateEditorHost, { ref: editorRef, label: typeof title === "string" ? title : undefined, initial: initial, dayOnly: dayOnly, clearable: clearable, seed: seed, focusDate: !sheet, onRequestClose: close }) }) })] }));
|
|
27
27
|
}
|
|
@@ -19,7 +19,9 @@ import { timeShown } from "../../display/format.js";
|
|
|
19
19
|
export function GridHeader({ showAddColumn = false, addColumnAt = "end", checkbox, checkColumnId, groupKey, ariaRowIndex, ariaLevel, ariaColOffset = 0, ariaTailIndex, columns, columnManager, minWidth, sort, sortMark = false, selectValues, optionColors, onOptionColorChange, dateStyles, onDateStyleChange, durationStyles, onDurationStyleChange, numberFormats, onNumberFormatChange, showTimeOverrides, onShowTimeChange, percentDisplays, onPercentDisplayChange, columnStateEnabled, listConfig, groupBy, resizingId, startResize, moveResize, endResize, resetColumnWidth, hideColumn, moveColumn, headerDrag, frozenCount = 0, frozenLeft, verticalBorders = true, headerVerticalBorders = false, viewBacked = false, formatsWritable, renderAddColumn, columnMenuItems, menus, openColumnMenu, onOpenColumnMenuChange, }) {
|
|
20
20
|
const { icons, components, messages } = useViews();
|
|
21
21
|
const headId = useId();
|
|
22
|
-
const addColumnNode = columnManager && showAddColumn
|
|
22
|
+
const addColumnNode = columnManager && showAddColumn
|
|
23
|
+
? gridAddColumnNode(renderAddColumn, columnManager, addColumnAt, menus?.addColumn && ((items) => menus.addColumn(items, { columns: columnManager.items })))
|
|
24
|
+
: null;
|
|
23
25
|
const addColumn = addColumnAt === "end" ? addColumnNode : null;
|
|
24
26
|
const titleId = addColumnAt === "title" ? columns.find((column) => column.type === "title")?.id : undefined;
|
|
25
27
|
const titleAddColumn = titleId != null && addColumnNode ? (_jsx("span", { "data-add-column": "", className: "ml-auto flex shrink-0 items-center", onClick: (event) => event.stopPropagation(), children: addColumnNode })) : null;
|
|
@@ -29,6 +29,6 @@ export declare function GridLongTextEditor({ initial, markdown, paragraph, type,
|
|
|
29
29
|
onCancel: () => void;
|
|
30
30
|
/** Closed via Tab — move to the next cell in reading order. */
|
|
31
31
|
onTab?: (backwards: boolean) => void;
|
|
32
|
-
/** Closed via Enter (⌘ or Ctrl Enter in a paragraph)
|
|
32
|
+
/** Closed via Enter (⌘ or Ctrl Enter in a paragraph): the grid's answer, which keeps the cell. */
|
|
33
33
|
onEnter?: () => void;
|
|
34
34
|
}): import("react/jsx-runtime").JSX.Element;
|