@akcelik/strct 0.30.0 → 0.31.1
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/fesm2022/akcelik-strct.mjs +363 -41
- package/fesm2022/akcelik-strct.mjs.map +1 -1
- package/package.json +1 -1
- package/types/akcelik-strct.d.ts +88 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akcelik/strct",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.1",
|
|
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",
|
package/types/akcelik-strct.d.ts
CHANGED
|
@@ -2049,6 +2049,26 @@ interface StrctDatagridColumn {
|
|
|
2049
2049
|
/** Allow the user to resize this column by dragging its right edge.
|
|
2050
2050
|
* Defaults to the global {@link StrctDatagrid#resizable} setting. */
|
|
2051
2051
|
resizable?: boolean;
|
|
2052
|
+
/**
|
|
2053
|
+
* Freeze this column against horizontal scroll. Mark **leading** columns
|
|
2054
|
+
* (utility columns freeze automatically alongside). Give every sticky column
|
|
2055
|
+
* except the last an explicit px `width` so offsets stay exact.
|
|
2056
|
+
*/
|
|
2057
|
+
sticky?: boolean;
|
|
2058
|
+
}
|
|
2059
|
+
type SortDir = 'asc' | 'desc';
|
|
2060
|
+
/** What the grid wants loaded in server-side (`lazy`) mode. */
|
|
2061
|
+
interface StrctDatagridLazyState {
|
|
2062
|
+
/** 1-based page. */
|
|
2063
|
+
page: number;
|
|
2064
|
+
pageSize: number;
|
|
2065
|
+
sortKey: string | null;
|
|
2066
|
+
sortDir: SortDir;
|
|
2067
|
+
}
|
|
2068
|
+
/** Persistable user column preferences (widths from resize, hidden from the chooser). */
|
|
2069
|
+
interface StrctDatagridColumnState {
|
|
2070
|
+
widths?: Record<string, number>;
|
|
2071
|
+
hidden?: string[];
|
|
2052
2072
|
}
|
|
2053
2073
|
/**
|
|
2054
2074
|
* Marks the expandable-row detail template. The row is the template's implicit
|
|
@@ -2141,6 +2161,34 @@ declare class StrctDatagrid {
|
|
|
2141
2161
|
refresh: string;
|
|
2142
2162
|
actions: string;
|
|
2143
2163
|
}>;
|
|
2164
|
+
/**
|
|
2165
|
+
* Virtual scrolling for large data sets: only the rows inside the viewport
|
|
2166
|
+
* (plus a small overscan) are in the DOM — 20k+ rows stay smooth. The scroll
|
|
2167
|
+
* area gets `viewportHeight` and a sticky header. Assumes uniform
|
|
2168
|
+
* `rowHeight`; combine with `expandable` is unsupported.
|
|
2169
|
+
*/
|
|
2170
|
+
readonly virtual: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
2171
|
+
/** Scroll viewport height in px (virtual mode). */
|
|
2172
|
+
readonly viewportHeight: _angular_core.InputSignal<number>;
|
|
2173
|
+
/** Uniform row height in px (virtual mode; tune when `compact`). */
|
|
2174
|
+
readonly rowHeight: _angular_core.InputSignal<number>;
|
|
2175
|
+
/**
|
|
2176
|
+
* Server-side mode: the grid never sorts or slices `rows` itself — it shows
|
|
2177
|
+
* them as given and emits `(lazyLoad)` with `{ page, pageSize, sortKey,
|
|
2178
|
+
* sortDir }` whenever the user pages or sorts (and once on init). Provide
|
|
2179
|
+
* `total` so the pager and count reflect the full server-side set.
|
|
2180
|
+
*/
|
|
2181
|
+
readonly lazy: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
2182
|
+
/** Total row count on the server (lazy mode). */
|
|
2183
|
+
readonly total: _angular_core.InputSignal<number | null>;
|
|
2184
|
+
/**
|
|
2185
|
+
* Persist the user's column widths + hidden columns under this key in
|
|
2186
|
+
* localStorage (`strct-dg:<key>`), restoring them on init. For full control
|
|
2187
|
+
* use the two-way `columnState` instead (both may be combined).
|
|
2188
|
+
*/
|
|
2189
|
+
readonly stateKey: _angular_core.InputSignal<string | null>;
|
|
2190
|
+
/** User column preferences (two-way): widths from resize, hidden from the chooser. */
|
|
2191
|
+
readonly columnState: _angular_core.ModelSignal<StrctDatagridColumnState | null>;
|
|
2144
2192
|
/** Emitted when the selection changes. */
|
|
2145
2193
|
readonly selectionChange: _angular_core.OutputEmitterRef<StrctRow[]>;
|
|
2146
2194
|
/** Emitted when the refresh button is clicked. */
|
|
@@ -2150,6 +2198,8 @@ declare class StrctDatagrid {
|
|
|
2150
2198
|
row: StrctRow;
|
|
2151
2199
|
item: StrctMenuItem;
|
|
2152
2200
|
}>;
|
|
2201
|
+
/** Server-side data request (lazy mode): load this page / sort and set `rows`. */
|
|
2202
|
+
readonly lazyLoad: _angular_core.OutputEmitterRef<StrctDatagridLazyState>;
|
|
2153
2203
|
private readonly menu;
|
|
2154
2204
|
protected readonly detailDef: _angular_core.Signal<StrctRowDetailDef | undefined>;
|
|
2155
2205
|
protected readonly actionBarDef: _angular_core.Signal<StrctDatagridActionBar | undefined>;
|
|
@@ -2182,13 +2232,49 @@ declare class StrctDatagrid {
|
|
|
2182
2232
|
protected readonly visibleColumns: _angular_core.Signal<StrctDatagridColumn[]>;
|
|
2183
2233
|
protected readonly sorted: _angular_core.Signal<StrctRow[]>;
|
|
2184
2234
|
protected readonly paged: _angular_core.Signal<StrctRow[]>;
|
|
2235
|
+
/** Full count for the pager / footer (server total in lazy mode). */
|
|
2236
|
+
protected readonly totalCount: _angular_core.Signal<number>;
|
|
2237
|
+
private readonly scrollTop;
|
|
2238
|
+
protected onScroll(event: Event): void;
|
|
2239
|
+
/** Visible index window incl. overscan (virtual mode). */
|
|
2240
|
+
private readonly vRange;
|
|
2241
|
+
/** The rows actually rendered: the virtual window, or the current page. */
|
|
2242
|
+
protected readonly renderRows: _angular_core.Signal<StrctRow[]>;
|
|
2243
|
+
protected readonly topPad: _angular_core.Signal<number>;
|
|
2244
|
+
protected readonly bottomPad: _angular_core.Signal<number>;
|
|
2245
|
+
protected readonly stickyActive: _angular_core.Signal<boolean>;
|
|
2246
|
+
/** Total width of the frozen utility columns (detail / expand / select). */
|
|
2247
|
+
private readonly utilityWidth;
|
|
2248
|
+
/** Left offset of a frozen utility column, or null when sticky is off. */
|
|
2249
|
+
protected utilLeft(which: 'detail' | 'expand' | 'sel'): number | null;
|
|
2250
|
+
/** Effective px width of a column (resize override → declared px → fallback). */
|
|
2251
|
+
private colPx;
|
|
2252
|
+
/** key → left px for sticky data columns. */
|
|
2253
|
+
private readonly stickyOffsets;
|
|
2254
|
+
protected stickyLeft(key: string): number | null;
|
|
2255
|
+
protected isSticky(col: StrctDatagridColumn): boolean;
|
|
2256
|
+
/** The last frozen column carries the edge shadow. */
|
|
2257
|
+
protected readonly lastStickyKey: _angular_core.Signal<string | null>;
|
|
2185
2258
|
protected readonly allPageSelected: _angular_core.Signal<boolean>;
|
|
2186
2259
|
protected readonly somePageSelected: _angular_core.Signal<boolean>;
|
|
2187
2260
|
/** Resolve a row's stable identity (defaults to the row object itself). */
|
|
2188
2261
|
private idOf;
|
|
2189
2262
|
protected rowKey(row: StrctRow): unknown;
|
|
2190
2263
|
protected cellTemplate(key: string): TemplateRef<StrctCellContext> | null;
|
|
2264
|
+
/** Last emitted lazy request (dedupe key). */
|
|
2265
|
+
private lastLazyKey;
|
|
2266
|
+
/** Last serialized column state pushed outward (loop guard). */
|
|
2267
|
+
private lastStateKey;
|
|
2191
2268
|
constructor();
|
|
2269
|
+
private readPersistedState;
|
|
2270
|
+
private applyColumnState;
|
|
2271
|
+
/**
|
|
2272
|
+
* The grid as CSV: header labels + every non-hidden column, all rows in the
|
|
2273
|
+
* current order (client mode: the full sorted set, not just the page).
|
|
2274
|
+
*/
|
|
2275
|
+
toCSV(): string;
|
|
2276
|
+
/** Download the grid as a CSV file. */
|
|
2277
|
+
downloadCSV(filename?: string): void;
|
|
2192
2278
|
protected colspan(): number;
|
|
2193
2279
|
/** Toggle the detail pane for a row (triggered by its » button, not the row,
|
|
2194
2280
|
* so row cells remain selectable for copy). */
|
|
@@ -2212,7 +2298,7 @@ declare class StrctDatagrid {
|
|
|
2212
2298
|
private commitSelection;
|
|
2213
2299
|
private compare;
|
|
2214
2300
|
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>;
|
|
2301
|
+
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
2302
|
}
|
|
2217
2303
|
|
|
2218
2304
|
/** Timeline node state colors. */
|
|
@@ -2950,4 +3036,4 @@ declare class StrctEmptyState {
|
|
|
2950
3036
|
}
|
|
2951
3037
|
|
|
2952
3038
|
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 };
|
|
3039
|
+
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 };
|