@duyluonganduin/acl-web-components 0.0.45 → 0.0.49

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/dist/react.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { LitElement } from 'lit';
3
3
  import { nothing } from 'lit';
4
+ import { PropertyValues } from 'lit';
4
5
  import { ReactWebComponent } from '@lit/react';
5
6
  import { TemplateResult } from 'lit-html';
6
7
 
@@ -57,6 +58,76 @@ declare class AnduinButton extends LitElement {
57
58
  render(): TemplateResult<1>;
58
59
  }
59
60
 
61
+ /**
62
+ * A single-month calendar grid with month/year pickers and full keyboard
63
+ * navigation.
64
+ *
65
+ * Used on its own for day selection, and composed by `anduin-date-range` — the
66
+ * range picker drives `range-start` / `range-end` to paint the range across two
67
+ * calendars.
68
+ *
69
+ * All date attributes take an ISO date string (`YYYY-MM-DD`). `value` doubles as
70
+ * the selected day and the month the calendar opens on.
71
+ *
72
+ * @example
73
+ * <anduin-calendar value="2026-07-15" min-date="2026-01-01"></anduin-calendar>
74
+ */
75
+ declare class AnduinCalendar extends LitElement {
76
+ static styles: CSSResult;
77
+ /** Selected day, ISO `YYYY-MM-DD`. Also the month the calendar opens on. */
78
+ value: string;
79
+ /** Earliest selectable day, ISO `YYYY-MM-DD`. */
80
+ minDate: string;
81
+ /** Latest selectable day, ISO `YYYY-MM-DD`. */
82
+ maxDate: string;
83
+ /** First day of a painted range, ISO `YYYY-MM-DD`. Set by `anduin-date-range`. */
84
+ rangeStart: string;
85
+ /** Last day of a painted range, ISO `YYYY-MM-DD`. Set by `anduin-date-range`. */
86
+ rangeEnd: string;
87
+ /**
88
+ * Suppress the single-day selected marker so only the range markers express
89
+ * selection. Set by `anduin-date-range` on its panels, where `value` is just
90
+ * the month anchor and highlighting it would read as a stray selected day.
91
+ */
92
+ rangeMode: boolean;
93
+ /** Displayed month, 0-based. Tracks `value` until the user navigates. */
94
+ private _viewMonth;
95
+ private _viewYear;
96
+ /** Roving-tabindex target for keyboard navigation, ISO `YYYY-MM-DD`. */
97
+ private _focus;
98
+ private _openSelect;
99
+ /** Set once `value` has seeded the view, so later edits don't yank the month
100
+ * back while the user is browsing. */
101
+ private _viewSeeded;
102
+ /** Set when a keyboard action moved focus, so we refocus after re-render. */
103
+ private _pendingFocus;
104
+ connectedCallback(): void;
105
+ disconnectedCallback(): void;
106
+ willUpdate(changed: Map<PropertyKey, unknown>): void;
107
+ updated(): void;
108
+ private _onOutsideClick;
109
+ private get _min();
110
+ private get _max();
111
+ private _isDisabled;
112
+ /** Clamp into [min, max] so keyboard navigation can't escape the range. */
113
+ private _clamp;
114
+ private _shiftMonth;
115
+ /** Move the roving focus, pulling the displayed month along with it. */
116
+ private _moveFocus;
117
+ private _onGridKeyDown;
118
+ private _pick;
119
+ private _emitHover;
120
+ /** The day that owns `tabindex="0"` when nothing has been focused yet. */
121
+ private _defaultFocusDate;
122
+ /** Years offered in the year picker — bounded by min/max when set, otherwise
123
+ * a ±10-year window around the displayed year. */
124
+ private get _yearOptions();
125
+ private _selectMonth;
126
+ private _selectYear;
127
+ private _renderSelect;
128
+ render(): TemplateResult<1>;
129
+ }
130
+
60
131
  declare class AnduinCallout extends LitElement {
61
132
  static styles: CSSResult;
62
133
  variant: string;
@@ -76,6 +147,238 @@ declare class AnduinCheckbox extends LitElement {
76
147
  render(): TemplateResult<1>;
77
148
  }
78
149
 
150
+ /**
151
+ * A formatted date input. Displays a pattern such as `MM/dd/yyyy` and lets users
152
+ * type digits into each segment; clicking a segment highlights it, and focus
153
+ * auto-advances once a segment is filled.
154
+ *
155
+ * Typing is committed per segment: when no valid completion remains (typing `5`
156
+ * into a month, since `50`–`59` all exceed `12`) the digit is zero-padded and
157
+ * focus moves on. Arrow keys step a segment's value, wrapping at its bounds.
158
+ *
159
+ * `anduin-date-input:change` fires once every segment is filled; `event.detail`
160
+ * is the formatted string.
161
+ *
162
+ * @example
163
+ * <anduin-date-input format="MM/dd/yyyy" value="03/15/2026"></anduin-date-input>
164
+ */
165
+ declare class AnduinDateInput extends LitElement {
166
+ static shadowRootOptions: ShadowRootInit;
167
+ static styles: CSSResult;
168
+ /** Pattern to display and type into, e.g. `MM/dd/yyyy`, `yyyy-MM-dd`, `dd.MM.yyyy`. */
169
+ format: string;
170
+ /** Current value, formatted to match `format`. Empty until every segment is filled. */
171
+ value: string;
172
+ size: DateInputSize;
173
+ disabled: boolean;
174
+ readonly: boolean;
175
+ /** `valid` | `invalid` | `warning` | `loading`. */
176
+ status: string;
177
+ startIcon: string;
178
+ /** Earliest allowed date, ISO `YYYY-MM-DD`. Completed dates below it are clamped up. */
179
+ minDate: string;
180
+ /** Latest allowed date, ISO `YYYY-MM-DD`. Completed dates above it are clamped down. */
181
+ maxDate: string;
182
+ /** Matches `anduin-field-label`'s `for` so clicking the label focuses this input. */
183
+ inputid: string;
184
+ /** Committed digits per segment, index-aligned with `_segments`. */
185
+ private _digits;
186
+ /** Index of the segment being typed into. */
187
+ private _active;
188
+ /** Digits typed into the active segment but not yet committed. */
189
+ private _buffer;
190
+ private _inputEl;
191
+ /** Selection we want after the next render, so re-renders don't drop the highlight. */
192
+ private _pendingSelection;
193
+ private _tokens;
194
+ private _segments;
195
+ connectedCallback(): void;
196
+ disconnectedCallback(): void;
197
+ private _onFieldLabelClick;
198
+ willUpdate(changed: Map<PropertyKey, unknown>): void;
199
+ updated(): void;
200
+ /** Parse an incoming formatted string by reading each segment's slice. */
201
+ private _adoptValue;
202
+ /** The rendered string: committed digits, the in-progress buffer, or placeholders. */
203
+ private _display;
204
+ /** The formatted value, or `''` while any segment is still empty. */
205
+ private _composeValue;
206
+ private _setDigits;
207
+ private _indexOfType;
208
+ /**
209
+ * Clamp a completed date into [minDate, maxDate]. Only applies when the format
210
+ * carries a full date — a partial format like `MM/dd` has no year to compare.
211
+ */
212
+ private _clampToBounds;
213
+ private _focusSegment;
214
+ /** Which segment contains (or is nearest to) a caret offset. */
215
+ private _segmentAt;
216
+ /**
217
+ * Snap the caret to whole-segment selection. Handled synchronously: by `mouseup`
218
+ * the browser has already placed the caret, and deferring (rAF/timeout) would
219
+ * leave a bare caret visible for a frame — or never run at all in a background
220
+ * tab, where rAF is throttled.
221
+ */
222
+ private _onSelectionIntent;
223
+ /** Write digits into a segment, clamped to its valid range and zero-padded. */
224
+ private _writeSegment;
225
+ /** Commit any half-typed digits so they aren't stranded on blur or navigation. */
226
+ private _flushBuffer;
227
+ private _commitBuffer;
228
+ private _typeDigit;
229
+ private _step;
230
+ private _clearSegment;
231
+ private _onKeyDown;
232
+ render(): TemplateResult<1>;
233
+ }
234
+
235
+ /**
236
+ * A formatted date input paired with a calendar popover.
237
+ *
238
+ * Clicking the input opens the calendar; typing a date into the input moves the
239
+ * calendar to match; picking a day closes the popover and fills the input.
240
+ * `disabled` and `readonly` both prevent the popover from opening.
241
+ *
242
+ * Slot content into `actions` to add buttons below the calendar — the consumer
243
+ * owns that container's layout entirely.
244
+ *
245
+ * @example
246
+ * <anduin-date-picker format="MM/dd/yyyy" value="03/15/2026"></anduin-date-picker>
247
+ */
248
+ declare class AnduinDatePicker extends LitElement {
249
+ static styles: CSSResult;
250
+ /** Pattern for the input, e.g. `MM/dd/yyyy`. `value` must match it. */
251
+ format: string;
252
+ /** Current value, formatted to match `format`. */
253
+ value: string;
254
+ size: DateInputSize;
255
+ disabled: boolean;
256
+ readonly: boolean;
257
+ /** `valid` | `invalid` | `warning` | `loading`. */
258
+ status: string;
259
+ startIcon: string;
260
+ /** Earliest selectable date, ISO `YYYY-MM-DD`. */
261
+ minDate: string;
262
+ /** Latest selectable date, ISO `YYYY-MM-DD`. */
263
+ maxDate: string;
264
+ /** Where the calendar opens relative to the input. */
265
+ placement: DatePickerPlacement;
266
+ /** Matches `anduin-field-label`'s `for` so clicking the label focuses the input. */
267
+ inputid: string;
268
+ /** Mirrors the popover's own state — the popover owns opening and closing. */
269
+ private _open;
270
+ private _inputEl;
271
+ private _popoverEl;
272
+ connectedCallback(): void;
273
+ disconnectedCallback(): void;
274
+ private _onPopoverOpenChange;
275
+ private _closePopover;
276
+ /** The current value as a `Date`, or `null` while it is incomplete. */
277
+ private get _date();
278
+ /** ISO form of the value, for driving the calendar. */
279
+ private get _isoValue();
280
+ private _emit;
281
+ /** Typing a complete date in the input moves the calendar to match. */
282
+ private _onInputChange;
283
+ /** Picking a day fills the input and dismisses the popover. */
284
+ private _onCalendarChange;
285
+ private _onKeyDown;
286
+ /**
287
+ * Swallow the trigger click when the field is locked, so it never reaches the
288
+ * popover's own toggle handler.
289
+ */
290
+ private _onTriggerClick;
291
+ render(): TemplateResult<1>;
292
+ }
293
+
294
+ /**
295
+ * Two side-by-side calendars for picking a date range.
296
+ *
297
+ * Selection is a two-click flow: the first click sets the start and clears any
298
+ * previous end, the second sets the end (swapping if it falls before the start).
299
+ * A third click begins a new selection. `anduin-date-range:change` fires only
300
+ * once a range is complete, and `start-date` / `end-date` reflect the last
301
+ * complete range.
302
+ *
303
+ * Use `anduin-date-range-default` for the standard side-by-side layout, or place
304
+ * `anduin-date-range-start` and `anduin-date-range-end` yourself for full
305
+ * control over what sits between them.
306
+ *
307
+ * @example
308
+ * <anduin-date-range start-date="2026-07-10" end-date="2026-07-20">
309
+ * <anduin-date-range-default></anduin-date-range-default>
310
+ * </anduin-date-range>
311
+ */
312
+ declare class AnduinDateRange extends LitElement {
313
+ static styles: CSSResult;
314
+ /** First day of the selected range, ISO `YYYY-MM-DD`. */
315
+ startDate: string;
316
+ /** Last day of the selected range, ISO `YYYY-MM-DD`. */
317
+ endDate: string;
318
+ /** Earliest selectable day, ISO `YYYY-MM-DD`. Forwarded to both calendars. */
319
+ minDate: string;
320
+ /** Latest selectable day, ISO `YYYY-MM-DD`. Forwarded to both calendars. */
321
+ maxDate: string;
322
+ /** First click of an in-progress selection, ISO `YYYY-MM-DD`. */
323
+ private _anchor;
324
+ /** Hovered day while a selection is in progress, for the range preview. */
325
+ private _hover;
326
+ private _panels;
327
+ /** Last `value` we pushed per panel. Mirrors Lit's "only write on change" so a
328
+ * calendar the user has navigated isn't yanked back to our derived month. */
329
+ private _pushedValue;
330
+ connectedCallback(): void;
331
+ disconnectedCallback(): void;
332
+ updated(): void;
333
+ /** Called by each panel once it has rendered its calendar. */
334
+ registerPanel(role: DateRangePanelRole, panel: AnduinDateRangePanel): void;
335
+ unregisterPanel(panel: AnduinDateRangePanel): void;
336
+ /** Push the derived range state down onto each registered panel's calendar. */
337
+ private _sync;
338
+ /** Which month each panel opens on: the start date on the left, the month
339
+ * after it on the right. Falls back to today when there's no range yet. */
340
+ private _panelValue;
341
+ /** The range the calendars should paint — the live preview while selecting,
342
+ * otherwise the committed range. */
343
+ private _displayedRange;
344
+ private _sorted;
345
+ private _onCalendarChange;
346
+ private _onCalendarHover;
347
+ render(): TemplateResult<1>;
348
+ }
349
+
350
+ /** The standard side-by-side layout: start calendar, 16px gap, end calendar. */
351
+ declare class AnduinDateRangeDefault extends LitElement {
352
+ static styles: CSSResult;
353
+ render(): TemplateResult<1>;
354
+ }
355
+
356
+ /** The right-hand calendar of a date range. */
357
+ declare class AnduinDateRangeEnd extends AnduinDateRangePanel {
358
+ protected readonly panelRole: "end";
359
+ }
360
+
361
+ /**
362
+ * Base class for the two calendar panels. Renders one `anduin-calendar` and
363
+ * registers with the enclosing `anduin-date-range`, which then drives it.
364
+ */
365
+ declare abstract class AnduinDateRangePanel extends LitElement {
366
+ static styles: CSSResult;
367
+ protected abstract readonly panelRole: DateRangePanelRole;
368
+ private _host;
369
+ /** The calendar this panel owns. Read by `anduin-date-range`. */
370
+ get calendar(): AnduinCalendar | null;
371
+ firstUpdated(): void;
372
+ disconnectedCallback(): void;
373
+ private _findRangeHost;
374
+ render(): TemplateResult<1>;
375
+ }
376
+
377
+ /** The left-hand calendar of a date range. */
378
+ declare class AnduinDateRangeStart extends AnduinDateRangePanel {
379
+ protected readonly panelRole: "start";
380
+ }
381
+
79
382
  declare class AnduinDivider extends LitElement {
80
383
  static styles: CSSResult;
81
384
  direction: string;
@@ -720,6 +1023,229 @@ declare class AnduinTabContent extends LitElement {
720
1023
  render(): TemplateResult<1>;
721
1024
  }
722
1025
 
1026
+ /**
1027
+ * anduin-table — displays tabular data with sorting, frozen columns, row
1028
+ * selection, tree data, grouping, and virtual scrolling.
1029
+ *
1030
+ * Columns and data are set as JS properties rather than attributes, because
1031
+ * both are structured values:
1032
+ *
1033
+ * @example
1034
+ * const table = document.querySelector('anduin-table')
1035
+ * table.columns = [
1036
+ * { type: 'selection' },
1037
+ * { field: 'fullName', title: 'Full name', isSortable: true, isFrozen: true },
1038
+ * { field: 'email', title: 'Email address', width: 220 },
1039
+ * { field: 'address.city', title: 'City' },
1040
+ * ]
1041
+ * table.data = employees
1042
+ *
1043
+ * Layout, height, loading, and selection behaviour are plain attributes:
1044
+ *
1045
+ * @example
1046
+ * <anduin-table layout="fit-columns" max-height="480px" selectable="selectable">
1047
+ * <div slot="empty">No employees found</div>
1048
+ * </anduin-table>
1049
+ */
1050
+ declare class AnduinTable extends LitElement {
1051
+ static styles: CSSResult;
1052
+ /** The columns to render, in display order. Set as a property, not an attribute. */
1053
+ columns: TableAnyColumn<any>[];
1054
+ /** The rows to render. Set as a property, not an attribute. */
1055
+ data: any[];
1056
+ /** How column widths are resolved. */
1057
+ layout: TableLayout;
1058
+ /** `virtual` only paints rows inside the viewport, and needs a bounded height. */
1059
+ renderMode: TableRenderMode;
1060
+ /** Row height in pixels. Virtual mode requires every row to be this tall. */
1061
+ rowHeight: number;
1062
+ /** CSS height for the table, e.g. `80vh`. */
1063
+ height: string;
1064
+ /** CSS max-height for the table, e.g. `600px`. */
1065
+ maxHeight: string;
1066
+ /** CSS min-height for the table. */
1067
+ minHeight: string;
1068
+ /**
1069
+ * Let users drag a column's right edge to resize it, and double-click that
1070
+ * edge to put the column back on automatic width. On by default, matching the
1071
+ * reference table. Turn it off table-wide with `resizable-columns="false"`, or
1072
+ * per column with `isResizable: false`.
1073
+ */
1074
+ resizableColumns: boolean;
1075
+ /** Present the table as a plain list, with no column headings. */
1076
+ hideHeader: boolean;
1077
+ /** Cover the table with a loading indicator. Slot `loading` to replace it. */
1078
+ loading: boolean;
1079
+ /** How rows respond to being clicked. */
1080
+ selectable: TableSelectableMode;
1081
+ /** The field holding each row's unique id. Falls back to the row's position. */
1082
+ indexColumn: string;
1083
+ /** Table-wide horizontal alignment. A column's own `align` wins. */
1084
+ columnAlign: TableAlign;
1085
+ /** Table-wide vertical alignment. A column's own `verticalAlign` wins. */
1086
+ columnVerticalAlign: TableVerticalAlign;
1087
+ /** The field currently sorted by. Set it to sort the table initially. */
1088
+ sortField: string;
1089
+ /** Direction of the current sort. */
1090
+ sortDirection: TableSortDirection;
1091
+ /** Treat `data` as a tree, reading each row's children from `tree-children-field`. */
1092
+ dataTree: boolean;
1093
+ /** The field holding a row's child rows in tree mode. */
1094
+ treeChildrenField: string;
1095
+ /** Pixels of indentation per tree level. */
1096
+ treeChildIndent: number;
1097
+ /** Group rows by this field. Rows sharing a value are collected under a heading. */
1098
+ groupBy: string;
1099
+ /** The currently selected rows. Assign to control the selection from outside. */
1100
+ selectedRows: any[];
1101
+ /** Decides whether a row's checkbox is disabled. */
1102
+ isRowDisabled?: (data: any) => boolean;
1103
+ /** Decides whether a tree row starts out expanded. */
1104
+ onStartExpanded?: (data: any) => boolean;
1105
+ /**
1106
+ * Extra tokens for a row, for highlighting rows by their data. They are added
1107
+ * both as classes and as `part` names, so a consumer can reach them from
1108
+ * outside the shadow root — including for hover and other states:
1109
+ *
1110
+ * anduin-table::part(overdue) { background: var(--color-danger-1); }
1111
+ * anduin-table::part(overdue):hover { background: var(--color-danger-2); }
1112
+ */
1113
+ rowClass?: (data: any, index: number) => string;
1114
+ /** Renders a group heading. Defaults to `value (count)`. */
1115
+ renderGroupHeader?: (value: unknown, count: number, rows: any[]) => unknown;
1116
+ /** Keys of the tree rows the user has expanded. */
1117
+ private expandedKeys;
1118
+ /** Keys of the groups the user has collapsed. Groups start expanded. */
1119
+ private collapsedGroups;
1120
+ /** Scroll offset driving the virtual window. Named to avoid HTMLElement.scrollTop. */
1121
+ private virtualScrollTop;
1122
+ /** Height of the virtual viewport, tracked so the window stays filled. */
1123
+ private viewportHeight;
1124
+ /** Whether the table is scrolled away from its left edge. */
1125
+ private scrolledX;
1126
+ /** Whether there is still content to the right of the viewport. */
1127
+ private scrollableXEnd;
1128
+ /** Widths the user has dragged columns to, keyed by column. */
1129
+ private resizedWidths;
1130
+ /** The column currently being dragged, for the handle's active styling. */
1131
+ private resizingKey;
1132
+ /** Anchor row for shift-click and shift-drag range selection. */
1133
+ private rangeAnchorKey;
1134
+ /** True while a shift-drag range selection is in progress. */
1135
+ private isDraggingRange;
1136
+ /** Rows selected when the current drag began, so the drag can be re-applied. */
1137
+ private dragBaseKeys;
1138
+ /** Whether the current drag is adding to or removing from the selection. */
1139
+ private dragSelects;
1140
+ private resizeObserver?;
1141
+ /** Rows expanded automatically, so `onStartExpanded` only applies once per key. */
1142
+ private autoExpandedKeys;
1143
+ /** In-flight column drag: where it started and how wide the column was then. */
1144
+ private resizeDrag;
1145
+ /** rAF handle, so a drag repaints once per frame instead of once per pointer event. */
1146
+ private resizeFrame;
1147
+ /**
1148
+ * Selection keys for the current render pass. Recomputing the set per cell
1149
+ * would make rendering quadratic in the row count, which virtual mode exists
1150
+ * to avoid. Refreshed in `willUpdate`.
1151
+ */
1152
+ private renderSelectedKeys;
1153
+ /** Selectable rows for the current render pass, for the header's checkbox. */
1154
+ private renderSelectableRows;
1155
+ /** The sorted, flattened, grouped row list. Rebuilt only when its inputs change. */
1156
+ private cachedRenderRows;
1157
+ private rowsDirty;
1158
+ connectedCallback(): void;
1159
+ disconnectedCallback(): void;
1160
+ firstUpdated(): void;
1161
+ /**
1162
+ * Scrolling a virtual table re-renders on every frame, but only the visible
1163
+ * window changes — the row list itself does not. Rebuild it only when one of
1164
+ * its actual inputs changes, so scrolling stays cheap at 10k+ rows.
1165
+ */
1166
+ willUpdate(changed: PropertyValues): void;
1167
+ updated(changed: PropertyValues): void;
1168
+ private get scrollEl();
1169
+ /** A stable identity for a row, used for selection and expansion state. */
1170
+ private keyFor;
1171
+ private get selectedKeySet();
1172
+ private rowIsDisabled;
1173
+ /**
1174
+ * Frozen columns stick to whichever edge they are nearest: a leading run of
1175
+ * frozen columns pins left, a trailing run pins right. An explicit
1176
+ * `isFrozen: 'left' | 'right'` overrides that.
1177
+ */
1178
+ private get frozenSides();
1179
+ /** Measures header widths and pins each frozen column at the right offset. */
1180
+ private applyFrozenOffsets;
1181
+ private get sortedColumn();
1182
+ private sortRows;
1183
+ private onHeaderClick;
1184
+ /** Sorts, flattens the tree, and inserts group headings. */
1185
+ private buildRenderRows;
1186
+ private buildFlatRows;
1187
+ private buildGroupedRows;
1188
+ private isExpanded;
1189
+ private toggleTreeRow;
1190
+ private toggleGroup;
1191
+ /** Expands every tree row that has children. */
1192
+ expandAll(): void;
1193
+ /** Collapses every tree row. */
1194
+ collapseAll(): void;
1195
+ /** Every selectable row currently on screen, in visual order. */
1196
+ private get selectableRows();
1197
+ private commitSelection;
1198
+ private setRowSelected;
1199
+ private toggleAllRows;
1200
+ /** Selects (or clears) every row between the anchor and `row`, inclusive. */
1201
+ private selectRange;
1202
+ private onRowMouseDown;
1203
+ private onRowMouseEnter;
1204
+ private onWindowMouseUp;
1205
+ private onRowClick;
1206
+ private onCellContextMenu;
1207
+ private onScroll;
1208
+ private syncHorizontalScrollState;
1209
+ /**
1210
+ * Sizing for one column's header and body cells.
1211
+ *
1212
+ * `fit-data-stretch` hands all the slack to the final column, so that one is
1213
+ * given `width: 100%` instead of its own width. Everywhere else an explicit
1214
+ * `width` is pinned with a matching max-width: under `table-layout: auto` a
1215
+ * bare `width` is only a suggestion, and long content would blow past it.
1216
+ */
1217
+ /** A stable identity for a column, used to remember a dragged width. */
1218
+ private columnKey;
1219
+ /** The width to lay a column out at: a dragged width beats the configured one. */
1220
+ private widthFor;
1221
+ /**
1222
+ * True for the final column under fit-data-stretch, which absorbs the slack.
1223
+ * Dragging that column opts it out — the user asked for a specific width, and
1224
+ * stretching would immediately overrule them.
1225
+ */
1226
+ private isStretchColumn;
1227
+ /** Marks how a column is sized, so the layout CSS can treat the cases apart. */
1228
+ private sizingClass;
1229
+ private cellStyle;
1230
+ private isColumnResizable;
1231
+ private onResizeStart;
1232
+ private onResizeMove;
1233
+ private onResizeEnd;
1234
+ /** Double-clicking the handle puts the column back on automatic width. */
1235
+ private onResizeReset;
1236
+ /** Clears every dragged width, putting all columns back on automatic sizing. */
1237
+ resetColumnWidths(): void;
1238
+ private alignClass;
1239
+ private renderHeaderCell;
1240
+ private renderCell;
1241
+ private get firstDataColumnIndex();
1242
+ private renderRow;
1243
+ private renderGroupRow;
1244
+ private get columnCount();
1245
+ private renderPlaceholder;
1246
+ render(): TemplateResult<1>;
1247
+ }
1248
+
723
1249
  declare class AnduinTabs extends LitElement {
724
1250
  static styles: CSSResult;
725
1251
  defaultValue: string;
@@ -988,6 +1514,13 @@ declare type ButtonSize = 'tiny' | 'extraSmall' | 'small' | 'medium' | 'large' |
988
1514
 
989
1515
  declare type ButtonVariant = 'gray0' | 'gray9' | 'primary' | 'danger' | 'success' | 'warning' | 'purple';
990
1516
 
1517
+ export declare const Calendar: ReactWebComponent<AnduinCalendar, {
1518
+ onValueChange: string;
1519
+ }>;
1520
+
1521
+ /** Fired when a day is picked. `event.detail` is the ISO date string (`YYYY-MM-DD`). */
1522
+ export declare const CALENDAR_CHANGE = "anduin-calendar:change";
1523
+
991
1524
  export declare const Callout: ReactWebComponent<AnduinCallout, {}>;
992
1525
 
993
1526
  export declare const Checkbox: ReactWebComponent<AnduinCheckbox, {
@@ -996,6 +1529,42 @@ onChange: string;
996
1529
 
997
1530
  export declare const CHECKBOX_CHANGE = "anduin-checkbox:change";
998
1531
 
1532
+ /** Fired when every segment is filled. `event.detail` is the formatted date string. */
1533
+ export declare const DATE_INPUT_CHANGE = "anduin-date-input:change";
1534
+
1535
+ /** Fired when a date is completed by typing or picked from the calendar. `event.detail` is the formatted string. */
1536
+ export declare const DATE_PICKER_CHANGE = "anduin-date-picker:change";
1537
+
1538
+ /**
1539
+ * Fired when the user completes a range selection (both ends picked).
1540
+ * `event.detail` is `{ startDate, endDate }`, both ISO `YYYY-MM-DD`.
1541
+ */
1542
+ export declare const DATE_RANGE_CHANGE = "anduin-date-range:change";
1543
+
1544
+ export declare const DateInput: ReactWebComponent<AnduinDateInput, {
1545
+ onValueChange: string;
1546
+ }>;
1547
+
1548
+ declare type DateInputSize = 'small' | 'default' | 'large';
1549
+
1550
+ export declare const DatePicker: ReactWebComponent<AnduinDatePicker, {
1551
+ onValueChange: string;
1552
+ }>;
1553
+
1554
+ declare type DatePickerPlacement = 'bottom-start' | 'bottom-end' | 'bottom' | 'top-start' | 'top-end' | 'top';
1555
+
1556
+ export declare const DateRange: ReactWebComponent<AnduinDateRange, {
1557
+ onChange: string;
1558
+ }>;
1559
+
1560
+ export declare const DateRangeDefault: ReactWebComponent<AnduinDateRangeDefault, {}>;
1561
+
1562
+ export declare const DateRangeEnd: ReactWebComponent<AnduinDateRangeEnd, {}>;
1563
+
1564
+ declare type DateRangePanelRole = 'start' | 'end';
1565
+
1566
+ export declare const DateRangeStart: ReactWebComponent<AnduinDateRangeStart, {}>;
1567
+
999
1568
  export declare const Divider: ReactWebComponent<AnduinDivider, {}>;
1000
1569
 
1001
1570
  export declare const Dot: ReactWebComponent<AnduinDot, {}>;
@@ -1108,7 +1677,12 @@ export declare const PaginationFirstPage: ReactWebComponent<AnduinPaginationFirs
1108
1677
 
1109
1678
  export declare const PaginationLastPage: ReactWebComponent<AnduinPaginationLastPage, {}>;
1110
1679
 
1111
- export declare const Popover: ReactWebComponent<AnduinPopover, {}>;
1680
+ export declare const Popover: ReactWebComponent<AnduinPopover, {
1681
+ onOpenChange: string;
1682
+ }>;
1683
+
1684
+ /** Fired whenever `open` changes, including self-initiated toggles and outside clicks. `event.detail` is the new state. */
1685
+ export declare const POPOVER_OPEN_CHANGE = "anduin-popover:open-change";
1112
1686
 
1113
1687
  export declare const PopoverClose: ReactWebComponent<AnduinPopoverClose, {}>;
1114
1688
 
@@ -1211,6 +1785,229 @@ export declare const TAB_CHANGE = "anduin-tab:change";
1211
1785
 
1212
1786
  export declare const TabContent: ReactWebComponent<AnduinTabContent, {}>;
1213
1787
 
1788
+ export declare const Table: ReactWebComponent<AnduinTable, {
1789
+ onSort: string;
1790
+ onColumnClick: string;
1791
+ onRowClick: string;
1792
+ onSelectionChange: string;
1793
+ onCellContextMenu: string;
1794
+ onRowExpand: string;
1795
+ onRowCollapse: string;
1796
+ onGroupToggle: string;
1797
+ onColumnResize: string;
1798
+ }>;
1799
+
1800
+ /** Fired on right-click over a data cell, so consumers can open their own menu. */
1801
+ export declare const TABLE_CELL_CONTEXT_MENU = "anduin-table:cell-context-menu";
1802
+
1803
+ /** Fired when any column header is clicked, sortable or not. */
1804
+ export declare const TABLE_COLUMN_CLICK = "anduin-table:column-click";
1805
+
1806
+ /** Fired when a column is resized by dragging, or reset by double-click. */
1807
+ export declare const TABLE_COLUMN_RESIZE = "anduin-table:column-resize";
1808
+
1809
+ /** Fired when a group header is expanded or collapsed. */
1810
+ export declare const TABLE_GROUP_TOGGLE = "anduin-table:group-toggle";
1811
+
1812
+ /** Fired when a data row is clicked. */
1813
+ export declare const TABLE_ROW_CLICK = "anduin-table:row-click";
1814
+
1815
+ /** Fired when a tree row is collapsed. */
1816
+ export declare const TABLE_ROW_COLLAPSE = "anduin-table:row-collapse";
1817
+
1818
+ /** Fired when a tree row is expanded. */
1819
+ export declare const TABLE_ROW_EXPAND = "anduin-table:row-expand";
1820
+
1821
+ /** Fired whenever the set of selected rows changes. */
1822
+ export declare const TABLE_SELECTION_CHANGE = "anduin-table:selection-change";
1823
+
1824
+ /** Fired when a sortable column header is activated. */
1825
+ export declare const TABLE_SORT = "anduin-table:sort";
1826
+
1827
+ /** Horizontal alignment of a column's content. */
1828
+ export declare type TableAlign = 'left' | 'center' | 'right';
1829
+
1830
+ /** Any entry accepted by the `columns` property. */
1831
+ export declare type TableAnyColumn<T = unknown> = TableColumn<T> | TableSelectionColumn<T>;
1832
+
1833
+ /** `detail` of `anduin-table:cell-context-menu`. */
1834
+ export declare interface TableCellContextMenuDetail<T = unknown> {
1835
+ data: T;
1836
+ key: string;
1837
+ index: number;
1838
+ column: TableColumn<T>;
1839
+ /** Viewport coordinates of the click, for positioning a menu. */
1840
+ x: number;
1841
+ y: number;
1842
+ originalEvent: MouseEvent;
1843
+ }
1844
+
1845
+ /** What `renderCell` receives. */
1846
+ export declare interface TableCellRenderProps<T = unknown> {
1847
+ /** The row's underlying model. */
1848
+ data: T;
1849
+ /** The value at `column.field`, resolved through dot notation. */
1850
+ value: unknown;
1851
+ /** Index of the row in the sorted, flattened row list. */
1852
+ rowIndex: number;
1853
+ /** The column being rendered. */
1854
+ column: TableColumn<T>;
1855
+ }
1856
+
1857
+ /**
1858
+ * A column definition.
1859
+ *
1860
+ * `renderCell` / `renderHeader` may return anything Lit can render: a string, a
1861
+ * number, a DOM `Node`, or a Lit `TemplateResult`. Returning a `Node` is the
1862
+ * portable choice for consumers that are not using Lit themselves.
1863
+ */
1864
+ export declare interface TableColumn<T = unknown> {
1865
+ /** The model property this column shows. Supports dot notation (`address.city`). */
1866
+ field: string;
1867
+ /** The column heading. */
1868
+ title?: string;
1869
+ /** Column width in pixels. */
1870
+ width?: number;
1871
+ /** Lower bound for the column's width in pixels. */
1872
+ minWidth?: number;
1873
+ /** Show a sort control in the header and let users sort by this column. */
1874
+ isSortable?: boolean;
1875
+ /** Stick the column to the left or right edge while the table scrolls sideways. */
1876
+ isFrozen?: TableFrozen;
1877
+ /** Horizontal alignment for this column, overriding the table-wide default. */
1878
+ align?: TableAlign;
1879
+ /** Vertical alignment for this column, overriding the table-wide default. */
1880
+ verticalAlign?: TableVerticalAlign;
1881
+ /** Horizontal alignment for the header cell. Defaults to `align`. */
1882
+ headerAlign?: TableAlign;
1883
+ /** Hide the cell's content until its row is hovered, selected, or focused. */
1884
+ showOnRowHover?: boolean;
1885
+ /** Let users drag this column's edge to resize it. Defaults to the table's setting. */
1886
+ isResizable?: boolean;
1887
+ /** Renders the cell body. Defaults to the raw value at `field`. */
1888
+ renderCell?: (props: TableCellRenderProps<T>) => unknown;
1889
+ /** Renders the header body. Defaults to `title`. */
1890
+ renderHeader?: (props: TableHeaderRenderProps<T>) => unknown;
1891
+ /** Compares two rows. Return <0, 0, or >0. Defaults to comparing `field`. */
1892
+ sortWith?: (sorter: TableColumnSorter<T>) => number;
1893
+ }
1894
+
1895
+ /** `detail` of `anduin-table:column-resize`. */
1896
+ export declare interface TableColumnResizeDetail<T = unknown> {
1897
+ column: TableAnyColumn<T>;
1898
+ field: string;
1899
+ /** The column's new width in pixels, or null when it was reset to automatic. */
1900
+ width: number | null;
1901
+ }
1902
+
1903
+ /** What a column's `sortWith` receives. Either side may be missing. */
1904
+ export declare interface TableColumnSorter<T = unknown> {
1905
+ a: T | undefined;
1906
+ b: T | undefined;
1907
+ }
1908
+
1909
+ /** Which edge a frozen column sticks to. `true` picks the edge from its position. */
1910
+ export declare type TableFrozen = boolean | 'left' | 'right';
1911
+
1912
+ /** `detail` of `anduin-table:group-toggle`. */
1913
+ export declare interface TableGroupToggleDetail<T = unknown> {
1914
+ value: unknown;
1915
+ rows: T[];
1916
+ expanded: boolean;
1917
+ }
1918
+
1919
+ /** What `renderHeader` receives. */
1920
+ export declare interface TableHeaderRenderProps<T = unknown> {
1921
+ column: TableColumn<T>;
1922
+ /** The column's current sort direction, or null when it is not sorted. */
1923
+ sortDirection: TableSortDirection | null;
1924
+ }
1925
+
1926
+ /**
1927
+ * How column widths are resolved.
1928
+ * - `fit-data` size columns to their content (default)
1929
+ * - `fit-columns` size columns to divide up the table's width exactly
1930
+ * - `fit-data-fill` size to content, but rows always span the full width
1931
+ * - `fit-data-stretch` size to content, stretching the last column
1932
+ * - `fit-data-table` size to content, shrinking the table to their total
1933
+ */
1934
+ export declare type TableLayout = 'fit-data' | 'fit-columns' | 'fit-data-fill' | 'fit-data-stretch' | 'fit-data-table';
1935
+
1936
+ /** Render mode. `virtual` only paints the rows inside the viewport. */
1937
+ export declare type TableRenderMode = 'basic' | 'virtual';
1938
+
1939
+ /** `detail` of `anduin-table:row-click`. */
1940
+ export declare interface TableRowClickDetail<T = unknown> {
1941
+ data: T;
1942
+ key: string;
1943
+ index: number;
1944
+ originalEvent: MouseEvent;
1945
+ }
1946
+
1947
+ /** `detail` of `anduin-table:row-expand` and `anduin-table:row-collapse`. */
1948
+ export declare interface TableRowExpandDetail<T = unknown> {
1949
+ data: T;
1950
+ key: string;
1951
+ expanded: boolean;
1952
+ }
1953
+
1954
+ /**
1955
+ * How rows respond to being clicked.
1956
+ * - `unselectable` rows cannot be selected
1957
+ * - `clickable` rows report clicks but never select (default)
1958
+ * - `selectable` clicking a row toggles its selection
1959
+ * - `selectable-by-clicking` click, then shift-click, to select a range
1960
+ * - `selectable-by-dragging` shift and drag across rows to select a range
1961
+ */
1962
+ export declare type TableSelectableMode = 'unselectable' | 'clickable' | 'selectable' | 'selectable-by-clicking' | 'selectable-by-dragging';
1963
+
1964
+ /** What the selection column's `renderCell` receives. */
1965
+ export declare interface TableSelectionCellRenderProps<T = unknown> {
1966
+ data: T;
1967
+ isChecked: boolean;
1968
+ isDisabled: boolean;
1969
+ onChange: (checked: boolean) => void;
1970
+ }
1971
+
1972
+ /** `detail` of `anduin-table:selection-change`. */
1973
+ export declare interface TableSelectionChangeDetail<T = unknown> {
1974
+ selectedRows: T[];
1975
+ selectedKeys: string[];
1976
+ }
1977
+
1978
+ /**
1979
+ * A checkbox column. Put it in `columns` wherever the checkboxes should appear —
1980
+ * usually first. It carries the same layout options as a normal column.
1981
+ */
1982
+ export declare interface TableSelectionColumn<T = unknown> extends Omit<TableColumn<T>, 'field' | 'renderCell' | 'renderHeader' | 'sortWith' | 'isSortable'> {
1983
+ type: 'selection';
1984
+ field?: string;
1985
+ /** Replaces the row checkbox, e.g. with an anduin-switcher. */
1986
+ renderCell?: (props: TableSelectionCellRenderProps<T>) => unknown;
1987
+ /** Replaces the header checkbox, e.g. with a "Select all" button. */
1988
+ renderHeader?: (props: TableSelectionHeaderRenderProps) => unknown;
1989
+ }
1990
+
1991
+ /** What the selection column's `renderHeader` receives. */
1992
+ export declare interface TableSelectionHeaderRenderProps {
1993
+ areAllRowsSelected: boolean;
1994
+ hasSelectedRow: boolean;
1995
+ onChange: (checked: boolean) => void;
1996
+ }
1997
+
1998
+ /** `detail` of `anduin-table:sort`. */
1999
+ export declare interface TableSortDetail<T = unknown> {
2000
+ field: string;
2001
+ direction: TableSortDirection | null;
2002
+ column: TableColumn<T>;
2003
+ }
2004
+
2005
+ /** Sort direction of the currently sorted column. */
2006
+ export declare type TableSortDirection = 'asc' | 'desc';
2007
+
2008
+ /** Vertical alignment of a column's content within its row. */
2009
+ export declare type TableVerticalAlign = 'top' | 'middle' | 'bottom';
2010
+
1214
2011
  export declare const Tabs: ReactWebComponent<AnduinTabs, {
1215
2012
  onChange: string;
1216
2013
  }>;