viewkitjs 0.32.0 → 0.34.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 +98 -0
- package/fields/dist/index.d.ts +1 -1
- package/fields/dist/index.js +1 -1
- package/fields/dist/query/evaluate.d.ts +7 -0
- package/fields/dist/query/exact-number.d.ts +8 -2
- package/fields/dist/query/exact-number.js +14 -1
- package/fields/dist/query/sort.js +13 -10
- package/fields/dist/registry.js +5 -1
- package/fields/dist/types.d.ts +4 -1
- package/fields/dist/zod.d.ts +5 -0
- package/fields/dist/zod.js +10 -1
- package/fields/docs/guides/contact-values.md +12 -0
- package/fields/docs/guides/field-types.md +1 -1
- package/fields/docs/guides/queries.md +3 -1
- package/fields/docs/reference/fields.md +1 -0
- package/package.json +1 -1
- package/postgres/dist/check.js +4 -1
- package/postgres/dist/definitions/formula-forms.js +3 -1
- package/postgres/dist/definitions/money.js +2 -1
- package/postgres/dist/page.js +6 -3
- package/postgres/dist/rules.d.ts +15 -1
- package/postgres/dist/rules.js +16 -0
- package/postgres/dist/sort.js +7 -2
- package/postgres/docs/guides/definitions.md +1 -1
- package/postgres/docs/guides/field-map.md +1 -1
- package/postgres/docs/reference/definitions.md +1 -1
- package/postgres/docs/reference/postgres.md +1 -1
- package/views/dist/atoms/ToolbarButton.d.ts +1 -1
- package/views/dist/atoms/ToolbarButton.js +4 -3
- package/views/dist/atoms/frame-parts.d.ts +6 -0
- package/views/dist/atoms/frame-parts.js +15 -0
- package/views/dist/atoms/types.d.ts +16 -7
- package/views/dist/cells/cell-title.d.ts +3 -1
- package/views/dist/cells/cell-title.js +2 -2
- package/views/dist/cells/cell-values.js +2 -2
- package/views/dist/contract.d.ts +46 -11
- package/views/dist/contract.js +157 -0
- package/views/dist/controls/alert/alert.js +2 -1
- package/views/dist/controls/alert-dialog/alert-dialog.js +3 -2
- package/views/dist/controls/bulk-bar/bulk-bar.js +25 -22
- package/views/dist/controls/button/map-button.js +2 -0
- package/views/dist/controls/checkbox/checkbox.d.ts +3 -2
- package/views/dist/controls/checkbox/checkbox.js +2 -2
- package/views/dist/controls/compound-editor/compound-editor.d.ts +1 -1
- package/views/dist/controls/compound-editor/name-parts.js +4 -4
- package/views/dist/controls/compound-editor/place-parts.js +19 -19
- package/views/dist/controls/compound-editor/range-parts.js +14 -14
- package/views/dist/controls/compound-editor/row.d.ts +3 -1
- package/views/dist/controls/compound-editor/row.js +2 -2
- package/views/dist/controls/controls.d.ts +4 -0
- package/views/dist/controls/controls.js +4 -0
- package/views/dist/controls/customize/customize.js +43 -39
- package/views/dist/controls/customize/map-customize-body.d.ts +2 -0
- package/views/dist/controls/customize/map-customize-body.js +7 -2
- package/views/dist/controls/date-editor/date-days.js +2 -2
- package/views/dist/controls/date-editor/date-editor.d.ts +3 -0
- package/views/dist/controls/date-editor/date-editor.js +27 -21
- package/views/dist/controls/date-editor/date-parts.js +6 -6
- package/views/dist/controls/date-editor/map-calendar.js +3 -1
- package/views/dist/controls/date-editor/map-date-body.d.ts +1 -1
- package/views/dist/controls/date-editor/map-date-body.js +7 -3
- package/views/dist/controls/date-editor.css +2 -2
- package/views/dist/controls/field/field.d.ts +3 -0
- package/views/dist/controls/field/field.js +6 -6
- package/views/dist/controls/filter-editor/block.d.ts +2 -2
- package/views/dist/controls/filter-editor/block.js +5 -5
- package/views/dist/controls/filter-editor/filter-editor.js +31 -33
- package/views/dist/controls/filter-editor/how.d.ts +3 -1
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +3 -0
- package/views/dist/controls/filter-editor/map-filter-body.js +11 -4
- package/views/dist/controls/filter-editor/map-rules.js +1 -1
- package/views/dist/controls/filter-editor/parts.d.ts +3 -1
- package/views/dist/controls/filter-editor/parts.js +8 -6
- package/views/dist/controls/group-editor/group-editor.js +17 -14
- package/views/dist/controls/group-editor/map-group-body.d.ts +1 -0
- package/views/dist/controls/group-editor/map-group-body.js +5 -1
- package/views/dist/controls/index.d.ts +2 -0
- package/views/dist/controls/index.js +1 -0
- package/views/dist/controls/input/input.js +4 -3
- package/views/dist/controls/input/map-input.js +2 -0
- package/views/dist/controls/internal/editor-parts.js +1 -1
- package/views/dist/controls/internal/head-button.d.ts +9 -0
- package/views/dist/controls/internal/head-button.js +13 -0
- package/views/dist/controls/internal/map-panel-controls.d.ts +8 -0
- package/views/dist/controls/internal/map-panel-controls.js +20 -0
- package/views/dist/controls/internal/panel-controls.d.ts +58 -0
- package/views/dist/controls/internal/panel-controls.js +240 -0
- package/views/dist/controls/internal/part-slot.d.ts +12 -0
- package/views/dist/controls/internal/part-slot.js +5 -0
- package/views/dist/controls/links-editor/links-editor.d.ts +1 -1
- package/views/dist/controls/links-editor/links-editor.js +27 -27
- package/views/dist/controls/menu/map-menu.d.ts +2 -2
- package/views/dist/controls/menu/map-menu.js +15 -12
- package/views/dist/controls/menu/menu.d.ts +3 -0
- package/views/dist/controls/menu/menu.js +5 -5
- package/views/dist/controls/menu-list/menu-list.d.ts +14 -4
- package/views/dist/controls/menu-list/menu-list.js +23 -22
- package/views/dist/controls/modal/modal.js +5 -3
- package/views/dist/controls/notice/notice.d.ts +3 -1
- package/views/dist/controls/notice/notice.js +2 -2
- package/views/dist/controls/number-editor/map-number-body.js +5 -1
- package/views/dist/controls/number-editor/number-editor.d.ts +1 -1
- package/views/dist/controls/number-editor/number-editor.js +16 -16
- package/views/dist/controls/number-field/number-field.js +5 -3
- package/views/dist/controls/pane/map-pane.d.ts +3 -0
- package/views/dist/controls/pane/map-pane.js +5 -0
- package/views/dist/controls/pane/pane.d.ts +4 -2
- package/views/dist/controls/pane/pane.js +4 -4
- package/views/dist/controls/picker/map-fields-body.js +25 -1
- package/views/dist/controls/picker/picker.d.ts +2 -0
- package/views/dist/controls/picker/picker.js +37 -36
- package/views/dist/controls/picker/rows.d.ts +4 -0
- package/views/dist/controls/picker.css +10 -1
- package/views/dist/controls/popover/map-popover.d.ts +1 -1
- package/views/dist/controls/popover/map-popover.js +4 -2
- package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +2 -1
- package/views/dist/controls/quick-filters/map-quick-filters-body.js +7 -3
- package/views/dist/controls/quick-filters/quick-filters.js +8 -6
- package/views/dist/controls/radio/radio.d.ts +3 -0
- package/views/dist/controls/radio/radio.js +4 -3
- package/views/dist/controls/select/map-select.d.ts +3 -0
- package/views/dist/controls/select/map-select.js +8 -0
- package/views/dist/controls/select/select.d.ts +3 -0
- package/views/dist/controls/select/select.js +3 -3
- package/views/dist/controls/setting-row/looks.js +5 -5
- package/views/dist/controls/setting-row/setting-row.d.ts +3 -1
- package/views/dist/controls/setting-row/setting-row.js +3 -1
- package/views/dist/controls/setting-row.css +3 -2
- package/views/dist/controls/sheet/bottom-sheet.d.ts +8 -2
- package/views/dist/controls/sheet/bottom-sheet.js +4 -4
- package/views/dist/controls/sheet/map-sheet.js +1 -1
- package/views/dist/controls/sort-editor/map-sort-body.d.ts +1 -0
- package/views/dist/controls/sort-editor/map-sort-body.js +8 -4
- package/views/dist/controls/sort-editor/sort-editor.js +24 -26
- package/views/dist/controls/sort-editor.css +5 -0
- package/views/dist/controls/text-editor/map-text-body.js +5 -1
- package/views/dist/controls/text-editor/text-editor.d.ts +1 -1
- package/views/dist/controls/text-editor/text-editor.js +11 -10
- package/views/dist/controls/toolbar/toolbar.d.ts +4 -2
- package/views/dist/controls/toolbar/toolbar.js +2 -2
- package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +3 -3
- package/views/dist/controls/toolbar-button/atom-toolbar-button.js +7 -6
- package/views/dist/controls/values-editor/values-editor.d.ts +1 -1
- package/views/dist/controls/values-editor/values-editor.js +22 -22
- package/views/dist/controls/views-list/map-view-menu.d.ts +3 -2
- package/views/dist/controls/views-list/map-view-menu.js +7 -3
- package/views/dist/controls/views-list/map-views-list-body.d.ts +2 -1
- package/views/dist/controls/views-list/map-views-list-body.js +6 -5
- package/views/dist/controls/views-list/view-menu.js +9 -10
- package/views/dist/controls/views-list/views-list.js +6 -6
- package/views/dist/editors/EditorPanel.js +4 -4
- package/views/dist/field-row/FieldRow.js +13 -0
- package/views/dist/fields/money.d.ts +5 -2
- package/views/dist/fields/money.js +14 -2
- package/views/dist/grid/chrome/GridTable.js +4 -1
- package/views/dist/grid/chrome/cell-clipboard.d.ts +4 -2
- package/views/dist/grid/chrome/cell-clipboard.js +2 -2
- package/views/dist/grid/chrome/cells.js +3 -1
- package/views/dist/grid/chrome/grid-row-menu-items.js +1 -1
- package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -1
- package/views/dist/grid/chrome/useGridKeyboard.js +29 -6
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +9 -2
- package/views/dist/grid/core/clipboard-model.d.ts +3 -1
- package/views/dist/grid/core/clipboard-model.js +9 -8
- package/views/dist/grid/core/editing-controller.d.ts +3 -0
- package/views/dist/grid/core/editing-controller.js +6 -0
- package/views/dist/grid/core/edits-sink.d.ts +19 -0
- package/views/dist/grid/core/edits-sink.js +2 -0
- package/views/dist/grid/core/spreadsheet-operations.js +1 -1
- package/views/dist/grid/core/useGridEditing.d.ts +5 -0
- package/views/dist/grid/core/useGridEditing.js +6 -0
- package/views/dist/list/answer.d.ts +40 -0
- package/views/dist/list/answer.js +43 -0
- package/views/dist/list/bulk-bar.d.ts +7 -0
- package/views/dist/list/bulk-bar.js +10 -0
- package/views/dist/list/columns.d.ts +24 -0
- package/views/dist/list/columns.js +27 -0
- package/views/dist/list/edits.d.ts +19 -0
- package/views/dist/list/edits.js +56 -0
- package/views/dist/list/grid.d.ts +11 -0
- package/views/dist/list/grid.js +76 -0
- package/views/dist/list/index.d.ts +14 -1
- package/views/dist/list/index.js +4 -1
- package/views/dist/list/link.d.ts +8 -0
- package/views/dist/list/link.js +78 -0
- package/views/dist/list/list.d.ts +74 -0
- package/views/dist/list/list.js +18 -0
- package/views/dist/list/parts.js +11 -3
- package/views/dist/list/root-base.d.ts +46 -0
- package/views/dist/list/root-base.js +137 -0
- package/views/dist/list/root.d.ts +35 -34
- package/views/dist/list/root.js +153 -113
- package/views/dist/list/source-answers.d.ts +39 -0
- package/views/dist/list/source-answers.js +225 -0
- package/views/dist/list/store.d.ts +37 -5
- package/views/dist/list/store.js +31 -0
- package/views/dist/list/toolbar.d.ts +3 -2
- package/views/dist/list/toolbar.js +23 -5
- package/views/dist/list/views-axis.js +4 -2
- package/views/dist/list/views.d.ts +7 -2
- package/views/dist/list/views.js +16 -5
- package/views/dist/model/column-capabilities.d.ts +13 -0
- package/views/dist/model/column-capabilities.js +23 -2
- package/views/dist/model/column-schema.d.ts +11 -1
- package/views/dist/model/view-rules.js +1 -0
- package/views/dist/panels/model.d.ts +2 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +21 -2
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +2 -2
- package/views/dist/panels/react/toolbar/Toolbar.d.ts +12 -1
- package/views/dist/panels/react/toolbar/Toolbar.js +20 -6
- package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +4 -3
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +4 -4
- package/views/dist/panels/react/toolbar/ToolbarButton.js +4 -1
- package/views/dist/panels/react/toolbar/ToolbarFilter.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +4 -3
- package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +5 -4
- package/views/dist/panels/react/toolbar/ToolbarNew.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarSort.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +8 -5
- package/views/dist/panels/react/toolbar/context.d.ts +31 -1
- package/views/dist/panels/react/toolbar/context.js +4 -0
- package/views/dist/panels/react/toolbar/pane-host.d.ts +6 -0
- package/views/dist/panels/react/toolbar/pane-host.js +17 -0
- package/views/dist/panels/react/toolbar/panel-part.d.ts +4 -1
- package/views/dist/panels/react/toolbar/panel-part.js +7 -4
- package/views/dist/panels/react.d.ts +1 -1
- package/views/dist/panels/settings/filter-groups.js +6 -1
- package/views/dist/provider/ViewsProvider.d.ts +7 -2
- package/views/dist/provider/ViewsProvider.js +18 -1
- package/views/dist/provider/components.d.ts +90 -2
- package/views/dist/provider/components.js +1 -1
- package/views/dist/provider/context.d.ts +4 -1
- package/views/dist/provider/own-control.d.ts +4 -0
- package/views/dist/provider/own-control.js +7 -0
- package/views/dist/provider/select-items.d.ts +3 -0
- package/views/dist/provider/select-items.js +6 -0
- package/views/dist/react.d.ts +4 -2
- package/views/dist/react.js +2 -0
- package/views/dist/styles.css +107 -80
- package/views/dist/styles.unlayered.css +107 -80
- package/views/docs/contract.md +310 -7
- package/views/docs/controls/alert-dialog.md +4 -0
- package/views/docs/controls/alert.md +4 -0
- package/views/docs/controls/bulk-bar.md +4 -0
- package/views/docs/controls/compound-editor.md +4 -0
- package/views/docs/controls/customize.md +8 -0
- package/views/docs/controls/date-editor.md +6 -0
- package/views/docs/controls/field.md +4 -0
- package/views/docs/controls/filter-editor.md +8 -0
- package/views/docs/controls/group-editor.md +8 -0
- package/views/docs/controls/input.md +4 -0
- package/views/docs/controls/links-editor.md +4 -0
- package/views/docs/controls/menu-list.md +8 -0
- package/views/docs/controls/menu.md +6 -0
- package/views/docs/controls/modal.md +4 -0
- package/views/docs/controls/notice.md +4 -0
- package/views/docs/controls/number-editor.md +6 -0
- package/views/docs/controls/pane.md +4 -0
- package/views/docs/controls/picker.md +8 -0
- package/views/docs/controls/quick-filters.md +8 -0
- package/views/docs/controls/radio.md +4 -0
- package/views/docs/controls/select.md +8 -0
- package/views/docs/controls/sheet.md +4 -0
- package/views/docs/controls/sort-editor.md +8 -0
- package/views/docs/controls/text-editor.md +6 -0
- package/views/docs/controls/toolbar.md +4 -0
- package/views/docs/controls/values-editor.md +4 -0
- package/views/docs/controls/views-list.md +8 -0
- package/views/docs/guides/the-grid.md +2 -2
- package/views/docs/guides/the-provider.md +19 -2
- package/views/docs/reference/controls.md +11 -7
- package/views/docs/reference/field-row.md +1 -1
- package/views/docs/reference/grid.md +1 -1
- package/views/docs/reference/list.md +143 -11
- package/views/docs/reference/looks.md +1 -1
- package/views/docs/reference/panels-react.md +6 -5
- package/views/docs/reference/react.md +19 -12
- package/views/docs/reference/views.md +11 -5
- package/views/docs/reshaping.md +17 -1
- package/views/skills/views/SKILL.md +1 -1
|
@@ -19,7 +19,7 @@ A field map from your definitions and a storage declaration. Guide: [a field map
|
|
|
19
19
|
|
|
20
20
|
## Your money function
|
|
21
21
|
|
|
22
|
-
- `ConvertMoney` — your one money function, `({ amount, currency, day, into }) => Sql`: the amount converted, as SQL; a zero or missing rate reads null, never raises. Called wherever a definition converts an amount, on the list's own rows, in the currency the request's `context.currencies` names for the field.
|
|
22
|
+
- `ConvertMoney` — your one money function, `({ amount, currency, day, into }) => Sql`: the amount converted, as SQL; a zero or missing rate reads null, never raises. Called wherever a definition converts an amount, on the list's own rows, in the currency the request's `context.currencies` names for the field, and in a sort by such a field that it names none for, in `context.sortCurrency`.
|
|
23
23
|
- `MoneyAsk` — one conversion: the amount (`numeric`), its currency (the row's code, as text), the day it converts on, and the currency it converts into.
|
|
24
24
|
- `MoneyDay` — the day an amount converts on: `{ ask }`, the request's moment, read as its UTC day; or `{ row, type }`, a row's own date (`"date"`) or instant (`"datetime"`, a `timestamptz`), read as its UTC day.
|
|
25
25
|
- `MoneyInto` — the currency an amount converts into: the request's, as text, or the one a rollup's result names, a fixed code or its record's own as SQL.
|
|
@@ -81,7 +81,7 @@ The one door. Guide: [the field map and the permission condition](../guides/fiel
|
|
|
81
81
|
- `VALUES_PAGE` — 1000: the keys one step of `valuesQuery` reads.
|
|
82
82
|
- `Page` — a page's `keys` in order, and `next`, the cursor the next page starts after, or null after the last.
|
|
83
83
|
- `KeysRequest` — a request: the app's map, its permission condition and the fields the reader may read (`readable`, required); the list's filter tree (relation rules and a value's parts included), its search (each word in some field it names, or the whole text a row's key), its quick-filter `hold` (fields' `ListHold`, on top of the filter: every statement keeps only rows that pass both, and a page's cursor is bound to it), and the context a date rule reads.
|
|
84
|
-
- `FilterContext` — what a rule reads beside its row: the reader's time zone and the moment relative days count from, which a date rule needs, and the reader's `region` (two letters), which a phone typed without its country code is read in; `since`, the instant a relation's `within` reads a rule's records from, never bound into a cursor;
|
|
84
|
+
- `FilterContext` — what a rule reads beside its row: the reader's time zone and the moment relative days count from, which a date rule needs, and the reader's `region` (two letters), which a phone typed without its country code is read in; `since`, the instant a relation's `within` reads a rule's records from, never bound into a cursor; `currencies`, the currency each field whose definition converts is read in, by key, bound into a page's cursor when it sorts, filters or groups by one; and `sortCurrency`, the currency such a field is sorted in when `currencies` names none for it (your app's own): its amount converted into it orders the rows while each still reads as kept, bound into the cursor of a page sorted by one.
|
|
85
85
|
|
|
86
86
|
## Counts and groups
|
|
87
87
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ViewsToolbarButtonProps } from "./types.js";
|
|
2
|
-
export declare function DefaultToolbarButton({ icon, label, word, count, onClear, dot, open, changed, edge, disabled, disabledReason, children, more, empty, iconAlone, aside, foot, joined, waits, size, popup, current, part, onContextMenu, onClick, onPointerDown, ref, }: ViewsToolbarButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function DefaultToolbarButton({ icon, label, word, count, onClear, dot, open, changed, edge, disabled, disabledReason, children, more, empty, iconAlone, aside, foot, joined, waits, size, popup, current, part, className, onContextMenu, onClick, onPointerDown, ref, }: ViewsToolbarButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,8 +4,9 @@ import { DisabledReason } from "./DisabledReason.js";
|
|
|
4
4
|
import { cx } from "../internal/cx.js";
|
|
5
5
|
import { ELEMENT_RESET } from "../internal/reset.js";
|
|
6
6
|
import { useViews } from "../provider/context.js";
|
|
7
|
+
import { isFramePart } from "./frame-parts.js";
|
|
7
8
|
const flag = (on) => (on ? "" : undefined);
|
|
8
|
-
export function DefaultToolbarButton({ icon, label, word, count, onClear, dot, open, changed, edge, disabled, disabledReason, children, more, empty, iconAlone, aside, foot, joined, waits, size, popup, current, part, onContextMenu, onClick, onPointerDown, ref, }) {
|
|
9
|
+
export function DefaultToolbarButton({ icon, label, word, count, onClear, dot, open, changed, edge, disabled, disabledReason, children, more, empty, iconAlone, aside, foot, joined, waits, size, popup, current, part, className, onContextMenu, onClick, onPointerDown, ref, }) {
|
|
9
10
|
const { messages, icons } = useViews();
|
|
10
11
|
const Chevron = icons.chevronDown;
|
|
11
12
|
const chevron = part === "views-chip" || part === "views-more";
|
|
@@ -13,7 +14,7 @@ export function DefaultToolbarButton({ icon, label, word, count, onClear, dot, o
|
|
|
13
14
|
const reasoned = !!disabled && !!disabledReason;
|
|
14
15
|
const worded = children != null && !iconAlone;
|
|
15
16
|
const shownMore = iconAlone ? undefined : more;
|
|
16
|
-
const button = (describedBy) => (_jsxs("span", { className: cx("relative inline-flex shrink-0", worded && "min-w-0 max-w-full"), children: [_jsxs("button", { ref: ref, type: "button", "aria-describedby": describedBy, "aria-label": worded ? undefined : label, "aria-haspopup": popup, "aria-expanded": popup ? Boolean(open) : undefined, "aria-disabled": reasoned ? true : undefined, disabled: disabled && !reasoned, "aria-current": current ? "true" : undefined, "data-slot": part ? PART_SLOT[part] : "vk-toolbar-button", "data-tab": current !== undefined ? "" : undefined, "data-current": flag(current), "data-open": flag(open), "data-changed": flag(changed), "data-edge": flag(edge), "data-disabled": flag(disabled), "data-empty": flag(empty), "data-icon-alone": flag(iconAlone), "data-aside": flag(aside), "data-foot": flag(foot), "data-joined": joined, "data-waits": flag(waits), onClick: reasoned ? (event) => event.preventDefault() : onClick, onPointerDown: reasoned ? undefined : onPointerDown, onContextMenu: reasoned ? undefined : onContextMenu, className: cx(ELEMENT_RESET, "inline-flex shrink-0 items-center justify-center transition-colors duration-150", joined ? JOINED_CLASS[joined] : "rounded-full", worded && "min-w-0 max-w-full", foot
|
|
17
|
+
const button = (describedBy) => (_jsxs("span", { className: cx("relative inline-flex shrink-0", worded && "min-w-0 max-w-full"), children: [_jsxs("button", { ref: ref, type: "button", "aria-describedby": describedBy, "aria-label": worded ? undefined : label, "aria-haspopup": popup, "aria-expanded": popup ? Boolean(open) : undefined, "aria-disabled": reasoned ? true : undefined, disabled: disabled && !reasoned, "aria-current": current ? "true" : undefined, "data-slot": isFramePart(part) ? PART_SLOT[part] : "vk-toolbar-button", "data-tab": current !== undefined ? "" : undefined, "data-current": flag(current), "data-open": flag(open), "data-changed": flag(changed), "data-edge": flag(edge), "data-disabled": flag(disabled), "data-empty": flag(empty), "data-icon-alone": flag(iconAlone), "data-aside": flag(aside), "data-foot": flag(foot), "data-joined": joined, "data-waits": flag(waits), onClick: reasoned ? (event) => event.preventDefault() : onClick, onPointerDown: reasoned ? undefined : onPointerDown, onContextMenu: reasoned ? undefined : onContextMenu, className: cx(ELEMENT_RESET, "inline-flex shrink-0 items-center justify-center transition-colors duration-150", joined ? JOINED_CLASS[joined] : "rounded-full", worded && "min-w-0 max-w-full", foot
|
|
17
18
|
? "h-11 w-11"
|
|
18
19
|
: worded || shownMore
|
|
19
20
|
? cx("gap-1.5 px-3", size === "sm" ? "h-8" : "h-9")
|
|
@@ -26,7 +27,7 @@ export function DefaultToolbarButton({ icon, label, word, count, onClear, dot, o
|
|
|
26
27
|
? "bg-(color:--vk-pressed) text-(color:--vk-fg)"
|
|
27
28
|
: current
|
|
28
29
|
? "bg-(color:--vk-selected,var(--vk-neutral)) text-(color:--vk-fg)"
|
|
29
|
-
: cx("hover:bg-(color:--vk-hovered) hover:text-(color:--vk-fg)", aside || part === "save" ? undefined : changed ? "text-(color:--vk-fg-brand)" : "text-(color:--vk-fg-subtle)"), disabled && "pointer-events-none opacity-40"), children: [icon, worded ? (_jsx("span", { "data-slot": "vk-toolbar-words", className: cx("min-w-0 truncate whitespace-nowrap text-sm", waits && "text-(color:--vk-fg-subtlest)"), children: children })) : (word !== null &&
|
|
30
|
+
: cx("hover:bg-(color:--vk-hovered) hover:text-(color:--vk-fg)", aside || part === "save" ? undefined : changed ? "text-(color:--vk-fg-brand)" : "text-(color:--vk-fg-subtle)"), disabled && "pointer-events-none opacity-40", className), children: [icon, worded ? (_jsx("span", { "data-slot": "vk-toolbar-words", className: cx("min-w-0 truncate whitespace-nowrap text-sm", waits && "text-(color:--vk-fg-subtlest)"), children: children })) : (word !== null &&
|
|
30
31
|
!iconAlone && (_jsx("span", { "data-slot": "vk-toolbar-word", className: "hidden text-sm font-medium", children: word ?? label }))), worded && shownMore && " ", shownMore && (_jsx("span", { "data-slot": "vk-toolbar-more", className: "text-sm tabular-nums text-(color:--vk-fg-subtle)", children: shownMore })), chevron && (_jsx("span", { "aria-hidden": true, "data-slot": "vk-toolbar-chevron", className: "inline-flex shrink-0 opacity-60", children: _jsx(Chevron, { className: "h-3.5 w-3.5" }) }))] }), dot && (_jsx("span", { "aria-hidden": true, "data-slot": "vk-toolbar-dot", className: "pointer-events-none absolute right-1.5 top-1.5 h-1.5 w-1.5 rounded-full bg-(color:--vk-brand)" })), counted &&
|
|
31
32
|
(onClear ? (_jsx("button", { type: "button", "data-slot": "vk-toolbar-count", "aria-label": messages({ key: "views.panels.toolbar-clear" }), disabled: disabled, onClick: (event) => {
|
|
32
33
|
event.stopPropagation();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ViewsFramePart, ViewsToolbarButtonPart } from "./types.js";
|
|
2
|
+
/** One of the six an app's own frame hands: the views row's parts, Clear and Save. */
|
|
3
|
+
export declare const isFramePart: (part: ViewsToolbarButtonPart | undefined) => part is ViewsFramePart;
|
|
4
|
+
/** The place's key as a part's name, where it names one of the toolbar's own places; else nothing (an app's own key, or
|
|
5
|
+
* no place: an app's own frame). */
|
|
6
|
+
export declare const placePart: (key: string | undefined) => ViewsToolbarButtonPart | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const FRAME_PARTS = new Set(["views-chip", "views-tab", "views-more", "views-add", "clear", "save"]);
|
|
2
|
+
export const isFramePart = (part) => part !== undefined && FRAME_PARTS.has(part);
|
|
3
|
+
const PLACE_PARTS = new Set([
|
|
4
|
+
"options",
|
|
5
|
+
"search",
|
|
6
|
+
"quick",
|
|
7
|
+
"new",
|
|
8
|
+
"sort",
|
|
9
|
+
"filter",
|
|
10
|
+
"filter-add",
|
|
11
|
+
"filters",
|
|
12
|
+
"advanced-filters",
|
|
13
|
+
"sort-pill",
|
|
14
|
+
]);
|
|
15
|
+
export const placePart = (key) => key !== undefined && PLACE_PARTS.has(key) ? key : undefined;
|
|
@@ -455,20 +455,29 @@ export type ViewsToolbarButtonProps = {
|
|
|
455
455
|
popup?: "menu" | "dialog";
|
|
456
456
|
/** A view tab: one of a row where one is open. `true`, the open one, `aria-current="true"`. */
|
|
457
457
|
current?: boolean;
|
|
458
|
-
/** Which of the toolbar's
|
|
459
|
-
*
|
|
460
|
-
*
|
|
461
|
-
*
|
|
458
|
+
/** Which of the toolbar's buttons it stands for (VK-984): every button the toolbar draws hands one, named after the
|
|
459
|
+
* `toolbarParts` place it stands in (`options`, `search`, `quick`, `new`, `sort`, `filter`, `filter-add`, `filters`,
|
|
460
|
+
* `advanced-filters`, `sort-pill`), a place's second kind of button by a name of its own (`sort-add`, `more-filters`), and
|
|
461
|
+
* ⋯ `more`. In an app's own frame also the views chip (a switcher: it names the view open and opens the rest), a view
|
|
462
|
+
* tab, the views row's "+N" and "+", Clear, and Save (the bar's keep-this-change), the frame's parts
|
|
463
|
+
* (`ViewsFramePart`): draw those as their `data-slot`, `vk-views-chip`, `vk-views-tab`, `vk-views-more`, `vk-views-add`,
|
|
464
|
+
* `vk-toolbar-clear`, `vk-toolbar-save-button`. An atom that spreads its leftover props onto its element takes `part`
|
|
465
|
+
* out first. */
|
|
462
466
|
part?: ViewsToolbarButtonPart;
|
|
467
|
+
/** The class its toolbar place hands (`ToolbarPartPlace.className`, VK-984): put it on the button itself. */
|
|
468
|
+
className?: string;
|
|
463
469
|
/** A right-click: a tab's verbs open on it. */
|
|
464
470
|
onContextMenu?: (event: ReactMouseEvent<HTMLButtonElement>) => void;
|
|
465
471
|
onClick?: (event: ReactMouseEvent<HTMLButtonElement>) => void;
|
|
466
472
|
onPointerDown?: (event: ReactPointerEvent<HTMLButtonElement>) => void;
|
|
467
473
|
ref?: Ref<HTMLButtonElement>;
|
|
468
474
|
};
|
|
469
|
-
/**
|
|
470
|
-
*
|
|
471
|
-
export type
|
|
475
|
+
/** The toolbar's buttons a `ToolbarButton` stands for only where an app's own frame draws them (VK-629): its kind and its
|
|
476
|
+
* hook. */
|
|
477
|
+
export type ViewsFramePart = "views-chip" | "views-tab" | "views-more" | "views-add" | "clear" | "save";
|
|
478
|
+
/** Which of the toolbar's buttons a `ToolbarButton` stands for (VK-984): the frame's parts, and every other button by the
|
|
479
|
+
* key of the place it stands in, or, a place's second kind of button, by a name of its own. */
|
|
480
|
+
export type ViewsToolbarButtonPart = ViewsFramePart | "options" | "search" | "quick" | "new" | "sort" | "filter" | "filter-add" | "filters" | "advanced-filters" | "sort-pill" | "sort-add" | "more-filters" | "more";
|
|
472
481
|
export type ViewsAtoms = {
|
|
473
482
|
List: ComponentType<ViewsListProps>;
|
|
474
483
|
Row: ComponentType<ViewsRowProps>;
|
|
@@ -17,4 +17,6 @@ export declare function renderTitleCell<Row>(col: ListColumn<Row>, row: Row, con
|
|
|
17
17
|
/** The surface's part on the name link: the grid hands `vk-grid-title`; elsewhere none. */
|
|
18
18
|
data?: {
|
|
19
19
|
readonly "data-slot": string;
|
|
20
|
-
}
|
|
20
|
+
},
|
|
21
|
+
/** The value the cell shows, handed to the column's indicator; absent, what `accessor` reads. */
|
|
22
|
+
value?: unknown): ReactNode;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cellTextClass } from "../display/text-class.js";
|
|
4
4
|
import { cx } from "../internal/cx.js";
|
|
5
|
-
export function renderTitleCell(col, row, content, data) {
|
|
6
|
-
const indicator = col.indicator?.(row);
|
|
5
|
+
export function renderTitleCell(col, row, content, data, value = col.accessor?.(row)) {
|
|
6
|
+
const indicator = col.indicator?.(row, { value });
|
|
7
7
|
return (_jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [_jsx("span", { ...data, "data-cell-open": true, className: cx("min-w-0 cursor-pointer font-medium text-(color:--vk-fg)", cellTextClass()), children: content }), indicator] }));
|
|
8
8
|
}
|
|
@@ -22,7 +22,7 @@ export function renderTypedCellValue(col, row, opts) {
|
|
|
22
22
|
if (!col.type)
|
|
23
23
|
return null;
|
|
24
24
|
if (col.type === "title")
|
|
25
|
-
return renderTitleCell(col, row, identityContent(col, row, value, opts), opts?.titleData);
|
|
25
|
+
return renderTitleCell(col, row, identityContent(col, row, value, opts), opts?.titleData, value);
|
|
26
26
|
const field = col.field ?? legacyFieldFromColumn(col);
|
|
27
27
|
const drawOpts = verbs && col.type === "user" ? { ...opts, slotOwnsClick: true } : opts;
|
|
28
28
|
const cell = renderFieldValue(field, value, displayOptionsFor(col, row, drawOpts));
|
|
@@ -70,7 +70,7 @@ function CommandCell({ col, cell, items, }) {
|
|
|
70
70
|
}
|
|
71
71
|
return (_jsx(CommandMenu, { items: verbs, align: "start", label: columnLabel(col), trigger: drawGridButton(views, {
|
|
72
72
|
"aria-label": columnLabel(col),
|
|
73
|
-
frame: "h-auto min-w-0 max-w-
|
|
73
|
+
frame: "h-auto min-w-0 max-w-[calc(100%+0.5rem)] justify-start gap-1 -mx-1 px-1 py-0 text-left [font:inherit]",
|
|
74
74
|
variant: "ghost",
|
|
75
75
|
size: "sm",
|
|
76
76
|
children: (_jsxs(_Fragment, { children: [cell, _jsx(Chevron, { className: "h-3 w-3 opacity-60" })] })),
|
package/views/dist/contract.d.ts
CHANGED
|
@@ -63,13 +63,16 @@ export type VkOptionalColour = (typeof VK_OPTIONAL_COLOURS)[number];
|
|
|
63
63
|
* `calc(var(--spacing)*5)`, what `mt-5` drew. `--vk-duration`, the text variables (`--vk-caption-text` to
|
|
64
64
|
* `--vk-sheet-text`), the underline and line variables and `--vk-selected-stroke` are read with each place's own value
|
|
65
65
|
* as the fallback, so one declaration sets every place of its kind (docs/contract.md, Tokens). `--vk-toolbar-foot`
|
|
66
|
-
* lifts New's + at a phone list's foot above a bar the app keeps there; undeclared, `1rem`.
|
|
66
|
+
* lifts New's + at a phone list's foot above a bar the app keeps there; undeclared, `1rem`. A folding toolbar's line on a
|
|
67
|
+
* computer (VK-1027): `--vk-toolbar-line-py` its padding above and below (undeclared `calc(var(--spacing)*2.5)`, what `py-2.5`
|
|
68
|
+
* drew), `--vk-toolbar-line-gap` the room between its tools (`calc(var(--spacing)*2)`) and `--vk-toolbar-line-w` the line
|
|
69
|
+
* under it (`1px`; `0px` draws none, for an app that draws its own edge to edge). `--vk-frozen-shadow-width` is the
|
|
67
70
|
* pinned edge's shadow's width; undeclared, `calc(var(--spacing)*1.5)`, what `w-1.5` drew. The field row's frame
|
|
68
71
|
* (VK-953): `--vk-field-row-label-w` its label column on a desktop (undeclared `calc(var(--spacing)*32)`, what `w-32` drew), `--vk-field-row-gap` the gap
|
|
69
72
|
* between its glyph, label, value and lane (`calc(var(--spacing)*3)`), `--vk-field-row-h` its least height, its content standing in
|
|
70
73
|
* the middle (`auto`), `--vk-field-row-py` its padding above and below (`calc(var(--spacing)*2.5)`) and `--vk-field-row-line-w` the
|
|
71
74
|
* line under every row but the last (`1px`; `0px` draws none). */
|
|
72
|
-
export declare const VK_OPTIONAL_LAYOUT: readonly ["--vk-field-row-label-w", "--vk-field-row-gap", "--vk-field-row-h", "--vk-field-row-py", "--vk-field-row-line-w", "--vk-toolbar-foot", "--vk-gutter", "--vk-scroll-inset-bottom", "--vk-panel-padding", "--vk-scroll-row-inset", "--vk-scroll-row-end", "--vk-outline-radius", "--vk-group-gap", "--vk-duration", "--vk-caption-text", "--vk-caption-leading", "--vk-caps-tracking", "--vk-input-text", "--vk-panel-title-text", "--vk-sheet-text", "--vk-underline-offset", "--vk-underline-width", "--vk-thick-line", "--vk-selected-stroke", "--vk-frozen-shadow-width"];
|
|
75
|
+
export declare const VK_OPTIONAL_LAYOUT: readonly ["--vk-field-row-label-w", "--vk-field-row-gap", "--vk-field-row-h", "--vk-field-row-py", "--vk-field-row-line-w", "--vk-toolbar-foot", "--vk-toolbar-line-py", "--vk-toolbar-line-gap", "--vk-toolbar-line-w", "--vk-gutter", "--vk-scroll-inset-bottom", "--vk-panel-padding", "--vk-scroll-row-inset", "--vk-scroll-row-end", "--vk-outline-radius", "--vk-group-gap", "--vk-duration", "--vk-caption-text", "--vk-caption-leading", "--vk-caps-tracking", "--vk-input-text", "--vk-panel-title-text", "--vk-sheet-text", "--vk-underline-offset", "--vk-underline-width", "--vk-thick-line", "--vk-selected-stroke", "--vk-frozen-shadow-width"];
|
|
73
76
|
export type VkOptionalLayout = (typeof VK_OPTIONAL_LAYOUT)[number];
|
|
74
77
|
/** The grid's own machinery, set and read by the grid alone: prefixed because they share the
|
|
75
78
|
* global namespace, and not public. An app neither sets nor reads them, and they may change in
|
|
@@ -103,27 +106,59 @@ export { GRID_TOKENS as VK_GRID_TOKENS } from "./grid-tokens.js";
|
|
|
103
106
|
export declare const COMPONENT_NAMES: readonly ["Button", "Popover", "Tooltip", "Checkbox", "Menu", "Collapse", "Sheet", "AppIcon", "Markdown", "TextBody", "NumberBody", "Picker", "LinksBody", "DateBody", "PartsBody", "ValuesBody", "CustomizeBody", "SortBody", "FilterBody", "FilterPartBody", "FieldsBody", "QuickFiltersBody", "ViewsListBody"];
|
|
104
107
|
export type ComponentName = (typeof COMPONENT_NAMES)[number];
|
|
105
108
|
/** The primitives an app may leave out, apart from `COMPONENT_NAMES`, which lists the ones it must hand
|
|
106
|
-
* in: `Input` has a plain default; `Command` and `Calendar`, reached without one, throw an error naming
|
|
109
|
+
* in: `Input` has a plain default; `Select` is drawn only inside the panels, under the provider's `panelControls`; `Command` and `Calendar`, reached without one, throw an error naming
|
|
107
110
|
* it (the filter's month draws through `Calendar`); without `RowsWait`, a grid waiting for new rows draws Loading in
|
|
108
111
|
* place of its body; `GroupBody` is read by nothing (deprecated: a `CustomizeBody` holds its own group editor); without
|
|
109
112
|
* `SearchField`, the toolbar's search draws its own field; without `PortsHost`, an app that hands no `confirm` gets the
|
|
110
113
|
* browser's and one that hands no `toast` sees
|
|
111
114
|
* nothing; without `SelectionBar`, a selection draws ViewKit's own bar; without `ViewMenu`, a views row's pill opens
|
|
112
|
-
* its view's `menu` rows
|
|
113
|
-
export declare const OPTIONAL_COMPONENT_NAMES: readonly ["Input", "Command", "Calendar", "RowsWait", "GroupBody", "SearchField", "PortsHost", "SelectionBar", "ViewMenu"];
|
|
115
|
+
* its view's `menu` rows; without `Pane`, a toolbar's `customizeIn: "pane"` opens Customize in the `Popover`. */
|
|
116
|
+
export declare const OPTIONAL_COMPONENT_NAMES: readonly ["Input", "Select", "Command", "Calendar", "RowsWait", "GroupBody", "SearchField", "PortsHost", "SelectionBar", "ViewMenu", "Pane"];
|
|
114
117
|
export type OptionalComponentName = (typeof OPTIONAL_COMPONENT_NAMES)[number];
|
|
115
118
|
/** The pieces the rendering is built from, and the app's own pieces it cannot draw itself (a command cell's verb menu, the row's right-click menu, where a relation goes, a wait, how a list asks for more), and the rows the panels draw with. Each ships as a default; an app swaps any of them through the provider's `atoms`. */
|
|
116
119
|
export declare const ATOM_NAMES: readonly ["Row", "RowContent", "TickBox", "StatusBadge", "StatusMarker", "Tag", "List", "CommandMenu", "RelationLink", "RelationRoles", "CellMore", "Loading", "LoadMore", "PlatformMark", "RowMenu", "SelectionSheet", "ChoiceRow", "CheckRow", "RadioRow", "DirectionButton", "MenuRow", "ToggleRow", "PanelSearch", "Pill", "RangeCalendar", "ToolbarButton", "Avatar"];
|
|
117
120
|
export type AtomName = (typeof ATOM_NAMES)[number];
|
|
121
|
+
/** The parts inside the default panels, by panel (VK-988): each its public `data-slot`, prefixed with the panel's own short name.
|
|
122
|
+
* A part that repeats also says which one it is (`data-key`) and, a sort or filter rule, its place (`data-index`). */
|
|
123
|
+
export declare const PANEL_SLOTS: {
|
|
124
|
+
readonly sort: readonly ["vk-sort", "vk-sort-rules", "vk-sort-rule", "vk-sort-grip", "vk-sort-field", "vk-sort-direction", "vk-sort-remove", "vk-sort-rule-open", "vk-sort-rule-more", "vk-sort-rule-action", "vk-sort-direction-option", "vk-sort-add", "vk-sort-clear", "vk-sort-foot", "vk-sort-none", "vk-sort-head"];
|
|
125
|
+
readonly filter: readonly ["vk-filter", "vk-filter-rules", "vk-filter-item", "vk-filter-rule", "vk-filter-where", "vk-filter-joined", "vk-filter-join", "vk-filter-field", "vk-filter-how", "vk-filter-value", "vk-filter-rule-more", "vk-filter-rule-action", "vk-filter-group", "vk-filter-group-head", "vk-filter-quantifier", "vk-filter-group-more", "vk-filter-group-action", "vk-filter-delete", "vk-filter-add", "vk-filter-clear", "vk-filter-foot", "vk-filter-none", "vk-filter-excluded", "vk-filter-head", "vk-filter-part-value", "vk-filter-part-pair"];
|
|
126
|
+
readonly group: readonly ["vk-group", "vk-group-setting", "vk-group-choice", "vk-group-heading", "vk-group-value", "vk-group-hide-all", "vk-group-remove"];
|
|
127
|
+
readonly customize: readonly ["vk-customize", "vk-customize-head", "vk-customize-title", "vk-customize-back", "vk-customize-close", "vk-customize-layout-button", "vk-customize-name", "vk-customize-heading", "vk-customize-section", "vk-customize-field", "vk-customize-toggle", "vk-customize-toggle-reset", "vk-customize-choice", "vk-customize-option", "vk-customize-layout", "vk-customize-column", "vk-customize-search", "vk-customize-columns-action", "vk-customize-foot", "vk-customize-changes", "vk-customize-action", "vk-customize-stale", "vk-customize-none", "vk-customize-rows", "vk-customize-columns-foot"];
|
|
128
|
+
readonly viewsList: readonly ["vk-views-list", "vk-views-list-row", "vk-views-list-head"];
|
|
129
|
+
readonly viewMenu: readonly ["vk-view-menu", "vk-view-menu-row", "vk-view-menu-name", "vk-view-menu-layout", "vk-view-menu-columns", "vk-view-menu-act"];
|
|
130
|
+
readonly quick: readonly ["vk-quick", "vk-quick-field", "vk-quick-search", "vk-quick-value", "vk-quick-count", "vk-quick-clear", "vk-quick-none", "vk-quick-head", "vk-quick-strip", "vk-quick-values"];
|
|
131
|
+
};
|
|
132
|
+
export type PanelSlot = (typeof PANEL_SLOTS)[keyof typeof PANEL_SLOTS][number];
|
|
118
133
|
/** The default atoms' `data-slot` values: prefixed, like the grid's. */
|
|
119
|
-
export declare const ATOM_SLOTS: readonly ["vk-row", "vk-row-content", "vk-tick", "vk-avatar", "vk-status", "vk-marker", "vk-tag", "vk-list", "vk-command-menu", "vk-relation-link", "vk-relation-roles", "vk-loading", "vk-load-more", "vk-platform", "vk-row-menu", "vk-choice-row", "vk-check-row", "vk-radio-row", "vk-direction", "vk-menu-row", "vk-toggle-row", "vk-panel-search", "vk-selection-sheet", "vk-pill", "vk-views-row", "vk-views-more", "vk-cell-more", "vk-show-more", "vk-phone", "vk-conversion", "vk-field-retry", "vk-views-chip", "vk-views-add", "vk-range-calendar", "vk-toolbar-button", "vk-toolbar-word", "vk-toolbar-count", "vk-toolbar-dot", "vk-toolbar-words", "vk-toolbar-more", "vk-toolbar-chevron", "vk-toolbar", "vk-toolbar-line", "vk-toolbar-cluster", "vk-toolbar-search", "vk-toolbar-search-field", "vk-toolbar-search-clear", "vk-toolbar-search-spinner", "vk-toolbar-new", "vk-toolbar-options", "vk-toolbar-options-panel", "vk-toolbar-sort", "vk-toolbar-sort-panel", "vk-toolbar-sort-pill", "vk-toolbar-sort-add", "vk-sort-head", "vk-filter-head", "vk-toolbar-quick", "vk-toolbar-quick-panel", "vk-quick-filters-reminder", "vk-quick-filters-reminder-open", "vk-quick-filters-reminder-clear", "vk-toolbar-filter", "vk-toolbar-filter-panel", "vk-toolbar-advanced-filter", "vk-toolbar-advanced-filter-panel", "vk-toolbar-filters", "vk-toolbar-filter-rule", "vk-toolbar-filter-aside", "vk-toolbar-filter-add", "vk-toolbar-more-filters", "vk-toolbar-filters-panel", "vk-toolbar-overflow", "vk-toolbar-separator", "vk-toolbar-save", "vk-toolbar-clear", "vk-toolbar-save-button", "vk-filter-convert"];
|
|
134
|
+
export declare const ATOM_SLOTS: readonly ["vk-row", "vk-row-content", "vk-tick", "vk-avatar", "vk-status", "vk-marker", "vk-tag", "vk-list", "vk-command-menu", "vk-relation-link", "vk-relation-roles", "vk-loading", "vk-load-more", "vk-platform", "vk-row-menu", "vk-choice-row", "vk-check-row", "vk-radio-row", "vk-direction", "vk-menu-row", "vk-toggle-row", "vk-panel-search", "vk-selection-sheet", "vk-pill", "vk-views-row", "vk-views-more", "vk-cell-more", "vk-show-more", "vk-phone", "vk-conversion", "vk-field-retry", "vk-views-chip", "vk-views-add", "vk-range-calendar", "vk-toolbar-button", "vk-toolbar-word", "vk-toolbar-count", "vk-toolbar-dot", "vk-toolbar-words", "vk-toolbar-more", "vk-toolbar-chevron", "vk-toolbar", "vk-toolbar-line", "vk-toolbar-cluster", "vk-toolbar-search", "vk-toolbar-search-field", "vk-toolbar-search-clear", "vk-toolbar-search-spinner", "vk-toolbar-new", "vk-toolbar-options", "vk-toolbar-options-panel", "vk-toolbar-sort", "vk-toolbar-sort-panel", "vk-toolbar-sort-pill", "vk-toolbar-sort-add", "vk-sort-head", "vk-filter-head", "vk-toolbar-quick", "vk-toolbar-quick-panel", "vk-quick-filters-reminder", "vk-quick-filters-reminder-open", "vk-quick-filters-reminder-clear", "vk-toolbar-filter", "vk-toolbar-filter-panel", "vk-toolbar-advanced-filter", "vk-toolbar-advanced-filter-panel", "vk-toolbar-filters", "vk-toolbar-filter-rule", "vk-toolbar-filter-aside", "vk-toolbar-filter-add", "vk-toolbar-more-filters", "vk-toolbar-filters-panel", "vk-toolbar-overflow", "vk-toolbar-separator", "vk-toolbar-save", "vk-toolbar-clear", "vk-toolbar-save-button", "vk-filter-convert", "vk-sort", "vk-sort-rules", "vk-sort-rule", "vk-sort-grip", "vk-sort-field", "vk-sort-direction", "vk-sort-remove", "vk-sort-rule-open", "vk-sort-rule-more", "vk-sort-rule-action", "vk-sort-direction-option", "vk-sort-add", "vk-sort-clear", "vk-sort-foot", "vk-sort-none", "vk-filter", "vk-filter-rules", "vk-filter-item", "vk-filter-rule", "vk-filter-where", "vk-filter-joined", "vk-filter-join", "vk-filter-field", "vk-filter-how", "vk-filter-value", "vk-filter-rule-more", "vk-filter-rule-action", "vk-filter-group", "vk-filter-group-head", "vk-filter-group-more", "vk-filter-quantifier", "vk-filter-group-action", "vk-filter-delete", "vk-filter-add", "vk-filter-clear", "vk-filter-foot", "vk-filter-none", "vk-filter-excluded", "vk-group", "vk-group-setting", "vk-group-choice", "vk-group-heading", "vk-group-value", "vk-group-hide-all", "vk-group-remove", "vk-customize", "vk-customize-head", "vk-customize-title", "vk-customize-back", "vk-customize-close", "vk-customize-layout-button", "vk-customize-name", "vk-customize-heading", "vk-customize-section", "vk-customize-field", "vk-customize-toggle", "vk-customize-toggle-reset", "vk-customize-choice", "vk-customize-option", "vk-customize-layout", "vk-customize-column", "vk-customize-search", "vk-customize-columns-action", "vk-customize-foot", "vk-customize-changes", "vk-customize-action", "vk-customize-stale", "vk-views-list", "vk-views-list-row", "vk-views-list-head", "vk-view-menu", "vk-view-menu-row", "vk-view-menu-name", "vk-view-menu-layout", "vk-view-menu-columns", "vk-view-menu-act", "vk-quick", "vk-quick-field", "vk-quick-search", "vk-quick-value", "vk-quick-count", "vk-quick-clear", "vk-quick-none", "vk-quick-head", "vk-filter-part-value", "vk-filter-part-pair", "vk-customize-none", "vk-customize-rows", "vk-customize-columns-foot", "vk-quick-strip", "vk-quick-values"];
|
|
120
135
|
export type AtomSlot = (typeof ATOM_SLOTS)[number];
|
|
136
|
+
/** The parts of the bulk bar (`CONTROLS.SelectionBar`, `BulkBar`) and of what it opens (VK-1023): each part's public `data-slot`,
|
|
137
|
+
* in every form (a computer's bar, the phone's tray and pill). A verb's button and a menu's row say which one they are by
|
|
138
|
+
* `data-key`: a verb's place in the verbs, from 0 (`delete` for Delete's row), a group's row its place in the group, a field's
|
|
139
|
+
* value its value. */
|
|
140
|
+
export declare const BULK_BAR_SLOTS: readonly ["vk-bulk-bar", "vk-bulk-count", "vk-bulk-separator", "vk-bulk-verb", "vk-bulk-delete", "vk-bulk-more", "vk-bulk-clear", "vk-bulk-actions", "vk-bulk-menu", "vk-bulk-menu-row", "vk-bulk-group-menu", "vk-bulk-group-row", "vk-bulk-choice", "vk-bulk-empty", "vk-bulk-field", "vk-bulk-field-sheet", "vk-bulk-toasts"];
|
|
141
|
+
export type BulkBarSlot = (typeof BULK_BAR_SLOTS)[number];
|
|
121
142
|
/** The selection bar's `data-slot` values: prefixed, like the grid's. The fixed box the app places,
|
|
122
|
-
* the pill inside it, and the count that clears the selection
|
|
123
|
-
|
|
143
|
+
* the pill inside it, and the count that clears the selection (ViewKit's own bar); then the bulk bar's parts
|
|
144
|
+
* (`CONTROLS.SelectionBar`, BULK_BAR_SLOTS). */
|
|
145
|
+
export declare const SELECTION_SLOTS: readonly ["vk-selection-bar", "vk-selection-pill", "vk-selection-chip", "vk-bulk-bar", "vk-bulk-count", "vk-bulk-separator", "vk-bulk-verb", "vk-bulk-delete", "vk-bulk-more", "vk-bulk-clear", "vk-bulk-actions", "vk-bulk-menu", "vk-bulk-menu-row", "vk-bulk-group-menu", "vk-bulk-group-row", "vk-bulk-choice", "vk-bulk-empty", "vk-bulk-field", "vk-bulk-field-sheet", "vk-bulk-toasts"];
|
|
124
146
|
export type SelectionSlot = (typeof SELECTION_SLOTS)[number];
|
|
125
|
-
/** The editor
|
|
126
|
-
|
|
147
|
+
/** The parts inside the default field editors (VK-989), by editor: each part's public `data-slot`, the box a person sees. The
|
|
148
|
+
* shared ones are every editor's ✕, ✓, ‹ and Cancel, wherever ViewKit draws them. */
|
|
149
|
+
export declare const EDITOR_PART_SLOTS: {
|
|
150
|
+
readonly shared: readonly ["vk-editor-close", "vk-editor-save", "vk-editor-back", "vk-editor-cancel"];
|
|
151
|
+
readonly date: readonly ["vk-date", "vk-calendar", "vk-date-line", "vk-date-reads", "vk-date-error", "vk-date-time", "vk-date-head", "vk-date-prev", "vk-date-next", "vk-date-month", "vk-date-year", "vk-date-days", "vk-date-weekdays", "vk-date-day", "vk-date-choices", "vk-date-choice", "vk-date-quarters", "vk-date-quarter", "vk-date-parts", "vk-date-part", "vk-date-segment", "vk-date-sep", "vk-date-picks", "vk-date-pick", "vk-date-card", "vk-date-wheels", "vk-date-wheel", "vk-date-wheel-row"];
|
|
152
|
+
readonly text: readonly ["vk-text", "vk-text-box", "vk-text-country", "vk-text-dial", "vk-text-note"];
|
|
153
|
+
readonly number: readonly ["vk-number", "vk-number-box", "vk-number-currency", "vk-number-unit"];
|
|
154
|
+
readonly parts: readonly ["vk-parts", "vk-parts-field", "vk-parts-box", "vk-parts-line", "vk-parts-own", "vk-parts-card", "vk-parts-pair", "vk-parts-note", "vk-parts-bands"];
|
|
155
|
+
readonly values: readonly ["vk-values", "vk-values-rows", "vk-values-row", "vk-values-value", "vk-values-edit", "vk-values-label", "vk-values-main", "vk-values-pill", "vk-values-acts", "vk-values-grip", "vk-values-copy", "vk-values-open", "vk-values-remove", "vk-values-line", "vk-values-code", "vk-values-prefix", "vk-values-add", "vk-values-back", "vk-values-error"];
|
|
156
|
+
readonly links: readonly ["vk-links", "vk-links-search", "vk-links-list", "vk-links-head", "vk-links-rows", "vk-links-row", "vk-links-name", "vk-links-field", "vk-links-value", "vk-links-control", "vk-links-pop", "vk-links-lead", "vk-links-remove", "vk-links-config", "vk-links-more", "vk-links-action", "vk-links-step", "vk-links-back", "vk-links-unlink", "vk-links-offers", "vk-links-offer", "vk-links-offer-action", "vk-links-note", "vk-links-retry"];
|
|
157
|
+
readonly picker: readonly ["vk-picker", "vk-picker-search", "vk-picker-list", "vk-picker-chips", "vk-picker-chip", "vk-picker-option", "vk-picker-parent", "vk-picker-empty", "vk-picker-add", "vk-picker-create", "vk-picker-action", "vk-picker-group", "vk-picker-heading", "vk-picker-card", "vk-picker-selected", "vk-picker-tick", "vk-picker-row-more", "vk-picker-more", "vk-picker-back", "vk-picker-count", "vk-picker-clear", "vk-picker-lead", "vk-picker-lead-make", "vk-picker-message", "vk-picker-retry", "vk-picker-loading", "vk-picker-foot"];
|
|
158
|
+
};
|
|
159
|
+
/** The editor panel's `data-slot` values: prefixed, like the grid's. Then the frames an app's body or a read-only editor stands
|
|
160
|
+
* in, and the parts inside the default field editors. */
|
|
161
|
+
export declare const EDITOR_SLOTS: readonly ["vk-editor-panel", "vk-editor-bar", "vk-editor-refusal", "vk-text-editor", "vk-date-editor", "vk-text-body", "vk-number-body", "vk-parts-body", "vk-values-body", "vk-links-body", ...("vk-editor-close" | "vk-editor-save" | "vk-editor-back" | "vk-editor-cancel" | "vk-date" | "vk-calendar" | "vk-date-line" | "vk-date-reads" | "vk-date-error" | "vk-date-time" | "vk-date-head" | "vk-date-prev" | "vk-date-next" | "vk-date-month" | "vk-date-year" | "vk-date-days" | "vk-date-weekdays" | "vk-date-day" | "vk-date-choices" | "vk-date-choice" | "vk-date-quarters" | "vk-date-quarter" | "vk-date-parts" | "vk-date-part" | "vk-date-segment" | "vk-date-sep" | "vk-date-picks" | "vk-date-pick" | "vk-date-card" | "vk-date-wheels" | "vk-date-wheel" | "vk-date-wheel-row" | "vk-text" | "vk-text-box" | "vk-text-country" | "vk-text-dial" | "vk-text-note" | "vk-number" | "vk-number-box" | "vk-number-currency" | "vk-number-unit" | "vk-parts" | "vk-parts-field" | "vk-parts-box" | "vk-parts-line" | "vk-parts-own" | "vk-parts-card" | "vk-parts-pair" | "vk-parts-note" | "vk-parts-bands" | "vk-values" | "vk-values-rows" | "vk-values-row" | "vk-values-value" | "vk-values-edit" | "vk-values-label" | "vk-values-main" | "vk-values-pill" | "vk-values-acts" | "vk-values-grip" | "vk-values-copy" | "vk-values-open" | "vk-values-remove" | "vk-values-line" | "vk-values-code" | "vk-values-prefix" | "vk-values-add" | "vk-values-back" | "vk-values-error" | "vk-links" | "vk-links-search" | "vk-links-list" | "vk-links-head" | "vk-links-rows" | "vk-links-row" | "vk-links-name" | "vk-links-field" | "vk-links-value" | "vk-links-control" | "vk-links-pop" | "vk-links-lead" | "vk-links-remove" | "vk-links-config" | "vk-links-more" | "vk-links-action" | "vk-links-step" | "vk-links-back" | "vk-links-unlink" | "vk-links-offers" | "vk-links-offer" | "vk-links-offer-action" | "vk-links-note" | "vk-links-retry" | "vk-picker" | "vk-picker-search" | "vk-picker-list" | "vk-picker-chips" | "vk-picker-chip" | "vk-picker-option" | "vk-picker-parent" | "vk-picker-empty" | "vk-picker-add" | "vk-picker-create" | "vk-picker-action" | "vk-picker-group" | "vk-picker-heading" | "vk-picker-card" | "vk-picker-selected" | "vk-picker-tick" | "vk-picker-row-more" | "vk-picker-more" | "vk-picker-back" | "vk-picker-count" | "vk-picker-clear" | "vk-picker-lead" | "vk-picker-lead-make" | "vk-picker-message" | "vk-picker-retry" | "vk-picker-loading" | "vk-picker-foot")[]];
|
|
127
162
|
export type EditorSlot = (typeof EDITOR_SLOTS)[number];
|
|
128
163
|
/** The editor panel's states. `vk-body` names the app's own body a popover holds (`picker`, `parts`, `values` or `links`). */
|
|
129
164
|
export declare const EDITOR_STATES: readonly ["vk-body"];
|
|
@@ -136,7 +171,7 @@ export type EditorState = (typeof EDITOR_STATES)[number];
|
|
|
136
171
|
* The display marks a phone it draws as typed, not read as international, `as-typed`; a money figure shown in another
|
|
137
172
|
* currency than its record's `converted`; a breakdown's bar for a period not yet complete `partial`; a link whose
|
|
138
173
|
* plain click the host owns `cell-link`; and a value whose press is its own, not the row's, `no-nav`. */
|
|
139
|
-
export declare const ATOM_STATES: readonly ["chosen", "disabled", "muted", "checked", "open", "status", "platform", "as-typed", "converted", "partial", "cell-link", "no-nav", "changed", "edge", "empty", "expanded", "form", "line", "fold", "icon-alone", "aside", "sort-step", "filter-step", "foot", "at", "joined", "waits", "tab", "current"];
|
|
174
|
+
export declare const ATOM_STATES: readonly ["chosen", "disabled", "muted", "checked", "open", "status", "platform", "as-typed", "converted", "partial", "cell-link", "no-nav", "changed", "edge", "empty", "expanded", "form", "line", "fold", "icon-alone", "aside", "sort-step", "filter-step", "foot", "at", "joined", "waits", "tab", "current", "key", "index", "held", "toolbar-item", "today", "picked", "highlighted"];
|
|
140
175
|
export type AtomState = (typeof ATOM_STATES)[number];
|
|
141
176
|
/** The runtime services an app hands in through the provider. */
|
|
142
177
|
export declare const PORT_NAMES: readonly ["toast", "haptics", "clipboard", "viewPrefs", "confirm"];
|
package/views/dist/contract.js
CHANGED
|
@@ -173,6 +173,9 @@ export const VK_OPTIONAL_LAYOUT = [
|
|
|
173
173
|
"--vk-field-row-py",
|
|
174
174
|
"--vk-field-row-line-w",
|
|
175
175
|
"--vk-toolbar-foot",
|
|
176
|
+
"--vk-toolbar-line-py",
|
|
177
|
+
"--vk-toolbar-line-gap",
|
|
178
|
+
"--vk-toolbar-line-w",
|
|
176
179
|
"--vk-gutter",
|
|
177
180
|
"--vk-scroll-inset-bottom",
|
|
178
181
|
"--vk-panel-padding",
|
|
@@ -231,6 +234,7 @@ export const COMPONENT_NAMES = [
|
|
|
231
234
|
];
|
|
232
235
|
export const OPTIONAL_COMPONENT_NAMES = [
|
|
233
236
|
"Input",
|
|
237
|
+
"Select",
|
|
234
238
|
"Command",
|
|
235
239
|
"Calendar",
|
|
236
240
|
"RowsWait",
|
|
@@ -239,6 +243,7 @@ export const OPTIONAL_COMPONENT_NAMES = [
|
|
|
239
243
|
"PortsHost",
|
|
240
244
|
"SelectionBar",
|
|
241
245
|
"ViewMenu",
|
|
246
|
+
"Pane",
|
|
242
247
|
];
|
|
243
248
|
export const ATOM_NAMES = [
|
|
244
249
|
"Row",
|
|
@@ -269,6 +274,18 @@ export const ATOM_NAMES = [
|
|
|
269
274
|
"ToolbarButton",
|
|
270
275
|
"Avatar",
|
|
271
276
|
];
|
|
277
|
+
export const PANEL_SLOTS = {
|
|
278
|
+
sort: ["vk-sort", "vk-sort-rules", "vk-sort-rule", "vk-sort-grip", "vk-sort-field", "vk-sort-direction", "vk-sort-remove", "vk-sort-rule-open", "vk-sort-rule-more", "vk-sort-rule-action", "vk-sort-direction-option", "vk-sort-add", "vk-sort-clear", "vk-sort-foot", "vk-sort-none", "vk-sort-head"],
|
|
279
|
+
filter: ["vk-filter", "vk-filter-rules", "vk-filter-item", "vk-filter-rule", "vk-filter-where", "vk-filter-joined", "vk-filter-join", "vk-filter-field", "vk-filter-how", "vk-filter-value", "vk-filter-rule-more", "vk-filter-rule-action", "vk-filter-group", "vk-filter-group-head", "vk-filter-quantifier", "vk-filter-group-more", "vk-filter-group-action", "vk-filter-delete", "vk-filter-add", "vk-filter-clear", "vk-filter-foot", "vk-filter-none", "vk-filter-excluded", "vk-filter-head",
|
|
280
|
+
"vk-filter-part-value", "vk-filter-part-pair"],
|
|
281
|
+
group: ["vk-group", "vk-group-setting", "vk-group-choice", "vk-group-heading", "vk-group-value", "vk-group-hide-all", "vk-group-remove"],
|
|
282
|
+
customize: ["vk-customize", "vk-customize-head", "vk-customize-title", "vk-customize-back", "vk-customize-close", "vk-customize-layout-button", "vk-customize-name", "vk-customize-heading", "vk-customize-section", "vk-customize-field", "vk-customize-toggle", "vk-customize-toggle-reset", "vk-customize-choice", "vk-customize-option", "vk-customize-layout", "vk-customize-column", "vk-customize-search", "vk-customize-columns-action", "vk-customize-foot", "vk-customize-changes", "vk-customize-action", "vk-customize-stale",
|
|
283
|
+
"vk-customize-none", "vk-customize-rows", "vk-customize-columns-foot"],
|
|
284
|
+
viewsList: ["vk-views-list", "vk-views-list-row", "vk-views-list-head"],
|
|
285
|
+
viewMenu: ["vk-view-menu", "vk-view-menu-row", "vk-view-menu-name", "vk-view-menu-layout", "vk-view-menu-columns", "vk-view-menu-act"],
|
|
286
|
+
quick: ["vk-quick", "vk-quick-field", "vk-quick-search", "vk-quick-value", "vk-quick-count", "vk-quick-clear", "vk-quick-none", "vk-quick-head",
|
|
287
|
+
"vk-quick-strip", "vk-quick-values"],
|
|
288
|
+
};
|
|
272
289
|
export const ATOM_SLOTS = [
|
|
273
290
|
"vk-row",
|
|
274
291
|
"vk-row-content",
|
|
@@ -348,17 +365,150 @@ export const ATOM_SLOTS = [
|
|
|
348
365
|
"vk-toolbar-clear",
|
|
349
366
|
"vk-toolbar-save-button",
|
|
350
367
|
"vk-filter-convert",
|
|
368
|
+
"vk-sort",
|
|
369
|
+
"vk-sort-rules",
|
|
370
|
+
"vk-sort-rule",
|
|
371
|
+
"vk-sort-grip",
|
|
372
|
+
"vk-sort-field",
|
|
373
|
+
"vk-sort-direction",
|
|
374
|
+
"vk-sort-remove",
|
|
375
|
+
"vk-sort-rule-open",
|
|
376
|
+
"vk-sort-rule-more",
|
|
377
|
+
"vk-sort-rule-action",
|
|
378
|
+
"vk-sort-direction-option",
|
|
379
|
+
"vk-sort-add",
|
|
380
|
+
"vk-sort-clear",
|
|
381
|
+
"vk-sort-foot",
|
|
382
|
+
"vk-sort-none",
|
|
383
|
+
"vk-filter",
|
|
384
|
+
"vk-filter-rules",
|
|
385
|
+
"vk-filter-item",
|
|
386
|
+
"vk-filter-rule",
|
|
387
|
+
"vk-filter-where",
|
|
388
|
+
"vk-filter-joined",
|
|
389
|
+
"vk-filter-join",
|
|
390
|
+
"vk-filter-field",
|
|
391
|
+
"vk-filter-how",
|
|
392
|
+
"vk-filter-value",
|
|
393
|
+
"vk-filter-rule-more",
|
|
394
|
+
"vk-filter-rule-action",
|
|
395
|
+
"vk-filter-group",
|
|
396
|
+
"vk-filter-group-head",
|
|
397
|
+
"vk-filter-group-more",
|
|
398
|
+
"vk-filter-quantifier",
|
|
399
|
+
"vk-filter-group-action",
|
|
400
|
+
"vk-filter-delete",
|
|
401
|
+
"vk-filter-add",
|
|
402
|
+
"vk-filter-clear",
|
|
403
|
+
"vk-filter-foot",
|
|
404
|
+
"vk-filter-none",
|
|
405
|
+
"vk-filter-excluded",
|
|
406
|
+
"vk-group",
|
|
407
|
+
"vk-group-setting",
|
|
408
|
+
"vk-group-choice",
|
|
409
|
+
"vk-group-heading",
|
|
410
|
+
"vk-group-value",
|
|
411
|
+
"vk-group-hide-all",
|
|
412
|
+
"vk-group-remove",
|
|
413
|
+
"vk-customize",
|
|
414
|
+
"vk-customize-head",
|
|
415
|
+
"vk-customize-title",
|
|
416
|
+
"vk-customize-back",
|
|
417
|
+
"vk-customize-close",
|
|
418
|
+
"vk-customize-layout-button",
|
|
419
|
+
"vk-customize-name",
|
|
420
|
+
"vk-customize-heading",
|
|
421
|
+
"vk-customize-section",
|
|
422
|
+
"vk-customize-field",
|
|
423
|
+
"vk-customize-toggle",
|
|
424
|
+
"vk-customize-toggle-reset",
|
|
425
|
+
"vk-customize-choice",
|
|
426
|
+
"vk-customize-option",
|
|
427
|
+
"vk-customize-layout",
|
|
428
|
+
"vk-customize-column",
|
|
429
|
+
"vk-customize-search",
|
|
430
|
+
"vk-customize-columns-action",
|
|
431
|
+
"vk-customize-foot",
|
|
432
|
+
"vk-customize-changes",
|
|
433
|
+
"vk-customize-action",
|
|
434
|
+
"vk-customize-stale",
|
|
435
|
+
"vk-views-list",
|
|
436
|
+
"vk-views-list-row",
|
|
437
|
+
"vk-views-list-head",
|
|
438
|
+
"vk-view-menu",
|
|
439
|
+
"vk-view-menu-row",
|
|
440
|
+
"vk-view-menu-name",
|
|
441
|
+
"vk-view-menu-layout",
|
|
442
|
+
"vk-view-menu-columns",
|
|
443
|
+
"vk-view-menu-act",
|
|
444
|
+
"vk-quick",
|
|
445
|
+
"vk-quick-field",
|
|
446
|
+
"vk-quick-search",
|
|
447
|
+
"vk-quick-value",
|
|
448
|
+
"vk-quick-count",
|
|
449
|
+
"vk-quick-clear",
|
|
450
|
+
"vk-quick-none",
|
|
451
|
+
"vk-quick-head",
|
|
452
|
+
"vk-filter-part-value",
|
|
453
|
+
"vk-filter-part-pair",
|
|
454
|
+
"vk-customize-none",
|
|
455
|
+
"vk-customize-rows",
|
|
456
|
+
"vk-customize-columns-foot",
|
|
457
|
+
"vk-quick-strip",
|
|
458
|
+
"vk-quick-values",
|
|
459
|
+
];
|
|
460
|
+
export const BULK_BAR_SLOTS = [
|
|
461
|
+
"vk-bulk-bar",
|
|
462
|
+
"vk-bulk-count",
|
|
463
|
+
"vk-bulk-separator",
|
|
464
|
+
"vk-bulk-verb",
|
|
465
|
+
"vk-bulk-delete",
|
|
466
|
+
"vk-bulk-more",
|
|
467
|
+
"vk-bulk-clear",
|
|
468
|
+
"vk-bulk-actions",
|
|
469
|
+
"vk-bulk-menu",
|
|
470
|
+
"vk-bulk-menu-row",
|
|
471
|
+
"vk-bulk-group-menu",
|
|
472
|
+
"vk-bulk-group-row",
|
|
473
|
+
"vk-bulk-choice",
|
|
474
|
+
"vk-bulk-empty",
|
|
475
|
+
"vk-bulk-field",
|
|
476
|
+
"vk-bulk-field-sheet",
|
|
477
|
+
"vk-bulk-toasts",
|
|
351
478
|
];
|
|
352
479
|
export const SELECTION_SLOTS = [
|
|
353
480
|
"vk-selection-bar",
|
|
354
481
|
"vk-selection-pill",
|
|
355
482
|
"vk-selection-chip",
|
|
483
|
+
...BULK_BAR_SLOTS,
|
|
356
484
|
];
|
|
485
|
+
export const EDITOR_PART_SLOTS = {
|
|
486
|
+
shared: ["vk-editor-close", "vk-editor-save", "vk-editor-back", "vk-editor-cancel"],
|
|
487
|
+
date: [
|
|
488
|
+
"vk-date", "vk-calendar", "vk-date-line", "vk-date-reads", "vk-date-error", "vk-date-time", "vk-date-head", "vk-date-prev",
|
|
489
|
+
"vk-date-next", "vk-date-month", "vk-date-year", "vk-date-days", "vk-date-weekdays", "vk-date-day", "vk-date-choices",
|
|
490
|
+
"vk-date-choice", "vk-date-quarters", "vk-date-quarter", "vk-date-parts", "vk-date-part", "vk-date-segment", "vk-date-sep",
|
|
491
|
+
"vk-date-picks", "vk-date-pick", "vk-date-card", "vk-date-wheels", "vk-date-wheel", "vk-date-wheel-row",
|
|
492
|
+
],
|
|
493
|
+
text: ["vk-text", "vk-text-box", "vk-text-country", "vk-text-dial", "vk-text-note"],
|
|
494
|
+
number: ["vk-number", "vk-number-box", "vk-number-currency", "vk-number-unit"],
|
|
495
|
+
parts: ["vk-parts", "vk-parts-field", "vk-parts-box", "vk-parts-line", "vk-parts-own", "vk-parts-card", "vk-parts-pair", "vk-parts-note", "vk-parts-bands"],
|
|
496
|
+
values: ["vk-values", "vk-values-rows", "vk-values-row", "vk-values-value", "vk-values-edit", "vk-values-label", "vk-values-main", "vk-values-pill", "vk-values-acts", "vk-values-grip", "vk-values-copy", "vk-values-open", "vk-values-remove", "vk-values-line", "vk-values-code", "vk-values-prefix", "vk-values-add", "vk-values-back", "vk-values-error"],
|
|
497
|
+
links: ["vk-links", "vk-links-search", "vk-links-list", "vk-links-head", "vk-links-rows", "vk-links-row", "vk-links-name", "vk-links-field", "vk-links-value", "vk-links-control", "vk-links-pop", "vk-links-lead", "vk-links-remove", "vk-links-config", "vk-links-more", "vk-links-action", "vk-links-step", "vk-links-back", "vk-links-unlink", "vk-links-offers", "vk-links-offer", "vk-links-offer-action", "vk-links-note", "vk-links-retry"],
|
|
498
|
+
picker: ["vk-picker", "vk-picker-search", "vk-picker-list", "vk-picker-chips", "vk-picker-chip", "vk-picker-option", "vk-picker-parent", "vk-picker-empty", "vk-picker-add", "vk-picker-create", "vk-picker-action", "vk-picker-group", "vk-picker-heading", "vk-picker-card", "vk-picker-selected", "vk-picker-tick", "vk-picker-row-more", "vk-picker-more", "vk-picker-back", "vk-picker-count", "vk-picker-clear", "vk-picker-lead", "vk-picker-lead-make", "vk-picker-message", "vk-picker-retry", "vk-picker-loading", "vk-picker-foot"],
|
|
499
|
+
};
|
|
357
500
|
export const EDITOR_SLOTS = [
|
|
358
501
|
"vk-editor-panel",
|
|
359
502
|
"vk-editor-bar",
|
|
360
503
|
"vk-editor-refusal",
|
|
361
504
|
"vk-text-editor",
|
|
505
|
+
"vk-date-editor",
|
|
506
|
+
"vk-text-body",
|
|
507
|
+
"vk-number-body",
|
|
508
|
+
"vk-parts-body",
|
|
509
|
+
"vk-values-body",
|
|
510
|
+
"vk-links-body",
|
|
511
|
+
...Object.values(EDITOR_PART_SLOTS).flat(),
|
|
362
512
|
];
|
|
363
513
|
export const EDITOR_STATES = ["vk-body"];
|
|
364
514
|
export const ATOM_STATES = [
|
|
@@ -391,6 +541,13 @@ export const ATOM_STATES = [
|
|
|
391
541
|
"waits",
|
|
392
542
|
"tab",
|
|
393
543
|
"current",
|
|
544
|
+
"key",
|
|
545
|
+
"index",
|
|
546
|
+
"held",
|
|
547
|
+
"toolbar-item",
|
|
548
|
+
"today",
|
|
549
|
+
"picked",
|
|
550
|
+
"highlighted",
|
|
394
551
|
];
|
|
395
552
|
export const PORT_NAMES = ["toast", "haptics", "clipboard", "viewPrefs", "confirm"];
|
|
396
553
|
export const ICON_NAMES = [
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cx } from "../../internal/cx.js";
|
|
3
|
-
import {
|
|
3
|
+
import { usePanelControls } from "../internal/panel-controls.js";
|
|
4
4
|
import { NOTICE_ICONS } from "../notice/notice.js";
|
|
5
5
|
const glyph = (paths) => _jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) });
|
|
6
6
|
export const ALERT_WORDS = { tryAgain: "Try again" };
|
|
7
7
|
const MARK = { primary: NOTICE_ICONS.information, information: NOTICE_ICONS.information, success: NOTICE_ICONS.success, warning: NOTICE_ICONS.warning, danger: NOTICE_ICONS.danger };
|
|
8
8
|
export function Alert({ title, line, action, kind = "primary", cancel = "Cancel", icon, onAnswer, state = "rest", failed, phone = false, shell = "panel", cancelRef, Title = "h2", Line = "p", words }) {
|
|
9
|
+
const { Button } = usePanelControls();
|
|
9
10
|
const working = state === "working", wrong = state === "failed", size = phone ? "lg" : undefined, says = wrong ? failed : line;
|
|
10
11
|
return (_jsxs("div", { className: "o-alert-body", "data-kind": kind, "data-screen": phone ? "phone" : "computer", "data-shell": shell, "data-kit": "alert", children: [_jsx("span", { className: "o-alert-mark", "aria-hidden": "true", children: icon ?? glyph(MARK[kind]) }), _jsx(Title, { className: "o-alert-title", children: title }), says != null && _jsx(Line, { className: cx("o-alert-line", wrong && "o-alert-wrong"), children: says }), _jsxs("div", { className: "o-alert-foot", children: [_jsx(Button, { ref: cancelRef, size: size, className: "o-alert-cancel", disabled: working, onClick: () => onAnswer(false), children: cancel }), _jsx(Button, { kind: kind, size: size, loading: working, onClick: () => onAnswer(true), children: wrong ? (words?.tryAgain ?? ALERT_WORDS.tryAgain) : action })] })] }));
|
|
11
12
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { AlertDialog as BaseAlert } from "@base-ui/react/alert-dialog";
|
|
4
4
|
import { Dialog as BaseDialog } from "@base-ui/react/dialog";
|
|
5
5
|
import { Alert, ALERT_WORDS } from "../alert/alert.js";
|
|
6
6
|
import { Button } from "../button/button.js";
|
|
7
|
+
import { PanelHeadButton } from "../internal/head-button.js";
|
|
7
8
|
import { GlassButton } from "../glass-button/glass-button.js";
|
|
8
9
|
import { PhoneHost, usePhone } from "../internal/phone.js";
|
|
9
10
|
import { OutOfFieldRows } from "../../internal/field-rows.js";
|
|
@@ -14,7 +15,7 @@ export { confirm } from "./confirm.js";
|
|
|
14
15
|
const glyph = (paths) => _jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) });
|
|
15
16
|
const X = ["M18 6l-12 12", "M6 6l12 12"];
|
|
16
17
|
function Held({ phone, shell, disabled, onClose, close, children }) {
|
|
17
|
-
return (_jsxs("div", { className: "o-alert-held", "data-screen": phone ? "phone" : "computer", "data-shell": shell, "data-kit": "alert-dialog", children: [children, phone && (
|
|
18
|
+
return (_jsxs("div", { className: "o-alert-held", "data-screen": phone ? "phone" : "computer", "data-shell": shell, "data-kit": "alert-dialog", children: [children, phone && (_jsx("span", { className: "o-alert-x", children: _jsx(PanelHeadButton, { "aria-label": close, icon: glyph(X), disabled: disabled, onClick: onClose, own: _jsxs(_Fragment, { children: [_jsx(GlassButton, { "aria-label": close, className: "o-alert-x-glass", icon: glyph(X), disabled: disabled, onClick: onClose }), _jsx(Button, { kind: "quiet", shape: "icon", size: "sm", "aria-label": close, className: "o-alert-x-plain", icon: glyph(X), disabled: disabled, onClick: onClose })] }) }) }))] }));
|
|
18
19
|
}
|
|
19
20
|
const shellOf = (el) => (el?.closest("[data-alert-phone]")?.dataset.alertPhone === "sheet" ? "sheet" : "panel");
|
|
20
21
|
function useShell(frame) {
|