viewkitjs 0.36.0 → 0.38.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 +75 -0
- package/package.json +1 -1
- package/views/dist/atoms/types.d.ts +32 -4
- package/views/dist/contract.d.ts +18 -9
- package/views/dist/contract.js +18 -1
- 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/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 +7 -4
- package/views/dist/controls/field.css +64 -1
- package/views/dist/controls/filter-editor/filter-editor.js +2 -2
- package/views/dist/controls/filter-editor/parts.d.ts +2 -0
- package/views/dist/controls/filter-editor/parts.js +1 -1
- package/views/dist/controls/glyphs/glyphs.js +2 -0
- package/views/dist/controls/index.d.ts +3 -1
- package/views/dist/controls/index.js +3 -1
- package/views/dist/controls/inline-input.css +10 -0
- package/views/dist/controls/internal/phone.d.ts +1 -1
- package/views/dist/controls/internal/phone.js +3 -2
- package/views/dist/controls/internal/read-token.d.ts +2 -1
- package/views/dist/controls/internal/read-token.js +2 -1
- 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-list/menu-list.js +3 -2
- package/views/dist/controls/menu.css +4 -4
- package/views/dist/controls/number-editor/tokens.d.ts +8 -0
- package/views/dist/controls/number-editor/tokens.js +2 -0
- package/views/dist/controls/number-editor.css +20 -0
- package/views/dist/controls/pane.css +1 -1
- package/views/dist/controls/picker.css +5 -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/select.js +1 -1
- package/views/dist/controls/sort-editor.css +4 -2
- package/views/dist/controls/text-editor/tokens.d.ts +8 -0
- package/views/dist/controls/text-editor/tokens.js +2 -0
- package/views/dist/controls/text-editor.css +28 -0
- package/views/dist/controls/toolbar/toolbar.d.ts +4 -2
- 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/tooltip.js +2 -1
- package/views/dist/controls/tooltip.css +5 -3
- package/views/dist/controls/values-editor.css +20 -5
- package/views/dist/display/entity-chip.d.ts +7 -1
- package/views/dist/display/entity-chip.js +2 -1
- package/views/dist/field-row/FieldRow.js +25 -12
- package/views/dist/field-row/field-row-button.d.ts +12 -0
- package/views/dist/field-row/field-row-button.js +5 -0
- package/views/dist/fields/binding.d.ts +4 -0
- 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 +15 -5
- package/views/dist/grid/chrome/GridCellOutline.js +20 -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/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 +3 -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/GridRowCells.js +6 -5
- package/views/dist/grid/chrome/GridSelectEditor.js +1 -1
- package/views/dist/grid/chrome/GridStructure.js +3 -3
- package/views/dist/grid/chrome/GridTable.d.ts +2 -1
- package/views/dist/grid/chrome/GridTable.js +7 -2
- package/views/dist/grid/chrome/GridTextEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridTextEditor.js +4 -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 +9 -4
- package/views/dist/grid/chrome/grid-cell-classes.js +2 -2
- package/views/dist/grid/chrome/grid-edit-session.d.ts +8 -0
- package/views/dist/grid/chrome/grid-edit-session.js +21 -3
- package/views/dist/grid/chrome/grid-editor-layer.d.ts +11 -0
- package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +4 -4
- package/views/dist/grid/chrome/grid-fitted-box.js +1 -3
- 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/useGridKeyboard.d.ts +5 -2
- package/views/dist/grid/chrome/useGridKeyboard.js +11 -15
- package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +3 -1
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +30 -2
- package/views/dist/grid/core/useGridEditing.d.ts +3 -0
- package/views/dist/grid/core/useGridEditing.js +2 -0
- package/views/dist/grid/grid.css +4 -19
- package/views/dist/internal/length.d.ts +2 -0
- package/views/dist/internal/length.js +16 -0
- 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 +2 -1
- package/views/dist/list/parts.d.ts +8 -2
- package/views/dist/list/parts.js +31 -7
- package/views/dist/list/toolbar.js +7 -3
- package/views/dist/looks/index.d.ts +1 -0
- package/views/dist/looks/index.js +1 -0
- package/views/dist/panels/react/popover.d.ts +3 -1
- package/views/dist/panels/react/popover.js +2 -2
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +6 -3
- 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/ToolbarButton.js +3 -2
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +1 -3
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +1 -1
- 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/views-row/FoldingViewRow.js +24 -7
- package/views/dist/panels/react/views-row/ViewPicker.js +1 -1
- 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.d.ts +1 -1
- package/views/dist/panels/toolbar/model.d.ts +2 -2
- package/views/dist/provider/components.d.ts +8 -7
- package/views/dist/provider/desktop.d.ts +2 -1
- package/views/dist/provider/desktop.js +5 -2
- package/views/dist/selection/bar-overflow.d.ts +2 -0
- package/views/dist/selection/bar-overflow.js +2 -1
- package/views/dist/selection/bar-props.d.ts +1 -1
- package/views/dist/selection/verbs.d.ts +2 -2
- package/views/dist/styles.css +341 -80
- package/views/dist/styles.unlayered.css +341 -80
- package/views/docs/contract.md +77 -23
- package/views/docs/controls/list.md +2 -0
- package/views/docs/controls/menu.md +2 -0
- package/views/docs/controls/number-editor.md +2 -0
- package/views/docs/controls/picker.md +2 -0
- package/views/docs/controls/popover.md +7 -0
- package/views/docs/controls/text-editor.md +2 -0
- package/views/docs/controls/tooltip.md +2 -0
- package/views/docs/guides/atoms.md +11 -10
- package/views/docs/guides/selection.md +1 -1
- package/views/docs/guides/the-grid.md +7 -5
- package/views/docs/guides/the-provider.md +2 -2
- package/views/docs/reference/controls.md +11 -6
- package/views/docs/reference/display.md +1 -1
- package/views/docs/reference/field-row.md +1 -1
- package/views/docs/reference/list.md +5 -6
- package/views/docs/reference/looks.md +4 -1
- package/views/docs/reference/panels-react.md +5 -4
- package/views/docs/reference/panels.md +1 -1
- package/views/docs/reference/react.md +6 -6
- package/views/docs/reference/selection.md +1 -1
- package/views/docs/reference/views.md +3 -3
- package/views/docs/reshaping.md +2 -2
- package/views/skills/views/SKILL.md +1 -1
|
@@ -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; }
|
|
@@ -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
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { memo, useContext, useEffect, useLayoutEffect, useRef, useState, } from "react";
|
|
4
4
|
import { optimisticDisplay, phoneText, presentedDef, resolveFieldMessage, } from "viewkitjs/fields";
|
|
5
5
|
import { ConvertedFigure } from "../display/converted.js";
|
|
@@ -11,19 +11,21 @@ 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";
|
|
17
18
|
import { FieldNoteLine } from "./FieldNoteLine.js";
|
|
18
19
|
import { FieldRowCheckbox } from "./field-row-checkbox.js";
|
|
19
|
-
import { FIELD_ROW_FRAME, FIELD_ROW_FRAME_BESIDE, FIELD_ROW_FRAME_ROWS, FIELD_ROW_FRAME_ROWS_UNDER, FIELD_ROW_FRAME_UNDER, FieldRowButton, drawFieldRowButton, } from "./field-row-button.js";
|
|
20
|
+
import { FIELD_ROW_FRAME, FIELD_ROW_FRAME_BESIDE, FIELD_ROW_FRAME_ROWS, FIELD_ROW_FRAME_ROWS_UNDER, FIELD_ROW_FRAME_UNDER, FieldRowButton, drawFieldRowButton, TARGET_KEY, } from "./field-row-button.js";
|
|
20
21
|
import { FieldRowLane } from "./FieldRowLane.js";
|
|
21
22
|
import { FieldWriteReconciliationRequired, } from "../fields/write-target.js";
|
|
22
23
|
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;
|
|
@@ -248,6 +251,14 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
|
|
|
248
251
|
setByKey(byKey);
|
|
249
252
|
setEditing(true);
|
|
250
253
|
};
|
|
254
|
+
const action = binding.action ??
|
|
255
|
+
((field.type === "text" && field.format?.long) || field.type === "rich_text"
|
|
256
|
+
? "expand"
|
|
257
|
+
: rowOpensSheet(field, oneValue)
|
|
258
|
+
? "edit"
|
|
259
|
+
: "none");
|
|
260
|
+
const Act = inRows || action === "none" ? null : icons[action];
|
|
261
|
+
const actIcon = Act ? (_jsx("span", { "data-field-row-act": action, "aria-hidden": "true", className: "hidden", children: _jsx(Act, { className: "size-3.75" }) })) : null;
|
|
251
262
|
const frameOf = (shape) => inRows
|
|
252
263
|
? shape === "under"
|
|
253
264
|
? FIELD_ROW_FRAME_ROWS_UNDER
|
|
@@ -259,7 +270,7 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
|
|
|
259
270
|
: shape === "beside"
|
|
260
271
|
? FIELD_ROW_FRAME_BESIDE
|
|
261
272
|
: FIELD_ROW_FRAME;
|
|
262
|
-
const editButton = (shape, children) => (_jsx(FieldRowButton, { views: views, frame: cx(frameOf(shape), "disabled:pointer-events-none aria-disabled:pointer-events-none", shape !== "under" && pending && "opacity-70"), variant: "ghost", size: "sm", ref: buttonRef, "aria-label": unread || shape === "under" || !shownText ? field.label : `${field.label}, ${shownText}`, disabled: !ready, "aria-disabled": pending ? true : undefined, onClick: (event) => open(event.detail === 0), children: children }));
|
|
273
|
+
const editButton = (shape, children) => (_jsx(FieldRowButton, { views: views, frame: cx(frameOf(shape), "disabled:pointer-events-none aria-disabled:pointer-events-none", shape !== "under" && pending && "opacity-70"), variant: "ghost", size: "sm", ref: buttonRef, "data-key": inRows ? undefined : TARGET_KEY[shape], "aria-label": unread || shape === "under" || !shownText ? field.label : `${field.label}, ${shownText}`, disabled: !ready, "aria-disabled": pending ? true : undefined, onClick: (event) => open(event.detail === 0), children: children }));
|
|
263
274
|
const rowRef = useRef(null);
|
|
264
275
|
const downWhileEditing = useRef(false);
|
|
265
276
|
const pressOpens = inRows && writable && shownDef.type !== "boolean" && !hasMenu && !unread && !editing && !pending && ready;
|
|
@@ -280,18 +291,19 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
|
|
|
280
291
|
open(false);
|
|
281
292
|
};
|
|
282
293
|
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
|
|
294
|
+
return (_jsx(EditLeaveContext.Provider, { value: leaveScope, children: _jsxs("div", { ref: rowRef, "data-form": form, className: cx(inRows
|
|
284
295
|
?
|
|
285
296
|
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
|
|
297
|
+
:
|
|
298
|
+
"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), "data-field-row": inRows ? undefined : "", "aria-busy": pending ? "true" : undefined, onClick: inRows ? onRowPress : undefined, onPointerDown: inRows
|
|
289
299
|
? () => {
|
|
290
300
|
downWhileEditing.current = editing;
|
|
291
301
|
}
|
|
292
|
-
: undefined, children: [_jsx("span", { className: inRows
|
|
302
|
+
: undefined, children: [_jsx("span", { className: inRows
|
|
303
|
+
? "o-field-row-glyph"
|
|
304
|
+
: "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
305
|
? "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)", !
|
|
306
|
+
: "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", { "data-field-row-editor": inRows ? undefined : "", 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 })) : (_jsxs("span", { className: cx(TARGET, "bg-(color:--vk-neutral)"), "data-field-row-anchor": "", children: [valueNode, actIcon] })), onAttempt: (resolution) => {
|
|
295
307
|
watchLeaving();
|
|
296
308
|
const answer = attempt(resolution);
|
|
297
309
|
if (answer.accepted && leaving.current)
|
|
@@ -299,12 +311,13 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
|
|
|
299
311
|
return answer;
|
|
300
312
|
}, onClose: closed, message: message, kindIcon: kindIcon, openedByKey: byKey }) })) : hasMenu && !verbsInLane ? (_jsx(CommandMenu, { trigger: drawFieldRowButton(views, {
|
|
301
313
|
frame: inRows ? FIELD_ROW_FRAME_ROWS : FIELD_ROW_FRAME,
|
|
314
|
+
...(inRows ? {} : { "data-key": TARGET_KEY.target }),
|
|
302
315
|
variant: "ghost",
|
|
303
316
|
size: "sm",
|
|
304
317
|
"aria-label": field.label,
|
|
305
318
|
disabled: !ready,
|
|
306
319
|
children: valueNode,
|
|
307
|
-
}), items: menuItems, align: "start" })) : writable && shownDef.type !== "boolean" ? (valueOverButton ? (_jsxs("div", { className: "relative min-w-0", children: [editButton("under"), _jsx("span", { "data-slot": "vk-row-value-layer", className: cx("pointer-events-none relative block min-w-0 [&_a]:pointer-events-auto [&_button]:pointer-events-auto", pending && "opacity-70"), children: valueNode })] })) : openType ? (_jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [editButton("beside", valueNode), _jsx(OpenValueAction, { type: openType, value: openValue, label: openLabel, compact: true })] })) : (editButton("target", valueNode))) : (_jsx("span", { className: "block min-w-0", children: valueNode })), !editing && note ? (_jsx(FieldNoteLine, { note: typeof note === "string" ? { text: note } : note })) : null, !editing && error && retryDraft ? (_jsx("div", { role: "alert", className: "mt-1 text-xs text-(color:--vk-danger)", children: _jsx("button", { type: "button", "data-slot": "vk-field-retry", onClick: () => {
|
|
320
|
+
}), items: menuItems, align: "start" })) : writable && shownDef.type !== "boolean" ? (valueOverButton ? (_jsxs("div", { className: "relative min-w-0", children: [editButton("under", actIcon), _jsx("span", { "data-slot": "vk-row-value-layer", className: cx("pointer-events-none relative block min-w-0 [&_a]:pointer-events-auto [&_button]:pointer-events-auto", pending && "opacity-70"), children: valueNode })] })) : openType ? (_jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [editButton("beside", _jsxs(_Fragment, { children: [valueNode, actIcon] })), _jsx(OpenValueAction, { type: openType, value: openValue, label: openLabel, compact: true })] })) : (editButton("target", _jsxs(_Fragment, { children: [valueNode, actIcon] })))) : (_jsx("span", { className: "block min-w-0", children: valueNode })), !editing && note ? (_jsx(FieldNoteLine, { note: typeof note === "string" ? { text: note } : note })) : null, !editing && error && retryDraft ? (_jsx("div", { role: "alert", className: "mt-1 text-xs text-(color:--vk-danger)", children: _jsx("button", { type: "button", "data-slot": "vk-field-retry", onClick: () => {
|
|
308
321
|
setError(null);
|
|
309
322
|
const retried = attempt({ kind: "commit", payload: retryDraft.commit });
|
|
310
323
|
if (!retried.accepted)
|
|
@@ -313,6 +326,6 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
|
|
|
313
326
|
}
|
|
314
327
|
function FieldRowPlace(props) {
|
|
315
328
|
const inCard = useContext(FieldRowsCardContext) !== null;
|
|
316
|
-
return _jsx(OutOfFieldRows, { children: _jsx(FieldRowImpl, { ...props, inCard: inCard }) });
|
|
329
|
+
return (_jsx(ScreenForms, { off: inCard, children: _jsx(OutOfFieldRows, { children: _jsx(FieldRowImpl, { ...props, inCard: inCard }) }) }));
|
|
317
330
|
}
|
|
318
331
|
export const FieldRow = memo(FieldRowPlace);
|
|
@@ -2,6 +2,16 @@ import type { MouseEvent as ReactMouseEvent, ReactElement, ReactNode, Ref } from
|
|
|
2
2
|
import type { ViewsContextValue } from "../provider/context.js";
|
|
3
3
|
/** What a field row's button reads from the provider: the app's `Button`. */
|
|
4
4
|
export type FieldRowButtonViews = Pick<ViewsContextValue, "components">;
|
|
5
|
+
/** The row's target outside a Field rows card, named for the Field's Box (`data-field-row-box="box"`, field.css), which dresses it:
|
|
6
|
+
* the button, the button beside a link's open action, or the empty one laid under a rich text. Named in its `data-key`, which the
|
|
7
|
+
* app's Button forwards and writes nothing of its own into, so its own `data-slot` stays its own. The value an open picker keeps
|
|
8
|
+
* drawn in its place is ViewKit's own span, marked `data-field-row-anchor`. */
|
|
9
|
+
export type FieldRowTargetShape = "target" | "beside" | "under";
|
|
10
|
+
export declare const TARGET_KEY: {
|
|
11
|
+
readonly target: "vk-field-row-target";
|
|
12
|
+
readonly beside: "vk-field-row-beside";
|
|
13
|
+
readonly under: "vk-field-row-under";
|
|
14
|
+
};
|
|
5
15
|
/** One button a field row draws itself, as each of its places describes it. */
|
|
6
16
|
export type FieldRowButtonDraw = {
|
|
7
17
|
/** The box ViewKit keeps on the app's `Button`: its size and its place. The look is the app's. */
|
|
@@ -13,6 +23,8 @@ export type FieldRowButtonDraw = {
|
|
|
13
23
|
"aria-disabled"?: boolean;
|
|
14
24
|
"aria-label"?: string;
|
|
15
25
|
"data-slot"?: string;
|
|
26
|
+
/** Which of the row's targets this is, outside a Field rows card (`TARGET_KEY`). */
|
|
27
|
+
"data-key"?: string;
|
|
16
28
|
/** Marks the press as the host's own: `data-no-nav` on a `display: contents` span around the app's button. */
|
|
17
29
|
noNav?: boolean;
|
|
18
30
|
onClick?: (event: ReactMouseEvent<HTMLButtonElement>) => void;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
export const TARGET_KEY = {
|
|
4
|
+
target: "vk-field-row-target",
|
|
5
|
+
beside: "vk-field-row-beside",
|
|
6
|
+
under: "vk-field-row-under",
|
|
7
|
+
};
|
|
3
8
|
export const FIELD_ROW_FRAME = "-mx-2 -my-1 flex h-auto min-h-7 w-[calc(100%+1rem)] min-w-0 items-center justify-start whitespace-normal px-2 py-1 text-left [font:inherit]";
|
|
4
9
|
export const FIELD_ROW_FRAME_BESIDE = "-ml-2 -my-1 flex h-auto min-h-7 min-w-0 flex-1 items-center justify-start whitespace-normal px-2 py-1 text-left [font:inherit]";
|
|
5
10
|
export const FIELD_ROW_FRAME_UNDER = "absolute -inset-x-2 -inset-y-1 h-auto w-auto p-0";
|
|
@@ -67,6 +67,10 @@ export type FieldBinding<Row, D extends FieldDef = FieldDef> = {
|
|
|
67
67
|
addOption?: OptionAdd;
|
|
68
68
|
/** The app's own icon name for this field, drawn by the app's AppIcon; the type's glyph when absent. */
|
|
69
69
|
icon?: string;
|
|
70
|
+
/** What a field row's one icon says a click does, under the Field's Action (`row-action: icon`): `edit` (an editor
|
|
71
|
+
* opens), `expand` (a long text opens) or `none`. Absent, the row answers by its type: expand for a long text or a rich
|
|
72
|
+
* text, edit where its editor opens in a popover, none where the box is the input. */
|
|
73
|
+
action?: "none" | "edit" | "expand";
|
|
70
74
|
/** This row keeps only the values of a `multiple` field (a plain list column): its editor offers no label box.
|
|
71
75
|
* Absent, each value keeps its label. */
|
|
72
76
|
labels?: false;
|
|
@@ -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, popover: boolean) => 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,18 @@ 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
|
-
|
|
55
|
-
|
|
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 lift and no tint on its cell, a popover no ring, and a cell typed in this same ring drawn
|
|
53
|
+
* by its box (`GRID_TYPED_RING`). */
|
|
54
|
+
export declare function GridCellOutline(): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* The selection ring on the box a cell is typed in (a text, an email, a link, a phone, a number): the same line, colour and
|
|
57
|
+
* corners as `GridCellOutline`, where it stood, so typing in keeps the cell marked; worn by the box itself, it goes round all
|
|
58
|
+
* the box covers as it grows past the cell. On the grid's type-in layer, which stands a pixel past the cell on each side
|
|
59
|
+
* (`GRID_EDITOR_LAYER`), so the line is set two lines in and the corners a line rounder, lying exactly on the selected
|
|
60
|
+
* ring. Refused, the box's own red ring stands alone. A text box is a textarea, whose own corners weigh a tag more.
|
|
61
|
+
*/
|
|
62
|
+
export declare const GRID_TYPED_RING: {
|
|
63
|
+
readonly text: string;
|
|
64
|
+
readonly number: string;
|
|
65
|
+
};
|
|
@@ -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,23 @@ 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
|
}
|
|
45
|
+
export const GRID_TYPED_RING = {
|
|
46
|
+
text: [
|
|
47
|
+
"[&_[data-slot=vk-text-box]]:outline [&_[data-slot=vk-text-box]]:-outline-offset-[calc(var(--vk-border-width)+var(--vk-border-width))]",
|
|
48
|
+
"[&_[data-slot=vk-text-box]]:outline-(color:--vk-outline,var(--vk-fg-subtle))",
|
|
49
|
+
"group-hover/gridcell:[&_[data-slot=vk-text-box]]:outline-(color:--vk-outline-active,var(--vk-border-brand))",
|
|
50
|
+
"[&_[data-slot=vk-text-box]]:rounded-[calc(var(--vk-outline-radius,var(--radius-sm))+var(--vk-border-width))]",
|
|
51
|
+
"[&_textarea[data-slot=vk-text-box]]:rounded-[calc(var(--vk-outline-radius,var(--radius-sm))+var(--vk-border-width))]",
|
|
52
|
+
"[&_[data-slot=vk-text-box]:is([aria-invalid=true],:has([aria-invalid=true]))]:outline-hidden",
|
|
53
|
+
].join(" "),
|
|
54
|
+
number: [
|
|
55
|
+
"[&_[data-slot=vk-number-box]]:outline [&_[data-slot=vk-number-box]]:-outline-offset-[calc(var(--vk-border-width)+var(--vk-border-width))]",
|
|
56
|
+
"[&_[data-slot=vk-number-box]]:outline-(color:--vk-outline,var(--vk-fg-subtle))",
|
|
57
|
+
"group-hover/gridcell:[&_[data-slot=vk-number-box]]:outline-(color:--vk-outline-active,var(--vk-border-brand))",
|
|
58
|
+
"[&_[data-slot=vk-number-box]]:rounded-[calc(var(--vk-outline-radius,var(--radius-sm))+var(--vk-border-width))]",
|
|
59
|
+
"[&_[data-slot=vk-number-box]:is([aria-invalid=true],:has([aria-invalid=true]))]:outline-hidden",
|
|
60
|
+
].join(" "),
|
|
61
|
+
};
|
|
@@ -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
|
}
|
|
@@ -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;
|
|
@@ -6,6 +6,7 @@ import { TextEditorHost, } from "../../editors/TextEditor.js";
|
|
|
6
6
|
import { useViews } from "../../provider/context.js";
|
|
7
7
|
import { cx } from "../../internal/cx.js";
|
|
8
8
|
import { useGridEditSession } from "./grid-edit-session.js";
|
|
9
|
+
import { useGridBodyPlace } from "./grid-body-place.js";
|
|
9
10
|
const MIN_W = 320;
|
|
10
11
|
const MAX_W = 512;
|
|
11
12
|
export function GridLongTextEditor({ initial, markdown = false, paragraph = true, type, title, onCancel, onTab, onEnter, }) {
|
|
@@ -25,14 +26,16 @@ export function GridLongTextEditor({ initial, markdown = false, paragraph = true
|
|
|
25
26
|
onTab,
|
|
26
27
|
onEnter,
|
|
27
28
|
});
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
29
|
+
const place = useGridBodyPlace(anchorRef);
|
|
30
|
+
const step = -place.alignOffset;
|
|
31
|
+
const width = cell ? Math.min(MAX_W, Math.max(MIN_W, cell.width + 2 * step)) : MIN_W;
|
|
32
|
+
const padY = cell ? Math.max(0, (cell.height - cell.lineHeight) / 2 - 1) + step : 8;
|
|
33
|
+
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 rounded-sm border-(color:--vk-border) p-0", style: { width }, children: (surface) => {
|
|
31
34
|
const framed = surface === "sheet" && paragraph;
|
|
32
35
|
const editor = (_jsx(TextEditorHost, { ref: editorRef, type: type ?? (markdown ? "rich_text" : "text"), multiline: paragraph, initial: initial, readOnly: true, ...(framed ? { rows: 3 } : {}), closeOnBlur: false, label: messages({ key: "views.grid.value" }), boxData: { "data-grid-editor": "" }, onRequestClose: close, style: cell && surface === "popover"
|
|
33
36
|
? {
|
|
34
|
-
paddingLeft: cell.paddingX,
|
|
35
|
-
paddingRight: cell.paddingX,
|
|
37
|
+
paddingLeft: cell.paddingX + step,
|
|
38
|
+
paddingRight: cell.paddingX + step,
|
|
36
39
|
paddingTop: padY,
|
|
37
40
|
paddingBottom: padY,
|
|
38
41
|
fontSize: cell.fontSize,
|
|
@@ -19,6 +19,6 @@ export declare function GridNameEditor({ title, initial, seed, allowEmpty, onCom
|
|
|
19
19
|
onCommit: (payload: NameValue | null) => void;
|
|
20
20
|
onCancel: () => void;
|
|
21
21
|
onTab?: (backwards: boolean) => void;
|
|
22
|
-
/** Commit happened via Enter
|
|
22
|
+
/** Commit happened via Enter: the grid's answer, which keeps the cell. */
|
|
23
23
|
onEnter?: () => void;
|
|
24
24
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,7 +18,7 @@ export function GridNameEditor({ title, initial, seed, allowEmpty = false, onCom
|
|
|
18
18
|
onTab,
|
|
19
19
|
onEnter,
|
|
20
20
|
});
|
|
21
|
-
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: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => {
|
|
21
|
+
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: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => {
|
|
22
22
|
const editor = (_jsx(NameEditor, { ref: editorRef, initial: initial, seed: seed, allowEmpty: allowEmpty, label: typeof title === "string" ? title : undefined, onRequestClose: close }));
|
|
23
23
|
return surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor;
|
|
24
24
|
} })] }));
|
|
@@ -40,7 +40,7 @@ export declare function GridNumberEditor({ title, initial, seed, unit, unitOptio
|
|
|
40
40
|
onCommit: (payload: GridNumberEditValue) => void;
|
|
41
41
|
onCancel: () => void;
|
|
42
42
|
onTab?: (backwards: boolean) => void;
|
|
43
|
-
/** Commit happened via Enter
|
|
43
|
+
/** Commit happened via Enter: the grid's answer, which keeps the cell. */
|
|
44
44
|
onEnter?: () => void;
|
|
45
45
|
/** The grid's judgement of a value before it is written: its reason when it would refuse it.
|
|
46
46
|
* A refused value keeps the editor open with that reason. */
|
|
@@ -6,8 +6,9 @@ import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
|
6
6
|
import { ConversionLine } from "../../display/converted.js";
|
|
7
7
|
import { useKeepInside } from "../../editors/keep-inside.js";
|
|
8
8
|
import { cx } from "../../internal/cx.js";
|
|
9
|
-
import { BODY_FIGURE_ROOM_PX, GRID_EDITOR_LAYER } from "./grid-editor-layer.js";
|
|
9
|
+
import { BODY_FIGURE_ROOM_PX, GRID_EDITOR_LAYER, GRID_TYPE_IN } from "./grid-editor-layer.js";
|
|
10
10
|
import { GridFittedBox } from "./grid-fitted-box.js";
|
|
11
|
+
import { GRID_TYPED_RING } from "./GridCellOutline.js";
|
|
11
12
|
import { GridRefusal, UNDER_CELL_CLASS, useGridEditSession } from "./grid-edit-session.js";
|
|
12
13
|
export function GridNumberEditor({ title, initial, seed, unit, unitOptions, code, decimals = 2, durationUnit, allowEmpty = false, unitLeft = false, conversion, onCommit, onCancel, onTab, onEnter, refuse, type, bounds, }) {
|
|
13
14
|
const editorRef = useRef(null);
|
|
@@ -32,7 +33,7 @@ export function GridNumberEditor({ title, initial, seed, unit, unitOptions, code
|
|
|
32
33
|
form: surface === "sheet" ? "phone" : "computer",
|
|
33
34
|
}
|
|
34
35
|
: {}), onRequestClose: close }));
|
|
35
|
-
return (_jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, inPlace: true, sheetOnPhone: true, children: (surface) => body ? (surface === "sheet" ? (_jsxs("div", { className: "px-2 pb-3", children: [editor(surface), conversion ? _jsx(ConversionLine, { figure: conversion, className: "pt-1.5" }) : null] })) : (_jsxs("span", { "data-slot": "vk-grid-editor", "data-grown": "", className: cx(GRID_EDITOR_LAYER, unitLeft && "justify-end"), children: [_jsx(GridFittedBox, { boxRef: anchorRef, edge: false, room: BODY_FIGURE_ROOM_PX, grows: unitLeft ? "left" : "right", children: editor(surface) }), _jsx(GridRefusal, { reason: session.refusal }), conversion && !session.refusal ? _jsx(UnderCellConversion, { figure: conversion }) : null] }))) : surface === "sheet" ? (_jsxs("div", { className: "px-2 pb-3", children: [_jsx("div", { className: "flex h-10 min-w-0 items-center rounded-md border border-(color:--vk-border) px-2", children: editor(surface) }), conversion ? _jsx(ConversionLine, { figure: conversion, className: "pt-1.5" }) : null] })) : (_jsxs("span", { "data-slot": "vk-grid-editor", className: cx("relative flex h-full w-full min-w-0", unitLeft && "justify-end"), children: [_jsx(GridFittedBox, { boxRef: anchorRef, grows: unitLeft ? "left" : "right", children: editor(surface) }), _jsx(GridRefusal, { reason: session.refusal }), conversion && !session.refusal ? _jsx(UnderCellConversion, { figure: conversion }) : null] })) }));
|
|
36
|
+
return (_jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, inPlace: true, sheetOnPhone: true, children: (surface) => body ? (surface === "sheet" ? (_jsxs("div", { className: "px-2 pb-3", children: [editor(surface), conversion ? _jsx(ConversionLine, { figure: conversion, className: "pt-1.5" }) : null] })) : (_jsxs("span", { "data-slot": "vk-grid-editor", "data-grown": "", ...GRID_TYPE_IN, className: cx(GRID_EDITOR_LAYER, GRID_TYPED_RING.number, unitLeft && "justify-end"), children: [_jsx(GridFittedBox, { boxRef: anchorRef, edge: false, room: BODY_FIGURE_ROOM_PX, grows: unitLeft ? "left" : "right", children: editor(surface) }), _jsx(GridRefusal, { reason: session.refusal }), conversion && !session.refusal ? _jsx(UnderCellConversion, { figure: conversion }) : null] }))) : surface === "sheet" ? (_jsxs("div", { className: "px-2 pb-3", children: [_jsx("div", { className: "flex h-10 min-w-0 items-center rounded-md border border-(color:--vk-border) px-2", children: editor(surface) }), conversion ? _jsx(ConversionLine, { figure: conversion, className: "pt-1.5" }) : null] })) : (_jsxs("span", { "data-slot": "vk-grid-editor", className: cx("relative flex h-full w-full min-w-0", unitLeft && "justify-end"), children: [_jsx(GridFittedBox, { boxRef: anchorRef, grows: unitLeft ? "left" : "right", children: editor(surface) }), _jsx(GridRefusal, { reason: session.refusal }), conversion && !session.refusal ? _jsx(UnderCellConversion, { figure: conversion }) : null] })) }));
|
|
36
37
|
}
|
|
37
38
|
function UnderCellConversion({ figure }) {
|
|
38
39
|
const ref = useRef(null);
|
|
@@ -21,6 +21,6 @@ export declare function GridPlaceEditor({ field, title, initial, refuse, onCommi
|
|
|
21
21
|
onCommit: (place: LocationValue | null) => void;
|
|
22
22
|
onCancel: () => void;
|
|
23
23
|
onTab?: (backwards: boolean) => void;
|
|
24
|
-
/** Commit happened via Enter
|
|
24
|
+
/** Commit happened via Enter: the grid's answer, which keeps the cell. */
|
|
25
25
|
onEnter?: () => void;
|
|
26
26
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -19,7 +19,7 @@ export function GridPlaceEditor({ field, title, initial, refuse, onCommit, onCan
|
|
|
19
19
|
onTab,
|
|
20
20
|
onEnter,
|
|
21
21
|
});
|
|
22
|
-
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: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => {
|
|
22
|
+
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: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => {
|
|
23
23
|
const editor = (_jsx(LocationEditor, { ref: editorRef, field: field, initial: initial, allowEmpty: true, label: typeof title === "string" ? title : undefined, onRequestClose: close }));
|
|
24
24
|
return surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor;
|
|
25
25
|
} })] }));
|
|
@@ -3,7 +3,7 @@ import type { RangePreset, RangeValue } from "viewkitjs/fields";
|
|
|
3
3
|
/**
|
|
4
4
|
* The GRID's host around the shared `RangeEditor`: the edit session owns the
|
|
5
5
|
* one-answer guard and the editor panel decides where it opens. On a desktop the
|
|
6
|
-
* app's parts body opens in a popover over the cell,
|
|
6
|
+
* app's parts body opens in a popover over the cell, a step above and left of it;
|
|
7
7
|
* on a phone it opens in the sheet and the answer waits for the sheet to slide away.
|
|
8
8
|
*/
|
|
9
9
|
export declare function GridRangeEditor({ title, initial, seed, decimals, allowEmpty, suffix, bands, min, max, onCommit, onCancel, onTab, onEnter, refuse, }: {
|
|
@@ -24,7 +24,7 @@ export declare function GridRangeEditor({ title, initial, seed, decimals, allowE
|
|
|
24
24
|
onCommit: (payload: RangeValue) => void;
|
|
25
25
|
onCancel: () => void;
|
|
26
26
|
onTab?: (backwards: boolean) => void;
|
|
27
|
-
/** Commit happened via Enter
|
|
27
|
+
/** Commit happened via Enter: the grid's answer, which keeps the cell. */
|
|
28
28
|
onEnter?: () => void;
|
|
29
29
|
/** The grid's judgement of a value before it is written: its reason when it would refuse it.
|
|
30
30
|
* A refused value keeps the editor open with that reason. */
|
|
@@ -20,5 +20,5 @@ export function GridRangeEditor({ title, initial, seed, decimals = 0, allowEmpty
|
|
|
20
20
|
onEnter,
|
|
21
21
|
});
|
|
22
22
|
const editor = (_jsx(RangeEditor, { ref: editorRef, initial: initial, seed: seed, decimals: decimals, allowEmpty: allowEmpty, suffix: suffix, bands: bands, min: min, max: max, label: typeof title === "string" ? title : undefined, onRequestClose: close }));
|
|
23
|
-
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: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => (surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor) })] }));
|
|
23
|
+
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: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => (surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor) })] }));
|
|
24
24
|
}
|
|
@@ -46,7 +46,7 @@ export function GridRelationEditor({ title, candidates, current, clearable, seed
|
|
|
46
46
|
},
|
|
47
47
|
]
|
|
48
48
|
: undefined;
|
|
49
|
-
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, onPanelClick: (e) => e.stopPropagation(), panelData: { "data-slot": "vk-grid-editor", ...panel.data }, chrome: "menu", className: panel.className, savesOnPick: true, children: _jsx(RelationEditor, { ref: editorRef, candidates: source, initial: current, clearable: clearable, seed: seed, focusSearch: !sheet, creates: creates, onRequestClose: close, label: typeof title === "string" ? title : undefined }) })] }));
|
|
49
|
+
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, onPanelClick: (e) => e.stopPropagation(), panelData: { "data-slot": "vk-grid-editor", ...panel.data }, chrome: "menu", className: panel.className, savesOnPick: true, children: _jsx(RelationEditor, { ref: editorRef, candidates: source, initial: current, clearable: clearable, seed: seed, focusSearch: !sheet, creates: creates, onRequestClose: close, label: typeof title === "string" ? title : undefined }) })] }));
|
|
50
50
|
}
|
|
51
51
|
export function GridRelationSetEditor({ title, candidates, current, lead, links, seed, create, refuse, onCommit, onLink, onCancel, onTab, }) {
|
|
52
52
|
const body = useSetBody(links);
|
|
@@ -95,5 +95,5 @@ export function GridRelationSetEditor({ title, candidates, current, lead, links,
|
|
|
95
95
|
},
|
|
96
96
|
]
|
|
97
97
|
: undefined;
|
|
98
|
-
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, onPanelClick: (e) => e.stopPropagation(), panelData: { "data-slot": "vk-grid-editor", ...panel.data }, chrome: "menu", className: panel.className, children: _jsx(RelationSetEditor, { ref: editorRef, candidates: candidates, initial: current, lead: lead, links: links, seed: seed, focusSearch: !sheet, creates: creates, onRequestClose: close, label: typeof title === "string" ? title : undefined }) })] }));
|
|
98
|
+
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, onPanelClick: (e) => e.stopPropagation(), panelData: { "data-slot": "vk-grid-editor", ...panel.data }, chrome: "menu", className: panel.className, children: _jsx(RelationSetEditor, { ref: editorRef, candidates: candidates, initial: current, lead: lead, links: links, seed: seed, focusSearch: !sheet, creates: creates, onRequestClose: close, label: typeof title === "string" ? title : undefined }) })] }));
|
|
99
99
|
}
|