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