@akcelik/strct 0.30.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akcelik/strct",
3
- "version": "0.30.0",
3
+ "version": "1.0.0",
4
4
  "description": "UIStruct — a standalone Angular component library with a tokenised, multi-palette theme system, built for datacenter / infrastructure management UIs.",
5
5
  "author": "Serkan Akcelik <serkan.akcelik@gmail.com>",
6
6
  "license": "MIT",
@@ -1798,6 +1798,8 @@ declare class StrctDatepicker implements ControlValueAccessor {
1798
1798
  /** Placeholder text when empty. */
1799
1799
  readonly placeholder: _angular_core.InputSignal<string>;
1800
1800
  protected readonly dow: string[];
1801
+ protected readonly dowFull: string[];
1802
+ protected readonly titleId: string;
1801
1803
  readonly value: _angular_core.WritableSignal<string>;
1802
1804
  readonly open: _angular_core.WritableSignal<boolean>;
1803
1805
  readonly isDisabled: _angular_core.WritableSignal<boolean>;
@@ -1808,12 +1810,21 @@ declare class StrctDatepicker implements ControlValueAccessor {
1808
1810
  protected readonly monthLabel: _angular_core.Signal<string>;
1809
1811
  protected readonly displayLabel: _angular_core.Signal<string>;
1810
1812
  protected readonly cells: _angular_core.Signal<DayCell[]>;
1813
+ /** The 42 cells chunked into ARIA grid rows (weeks). */
1814
+ protected readonly weeks: _angular_core.Signal<DayCell[][]>;
1815
+ /** Accessible name of one day cell: "Tuesday, March 4, 2026". */
1816
+ protected cellAria(cell: DayCell): string;
1811
1817
  private onChange;
1812
1818
  private onTouched;
1813
1819
  toggle(): void;
1814
1820
  shiftMonth(delta: number): void;
1815
1821
  pick(iso: string): void;
1822
+ constructor();
1816
1823
  onKeydown(event: KeyboardEvent): void;
1824
+ /** Day-of-week (0–6) of the keyboard cursor. */
1825
+ private focusedDow;
1826
+ /** Close the panel and hand focus back to the input. */
1827
+ private close;
1817
1828
  private syncFocus;
1818
1829
  private shiftFocus;
1819
1830
  protected onDocClick(event: MouseEvent): void;
@@ -2049,6 +2060,26 @@ interface StrctDatagridColumn {
2049
2060
  /** Allow the user to resize this column by dragging its right edge.
2050
2061
  * Defaults to the global {@link StrctDatagrid#resizable} setting. */
2051
2062
  resizable?: boolean;
2063
+ /**
2064
+ * Freeze this column against horizontal scroll. Mark **leading** columns
2065
+ * (utility columns freeze automatically alongside). Give every sticky column
2066
+ * except the last an explicit px `width` so offsets stay exact.
2067
+ */
2068
+ sticky?: boolean;
2069
+ }
2070
+ type SortDir = 'asc' | 'desc';
2071
+ /** What the grid wants loaded in server-side (`lazy`) mode. */
2072
+ interface StrctDatagridLazyState {
2073
+ /** 1-based page. */
2074
+ page: number;
2075
+ pageSize: number;
2076
+ sortKey: string | null;
2077
+ sortDir: SortDir;
2078
+ }
2079
+ /** Persistable user column preferences (widths from resize, hidden from the chooser). */
2080
+ interface StrctDatagridColumnState {
2081
+ widths?: Record<string, number>;
2082
+ hidden?: string[];
2052
2083
  }
2053
2084
  /**
2054
2085
  * Marks the expandable-row detail template. The row is the template's implicit
@@ -2141,6 +2172,34 @@ declare class StrctDatagrid {
2141
2172
  refresh: string;
2142
2173
  actions: string;
2143
2174
  }>;
2175
+ /**
2176
+ * Virtual scrolling for large data sets: only the rows inside the viewport
2177
+ * (plus a small overscan) are in the DOM — 20k+ rows stay smooth. The scroll
2178
+ * area gets `viewportHeight` and a sticky header. Assumes uniform
2179
+ * `rowHeight`; combine with `expandable` is unsupported.
2180
+ */
2181
+ readonly virtual: _angular_core.InputSignalWithTransform<boolean, unknown>;
2182
+ /** Scroll viewport height in px (virtual mode). */
2183
+ readonly viewportHeight: _angular_core.InputSignal<number>;
2184
+ /** Uniform row height in px (virtual mode; tune when `compact`). */
2185
+ readonly rowHeight: _angular_core.InputSignal<number>;
2186
+ /**
2187
+ * Server-side mode: the grid never sorts or slices `rows` itself — it shows
2188
+ * them as given and emits `(lazyLoad)` with `{ page, pageSize, sortKey,
2189
+ * sortDir }` whenever the user pages or sorts (and once on init). Provide
2190
+ * `total` so the pager and count reflect the full server-side set.
2191
+ */
2192
+ readonly lazy: _angular_core.InputSignalWithTransform<boolean, unknown>;
2193
+ /** Total row count on the server (lazy mode). */
2194
+ readonly total: _angular_core.InputSignal<number | null>;
2195
+ /**
2196
+ * Persist the user's column widths + hidden columns under this key in
2197
+ * localStorage (`strct-dg:<key>`), restoring them on init. For full control
2198
+ * use the two-way `columnState` instead (both may be combined).
2199
+ */
2200
+ readonly stateKey: _angular_core.InputSignal<string | null>;
2201
+ /** User column preferences (two-way): widths from resize, hidden from the chooser. */
2202
+ readonly columnState: _angular_core.ModelSignal<StrctDatagridColumnState | null>;
2144
2203
  /** Emitted when the selection changes. */
2145
2204
  readonly selectionChange: _angular_core.OutputEmitterRef<StrctRow[]>;
2146
2205
  /** Emitted when the refresh button is clicked. */
@@ -2150,6 +2209,8 @@ declare class StrctDatagrid {
2150
2209
  row: StrctRow;
2151
2210
  item: StrctMenuItem;
2152
2211
  }>;
2212
+ /** Server-side data request (lazy mode): load this page / sort and set `rows`. */
2213
+ readonly lazyLoad: _angular_core.OutputEmitterRef<StrctDatagridLazyState>;
2153
2214
  private readonly menu;
2154
2215
  protected readonly detailDef: _angular_core.Signal<StrctRowDetailDef | undefined>;
2155
2216
  protected readonly actionBarDef: _angular_core.Signal<StrctDatagridActionBar | undefined>;
@@ -2182,13 +2243,49 @@ declare class StrctDatagrid {
2182
2243
  protected readonly visibleColumns: _angular_core.Signal<StrctDatagridColumn[]>;
2183
2244
  protected readonly sorted: _angular_core.Signal<StrctRow[]>;
2184
2245
  protected readonly paged: _angular_core.Signal<StrctRow[]>;
2246
+ /** Full count for the pager / footer (server total in lazy mode). */
2247
+ protected readonly totalCount: _angular_core.Signal<number>;
2248
+ private readonly scrollTop;
2249
+ protected onScroll(event: Event): void;
2250
+ /** Visible index window incl. overscan (virtual mode). */
2251
+ private readonly vRange;
2252
+ /** The rows actually rendered: the virtual window, or the current page. */
2253
+ protected readonly renderRows: _angular_core.Signal<StrctRow[]>;
2254
+ protected readonly topPad: _angular_core.Signal<number>;
2255
+ protected readonly bottomPad: _angular_core.Signal<number>;
2256
+ protected readonly stickyActive: _angular_core.Signal<boolean>;
2257
+ /** Total width of the frozen utility columns (detail / expand / select). */
2258
+ private readonly utilityWidth;
2259
+ /** Left offset of a frozen utility column, or null when sticky is off. */
2260
+ protected utilLeft(which: 'detail' | 'expand' | 'sel'): number | null;
2261
+ /** Effective px width of a column (resize override → declared px → fallback). */
2262
+ private colPx;
2263
+ /** key → left px for sticky data columns. */
2264
+ private readonly stickyOffsets;
2265
+ protected stickyLeft(key: string): number | null;
2266
+ protected isSticky(col: StrctDatagridColumn): boolean;
2267
+ /** The last frozen column carries the edge shadow. */
2268
+ protected readonly lastStickyKey: _angular_core.Signal<string | null>;
2185
2269
  protected readonly allPageSelected: _angular_core.Signal<boolean>;
2186
2270
  protected readonly somePageSelected: _angular_core.Signal<boolean>;
2187
2271
  /** Resolve a row's stable identity (defaults to the row object itself). */
2188
2272
  private idOf;
2189
2273
  protected rowKey(row: StrctRow): unknown;
2190
2274
  protected cellTemplate(key: string): TemplateRef<StrctCellContext> | null;
2275
+ /** Last emitted lazy request (dedupe key). */
2276
+ private lastLazyKey;
2277
+ /** Last serialized column state pushed outward (loop guard). */
2278
+ private lastStateKey;
2191
2279
  constructor();
2280
+ private readPersistedState;
2281
+ private applyColumnState;
2282
+ /**
2283
+ * The grid as CSV: header labels + every non-hidden column, all rows in the
2284
+ * current order (client mode: the full sorted set, not just the page).
2285
+ */
2286
+ toCSV(): string;
2287
+ /** Download the grid as a CSV file. */
2288
+ downloadCSV(filename?: string): void;
2192
2289
  protected colspan(): number;
2193
2290
  /** Toggle the detail pane for a row (triggered by its » button, not the row,
2194
2291
  * so row cells remain selectable for copy). */
@@ -2212,7 +2309,7 @@ declare class StrctDatagrid {
2212
2309
  private commitSelection;
2213
2310
  private compare;
2214
2311
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctDatagrid, never>;
2215
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctDatagrid, "strct-datagrid", never, { "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "rows": { "alias": "rows"; "required": true; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "expandable": { "alias": "expandable"; "required": false; "isSignal": true; }; "detailPane": { "alias": "detailPane"; "required": false; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; "singleLine": { "alias": "singleLine"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "columnChooser": { "alias": "columnChooser"; "required": false; "isSignal": true; }; "sync": { "alias": "sync"; "required": false; "isSignal": true; }; "footerActionsDisabled": { "alias": "footerActionsDisabled"; "required": false; "isSignal": true; }; "rowId": { "alias": "rowId"; "required": false; "isSignal": true; }; "rowActions": { "alias": "rowActions"; "required": false; "isSignal": true; }; "initialSelection": { "alias": "initialSelection"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "syncChange": "syncChange"; "rowAction": "rowAction"; }, ["detailDef", "actionBarDef", "cellDefs"], ["[strctDatagridActionBar]"], true, never>;
2312
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctDatagrid, "strct-datagrid", never, { "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "rows": { "alias": "rows"; "required": true; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "expandable": { "alias": "expandable"; "required": false; "isSignal": true; }; "detailPane": { "alias": "detailPane"; "required": false; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; "singleLine": { "alias": "singleLine"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "columnChooser": { "alias": "columnChooser"; "required": false; "isSignal": true; }; "sync": { "alias": "sync"; "required": false; "isSignal": true; }; "footerActionsDisabled": { "alias": "footerActionsDisabled"; "required": false; "isSignal": true; }; "rowId": { "alias": "rowId"; "required": false; "isSignal": true; }; "rowActions": { "alias": "rowActions"; "required": false; "isSignal": true; }; "initialSelection": { "alias": "initialSelection"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; "virtual": { "alias": "virtual"; "required": false; "isSignal": true; }; "viewportHeight": { "alias": "viewportHeight"; "required": false; "isSignal": true; }; "rowHeight": { "alias": "rowHeight"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "total": { "alias": "total"; "required": false; "isSignal": true; }; "stateKey": { "alias": "stateKey"; "required": false; "isSignal": true; }; "columnState": { "alias": "columnState"; "required": false; "isSignal": true; }; }, { "columnState": "columnStateChange"; "selectionChange": "selectionChange"; "syncChange": "syncChange"; "rowAction": "rowAction"; "lazyLoad": "lazyLoad"; }, ["detailDef", "actionBarDef", "cellDefs"], ["[strctDatagridActionBar]"], true, never>;
2216
2313
  }
2217
2314
 
2218
2315
  /** Timeline node state colors. */
@@ -2950,4 +3047,4 @@ declare class StrctEmptyState {
2950
3047
  }
2951
3048
 
2952
3049
  export { STRCT_ICONS, STRCT_ICON_GROUPS, STRCT_MASKS, STRCT_PALETTES, STRCT_RAW_ICONS, StrctAccordion, StrctAccordionPanel, StrctAlert, StrctAvatar, StrctBadge, StrctBreadcrumb, StrctBreadcrumbItem, StrctButton, StrctButtonGroup, StrctCard, StrctCardBlock, StrctCardFooter, StrctCardHeader, StrctCascadeHost, StrctCascadeNode, StrctCascadeSelect, StrctCellDef, StrctCellStatus, StrctChart, StrctCheckbox, StrctChips, StrctColorPicker, StrctCombobox, StrctCommandPalette, StrctContextMenu, StrctContextMenuTrigger, StrctDatagrid, StrctDatagridActionBar, StrctDatepicker, StrctDesc, StrctDescriptionList, StrctDivider, StrctDonut, StrctDrawer, StrctDrawerFooter, StrctDropdown, StrctDropdownDivider, StrctDropdownItem, StrctEmptyState, StrctField, StrctFile, StrctFlow, StrctFooter, StrctGauge, StrctHeader, StrctHero, StrctIcon, StrctInput, StrctInputMask, StrctInputOtp, StrctKbd, StrctKnob, StrctLogin, StrctMenuPanel, StrctMenuService, StrctMetricTile, StrctModal, StrctNav, StrctNavItem, StrctOverlay, StrctPagination, StrctPassword, StrctProgress, StrctRadio, StrctRadioGroup, StrctRail, StrctRange, StrctRating, StrctRowDetailDef, StrctSectionMenu, StrctSegmented, StrctShell, StrctShellService, StrctSignpost, StrctSkeleton, StrctSparkline, StrctSpeedDial, StrctSpinner, StrctStack, StrctStackItem, StrctStep, StrctSubmenu, StrctTab, StrctTable, StrctTabs, StrctTag, StrctThemeService, StrctThemeSwitcher, StrctTimeline, StrctTimelineItem, StrctToastOutlet, StrctToastService, StrctToggle, StrctTooltip, StrctTree, StrctTreeNode, StrctVerticalNav, StrctWizard, registerStrctIcon, strctValidationIcon, strctValidationTone };
2953
- export type { StrctAlertType, StrctAvatarSize, StrctAvatarStatus, StrctBadgeStatus, StrctButtonSize, StrctButtonVariant, StrctCascadeOption, StrctCellContext, StrctChartAnnotation, StrctChartCurve, StrctChartSeries, StrctChartStatus, StrctChartThreshold, StrctChartType, StrctColumn, StrctCommandItem, StrctDatagridColumn, StrctDatagridLabels, StrctDescAlign, StrctDescItem, StrctDonutSegment, StrctDrawerSide, StrctDrawerSize, StrctEmptyVariant, StrctFlowDirection, StrctFlowNode, StrctFlowOrientation, StrctIconBadge, StrctKnobStatus, StrctMenuItem, StrctMenuLink, StrctMenuOpenOptions, StrctMenuSection, StrctMetricStatus, StrctModalSize, StrctMode, StrctOption, StrctOverlayPlacement, StrctPalette, StrctPaletteInfo, StrctProgressStatus, StrctRailItem, StrctRailStatus, StrctRow, StrctRowId, StrctSegmentedOption, StrctSegmentedSize, StrctSignpostPosition, StrctSpeedDialDirection, StrctSpinnerSize, StrctStatus, StrctTagStatus, StrctThresholds, StrctTimelineState, StrctToast, StrctToastOptions, StrctToastType, StrctTooltipPosition, StrctTreeMenuEvent, StrctTreeNodeData, StrctTreeNodeMenuFn, StrctValidationState, StrctValidationStatus };
3050
+ export type { StrctAlertType, StrctAvatarSize, StrctAvatarStatus, StrctBadgeStatus, StrctButtonSize, StrctButtonVariant, StrctCascadeOption, StrctCellContext, StrctChartAnnotation, StrctChartCurve, StrctChartSeries, StrctChartStatus, StrctChartThreshold, StrctChartType, StrctColumn, StrctCommandItem, StrctDatagridColumn, StrctDatagridColumnState, StrctDatagridLabels, StrctDatagridLazyState, StrctDescAlign, StrctDescItem, StrctDonutSegment, StrctDrawerSide, StrctDrawerSize, StrctEmptyVariant, StrctFlowDirection, StrctFlowNode, StrctFlowOrientation, StrctIconBadge, StrctKnobStatus, StrctMenuItem, StrctMenuLink, StrctMenuOpenOptions, StrctMenuSection, StrctMetricStatus, StrctModalSize, StrctMode, StrctOption, StrctOverlayPlacement, StrctPalette, StrctPaletteInfo, StrctProgressStatus, StrctRailItem, StrctRailStatus, StrctRow, StrctRowId, StrctSegmentedOption, StrctSegmentedSize, StrctSignpostPosition, StrctSpeedDialDirection, StrctSpinnerSize, StrctStatus, StrctTagStatus, StrctThresholds, StrctTimelineState, StrctToast, StrctToastOptions, StrctToastType, StrctTooltipPosition, StrctTreeMenuEvent, StrctTreeNodeData, StrctTreeNodeMenuFn, StrctValidationState, StrctValidationStatus };