@evotecit/canopyx 0.3.16 → 0.3.20
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/CanopyX.Html/Assets/canopyx-board.css +50 -0
- package/CanopyX.Html/Assets/canopyx-board.js +39 -0
- package/CanopyX.Html/Assets/canopyx-buckets.js +15 -0
- package/CanopyX.Html/Assets/canopyx-calculations.css +7 -0
- package/CanopyX.Html/Assets/canopyx-calculations.js +52 -0
- package/CanopyX.Html/Assets/canopyx-calendar-edit.js +3 -3
- package/CanopyX.Html/Assets/canopyx-calendar.css +74 -80
- package/CanopyX.Html/Assets/canopyx-calendar.js +26 -31
- package/CanopyX.Html/Assets/canopyx-cell-range.css +4 -4
- package/CanopyX.Html/Assets/canopyx-cell-range.js +16 -14
- package/CanopyX.Html/Assets/canopyx-changes.css +61 -79
- package/CanopyX.Html/Assets/canopyx-changes.js +18 -15
- package/CanopyX.Html/Assets/canopyx-column-groups.css +5 -1
- package/CanopyX.Html/Assets/canopyx-column-groups.js +15 -9
- package/CanopyX.Html/Assets/canopyx-compare.css +37 -0
- package/CanopyX.Html/Assets/canopyx-compare.js +12 -0
- package/CanopyX.Html/Assets/canopyx-data.js +3 -3
- package/CanopyX.Html/Assets/canopyx-detail-rows.css +4 -4
- package/CanopyX.Html/Assets/canopyx-detail-rows.js +1 -1
- package/CanopyX.Html/Assets/canopyx-editing.css +5 -5
- package/CanopyX.Html/Assets/canopyx-editing.js +2 -2
- package/CanopyX.Html/Assets/canopyx-enhance.js +5 -5
- package/CanopyX.Html/Assets/canopyx-export.js +54 -13
- package/CanopyX.Html/Assets/canopyx-facets.css +32 -22
- package/CanopyX.Html/Assets/canopyx-facets.js +19 -15
- package/CanopyX.Html/Assets/canopyx-filter-editor.css +75 -89
- package/CanopyX.Html/Assets/canopyx-filter-editor.js +20 -16
- package/CanopyX.Html/Assets/canopyx-flow-checks.css +3 -3
- package/CanopyX.Html/Assets/canopyx-flow-checks.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-command.css +3 -3
- package/CanopyX.Html/Assets/canopyx-flow-command.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-dialog.css +4 -4
- package/CanopyX.Html/Assets/canopyx-flow-dialog.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-drafts.css +2 -2
- package/CanopyX.Html/Assets/canopyx-flow-drafts.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-entry.css +142 -17
- package/CanopyX.Html/Assets/canopyx-flow-entry.js +5 -5
- package/CanopyX.Html/Assets/canopyx-flow-host.css +2 -2
- package/CanopyX.Html/Assets/canopyx-flow-host.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-module.mjs +5 -5
- package/CanopyX.Html/Assets/canopyx-flow-pick.css +4 -4
- package/CanopyX.Html/Assets/canopyx-flow-pick.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-preview.css +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-preview.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-records.css +2 -2
- package/CanopyX.Html/Assets/canopyx-flow-records.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-tasks.css +4 -4
- package/CanopyX.Html/Assets/canopyx-flow-tasks.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow.css +41 -41
- package/CanopyX.Html/Assets/canopyx-flow.js +1 -1
- package/CanopyX.Html/Assets/canopyx-format-editor.css +9 -9
- package/CanopyX.Html/Assets/canopyx-format-editor.js +2 -2
- package/CanopyX.Html/Assets/canopyx-formatting.css +13 -13
- package/CanopyX.Html/Assets/canopyx-formatting.js +12 -11
- package/CanopyX.Html/Assets/canopyx-forms.css +3 -3
- package/CanopyX.Html/Assets/canopyx-forms.js +1 -1
- package/CanopyX.Html/Assets/canopyx-grid-module.mjs +220 -155
- package/CanopyX.Html/Assets/canopyx-grid-options.css +8 -8
- package/CanopyX.Html/Assets/canopyx-grid-options.js +9 -2
- package/CanopyX.Html/Assets/canopyx-grid.css +285 -150
- package/CanopyX.Html/Assets/canopyx-grid.js +220 -155
- package/CanopyX.Html/Assets/canopyx-grouping.css +23 -16
- package/CanopyX.Html/Assets/canopyx-grouping.js +24 -17
- package/CanopyX.Html/Assets/canopyx-highlight.css +10 -10
- package/CanopyX.Html/Assets/canopyx-highlight.js +1 -1
- package/CanopyX.Html/Assets/canopyx-interactive.css +215 -91
- package/CanopyX.Html/Assets/canopyx-interactive.js +47 -52
- package/CanopyX.Html/Assets/canopyx-labels-de.js +177 -9
- package/CanopyX.Html/Assets/canopyx-labels-es.js +177 -9
- package/CanopyX.Html/Assets/canopyx-labels-fr.js +176 -8
- package/CanopyX.Html/Assets/canopyx-labels-it.js +176 -8
- package/CanopyX.Html/Assets/canopyx-labels-pl.js +176 -8
- package/CanopyX.Html/Assets/canopyx-layouts.css +49 -21
- package/CanopyX.Html/Assets/canopyx-layouts.js +36 -14
- package/CanopyX.Html/Assets/canopyx-link.css +3 -3
- package/CanopyX.Html/Assets/canopyx-link.js +4 -4
- package/CanopyX.Html/Assets/canopyx-links.js +2 -2
- package/CanopyX.Html/Assets/canopyx-live.css +3 -5
- package/CanopyX.Html/Assets/canopyx-live.js +3 -3
- package/CanopyX.Html/Assets/canopyx-matrix.css +32 -39
- package/CanopyX.Html/Assets/canopyx-matrix.js +11 -11
- package/CanopyX.Html/Assets/canopyx-module.mjs +47 -52
- package/CanopyX.Html/Assets/canopyx-office-export.js +2936 -0
- package/CanopyX.Html/Assets/canopyx-pager.css +1 -1
- package/CanopyX.Html/Assets/canopyx-pager.js +1 -1
- package/CanopyX.Html/Assets/canopyx-path.css +45 -0
- package/CanopyX.Html/Assets/canopyx-path.js +28 -0
- package/CanopyX.Html/Assets/canopyx-pivot.css +75 -0
- package/CanopyX.Html/Assets/canopyx-pivot.js +72 -0
- package/CanopyX.Html/Assets/canopyx-plan.css +63 -0
- package/CanopyX.Html/Assets/canopyx-plan.js +71 -0
- package/CanopyX.Html/Assets/canopyx-presenters.js +2 -2
- package/CanopyX.Html/Assets/canopyx-record-panel.css +51 -45
- package/CanopyX.Html/Assets/canopyx-record-panel.js +30 -22
- package/CanopyX.Html/Assets/canopyx-reporting-module.mjs +262 -197
- package/CanopyX.Html/Assets/canopyx-reporting.css +300 -164
- package/CanopyX.Html/Assets/canopyx-reporting.js +262 -197
- package/CanopyX.Html/Assets/canopyx-stack.css +35 -0
- package/CanopyX.Html/Assets/canopyx-stack.js +24 -0
- package/CanopyX.Html/Assets/canopyx-time-slider.css +18 -0
- package/CanopyX.Html/Assets/canopyx-time-slider.js +27 -0
- package/CanopyX.Html/Assets/canopyx-timeline.css +19 -19
- package/CanopyX.Html/Assets/canopyx-timeline.js +6 -5
- package/CanopyX.Html/Assets/canopyx-tree-tools.css +47 -46
- package/CanopyX.Html/Assets/canopyx-tree-tools.js +15 -12
- package/CanopyX.Html/Assets/canopyx-ui-menu.css +41 -0
- package/CanopyX.Html/Assets/canopyx-ui-menu.js +64 -0
- package/CanopyX.Html/Assets/canopyx-ui-navigation.css +73 -0
- package/CanopyX.Html/Assets/canopyx-ui-navigation.js +39 -0
- package/CanopyX.Html/Assets/canopyx-ui-overlays.css +79 -0
- package/CanopyX.Html/Assets/canopyx-ui-overlays.js +45 -0
- package/CanopyX.Html/Assets/canopyx-ui-picker.css +12 -0
- package/CanopyX.Html/Assets/canopyx-ui-picker.js +6 -0
- package/CanopyX.Html/Assets/canopyx-ui-stepper.css +174 -0
- package/CanopyX.Html/Assets/canopyx-ui-stepper.js +48 -0
- package/CanopyX.Html/Assets/canopyx-ui-tabs.css +153 -0
- package/CanopyX.Html/Assets/canopyx-ui-tabs.js +47 -0
- package/CanopyX.Html/Assets/canopyx-values.css +5 -0
- package/CanopyX.Html/Assets/canopyx-values.js +13 -0
- package/CanopyX.Html/Assets/canopyx-view-intents.css +12 -0
- package/CanopyX.Html/Assets/canopyx-view-intents.js +56 -0
- package/CanopyX.Html/Assets/canopyx.css +212 -85
- package/CanopyX.Html/Assets/canopyx.js +38 -26
- package/JavaScript/board.d.ts +30 -0
- package/JavaScript/changes.d.ts +4 -1
- package/JavaScript/column-groups.d.ts +24 -4
- package/JavaScript/facets.d.ts +5 -3
- package/JavaScript/grid.d.ts +161 -17
- package/JavaScript/hosts.d.ts +16 -1
- package/JavaScript/index.d.ts +4 -2
- package/JavaScript/locales/de.mjs +177 -9
- package/JavaScript/locales/es.mjs +177 -9
- package/JavaScript/locales/fr.mjs +176 -8
- package/JavaScript/locales/it.mjs +176 -8
- package/JavaScript/locales/pl.mjs +176 -8
- package/JavaScript/matrix.d.ts +4 -1
- package/JavaScript/path.d.ts +33 -0
- package/JavaScript/pivot.d.ts +135 -0
- package/JavaScript/plan.d.ts +23 -0
- package/JavaScript/protocol.d.ts +18 -3
- package/JavaScript/records.d.ts +4 -0
- package/JavaScript/stack.d.ts +28 -0
- package/JavaScript/time-slider.d.ts +58 -0
- package/JavaScript/ui.d.ts +261 -0
- package/JavaScript/view-intents.d.ts +45 -0
- package/README.md +76 -187
- package/README.nuget.md +63 -87
- package/ThirdParty/OfficeIMO/LICENSE +21 -0
- package/ThirdParty/OfficeIMO/README.md +13 -0
- package/package.json +76 -3
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import type { LabelName } from "./protocol.js";
|
|
2
|
+
|
|
3
|
+
/** An element, or a selector resolving to one element. Context-menu selectors are delegated instead. */
|
|
4
|
+
export type UiTarget = HTMLElement | string;
|
|
5
|
+
/** Calls made before ready wait for the lazy implementation; after readiness, queries may return synchronously. */
|
|
6
|
+
export type UiResult<T> = T | Promise<T>;
|
|
7
|
+
/** Host-owned labels override the runtime defaults. */
|
|
8
|
+
export type UiLabels = Partial<Record<LabelName, string>>;
|
|
9
|
+
|
|
10
|
+
/** The public wrapper is stable from creation until destruction, including while its lazy part loads. */
|
|
11
|
+
export interface UiController {
|
|
12
|
+
readonly element: HTMLElement;
|
|
13
|
+
/** Resolves to this same wrapper after initialization; rejects on loading failure or destruction before initialization. */
|
|
14
|
+
readonly ready: Promise<this>;
|
|
15
|
+
/** Releases this instance. Repeated calls do nothing; later method calls throw. */
|
|
16
|
+
destroy(): void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** A record discovered from the declarative markup, passed to navigation hooks. */
|
|
20
|
+
export interface UiNavigationItem {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly index: number;
|
|
23
|
+
readonly element: HTMLElement;
|
|
24
|
+
readonly panel?: HTMLElement;
|
|
25
|
+
readonly label: string;
|
|
26
|
+
readonly badge?: string;
|
|
27
|
+
readonly icon?: Node | string;
|
|
28
|
+
readonly disabled: boolean;
|
|
29
|
+
readonly optional: boolean;
|
|
30
|
+
readonly visited: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Loader strings are trusted host HTML and pass through CanopyX's canonical HTML/Trusted Types boundary.
|
|
34
|
+
* Print preparation may call loaders for inactive panels with a separate signal; return content without mutating live panels. */
|
|
35
|
+
export type UiContentLoader<Item extends UiNavigationItem = UiNavigationItem> =
|
|
36
|
+
(item: Item, signal: AbortSignal) => Node | string | null | void | Promise<Node | string | null | void>;
|
|
37
|
+
|
|
38
|
+
/** Shared deferred-panel behavior for tabs and steppers. Templates also opt a panel into deferred loading. */
|
|
39
|
+
export interface UiDeferredOptions<Item extends UiNavigationItem = UiNavigationItem> {
|
|
40
|
+
deferred?: boolean;
|
|
41
|
+
/** Defaults to true. False disposes deferred content on leave and loads it again on return. */
|
|
42
|
+
keepAlive?: boolean;
|
|
43
|
+
loader?: UiContentLoader<Item>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Shared options for navigation over existing declarative markup. Host callbacks may ignore cancellation; stale results never commit. */
|
|
47
|
+
export interface UiNavigationOptions<Item extends UiNavigationItem = UiNavigationItem> extends UiDeferredOptions<Item> {
|
|
48
|
+
/** Renders an encoded icon name from the markup into a decorative node or plain text. */
|
|
49
|
+
renderIcon?: (icon: string, item: Partial<Item>) => Node | string | null | void;
|
|
50
|
+
labels?: UiLabels;
|
|
51
|
+
selectedIndex?: number;
|
|
52
|
+
/** Local item identity or zero-based index. selectedIndex takes precedence when supplied. */
|
|
53
|
+
selected?: string | number;
|
|
54
|
+
/** Returning false cancels the leave. Selection remains unchanged while this callback is pending. */
|
|
55
|
+
beforeChange?: (from: Item | undefined, to: Item, signal: AbortSignal) => boolean | void | Promise<boolean | void>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Deferred settings for one tab, matched by its data-tab-id. Labels, badges and disabled state come from markup. */
|
|
59
|
+
export interface UiTabOptions extends UiDeferredOptions {
|
|
60
|
+
id: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Tabs over the .NET tablist/tabpanel contract. */
|
|
64
|
+
export interface UiTabsOptions extends UiNavigationOptions {
|
|
65
|
+
style?: "underline" | "pills" | "segmented" | "vertical";
|
|
66
|
+
overflow?: "scroll" | "menu" | "wrap";
|
|
67
|
+
collapse?: "picker" | "none";
|
|
68
|
+
activation?: "automatic" | "manual";
|
|
69
|
+
print?: "all" | "selected";
|
|
70
|
+
transition?: "none" | "fade" | "slide";
|
|
71
|
+
hash?: boolean;
|
|
72
|
+
hashHistory?: "replace" | "push";
|
|
73
|
+
tabs?: readonly UiTabOptions[];
|
|
74
|
+
/** Optional automatic progression. Manual selection stops it; reduced motion disables it.
|
|
75
|
+
* False disables settings emitted by the .NET builder. */
|
|
76
|
+
autoProgress?: false | {
|
|
77
|
+
/** A positive interval in milliseconds. */
|
|
78
|
+
interval: number;
|
|
79
|
+
/** Suspends the interval while hovered. Defaults to true. */
|
|
80
|
+
pauseOnHover?: boolean;
|
|
81
|
+
/** Suspends the interval while focus is inside. Defaults to true. */
|
|
82
|
+
pauseOnFocus?: boolean;
|
|
83
|
+
};
|
|
84
|
+
/** Enables the development warning when segmented tabs fall back to pills above five items. */
|
|
85
|
+
debug?: boolean;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Shared navigation methods. Selection identifies items by local identity or zero-based index. */
|
|
89
|
+
export interface UiNavigationController extends UiController {
|
|
90
|
+
select(idOrIndex: string | number): Promise<boolean>;
|
|
91
|
+
getSelected(): UiResult<string | null>;
|
|
92
|
+
/** Rediscovers the current markup and updates presentation. */
|
|
93
|
+
refresh(): UiResult<void>;
|
|
94
|
+
/** Prepares deferred print bodies without navigation. Await before window.print(); rejects on load failure or cancellation. */
|
|
95
|
+
preparePrint(): Promise<void>;
|
|
96
|
+
}
|
|
97
|
+
export interface UiTabsController extends UiNavigationController {}
|
|
98
|
+
|
|
99
|
+
/** Step states are presentation supplied by the host or by successful navigation and validation. */
|
|
100
|
+
export type UiStepState = "upcoming" | "current" | "done" | "error" | "skipped" | "disabled";
|
|
101
|
+
export interface UiStepItem extends UiNavigationItem {
|
|
102
|
+
readonly state: UiStepState;
|
|
103
|
+
}
|
|
104
|
+
export interface UiStepOptions extends UiDeferredOptions<UiStepItem> {
|
|
105
|
+
id: string;
|
|
106
|
+
}
|
|
107
|
+
/** A false value or a nonempty message array rejects navigation; messages render as a focused alert. */
|
|
108
|
+
export type UiStepValidation = boolean | readonly string[] | void;
|
|
109
|
+
export interface UiStepperState {
|
|
110
|
+
selected: string | null;
|
|
111
|
+
finished: boolean;
|
|
112
|
+
steps: Array<{ id: string; state: UiStepState; current: boolean; visited: boolean; optional: boolean }>;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** A content wizard, a readable report, or a static progress header. */
|
|
116
|
+
export interface UiStepperOptions extends UiNavigationOptions<UiStepItem> {
|
|
117
|
+
mode?: "interactive" | "report" | "static";
|
|
118
|
+
linear?: boolean;
|
|
119
|
+
vertical?: "inline" | "side";
|
|
120
|
+
resetForwardOnBack?: boolean;
|
|
121
|
+
steps?: readonly UiStepOptions[];
|
|
122
|
+
validate?: (step: UiStepItem, signal: AbortSignal) => UiStepValidation | Promise<UiStepValidation>;
|
|
123
|
+
backLabel?: string;
|
|
124
|
+
nextLabel?: string;
|
|
125
|
+
finishLabel?: string;
|
|
126
|
+
skipLabel?: string;
|
|
127
|
+
saveDraftLabel?: string;
|
|
128
|
+
/** False omits Skip even for optional steps. */
|
|
129
|
+
skip?: boolean;
|
|
130
|
+
onSaveDraft?: (state: UiStepperState) => void;
|
|
131
|
+
onFinish?: (state: UiStepperState) => void;
|
|
132
|
+
}
|
|
133
|
+
export interface UiStepperController extends UiNavigationController {
|
|
134
|
+
next(): Promise<boolean>;
|
|
135
|
+
back(): Promise<boolean>;
|
|
136
|
+
skip(): Promise<boolean>;
|
|
137
|
+
finish(): Promise<boolean>;
|
|
138
|
+
/** Invalid transitions (including skipping a required step) return false. */
|
|
139
|
+
setStepState(id: string, state: UiStepState): UiResult<boolean>;
|
|
140
|
+
getState(): UiResult<UiStepperState>;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Positioning sides use logical start/end alignment for vertical placements. */
|
|
144
|
+
export type UiPlacement = "top" | "bottom" | "left" | "right" | "top-start" | "top-end" | "bottom-start" | "bottom-end";
|
|
145
|
+
export interface UiOverlayOpenOptions {
|
|
146
|
+
modal?: boolean;
|
|
147
|
+
/** Viewport coordinates for pointer-anchored menus. */
|
|
148
|
+
point?: { x: number; y: number };
|
|
149
|
+
}
|
|
150
|
+
export interface UiOverlayOptions {
|
|
151
|
+
trigger?: HTMLElement;
|
|
152
|
+
host?: HTMLElement;
|
|
153
|
+
placement?: UiPlacement;
|
|
154
|
+
dismissible?: boolean;
|
|
155
|
+
modal?: boolean;
|
|
156
|
+
initialFocus?: HTMLElement | ((element: HTMLElement) => HTMLElement | null | undefined);
|
|
157
|
+
focus?: boolean;
|
|
158
|
+
}
|
|
159
|
+
/** Shared open/close behavior for popovers and tooltips. */
|
|
160
|
+
export interface UiOverlayController extends UiController {
|
|
161
|
+
open(options?: UiOverlayOpenOptions): UiResult<boolean>;
|
|
162
|
+
close(reason?: string, restoreFocus?: boolean, force?: boolean): UiResult<boolean>;
|
|
163
|
+
}
|
|
164
|
+
export interface UiDialogOptions {
|
|
165
|
+
trigger?: HTMLElement;
|
|
166
|
+
host?: HTMLElement;
|
|
167
|
+
/** The container whose width selects the drawer's phone behavior. */
|
|
168
|
+
container?: HTMLElement;
|
|
169
|
+
labels?: UiLabels;
|
|
170
|
+
dismissible?: boolean;
|
|
171
|
+
initialFocus?: HTMLElement | ((element: HTMLElement) => HTMLElement | null | undefined);
|
|
172
|
+
}
|
|
173
|
+
export interface UiDrawerOptions extends UiDialogOptions {
|
|
174
|
+
modal?: boolean;
|
|
175
|
+
/** Header navigation when focus is outside an editable field. */
|
|
176
|
+
records?: (direction: -1 | 1) => void;
|
|
177
|
+
}
|
|
178
|
+
export interface UiDialogState { open: boolean; modal: boolean }
|
|
179
|
+
export interface UiDialogController extends UiOverlayController {
|
|
180
|
+
/** Dialog modality is fixed; drawer modality comes from its container width and factory options. */
|
|
181
|
+
open(): UiResult<boolean>;
|
|
182
|
+
refresh(): UiResult<void>;
|
|
183
|
+
getState(): UiResult<UiDialogState>;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** Menu decorations and actions use the same item model as context menus. */
|
|
187
|
+
export interface UiMenuItem {
|
|
188
|
+
id?: string;
|
|
189
|
+
label?: string;
|
|
190
|
+
kind?: "separator" | "groupLabel" | "grouplabel" | "radio" | "checkbox";
|
|
191
|
+
type?: "separator" | "groupLabel" | "grouplabel" | "radio" | "checkbox";
|
|
192
|
+
/** Checkbox roles are selected by kind/type or by the presence of checked. */
|
|
193
|
+
role?: "menuitemradio";
|
|
194
|
+
icon?: string;
|
|
195
|
+
badge?: string | number;
|
|
196
|
+
shortcut?: string;
|
|
197
|
+
checked?: boolean;
|
|
198
|
+
disabled?: boolean;
|
|
199
|
+
danger?: boolean;
|
|
200
|
+
group?: string;
|
|
201
|
+
items?: readonly UiMenuItem[];
|
|
202
|
+
}
|
|
203
|
+
export interface UiMenuSelectDetail {
|
|
204
|
+
id: string;
|
|
205
|
+
item: UiMenuItem;
|
|
206
|
+
checked?: boolean;
|
|
207
|
+
element: HTMLElement;
|
|
208
|
+
originalEvent: Event;
|
|
209
|
+
}
|
|
210
|
+
/** Binds behavior to a menu already rendered in markup; contextMenu supplies its own item DOM. */
|
|
211
|
+
export interface UiMenuOptions {
|
|
212
|
+
trigger?: HTMLElement;
|
|
213
|
+
host?: HTMLElement;
|
|
214
|
+
label?: string;
|
|
215
|
+
placement?: UiPlacement;
|
|
216
|
+
bindTrigger?: boolean;
|
|
217
|
+
renderIcon?: (icon: string, item: UiMenuItem) => Node | string | null | void;
|
|
218
|
+
onSelect?: (item: UiMenuItem, event: Event, element: HTMLElement, detail: UiMenuSelectDetail) => void;
|
|
219
|
+
}
|
|
220
|
+
export interface UiMenuOpenOptions extends UiOverlayOpenOptions {
|
|
221
|
+
focus?: "first" | "last" | "none";
|
|
222
|
+
}
|
|
223
|
+
export interface UiMenuController extends UiOverlayController {
|
|
224
|
+
open(options?: UiMenuOpenOptions): UiResult<boolean>;
|
|
225
|
+
refresh(): UiResult<void>;
|
|
226
|
+
}
|
|
227
|
+
export interface UiContextMenuOptions extends UiMenuOptions {
|
|
228
|
+
variant?: string;
|
|
229
|
+
}
|
|
230
|
+
/** Disposes the binding and any active context menu. ready settles after the lazy binding is installed. */
|
|
231
|
+
export interface UiContextMenuDisposer {
|
|
232
|
+
(): void;
|
|
233
|
+
readonly ready: Promise<void>;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/** Mounts declarative UI under root (including root). Report/static steppers need no controller and are skipped. */
|
|
237
|
+
export function mountUi(root?: ParentNode): UiController[];
|
|
238
|
+
/** Delegates a selector, or binds one element. Inputs, links, selected text and Shift+right-click keep their native menu. */
|
|
239
|
+
export function contextMenu(target: UiTarget,
|
|
240
|
+
items: readonly UiMenuItem[] | ((event: MouseEvent | KeyboardEvent | PointerEvent, element: HTMLElement) => readonly UiMenuItem[] | null | undefined),
|
|
241
|
+
options?: UiContextMenuOptions): UiContextMenuDisposer;
|
|
242
|
+
export function tabs(target: UiTarget, options?: UiTabsOptions): UiTabsController;
|
|
243
|
+
export function stepper(target: UiTarget, options?: UiStepperOptions): UiStepperController;
|
|
244
|
+
export function dialog(target: UiTarget, options?: UiDialogOptions): UiDialogController;
|
|
245
|
+
export function drawer(target: UiTarget, options?: UiDrawerOptions): UiDialogController;
|
|
246
|
+
export function popover(target: UiTarget, options?: UiOverlayOptions): UiOverlayController;
|
|
247
|
+
export function tooltip(target: UiTarget, options?: UiOverlayOptions): UiOverlayController;
|
|
248
|
+
export function menu(target: UiTarget, options?: UiMenuOptions): UiMenuController;
|
|
249
|
+
|
|
250
|
+
/** Named UI exports shared by tree and grid/reporting entry points. */
|
|
251
|
+
export interface UiApi {
|
|
252
|
+
mountUi: typeof mountUi;
|
|
253
|
+
contextMenu: typeof contextMenu;
|
|
254
|
+
tabs: typeof tabs;
|
|
255
|
+
stepper: typeof stepper;
|
|
256
|
+
dialog: typeof dialog;
|
|
257
|
+
drawer: typeof drawer;
|
|
258
|
+
popover: typeof popover;
|
|
259
|
+
tooltip: typeof tooltip;
|
|
260
|
+
menu: typeof menu;
|
|
261
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { AcceptedGridQuery, GridFilter, GridFilterGroup, GridGroupLevel, GridSort, GridTupleFilter } from "./grid.js";
|
|
2
|
+
import type { GridPivotDefinition } from "./pivot.js";
|
|
3
|
+
|
|
4
|
+
/** A data-only view proposal. Missing fields preserve the current view; empty arrays clear the corresponding setting. */
|
|
5
|
+
export interface GridViewIntent {
|
|
6
|
+
readonly protocol: "canopyx/2";
|
|
7
|
+
readonly type: "viewIntent";
|
|
8
|
+
readonly version: 1;
|
|
9
|
+
readonly view: string;
|
|
10
|
+
readonly query?: {
|
|
11
|
+
readonly search?: string;
|
|
12
|
+
/** Regex requires the target grid to enable allowRegexSearch and uses its bounded pattern grammar. */
|
|
13
|
+
readonly searchMode?: "substring" | "words" | "regex";
|
|
14
|
+
readonly sort?: readonly GridSort[];
|
|
15
|
+
readonly filters?: readonly GridFilter[];
|
|
16
|
+
readonly filterGroup?: GridFilterGroup | null;
|
|
17
|
+
/** Exact correlated predicates used by pivot drill-through; [] clears them. */
|
|
18
|
+
readonly tupleFilters?: readonly GridTupleFilter[];
|
|
19
|
+
readonly groupBy?: readonly GridGroupLevel[];
|
|
20
|
+
};
|
|
21
|
+
/** Visible column identities in display order. Hidden columns remain available to queries and host policy. */
|
|
22
|
+
readonly columns?: readonly string[];
|
|
23
|
+
/** A pivot definition activates/replaces the axes and values; false returns to records. Omission preserves the mode. */
|
|
24
|
+
readonly pivot?: GridPivotDefinition | false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** A one-use proposal preview, tied to the grid's accepted state. It never grants data or write authorization. */
|
|
28
|
+
export interface GridViewIntentPreview<Q extends AcceptedGridQuery = AcceptedGridQuery> {
|
|
29
|
+
readonly element: HTMLElement;
|
|
30
|
+
readonly intent: GridViewIntent;
|
|
31
|
+
/** Apply the captured proposal. Rejects if the grid changed, was destroyed, or this handle was already consumed. */
|
|
32
|
+
apply(): Promise<Q>;
|
|
33
|
+
cancel(): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface GridViewIntentApi<Q extends AcceptedGridQuery = AcceptedGridQuery> {
|
|
37
|
+
/** Export the accepted query and visible columns as a versioned proposal. Loads the optional part. */
|
|
38
|
+
getViewIntent(): Promise<GridViewIntent>;
|
|
39
|
+
/** Validate against actual column identities, types and capabilities; never changes the view. */
|
|
40
|
+
validateViewIntent(input: unknown): Promise<GridViewIntent>;
|
|
41
|
+
/** Render preview chips without applying the proposal. */
|
|
42
|
+
previewViewIntent(input: GridViewIntent, container?: HTMLElement): Promise<GridViewIntentPreview<Q>>;
|
|
43
|
+
/** Validate and render preview chips. The reader's Apply action or returned handle applies the proposal. */
|
|
44
|
+
applyViewIntent(input: GridViewIntent): Promise<GridViewIntentPreview<Q>>;
|
|
45
|
+
}
|