@ds-mo/ui 14.3.0 → 14.4.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/dist/.package-ready.json +1 -1
- package/dist/agent-patterns.json +1 -1
- package/dist/agent.json +42 -11
- package/dist/angular/ds-pagination.d.ts +1 -1
- package/dist/angular/ds-pagination.js +3 -3
- package/dist/angular/ds-select.d.ts +1 -1
- package/dist/angular/ds-select.js +3 -3
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-title.js +1 -1
- package/dist/components/ds-bar-workflow.js +1 -1
- package/dist/components/ds-menu.js +1 -1
- package/dist/components/ds-mobile-header.js +1 -1
- package/dist/components/ds-mobile-section-switcher.js +1 -1
- package/dist/components/ds-pagination.js +1 -1
- package/dist/components/ds-panel-nav.js +1 -1
- package/dist/components/ds-panel-tool-header.js +1 -1
- package/dist/components/ds-panel-tool-search.js +1 -1
- package/dist/components/ds-panel-tools.js +1 -1
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-shell-app.js +1 -1
- package/dist/components/ds-shell-page.js +1 -1
- package/dist/components/ds-shell-tools.js +1 -1
- package/dist/components/ds-swatch-picker.js +1 -1
- package/dist/components/ds-table.js +1 -1
- package/dist/components/ds-table.js.map +1 -1
- package/dist/components/ds-toast.js +1 -1
- package/dist/components/ds-typing-indicator.js +1 -1
- package/dist/components/{p-BSBQ5kGe.js → p-BDXMXH_i.js} +2 -2
- package/dist/components/{p-Cpqd69kg.js → p-CDF_nP74.js} +2 -2
- package/dist/components/{p-CWsziQQY.js → p-CKfdvOZ2.js} +2 -2
- package/dist/components/{p-DwqUW4Rg.js → p-CRLRjtsc.js} +2 -2
- package/dist/components/p-CRLRjtsc.js.map +1 -0
- package/dist/components/{p-Cjf54_Cq.js → p-CW7ML-3h.js} +2 -2
- package/dist/components/{p-qA4eKZkW.js → p-CbqdWBAC.js} +2 -2
- package/dist/components/p-Cc5xgR17.js +2 -0
- package/dist/components/p-Cc5xgR17.js.map +1 -0
- package/dist/components/{p-C68-8tlp.js → p-ChWnbdFS.js} +2 -2
- package/dist/components/{p-CkWVI16a.js → p-DF52Grw1.js} +2 -2
- package/dist/components/{p-Bxe6532y.js → p-DhDWmMxD.js} +2 -2
- package/dist/components/{p-BiBXCjjo.js → p-O3OuOaj3.js} +2 -2
- package/dist/components/{p-Dh_TVLnz.js → p-RLiackRN.js} +2 -2
- package/dist/components/{p-CW3sRYuf.js → p-b-Dlg3y_.js} +2 -2
- package/dist/docs/components.json +243 -13
- package/dist/mcp-data/registry/pagination.json +119 -13
- package/dist/mcp-data/registry/registry.json +41 -10
- package/dist/mcp-data/registry/select.json +20 -2
- package/dist/mcp-data/registry/table.json +19 -11
- package/dist/styles/table.css +11 -0
- package/dist/types/components/Pagination/Pagination.d.ts +15 -1
- package/dist/types/components/Pagination/index.d.ts +1 -1
- package/dist/types/components/Pagination/pagination-model.d.ts +3 -2
- package/dist/types/components/Pagination/pagination-types.d.ts +13 -1
- package/dist/types/components/Select/Select.d.ts +3 -0
- package/dist/types/components/Select/index.d.ts +1 -1
- package/dist/types/components/Table/Table.d.ts +12 -0
- package/dist/types/components/Table/index.d.ts +1 -1
- package/dist/types/components/Table/table-pagination-fit.d.ts +8 -0
- package/dist/types/components/Table/table-types.d.ts +30 -1
- package/dist/types/components.d.ts +83 -8
- package/package.json +1 -1
- package/dist/components/p-D1ZI_10t.js +0 -2
- package/dist/components/p-D1ZI_10t.js.map +0 -1
- package/dist/components/p-DwqUW4Rg.js.map +0 -1
- /package/dist/components/{p-BSBQ5kGe.js.map → p-BDXMXH_i.js.map} +0 -0
- /package/dist/components/{p-Cpqd69kg.js.map → p-CDF_nP74.js.map} +0 -0
- /package/dist/components/{p-CWsziQQY.js.map → p-CKfdvOZ2.js.map} +0 -0
- /package/dist/components/{p-Cjf54_Cq.js.map → p-CW7ML-3h.js.map} +0 -0
- /package/dist/components/{p-qA4eKZkW.js.map → p-CbqdWBAC.js.map} +0 -0
- /package/dist/components/{p-C68-8tlp.js.map → p-ChWnbdFS.js.map} +0 -0
- /package/dist/components/{p-CkWVI16a.js.map → p-DF52Grw1.js.map} +0 -0
- /package/dist/components/{p-Bxe6532y.js.map → p-DhDWmMxD.js.map} +0 -0
- /package/dist/components/{p-BiBXCjjo.js.map → p-O3OuOaj3.js.map} +0 -0
- /package/dist/components/{p-Dh_TVLnz.js.map → p-RLiackRN.js.map} +0 -0
- /package/dist/components/{p-CW3sRYuf.js.map → p-b-Dlg3y_.js.map} +0 -0
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
import type { PaginationChangeDetail } from './pagination-types';
|
|
2
|
+
import type { PaginationChangeDetail, PaginationPageSizeMode } from './pagination-types';
|
|
3
3
|
export declare class Pagination {
|
|
4
4
|
/** Controlled zero-based page index. */
|
|
5
5
|
pageIndex: number;
|
|
6
6
|
/** Controlled number of top-level items on a full page. */
|
|
7
7
|
pageSize: number;
|
|
8
|
+
/** Whether pageSize is a fixed choice or a measured Fit snapshot. */
|
|
9
|
+
pageSizeMode: PaginationPageSizeMode;
|
|
8
10
|
/** Controlled total number of top-level items across every page. */
|
|
9
11
|
totalItems: number;
|
|
10
12
|
/** Available page sizes. Assign arrays through JavaScript. */
|
|
11
13
|
pageSizeOptions: number[];
|
|
14
|
+
/** Include the Fit to page choice. */
|
|
15
|
+
fitToPage: boolean;
|
|
16
|
+
/** Effective whole-item capacity to request when Fit is selected. */
|
|
17
|
+
fitPageSize: number | undefined;
|
|
18
|
+
/** Full choice-list label for Fit. */
|
|
19
|
+
fitPageSizeLabel: string;
|
|
20
|
+
/** Compact closed-trigger label while Fit is selected. */
|
|
21
|
+
fitPageSizeTriggerLabel: string;
|
|
12
22
|
/** Localized plural noun used by assistive range announcements. */
|
|
13
23
|
itemLabel: string;
|
|
14
24
|
/** Visible page-size control label. */
|
|
15
25
|
pageSizeLabel: string;
|
|
26
|
+
/** Accessible page-size control label. Defaults to “{pageSizeLabel} per page”. */
|
|
27
|
+
pageSizeAriaLabel: string | undefined;
|
|
16
28
|
/** Accessible name for the pagination navigation region. */
|
|
17
29
|
label: string;
|
|
18
30
|
/** Prevent interaction while the owner replaces the current data page. */
|
|
@@ -22,6 +34,8 @@ export declare class Pagination {
|
|
|
22
34
|
private readonly pageSizeControlId;
|
|
23
35
|
private requestPage;
|
|
24
36
|
private requestPageSize;
|
|
37
|
+
private handleKeyDown;
|
|
38
|
+
private get resolvedFitPageSize();
|
|
25
39
|
private get resolvedState();
|
|
26
40
|
render(): any;
|
|
27
41
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Pagination } from './Pagination';
|
|
2
|
-
export type { PaginationChangeDetail, PaginationChangeReason, PaginationState, } from './pagination-types';
|
|
2
|
+
export type { PaginationChangeDetail, PaginationChangeReason, PaginationPageSizeMode, PaginationState, } from './pagination-types';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import type { PaginationState } from './pagination-types';
|
|
1
|
+
import type { PaginationPageSizeMode, PaginationState } from './pagination-types';
|
|
2
2
|
export declare const DEFAULT_PAGE_SIZE_OPTIONS: readonly [25, 50, 100, 200];
|
|
3
3
|
export interface ResolvedPaginationState {
|
|
4
4
|
pageIndex: number;
|
|
5
5
|
pageSize: number;
|
|
6
|
+
pageSizeMode: PaginationPageSizeMode;
|
|
6
7
|
totalItems: number;
|
|
7
8
|
totalPages: number;
|
|
8
9
|
firstItem: number;
|
|
9
10
|
lastItem: number;
|
|
10
11
|
pageSizeOptions: number[];
|
|
11
12
|
}
|
|
12
|
-
export declare function resolvePaginationState(state: Pick<PaginationState, 'pageIndex' | 'pageSize' | 'totalItems' | 'pageSizeOptions'>): ResolvedPaginationState;
|
|
13
|
+
export declare function resolvePaginationState(state: Pick<PaginationState, 'pageIndex' | 'pageSize' | 'pageSizeMode' | 'totalItems' | 'pageSizeOptions'>): ResolvedPaginationState;
|
|
13
14
|
//# sourceMappingURL=pagination-model.d.ts.map
|
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
export type PaginationChangeReason = 'page' | 'page-size';
|
|
1
|
+
export type PaginationChangeReason = 'page' | 'page-size' | 'fit';
|
|
2
|
+
export type PaginationPageSizeMode = 'fixed' | 'fit';
|
|
2
3
|
/** Controlled pagination state shared by Pagination and pagination-aware consumers. */
|
|
3
4
|
export interface PaginationState {
|
|
4
5
|
/** Zero-based page index. */
|
|
5
6
|
pageIndex: number;
|
|
6
7
|
/** Number of top-level items on a full page. */
|
|
7
8
|
pageSize: number;
|
|
9
|
+
/** Whether pageSize is a chosen fixed value or a measured Fit snapshot. */
|
|
10
|
+
pageSizeMode?: PaginationPageSizeMode;
|
|
8
11
|
/** Total number of top-level items across every page. */
|
|
9
12
|
totalItems: number;
|
|
10
13
|
/** Available page sizes. Defaults to 25, 50, 100, and 200. */
|
|
11
14
|
pageSizeOptions?: number[];
|
|
15
|
+
/** Include a Fit to page option. The owner supplies the effective fitted size. */
|
|
16
|
+
fitToPage?: boolean;
|
|
17
|
+
/** Effective page size proposed when Fit to page is selected. */
|
|
18
|
+
fitPageSize?: number;
|
|
19
|
+
/** Full option label for Fit in the open choice list. */
|
|
20
|
+
fitPageSizeLabel?: string;
|
|
21
|
+
/** Compact trigger label while Fit is selected. */
|
|
22
|
+
fitPageSizeTriggerLabel?: string;
|
|
12
23
|
/** Localized plural noun used by assistive range announcements. */
|
|
13
24
|
itemLabel?: string;
|
|
14
25
|
/** Visible label for the page-size selector. */
|
|
@@ -20,6 +31,7 @@ export interface PaginationState {
|
|
|
20
31
|
export interface PaginationChangeDetail extends PaginationState {
|
|
21
32
|
previousPageIndex: number;
|
|
22
33
|
previousPageSize: number;
|
|
34
|
+
previousPageSizeMode: PaginationPageSizeMode;
|
|
23
35
|
reason: PaginationChangeReason;
|
|
24
36
|
}
|
|
25
37
|
//# sourceMappingURL=pagination-types.d.ts.map
|
|
@@ -8,6 +8,7 @@ export type SelectSize = 'lg' | 'md' | 'sm' | 'xs';
|
|
|
8
8
|
export type SelectWidth = ControlWidth;
|
|
9
9
|
export type SelectPopupAlign = 'start' | 'end';
|
|
10
10
|
export type SelectValue = string | string[];
|
|
11
|
+
export type SelectIndicator = 'down' | 'up-down';
|
|
11
12
|
export interface SelectOptionActionDetail {
|
|
12
13
|
value: string;
|
|
13
14
|
anchorId: string;
|
|
@@ -58,6 +59,8 @@ export declare class Select {
|
|
|
58
59
|
hasBorder: boolean;
|
|
59
60
|
/** Optional trigger prefix icon name. */
|
|
60
61
|
icon: string | undefined;
|
|
62
|
+
/** Trailing choice indicator. Use up-down for compact value steppers such as page size. */
|
|
63
|
+
indicator: SelectIndicator;
|
|
61
64
|
/** Show the clear footer action when a value exists. */
|
|
62
65
|
allowClear: boolean;
|
|
63
66
|
/** Localized clear action label. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { SelectBackground, SelectOption, SelectSection, SelectSize, SelectValue, SelectWidth, } from './Select';
|
|
1
|
+
export type { SelectBackground, SelectIndicator, SelectOption, SelectSection, SelectSize, SelectValue, SelectWidth, } from './Select';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -45,6 +45,7 @@ export declare class Table {
|
|
|
45
45
|
selectedRowIds: string[];
|
|
46
46
|
/** Initial loading state. Existing rows stay visible; incremental loading uses loadingMore. */
|
|
47
47
|
loading: boolean;
|
|
48
|
+
/** Initial-loading rows. Defaults to ten so bounded tables retain a useful filled viewport. */
|
|
48
49
|
skeletonRows: number;
|
|
49
50
|
emptyHeading: string;
|
|
50
51
|
emptyBody: string;
|
|
@@ -97,6 +98,7 @@ export declare class Table {
|
|
|
97
98
|
private activeStickyGroupId;
|
|
98
99
|
private viewportFitSettled;
|
|
99
100
|
private headerPresent;
|
|
101
|
+
private fitPageSize;
|
|
100
102
|
private rootEl;
|
|
101
103
|
private viewportEl;
|
|
102
104
|
private frameEl;
|
|
@@ -112,6 +114,10 @@ export declare class Table {
|
|
|
112
114
|
private renderedModel;
|
|
113
115
|
private stickyGroupConnected;
|
|
114
116
|
private headerSlotObserver;
|
|
117
|
+
private fitResizeObserver;
|
|
118
|
+
private fitObservedViewport;
|
|
119
|
+
private fitObservedTable;
|
|
120
|
+
private fitMeasurementPending;
|
|
115
121
|
private readonly layoutController;
|
|
116
122
|
private readonly loadController;
|
|
117
123
|
private readonly groupLoadController;
|
|
@@ -132,6 +138,7 @@ export declare class Table {
|
|
|
132
138
|
handleLoadIdentityChange(): void;
|
|
133
139
|
handleLazyConfigurationChange(): void;
|
|
134
140
|
handleDataModeChange(): void;
|
|
141
|
+
handlePaginationChange(pagination: TablePaginationState | null, previous: TablePaginationState | null): void;
|
|
135
142
|
handleLoadingMoreChange(loading: boolean): void;
|
|
136
143
|
handleLoadMoreErrorChange(error: string | undefined): void;
|
|
137
144
|
handleHasMoreChange(hasMore: boolean, hadMore: boolean): void;
|
|
@@ -142,6 +149,9 @@ export declare class Table {
|
|
|
142
149
|
private get fixedHeight();
|
|
143
150
|
private get boundedComposition();
|
|
144
151
|
private get containedScroll();
|
|
152
|
+
private connectFitObserver;
|
|
153
|
+
private disconnectFitObserver;
|
|
154
|
+
private readonly syncFitPageSize;
|
|
145
155
|
private currentLoadedRows;
|
|
146
156
|
private currentLoadedRowCount;
|
|
147
157
|
private createRenderModel;
|
|
@@ -173,6 +183,8 @@ export declare class Table {
|
|
|
173
183
|
private renderStickyGroup;
|
|
174
184
|
private renderDataBodies;
|
|
175
185
|
private renderSkeletonBody;
|
|
186
|
+
private renderSkeletonCell;
|
|
187
|
+
private renderSkeletonCellContent;
|
|
176
188
|
private renderStateBody;
|
|
177
189
|
private renderLazyBody;
|
|
178
190
|
private renderDocumentStickyHeader;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { TableCaptionVisibility, TableCellAlign, TableCellAction, TableCellActionDetail, TableCellBlank, TableCellEmpty, TableCellIcon, TableCellImage, TableCellPrimaryText, TableCellText, TableCellTag, TableCellTagVariant, TableCellValue, TableColumn, TableColumnSticky, TableColumnWidth, TableDataMode, TableGroup, TableGroupCollapseChangeDetail, TableGroupLoadMoreDetail, TableGroupIntent, TableHeaderSegment, TableGroupingState, TableLoadMoreDetail, TableLoadMoreMode, TableLoadMoreReason, TablePaginationState, TableRow, TableRowActivateDetail, TableSelectionChangeDetail, TableSelectionMode, TableSortChangeDetail, TableSortDirection, TableSortState, } from './table-types';
|
|
1
|
+
export type { TableCaptionVisibility, TableCellAlign, TableCellAction, TableCellActionDetail, TableCellBlank, TableCellEmpty, TableCellIcon, TableCellImage, TableCellPrimaryText, TableCellSkeleton, TableCellText, TableCellTag, TableCellTagVariant, TableCellValue, TableSkeletonWidth, TableColumn, TableColumnSticky, TableColumnWidth, TableDataMode, TableGroup, TableGroupCollapseChangeDetail, TableGroupLoadMoreDetail, TableGroupIntent, TableHeaderSegment, TableGroupingState, TableLoadMoreDetail, TableLoadMoreMode, TableLoadMoreReason, TablePaginationState, TableRow, TableRowActivateDetail, TableSelectionChangeDetail, TableSelectionMode, TableSortChangeDetail, TableSortDirection, TableSortState, } from './table-types';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TableFitPageSizeInput {
|
|
2
|
+
viewportBlockSize: number;
|
|
3
|
+
headerBlockSize: number;
|
|
4
|
+
itemBlockSize: number;
|
|
5
|
+
}
|
|
6
|
+
/** Resolve how many complete top-level rows or group headers fit below the column header. */
|
|
7
|
+
export declare function resolveTableFitPageSize(input: TableFitPageSizeInput): number | undefined;
|
|
8
|
+
//# sourceMappingURL=table-pagination-fit.d.ts.map
|
|
@@ -121,6 +121,30 @@ export type TableCellTag = TableCellTagBase & ({
|
|
|
121
121
|
text: string;
|
|
122
122
|
});
|
|
123
123
|
export type TableCellValue = string | number | null | undefined | TableCellText | TableCellPrimaryText | TableCellTag | TableCellIcon | TableCellImage | TableCellAction | TableCellEmpty | TableCellBlank;
|
|
124
|
+
export type TableSkeletonWidth = string | number;
|
|
125
|
+
/** Representative loading geometry for one table column. */
|
|
126
|
+
export type TableCellSkeleton = {
|
|
127
|
+
kind: 'text';
|
|
128
|
+
/** One track for scalar content, two for primary and secondary copy. */
|
|
129
|
+
lines?: 1 | 2;
|
|
130
|
+
primaryWidth?: TableSkeletonWidth;
|
|
131
|
+
secondaryWidth?: TableSkeletonWidth;
|
|
132
|
+
} | {
|
|
133
|
+
kind: 'image';
|
|
134
|
+
} | {
|
|
135
|
+
kind: 'tag';
|
|
136
|
+
width?: TableSkeletonWidth;
|
|
137
|
+
} | {
|
|
138
|
+
kind: 'icon';
|
|
139
|
+
rounded?: boolean;
|
|
140
|
+
} | {
|
|
141
|
+
kind: 'action';
|
|
142
|
+
/** Icon actions use a square control canvas; labeled actions may provide a wider width. */
|
|
143
|
+
variant?: 'icon' | 'label' | 'icon-label';
|
|
144
|
+
width?: TableSkeletonWidth;
|
|
145
|
+
} | {
|
|
146
|
+
kind: 'blank';
|
|
147
|
+
};
|
|
124
148
|
export interface TableColumn {
|
|
125
149
|
/** Stable column identity. */
|
|
126
150
|
id: string;
|
|
@@ -147,6 +171,8 @@ export interface TableColumn {
|
|
|
147
171
|
* geometry and may host grouped table-level controls in their header.
|
|
148
172
|
*/
|
|
149
173
|
kind?: 'data' | 'action';
|
|
174
|
+
/** Representative loading geometry for this column. Defaults to one text line. */
|
|
175
|
+
skeleton?: TableCellSkeleton;
|
|
150
176
|
}
|
|
151
177
|
export interface TableRow {
|
|
152
178
|
/** Stable identity, unique across all groups. */
|
|
@@ -220,6 +246,9 @@ export interface TableRowActivateDetail {
|
|
|
220
246
|
rowId: string;
|
|
221
247
|
}
|
|
222
248
|
/** Controlled top-level pagination state. Rows or groups contain only the active page. */
|
|
223
|
-
export
|
|
249
|
+
export interface TablePaginationState extends PaginationState {
|
|
250
|
+
/** Change to request one fresh fitted-capacity snapshot for the current query shape. */
|
|
251
|
+
fitIdentity?: string | number;
|
|
252
|
+
}
|
|
224
253
|
export {};
|
|
225
254
|
//# sourceMappingURL=table-types.d.ts.map
|
|
@@ -47,14 +47,14 @@ import { MobileHeaderHeadingLevel, MobileHeaderSectionsPresentation, MobileHeade
|
|
|
47
47
|
import { TabGroupItem, TabItem } from "./components/TabGroup/tab-item-utils";
|
|
48
48
|
import { TabGroupSize } from "./components/TabGroup/TabGroup";
|
|
49
49
|
import { ModalCloseDetail, ModalWidth } from "./components/Modal/Modal";
|
|
50
|
-
import { PaginationChangeDetail } from "./components/Pagination/pagination-types";
|
|
50
|
+
import { PaginationChangeDetail, PaginationPageSizeMode } from "./components/Pagination/pagination-types";
|
|
51
51
|
import { ChromeTransitionDetail } from "./shell/chrome-transition";
|
|
52
52
|
import { PanelSubNavItem } from "./components/PanelSubNav/panel-sub-nav-types";
|
|
53
53
|
import { PanelSubNavBackground } from "./components/PanelSubNav/PanelSubNav";
|
|
54
54
|
import { PanelToolsHeaderAction, PanelToolsHeaders, PanelToolsItem, PanelToolsToolId } from "./components/PanelTools/panel-tools-types";
|
|
55
55
|
import { RadioOption, RadioSize } from "./components/Radio/Radio";
|
|
56
56
|
import { ScrollOverlayScrollDetail } from "./components/ScrollOverlay/ScrollOverlay";
|
|
57
|
-
import { SelectBackground, SelectOption, SelectOptionActionDetail, SelectPopupAlign, SelectSection, SelectSize, SelectValue, SelectWidth } from "./components/Select/Select";
|
|
57
|
+
import { SelectBackground, SelectIndicator, SelectOption, SelectOptionActionDetail, SelectPopupAlign, SelectSection, SelectSize, SelectValue, SelectWidth } from "./components/Select/Select";
|
|
58
58
|
import { ShellAppComposition, ShellNavigationConfig, ShellPageChromeConfig, ShellToolsConfig } from "./components/ShellApp/shell-app-types";
|
|
59
59
|
import { ShellGradientPreset } from "./shell/shell-gradient-presets";
|
|
60
60
|
import { ShellPageCapacity, ShellPageContentInset, ShellPageContentSurface, ShellPageHeaderPresentation } from "./components/ShellPage/shell-page-types";
|
|
@@ -111,14 +111,14 @@ export { MobileHeaderHeadingLevel, MobileHeaderSectionsPresentation, MobileHeade
|
|
|
111
111
|
export { TabGroupItem, TabItem } from "./components/TabGroup/tab-item-utils";
|
|
112
112
|
export { TabGroupSize } from "./components/TabGroup/TabGroup";
|
|
113
113
|
export { ModalCloseDetail, ModalWidth } from "./components/Modal/Modal";
|
|
114
|
-
export { PaginationChangeDetail } from "./components/Pagination/pagination-types";
|
|
114
|
+
export { PaginationChangeDetail, PaginationPageSizeMode } from "./components/Pagination/pagination-types";
|
|
115
115
|
export { ChromeTransitionDetail } from "./shell/chrome-transition";
|
|
116
116
|
export { PanelSubNavItem } from "./components/PanelSubNav/panel-sub-nav-types";
|
|
117
117
|
export { PanelSubNavBackground } from "./components/PanelSubNav/PanelSubNav";
|
|
118
118
|
export { PanelToolsHeaderAction, PanelToolsHeaders, PanelToolsItem, PanelToolsToolId } from "./components/PanelTools/panel-tools-types";
|
|
119
119
|
export { RadioOption, RadioSize } from "./components/Radio/Radio";
|
|
120
120
|
export { ScrollOverlayScrollDetail } from "./components/ScrollOverlay/ScrollOverlay";
|
|
121
|
-
export { SelectBackground, SelectOption, SelectOptionActionDetail, SelectPopupAlign, SelectSection, SelectSize, SelectValue, SelectWidth } from "./components/Select/Select";
|
|
121
|
+
export { SelectBackground, SelectIndicator, SelectOption, SelectOptionActionDetail, SelectPopupAlign, SelectSection, SelectSize, SelectValue, SelectWidth } from "./components/Select/Select";
|
|
122
122
|
export { ShellAppComposition, ShellNavigationConfig, ShellPageChromeConfig, ShellToolsConfig } from "./components/ShellApp/shell-app-types";
|
|
123
123
|
export { ShellGradientPreset } from "./shell/shell-gradient-presets";
|
|
124
124
|
export { ShellPageCapacity, ShellPageContentInset, ShellPageContentSurface, ShellPageHeaderPresentation } from "./components/ShellPage/shell-page-types";
|
|
@@ -1808,6 +1808,25 @@ export namespace Components {
|
|
|
1808
1808
|
"open": boolean;
|
|
1809
1809
|
}
|
|
1810
1810
|
interface DsPagination {
|
|
1811
|
+
/**
|
|
1812
|
+
* Effective whole-item capacity to request when Fit is selected.
|
|
1813
|
+
*/
|
|
1814
|
+
"fitPageSize": number | undefined;
|
|
1815
|
+
/**
|
|
1816
|
+
* Full choice-list label for Fit.
|
|
1817
|
+
* @default 'Fit to page'
|
|
1818
|
+
*/
|
|
1819
|
+
"fitPageSizeLabel": string;
|
|
1820
|
+
/**
|
|
1821
|
+
* Compact closed-trigger label while Fit is selected.
|
|
1822
|
+
* @default 'Fit'
|
|
1823
|
+
*/
|
|
1824
|
+
"fitPageSizeTriggerLabel": string;
|
|
1825
|
+
/**
|
|
1826
|
+
* Include the Fit to page choice.
|
|
1827
|
+
* @default false
|
|
1828
|
+
*/
|
|
1829
|
+
"fitToPage": boolean;
|
|
1811
1830
|
/**
|
|
1812
1831
|
* Localized plural noun used by assistive range announcements.
|
|
1813
1832
|
* @default 'items'
|
|
@@ -1833,11 +1852,20 @@ export namespace Components {
|
|
|
1833
1852
|
* @default 25
|
|
1834
1853
|
*/
|
|
1835
1854
|
"pageSize": number;
|
|
1855
|
+
/**
|
|
1856
|
+
* Accessible page-size control label. Defaults to “{pageSizeLabel} per page”.
|
|
1857
|
+
*/
|
|
1858
|
+
"pageSizeAriaLabel": string | undefined;
|
|
1836
1859
|
/**
|
|
1837
1860
|
* Visible page-size control label.
|
|
1838
|
-
* @default 'Items
|
|
1861
|
+
* @default 'Items'
|
|
1839
1862
|
*/
|
|
1840
1863
|
"pageSizeLabel": string;
|
|
1864
|
+
/**
|
|
1865
|
+
* Whether pageSize is a fixed choice or a measured Fit snapshot.
|
|
1866
|
+
* @default 'fixed'
|
|
1867
|
+
*/
|
|
1868
|
+
"pageSizeMode": PaginationPageSizeMode;
|
|
1841
1869
|
/**
|
|
1842
1870
|
* Available page sizes. Assign arrays through JavaScript.
|
|
1843
1871
|
* @default [25, 50, 100, 200]
|
|
@@ -2281,6 +2309,11 @@ export namespace Components {
|
|
|
2281
2309
|
* Optional trigger prefix icon name.
|
|
2282
2310
|
*/
|
|
2283
2311
|
"icon": string | undefined;
|
|
2312
|
+
/**
|
|
2313
|
+
* Trailing choice indicator. Use up-down for compact value steppers such as page size.
|
|
2314
|
+
* @default 'down'
|
|
2315
|
+
*/
|
|
2316
|
+
"indicator": SelectIndicator;
|
|
2284
2317
|
/**
|
|
2285
2318
|
* ID applied to the internal combobox trigger for external labels.
|
|
2286
2319
|
*/
|
|
@@ -2995,7 +3028,8 @@ export namespace Components {
|
|
|
2995
3028
|
*/
|
|
2996
3029
|
"selectionMode": TableSelectionMode;
|
|
2997
3030
|
/**
|
|
2998
|
-
*
|
|
3031
|
+
* Initial-loading rows. Defaults to ten so bounded tables retain a useful filled viewport.
|
|
3032
|
+
* @default 10
|
|
2999
3033
|
*/
|
|
3000
3034
|
"skeletonRows": number;
|
|
3001
3035
|
/**
|
|
@@ -6427,6 +6461,25 @@ declare namespace LocalJSX {
|
|
|
6427
6461
|
"open"?: boolean;
|
|
6428
6462
|
}
|
|
6429
6463
|
interface DsPagination {
|
|
6464
|
+
/**
|
|
6465
|
+
* Effective whole-item capacity to request when Fit is selected.
|
|
6466
|
+
*/
|
|
6467
|
+
"fitPageSize"?: number | undefined;
|
|
6468
|
+
/**
|
|
6469
|
+
* Full choice-list label for Fit.
|
|
6470
|
+
* @default 'Fit to page'
|
|
6471
|
+
*/
|
|
6472
|
+
"fitPageSizeLabel"?: string;
|
|
6473
|
+
/**
|
|
6474
|
+
* Compact closed-trigger label while Fit is selected.
|
|
6475
|
+
* @default 'Fit'
|
|
6476
|
+
*/
|
|
6477
|
+
"fitPageSizeTriggerLabel"?: string;
|
|
6478
|
+
/**
|
|
6479
|
+
* Include the Fit to page choice.
|
|
6480
|
+
* @default false
|
|
6481
|
+
*/
|
|
6482
|
+
"fitToPage"?: boolean;
|
|
6430
6483
|
/**
|
|
6431
6484
|
* Localized plural noun used by assistive range announcements.
|
|
6432
6485
|
* @default 'items'
|
|
@@ -6456,11 +6509,20 @@ declare namespace LocalJSX {
|
|
|
6456
6509
|
* @default 25
|
|
6457
6510
|
*/
|
|
6458
6511
|
"pageSize"?: number;
|
|
6512
|
+
/**
|
|
6513
|
+
* Accessible page-size control label. Defaults to “{pageSizeLabel} per page”.
|
|
6514
|
+
*/
|
|
6515
|
+
"pageSizeAriaLabel"?: string | undefined;
|
|
6459
6516
|
/**
|
|
6460
6517
|
* Visible page-size control label.
|
|
6461
|
-
* @default 'Items
|
|
6518
|
+
* @default 'Items'
|
|
6462
6519
|
*/
|
|
6463
6520
|
"pageSizeLabel"?: string;
|
|
6521
|
+
/**
|
|
6522
|
+
* Whether pageSize is a fixed choice or a measured Fit snapshot.
|
|
6523
|
+
* @default 'fixed'
|
|
6524
|
+
*/
|
|
6525
|
+
"pageSizeMode"?: PaginationPageSizeMode;
|
|
6464
6526
|
/**
|
|
6465
6527
|
* Available page sizes. Assign arrays through JavaScript.
|
|
6466
6528
|
* @default [25, 50, 100, 200]
|
|
@@ -6940,6 +7002,11 @@ declare namespace LocalJSX {
|
|
|
6940
7002
|
* Optional trigger prefix icon name.
|
|
6941
7003
|
*/
|
|
6942
7004
|
"icon"?: string | undefined;
|
|
7005
|
+
/**
|
|
7006
|
+
* Trailing choice indicator. Use up-down for compact value steppers such as page size.
|
|
7007
|
+
* @default 'down'
|
|
7008
|
+
*/
|
|
7009
|
+
"indicator"?: SelectIndicator;
|
|
6943
7010
|
/**
|
|
6944
7011
|
* ID applied to the internal combobox trigger for external labels.
|
|
6945
7012
|
*/
|
|
@@ -7737,7 +7804,8 @@ declare namespace LocalJSX {
|
|
|
7737
7804
|
*/
|
|
7738
7805
|
"selectionMode"?: TableSelectionMode;
|
|
7739
7806
|
/**
|
|
7740
|
-
*
|
|
7807
|
+
* Initial-loading rows. Defaults to ten so bounded tables retain a useful filled viewport.
|
|
7808
|
+
* @default 10
|
|
7741
7809
|
*/
|
|
7742
7810
|
"skeletonRows"?: number;
|
|
7743
7811
|
/**
|
|
@@ -8432,9 +8500,15 @@ declare namespace LocalJSX {
|
|
|
8432
8500
|
interface DsPaginationAttributes {
|
|
8433
8501
|
"pageIndex": number;
|
|
8434
8502
|
"pageSize": number;
|
|
8503
|
+
"pageSizeMode": PaginationPageSizeMode;
|
|
8435
8504
|
"totalItems": number;
|
|
8505
|
+
"fitToPage": boolean;
|
|
8506
|
+
"fitPageSize": number | undefined;
|
|
8507
|
+
"fitPageSizeLabel": string;
|
|
8508
|
+
"fitPageSizeTriggerLabel": string;
|
|
8436
8509
|
"itemLabel": string;
|
|
8437
8510
|
"pageSizeLabel": string;
|
|
8511
|
+
"pageSizeAriaLabel": string | undefined;
|
|
8438
8512
|
"label": string;
|
|
8439
8513
|
"loading": boolean;
|
|
8440
8514
|
}
|
|
@@ -8535,6 +8609,7 @@ declare namespace LocalJSX {
|
|
|
8535
8609
|
"activeFill": boolean;
|
|
8536
8610
|
"hasBorder": boolean;
|
|
8537
8611
|
"icon": string | undefined;
|
|
8612
|
+
"indicator": SelectIndicator;
|
|
8538
8613
|
"allowClear": boolean;
|
|
8539
8614
|
"clearLabel": string;
|
|
8540
8615
|
"selectedLabel": string;
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p as e,H as a,c as i,h as s,a as t,t as n}from"./index.js";import{d as o}from"./p-D8nnhQNJ.js";import{d}from"./p-CTTDiW33.js";import{d as c}from"./p-C5TrNd31.js";import{d as r}from"./p-DLkNcCY0.js";import{d as l}from"./p-BFfLvMZd.js";import{d as p}from"./p-Ca-I2UnB.js";import{d as g}from"./p-DwqUW4Rg.js";import{d as b}from"./p-DZFilC--.js";import{d as f}from"./p-CtOK5oZ1.js";const m=[25,50,100,200];function h(e){return Number.isFinite(e)?Math.max(0,Math.trunc(e)):0}function u(e,a){return Number.isFinite(e)&&e>0?Math.trunc(e):a}function v(e){const a=u(e.pageSize,m[0]);const i=h(e.totalItems);const s=Math.max(1,Math.ceil(i/a));const t=Math.min(h(e.pageIndex),s-1);const n=(e.pageSizeOptions?.length?e.pageSizeOptions:m).map((e=>u(e,0))).filter((e=>e>0));const o=[...new Set([...n,a])].sort(((e,a)=>e-a));const d=i===0?0:t*a+1;const c=i===0?0:Math.min(i,d+a-1);return{pageIndex:t,pageSize:a,totalItems:i,totalPages:s,firstItem:d,lastItem:c,pageSizeOptions:o}}const x=()=>`.ds-visually-hidden.sc-ds-pagination-h,.ds-visually-hidden.sc-ds-pagination{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.sc-ds-pagination-h{display:block;box-sizing:border-box;min-width:0;max-width:100%;overflow-x:auto;scrollbar-width:none}.sc-ds-pagination-h::-webkit-scrollbar{display:none}.pagination.sc-ds-pagination,.pagination__page-size.sc-ds-pagination,.pagination__navigation.sc-ds-pagination{display:flex;align-items:center;box-sizing:border-box}.pagination.sc-ds-pagination{width:max-content;min-width:100%;gap:var(--dimension-space-200)}.pagination__page-size.sc-ds-pagination,.pagination__navigation.sc-ds-pagination{flex:0 0 auto;gap:var(--dimension-space-050)}.pagination__range.sc-ds-pagination,.pagination__page.sc-ds-pagination,.pagination__label.sc-ds-pagination{display:inline-flex;align-items:center;flex:0 0 auto;white-space:nowrap}.pagination__page.sc-ds-pagination{justify-content:center;min-inline-size:calc(var(--dimension-size-800) + var(--dimension-space-200));padding-inline:var(--dimension-space-050)}`;let y=0;const k=e(class e extends a{constructor(e){super();if(e!==false){this.__registerHost()}this.dsChange=i(this,"dsChange");this.pageIndex=0;this.pageSize=25;this.totalItems=0;this.pageSizeOptions=[25,50,100,200];this.itemLabel="items";this.pageSizeLabel="Items per page";this.label="Pagination";this.loading=false;this.pageSizeControlId=`ds-pagination-${++y}-page-size`}requestPage(e){const a=this.resolvedState;if(this.loading||e===a.pageIndex||e<0||e>=a.totalPages){return}this.dsChange.emit({pageIndex:e,pageSize:a.pageSize,totalItems:a.totalItems,pageSizeOptions:a.pageSizeOptions,itemLabel:this.itemLabel,pageSizeLabel:this.pageSizeLabel,ariaLabel:this.label,previousPageIndex:a.pageIndex,previousPageSize:a.pageSize,reason:"page"})}requestPageSize(e){if(this.loading||typeof e!=="string")return;const a=Number(e);const i=this.resolvedState;if(!Number.isFinite(a)||a<=0||a===i.pageSize)return;this.dsChange.emit({pageIndex:0,pageSize:Math.trunc(a),totalItems:i.totalItems,pageSizeOptions:i.pageSizeOptions,itemLabel:this.itemLabel,pageSizeLabel:this.pageSizeLabel,ariaLabel:this.label,previousPageIndex:i.pageIndex,previousPageSize:i.pageSize,reason:"page-size"})}get resolvedState(){return v({pageIndex:this.pageIndex,pageSize:this.pageSize,totalItems:this.totalItems,pageSizeOptions:this.pageSizeOptions})}render(){const e=this.resolvedState;const a=e.pageIndex===0;const i=e.pageIndex===e.totalPages-1;const n=`${e.firstItem}–${e.lastItem} of ${e.totalItems}`;const o=`Page ${e.pageIndex+1} of ${e.totalPages}`;return s(t,{key:"97730e6b852fb7c0e42fa1ac8e3004d3d2bb76dc"},s("nav",{key:"3985455856f989b87f9ca5266754fe422765bd9f",class:"pagination","aria-label":this.label,"aria-busy":this.loading?"true":undefined},s("div",{key:"41a68ce203f345f8d23d7ba023fad194895bc4eb",class:"pagination__page-size"},s("ds-text",{key:"b9342a3b08692856caae7f4b51786bb4185815b4",id:`${this.pageSizeControlId}-label`,class:"pagination__label",as:"span",variant:"text-body-medium",color:"secondary"},this.pageSizeLabel),s("ds-select",{key:"448356e6f700ebd64dcc8078a5e42fbd3d78778c",size:"md",inputId:this.pageSizeControlId,ariaLabelledby:`${this.pageSizeControlId}-label`,options:e.pageSizeOptions.map((e=>({label:String(e),value:String(e)}))),value:String(e.pageSize),allowClear:false,activeFill:false,isInactive:this.loading,onDsChange:e=>{e.stopPropagation();this.requestPageSize(e.detail)}})),s("ds-text",{key:"b7ae026614124ee78890e3b20033bb9138d827e9",class:"pagination__range",as:"span",variant:"text-body-medium",color:"secondary",fontFeature:"tabular-nums"},n),s("div",{key:"d98195913447b85bf2de8442d427f6386882750b",class:"pagination__navigation"},s("ds-button-unfilled",{key:"652045ec2fcf363f8f7f7a8912b1f6304b209c1e",variant:"icon",size:"md",icon:"ChevronLeftDouble",ariaLabel:"First page",hasBorder:false,isInactive:this.loading||a,onDsClick:()=>this.requestPage(0)}),s("ds-button-unfilled",{key:"78e74050c116db3f5908eea8e8e7f1c96f04b57b",variant:"icon",size:"md",icon:"ChevronLeft",ariaLabel:"Previous page",hasBorder:false,isInactive:this.loading||a,onDsClick:()=>this.requestPage(e.pageIndex-1)}),s("ds-text",{key:"8227c75b341a66b73b6d6aae875afe87fe524bde",class:"pagination__page",as:"span",variant:"text-body-medium",color:"secondary",fontFeature:"tabular-nums"},o),s("ds-button-unfilled",{key:"7f6cf5029fde8e180125d4615d506c1764f79930",variant:"icon",size:"md",icon:"ChevronRight",ariaLabel:"Next page",hasBorder:false,isInactive:this.loading||i,onDsClick:()=>this.requestPage(e.pageIndex+1)}),s("ds-button-unfilled",{key:"9ac5ffb3f3b10c47a73cdd3341d8432ddd7cbad4",variant:"icon",size:"md",icon:"ChevronRightDouble",ariaLabel:"Last page",hasBorder:false,isInactive:this.loading||i,onDsClick:()=>this.requestPage(e.totalPages-1)})),s("span",{key:"1c52f9b74102a04cbf5248069768a864a3e61518",class:"ds-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true"},n," ",this.itemLabel,". ",o,".")))}static get style(){return x()}},[2,"ds-pagination",{pageIndex:[2,"page-index"],pageSize:[2,"page-size"],totalItems:[2,"total-items"],pageSizeOptions:[16],itemLabel:[1,"item-label"],pageSizeLabel:[1,"page-size-label"],label:[1],loading:[4]}]);function z(){if(typeof customElements==="undefined"){return}const e=["ds-pagination","ds-badge","ds-button-unfilled","ds-checkbox","ds-empty-state","ds-icon","ds-loader","ds-select","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-pagination":if(!customElements.get(n(e))){customElements.define(n(e),k)}break;case"ds-badge":if(!customElements.get(n(e))){o()}break;case"ds-button-unfilled":if(!customElements.get(n(e))){d()}break;case"ds-checkbox":if(!customElements.get(n(e))){c()}break;case"ds-empty-state":if(!customElements.get(n(e))){r()}break;case"ds-icon":if(!customElements.get(n(e))){l()}break;case"ds-loader":if(!customElements.get(n(e))){p()}break;case"ds-select":if(!customElements.get(n(e))){g()}break;case"ds-text":if(!customElements.get(n(e))){b()}break;case"ds-tooltip":if(!customElements.get(n(e))){f()}break}}))}z();export{k as P,z as d};
|
|
2
|
-
//# sourceMappingURL=p-D1ZI_10t.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_PAGE_SIZE_OPTIONS","nonNegativeInteger","value","Number","isFinite","Math","max","trunc","positiveInteger","fallback","resolvePaginationState","state","pageSize","totalItems","totalPages","ceil","pageIndex","min","options","pageSizeOptions","length","map","filter","Set","sort","left","right","firstItem","lastItem","paginationCss","paginationId","Pagination","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","itemLabel","pageSizeLabel","label","loading","pageSizeControlId","requestPage","resolvedState","dsChange","emit","ariaLabel","previousPageIndex","previousPageSize","reason","requestPageSize","render","atStart","atEnd","range","page","h","Host","key","class","undefined","id","as","variant","color","size","inputId","ariaLabelledby","String","allowClear","activeFill","isInactive","onDsChange","event","stopPropagation","detail","fontFeature","icon","hasBorder","onDsClick","role"],"sources":["src/wc/components/Pagination/pagination-model.ts","src/wc/components/Pagination/Pagination.css?tag=ds-pagination&encapsulation=scoped","src/wc/components/Pagination/Pagination.tsx"],"sourcesContent":["import type { PaginationState } from './pagination-types';\n\nexport const DEFAULT_PAGE_SIZE_OPTIONS = [25, 50, 100, 200] as const;\n\nexport interface ResolvedPaginationState {\n pageIndex: number;\n pageSize: number;\n totalItems: number;\n totalPages: number;\n firstItem: number;\n lastItem: number;\n pageSizeOptions: number[];\n}\n\nfunction nonNegativeInteger(value: number): number {\n return Number.isFinite(value) ? Math.max(0, Math.trunc(value)) : 0;\n}\n\nfunction positiveInteger(value: number, fallback: number): number {\n return Number.isFinite(value) && value > 0 ? Math.trunc(value) : fallback;\n}\n\nexport function resolvePaginationState(\n state: Pick<PaginationState, 'pageIndex' | 'pageSize' | 'totalItems' | 'pageSizeOptions'>,\n): ResolvedPaginationState {\n const pageSize = positiveInteger(state.pageSize, DEFAULT_PAGE_SIZE_OPTIONS[0]);\n const totalItems = nonNegativeInteger(state.totalItems);\n const totalPages = Math.max(1, Math.ceil(totalItems / pageSize));\n const pageIndex = Math.min(nonNegativeInteger(state.pageIndex), totalPages - 1);\n const options = (state.pageSizeOptions?.length\n ? state.pageSizeOptions\n : DEFAULT_PAGE_SIZE_OPTIONS\n )\n .map(value => positiveInteger(value, 0))\n .filter(value => value > 0);\n const pageSizeOptions = [...new Set([...options, pageSize])].sort((left, right) => left - right);\n const firstItem = totalItems === 0 ? 0 : pageIndex * pageSize + 1;\n const lastItem = totalItems === 0 ? 0 : Math.min(totalItems, firstItem + pageSize - 1);\n\n return {\n pageIndex,\n pageSize,\n totalItems,\n totalPages,\n firstItem,\n lastItem,\n pageSizeOptions,\n };\n}\n","@import '../../utils/visually-hidden.css';\n\n:host {\n display: block;\n box-sizing: border-box;\n min-width: 0;\n max-width: 100%;\n overflow-x: auto;\n scrollbar-width: none;\n}\n\n:host::-webkit-scrollbar {\n display: none;\n}\n\n.pagination,\n.pagination__page-size,\n.pagination__navigation {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n}\n\n.pagination {\n width: max-content;\n min-width: 100%;\n gap: var(--dimension-space-200);\n}\n\n.pagination__page-size,\n.pagination__navigation {\n flex: 0 0 auto;\n gap: var(--dimension-space-050);\n}\n\n.pagination__range,\n.pagination__page,\n.pagination__label {\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n white-space: nowrap;\n}\n\n.pagination__page {\n justify-content: center;\n min-inline-size: calc(var(--dimension-size-800) + var(--dimension-space-200));\n padding-inline: var(--dimension-space-050);\n}\n","import { Component, Event, EventEmitter, h, Host, Prop } from '@stencil/core';\nimport { resolvePaginationState } from './pagination-model';\nimport type { PaginationChangeDetail } from './pagination-types';\n\nlet paginationId = 0;\n\n@Component({\n tag: 'ds-pagination',\n styleUrl: 'Pagination.css',\n scoped: true,\n})\nexport class Pagination {\n /** Controlled zero-based page index. */\n @Prop() pageIndex: number = 0;\n /** Controlled number of top-level items on a full page. */\n @Prop() pageSize: number = 25;\n /** Controlled total number of top-level items across every page. */\n @Prop() totalItems: number = 0;\n /** Available page sizes. Assign arrays through JavaScript. */\n @Prop() pageSizeOptions: number[] = [25, 50, 100, 200];\n /** Localized plural noun used by assistive range announcements. */\n @Prop() itemLabel: string = 'items';\n /** Visible page-size control label. */\n @Prop() pageSizeLabel: string = 'Items per page';\n /** Accessible name for the pagination navigation region. */\n @Prop() label: string = 'Pagination';\n /** Prevent interaction while the owner replaces the current data page. */\n @Prop() loading: boolean = false;\n\n /** Emits the complete next controlled state after a page or page-size request. */\n @Event() dsChange!: EventEmitter<PaginationChangeDetail>;\n\n private readonly pageSizeControlId = `ds-pagination-${++paginationId}-page-size`;\n\n private requestPage(pageIndex: number): void {\n const state = this.resolvedState;\n if (this.loading || pageIndex === state.pageIndex || pageIndex < 0 || pageIndex >= state.totalPages) {\n return;\n }\n this.dsChange.emit({\n pageIndex,\n pageSize: state.pageSize,\n totalItems: state.totalItems,\n pageSizeOptions: state.pageSizeOptions,\n itemLabel: this.itemLabel,\n pageSizeLabel: this.pageSizeLabel,\n ariaLabel: this.label,\n previousPageIndex: state.pageIndex,\n previousPageSize: state.pageSize,\n reason: 'page',\n });\n }\n\n private requestPageSize(value: string | string[]): void {\n if (this.loading || typeof value !== 'string') return;\n const pageSize = Number(value);\n const state = this.resolvedState;\n if (!Number.isFinite(pageSize) || pageSize <= 0 || pageSize === state.pageSize) return;\n this.dsChange.emit({\n pageIndex: 0,\n pageSize: Math.trunc(pageSize),\n totalItems: state.totalItems,\n pageSizeOptions: state.pageSizeOptions,\n itemLabel: this.itemLabel,\n pageSizeLabel: this.pageSizeLabel,\n ariaLabel: this.label,\n previousPageIndex: state.pageIndex,\n previousPageSize: state.pageSize,\n reason: 'page-size',\n });\n }\n\n private get resolvedState() {\n return resolvePaginationState({\n pageIndex: this.pageIndex,\n pageSize: this.pageSize,\n totalItems: this.totalItems,\n pageSizeOptions: this.pageSizeOptions,\n });\n }\n\n render() {\n const state = this.resolvedState;\n const atStart = state.pageIndex === 0;\n const atEnd = state.pageIndex === state.totalPages - 1;\n const range = `${state.firstItem}–${state.lastItem} of ${state.totalItems}`;\n const page = `Page ${state.pageIndex + 1} of ${state.totalPages}`;\n\n return (\n <Host>\n <nav class=\"pagination\" aria-label={this.label} aria-busy={this.loading ? 'true' : undefined}>\n <div class=\"pagination__page-size\">\n <ds-text\n id={`${this.pageSizeControlId}-label`}\n class=\"pagination__label\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"secondary\"\n >\n {this.pageSizeLabel}\n </ds-text>\n <ds-select\n size=\"md\"\n inputId={this.pageSizeControlId}\n ariaLabelledby={`${this.pageSizeControlId}-label`}\n options={state.pageSizeOptions.map(value => ({ label: String(value), value: String(value) }))}\n value={String(state.pageSize)}\n allowClear={false}\n activeFill={false}\n isInactive={this.loading}\n onDsChange={event => {\n event.stopPropagation();\n this.requestPageSize(event.detail);\n }}\n />\n </div>\n <ds-text\n class=\"pagination__range\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"secondary\"\n fontFeature=\"tabular-nums\"\n >\n {range}\n </ds-text>\n <div class=\"pagination__navigation\">\n <ds-button-unfilled\n variant=\"icon\"\n size=\"md\"\n icon=\"ChevronLeftDouble\"\n ariaLabel=\"First page\"\n hasBorder={false}\n isInactive={this.loading || atStart}\n onDsClick={() => this.requestPage(0)}\n />\n <ds-button-unfilled\n variant=\"icon\"\n size=\"md\"\n icon=\"ChevronLeft\"\n ariaLabel=\"Previous page\"\n hasBorder={false}\n isInactive={this.loading || atStart}\n onDsClick={() => this.requestPage(state.pageIndex - 1)}\n />\n <ds-text\n class=\"pagination__page\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"secondary\"\n fontFeature=\"tabular-nums\"\n >\n {page}\n </ds-text>\n <ds-button-unfilled\n variant=\"icon\"\n size=\"md\"\n icon=\"ChevronRight\"\n ariaLabel=\"Next page\"\n hasBorder={false}\n isInactive={this.loading || atEnd}\n onDsClick={() => this.requestPage(state.pageIndex + 1)}\n />\n <ds-button-unfilled\n variant=\"icon\"\n size=\"md\"\n icon=\"ChevronRightDouble\"\n ariaLabel=\"Last page\"\n hasBorder={false}\n isInactive={this.loading || atEnd}\n onDsClick={() => this.requestPage(state.totalPages - 1)}\n />\n </div>\n <span class=\"ds-visually-hidden\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {range} {this.itemLabel}. {page}.\n </span>\n </nav>\n </Host>\n );\n }\n}\n"],"mappings":"iYAEO,MAAMA,EAA4B,CAAC,GAAI,GAAI,IAAK,KAYvD,SAASC,EAAmBC,GAC1B,OAAOC,OAAOC,SAASF,GAASG,KAAKC,IAAI,EAAGD,KAAKE,MAAML,IAAU,CACnE,CAEA,SAASM,EAAgBN,EAAeO,GACtC,OAAON,OAAOC,SAASF,IAAUA,EAAQ,EAAIG,KAAKE,MAAML,GAASO,CACnE,CAEM,SAAUC,EACdC,GAEA,MAAMC,EAAWJ,EAAgBG,EAAMC,SAAUZ,EAA0B,IAC3E,MAAMa,EAAaZ,EAAmBU,EAAME,YAC5C,MAAMC,EAAaT,KAAKC,IAAI,EAAGD,KAAKU,KAAKF,EAAaD,IACtD,MAAMI,EAAYX,KAAKY,IAAIhB,EAAmBU,EAAMK,WAAYF,EAAa,GAC7E,MAAMI,GAAWP,EAAMQ,iBAAiBC,OACpCT,EAAMQ,gBACNnB,GAEDqB,KAAInB,GAASM,EAAgBN,EAAO,KACpCoB,QAAOpB,GAASA,EAAQ,IAC3B,MAAMiB,EAAkB,IAAI,IAAII,IAAI,IAAIL,EAASN,KAAYY,MAAK,CAACC,EAAMC,IAAUD,EAAOC,IAC1F,MAAMC,EAAYd,IAAe,EAAI,EAAIG,EAAYJ,EAAW,EAChE,MAAMgB,EAAWf,IAAe,EAAI,EAAIR,KAAKY,IAAIJ,EAAYc,EAAYf,EAAW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