dap-design-system 0.21.1 → 0.22.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/dds.d.ts CHANGED
@@ -1,9 +1,17 @@
1
+ import { ColumnDef } from '@tanstack/lit-table';
1
2
  import { CSSResult } from 'lit';
2
3
  import { Dayjs } from 'dayjs';
3
4
  import { default as default_2 } from 'dayjs';
4
5
  import { LitElement } from 'lit';
5
6
  import { nothing } from 'lit';
7
+ import { PaginationState } from '@tanstack/lit-table';
6
8
  import { PropertyValueMap } from 'lit';
9
+ import { Row } from '@tanstack/lit-table';
10
+ import { RowData } from '@tanstack/lit-table';
11
+ import { RowSelectionState } from '@tanstack/lit-table';
12
+ import { SortingState } from '@tanstack/lit-table';
13
+ import { Table } from '@tanstack/lit-table';
14
+ import { TableController } from '@tanstack/lit-table';
7
15
  import { TemplateResult } from 'lit';
8
16
  import { TemplateResult as TemplateResult_2 } from 'lit-html';
9
17
 
@@ -503,7 +511,11 @@ export declare class ArrowsExpandUpDownFill extends DdsElement {
503
511
 
504
512
  export declare type BackgroundShade = 'subtle' | 'base' | 'medium' | 'strong';
505
513
 
506
- declare type BadgeType = 'neutral' | 'brand' | 'info' | 'positive' | 'warning' | 'negative';
514
+ export declare type BadgeType = 'neutral' | 'brand' | 'info' | 'positive' | 'warning' | 'negative';
515
+
516
+ declare type BadgeType_2 = 'neutral' | 'brand' | 'info' | 'positive' | 'warning' | 'negative';
517
+
518
+ declare type BadgeVariant = 'round' | 'dot';
507
519
 
508
520
  declare type BannerVariant = 'brand' | 'positive' | 'info' | 'warning' | 'negative';
509
521
 
@@ -597,6 +609,8 @@ declare interface ChoiceElementMixinInterface {
597
609
  checked: boolean;
598
610
  }
599
611
 
612
+ export { ColumnDef }
613
+
600
614
  declare class ComboboxBaseElement extends GenericFormElement {
601
615
  triggerInput: HTMLInputElement;
602
616
  optionList: DapDSOptionList;
@@ -804,7 +818,7 @@ export declare class DapDSBadge extends DdsElement {
804
818
  /** The type of the badge
805
819
  * @type { 'neutral' | 'brand' | 'info' | 'positive' | 'warning' | 'negative' }
806
820
  */
807
- type: BadgeType;
821
+ type: BadgeType_2;
808
822
  /** The size of the badge
809
823
  * @type { 'lg' | 'sm' }
810
824
  */
@@ -1565,6 +1579,70 @@ export declare class DapDSDAPBadge extends DdsElement {
1565
1579
  render(): TemplateResult_2;
1566
1580
  }
1567
1581
 
1582
+ /**
1583
+ * `dap-ds-datatable`
1584
+ * @summary A data table is a component that displays data in a tabular format.
1585
+ * @element dap-ds-datatable
1586
+ * @title - Data table
1587
+ *
1588
+ * @event dds-sorting-change - Fired when the sorting of the table changes.
1589
+ * @event dds-selection-change - Fired when the selection of the table changes.
1590
+ * @event dds-pagination-change - Fired when the pagination of the table changes.
1591
+ * @event dds-row-click - Fired when a row is clicked.
1592
+ *
1593
+ * @csspart base - The main table container.
1594
+ * @csspart header - The header of the table.
1595
+ * @csspart header-row - The header row of the table.
1596
+ * @csspart header-cell - All cells of the header.
1597
+ * @csspart body - The body of the table.
1598
+ * @csspart row - All rows of the table.
1599
+ * @csspart cell - All cells of the table.
1600
+ * @csspart pager - The pager of the table.
1601
+ *
1602
+ */
1603
+ export declare class DapDSDataTable<T> extends DdsElement {
1604
+ static styles: CSSResult;
1605
+ private tableController;
1606
+ /** Data to display in the table */
1607
+ data: RowData[];
1608
+ /** Columns to display in the table */
1609
+ columns: ColumnDef<T>[];
1610
+ /** Row key to use for row selection, this should be a unique key for each row */
1611
+ rowKey: string;
1612
+ /** Enable row selection on the table, can be a boolean or a function that returns a boolean */
1613
+ enableRowSelection: boolean | ((row: Row<T>) => boolean);
1614
+ /** Enable sorting on the table */
1615
+ enableSorting: boolean;
1616
+ /** Enable manual sorting on the table */
1617
+ manualSorting: boolean;
1618
+ /** Enables manual pagination. If this option is set to true, the table will not automatically paginate rows and instead will expect you to manually paginate the rows before passing them to the table. This is useful if you are doing server-side pagination and aggregation. */
1619
+ manualPagination: boolean;
1620
+ /** If set to true, pagination will be reset to the first page when page-altering state changes eg. data is updated, filters change, grouping changes, etc. */
1621
+ autoResetPageIndex: boolean;
1622
+ /** Enable row click on the table */
1623
+ enableRowClick: boolean;
1624
+ /** Loading state of the table */
1625
+ loading: boolean;
1626
+ /** Sorting state of the table */
1627
+ sorting: SortingState;
1628
+ private _sorting;
1629
+ /** Selection state of the table */
1630
+ rowSelection: RowSelectionState;
1631
+ private _rowSelection;
1632
+ pagination: PaginationState;
1633
+ private _pagination;
1634
+ /** Number of rows in the table */
1635
+ rowCount: number;
1636
+ /** @ignore */
1637
+ debug: boolean;
1638
+ protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
1639
+ protected updated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
1640
+ columnsMemo: () => ColumnDef<T>[];
1641
+ renderHeader: (table: Table<T>) => TemplateResult_2<1>;
1642
+ renderBody: (table: Table<T>) => TemplateResult_2<1>;
1643
+ protected render(): TemplateResult_2<1>;
1644
+ }
1645
+
1568
1646
  /**
1569
1647
  * `dap-ds-datepicker`
1570
1648
  * @summary A datepicker is a graphical user interface widget that allows the user to select a date from a calendar and/or time from a time range.
@@ -1908,8 +1986,6 @@ declare const DapDSFileInputListItem_base: typeof DdsElement & {
1908
1986
  * @title - Form label
1909
1987
  * @group form
1910
1988
  *
1911
- * @property {string} for - The id of the form element that the label is associated with.
1912
- * @property {boolean} renderAsText - Whether the label should be rendered as text or a <label> tag. Default is false.
1913
1989
  * @property {string} optionalLabel - Label of optional text
1914
1990
  * @property {boolean} subtle - Text weight of the label.
1915
1991
  * @property {boolean} optional - If the label is optional.
@@ -1918,13 +1994,15 @@ declare const DapDSFileInputListItem_base: typeof DdsElement & {
1918
1994
  * @csspart required - The required indicator of the form label.
1919
1995
  * @csspart optional - The optional indicator of the form label.
1920
1996
  */
1921
- export declare class DapDSFormLabel extends DapDSFormLabel_base {
1997
+ declare class DapDSFormLabel extends DapDSFormLabel_base {
1922
1998
  for?: string;
1923
- renderAsText?: boolean;
1999
+ renderAs: string;
1924
2000
  static styles: CSSResult;
1925
2001
  createRenderRoot(): this;
1926
2002
  render(): TemplateResult_2;
1927
2003
  }
2004
+ export { DapDSFormLabel }
2005
+ export { DapDSFormLabel as DapDSLabel }
1928
2006
 
1929
2007
  declare const DapDSFormLabel_base: {
1930
2008
  new (...args: any[]): LabelableElementInterface;
@@ -2211,6 +2289,14 @@ export declare class DapDSListItem extends DdsElement {
2211
2289
  * Whether the list item is interactive. Generates an anchor tag.
2212
2290
  */
2213
2291
  interactive: boolean;
2292
+ /** The link target of the list item when interactive.
2293
+ * @type { '_blank' | '_self' | '_parent' | '_top' }
2294
+ */
2295
+ target: LinkTarget;
2296
+ /** The href of the list item when interactive */
2297
+ href: string;
2298
+ /** The rel of the list item when interactive */
2299
+ rel: string;
2214
2300
  /**
2215
2301
  * Whether the list item has an icon.
2216
2302
  */
@@ -2266,6 +2352,46 @@ export declare class DapDSModal extends ModalBaseElement {
2266
2352
  render(): TemplateResult_2<1>;
2267
2353
  }
2268
2354
 
2355
+ /**
2356
+ * `dap-ds-notification-badge`
2357
+ * @summary A notification badge component is a user interface element that visually indicates the presence of new information or updates, often displaying a numeric count of unread notifications, messages, or items requiring attention.
2358
+ * @element dap-ds-notification-badge
2359
+ * @title - Notification badge
2360
+ *
2361
+ * @slot - The content of the notification badge.
2362
+ *
2363
+ * @csspart base - The main container of the notification badge.
2364
+ * @csspart noty - The notification badge container.
2365
+ */
2366
+ export declare class DapDSNotificationBadge extends DdsElement {
2367
+ /** The content of the badge, it can be a number or a string. Content tried to be parsed as a number, if it's not a number, it will be displayed as a string. */
2368
+ badgeContent: string;
2369
+ /** This switch decides the visibility of the badge. This property overrides the badge content visibility. Use it for explicit control. */
2370
+ visible: boolean;
2371
+ /** This switch decides whether to show a zero value or not. */
2372
+ showZero: boolean;
2373
+ /** The color scheme of the badge
2374
+ * @type { 'neutral' | 'brand' | 'info' | 'positive' | 'warning' | 'negative' }
2375
+ */
2376
+ type: BadgeType;
2377
+ /** The variant of the badge.
2378
+ * @type { 'round' | 'dot' }
2379
+ */
2380
+ variant: BadgeVariant;
2381
+ /** The cap value of badge content, if the badge content is greater than the max value, it will be displayed as `[number]+`. Zero means no cap. */
2382
+ max: number;
2383
+ /** The position of the badge content around the slot content.
2384
+ * @type { 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' }
2385
+ */
2386
+ placement: PopupPlacement;
2387
+ static styles: CSSResult;
2388
+ private parseBadgeContent;
2389
+ private handleMax;
2390
+ private renderContent;
2391
+ private get hide();
2392
+ render(): TemplateResult_2;
2393
+ }
2394
+
2269
2395
  /**
2270
2396
  * `dap-ds-number-input`
2271
2397
  * @summary A number input is a field for entering a number.
@@ -2453,6 +2579,38 @@ export declare class DapDSOverlay extends DdsElement {
2453
2579
  render(): TemplateResult_2<1>;
2454
2580
  }
2455
2581
 
2582
+ /**
2583
+ * `dap-ds-pager`
2584
+ * @summary A pager is a component that displays pagination controls.
2585
+ * @element dap-ds-pager
2586
+ * @title - Pager
2587
+ *
2588
+ * @event dds-pagination-change - Event fired when the pagination changes
2589
+ *
2590
+ * @csspart base - The main pager container.
2591
+ * @csspart first - The first page button.
2592
+ * @csspart previous - The previous page button.
2593
+ * @csspart next - The next page button.
2594
+ * @csspart last - The last page button.
2595
+ *
2596
+ */
2597
+ export declare class DapDSPager extends DdsElement {
2598
+ /** Enable manual pagination. If true, the component will not automatically update the page index. */
2599
+ manualPagination: boolean;
2600
+ /** The current page index. */
2601
+ pageIndex: number;
2602
+ private _pageIndex;
2603
+ /** The number of items per page. */
2604
+ pageSize: number;
2605
+ private _pageSize;
2606
+ /** The total number of rows. */
2607
+ totalRows: number;
2608
+ static styles: CSSResult;
2609
+ protected updated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
2610
+ private updatePageIndex;
2611
+ protected render(): TemplateResult_2<1>;
2612
+ }
2613
+
2456
2614
  /**
2457
2615
  * `dap-ds-password-input`
2458
2616
  * @summary A password input a field for entering a password.
@@ -3322,12 +3480,14 @@ export declare class DapDSTextarea extends GenericFormElement {
3322
3480
  * @element dap-ds-toc
3323
3481
  * @title - toc
3324
3482
  *
3483
+ * @property {'sm' | 'lg'} size - The size of the toc. Default is `lg`.
3484
+ *
3325
3485
  * @event dds-anchor-change - Event that is triggered when the anchor changes.
3326
3486
  *
3327
3487
  * @csspart base - The main container of the toc.
3328
3488
  *
3329
3489
  */
3330
- export declare class DapDSTOC extends DdsElement {
3490
+ export declare class DapDSTOC extends DapDSTOC_base {
3331
3491
  /** The root element to observe [`IntersectionObserver`](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#root) */
3332
3492
  root: string;
3333
3493
  /** The margin around the root element to observe [`IntersectionObserver`](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#rootmargin) */
@@ -3351,6 +3511,7 @@ export declare class DapDSTOC extends DdsElement {
3351
3511
  private _selectors;
3352
3512
  private _items;
3353
3513
  static styles: CSSResult;
3514
+ constructor();
3354
3515
  get activeAnchor(): HTMLAnchorElement;
3355
3516
  get anchors(): HTMLElement[];
3356
3517
  get items(): Heading[];
@@ -3368,6 +3529,11 @@ export declare class DapDSTOC extends DdsElement {
3368
3529
  private _handleIntersect;
3369
3530
  }
3370
3531
 
3532
+ declare const DapDSTOC_base: typeof DdsElement & {
3533
+ new (...args: any[]): SizedElementInterface;
3534
+ prototype: SizedElementInterface;
3535
+ };
3536
+
3371
3537
  /**
3372
3538
  * `dap-ds-tooltip`
3373
3539
  * @summary A tooltip is a container for tooltip content.
@@ -3562,10 +3728,18 @@ export declare type DdsOptionChangeEvent = CustomEvent<Record<PropertyKey, never
3562
3728
 
3563
3729
  export declare type DdsOptionItemsChangedEvent = CustomEvent<Record<PropertyKey, never>>;
3564
3730
 
3731
+ export declare type DdsPaginationChangeEvent = CustomEvent<SortingState[]>;
3732
+
3733
+ export declare type DdsRowClickEvent = CustomEvent<SortingState[]>;
3734
+
3565
3735
  export declare type DdsSearchEvent = CustomEvent<Record<PropertyKey, never>>;
3566
3736
 
3567
3737
  export declare type DdsSelectEvent = CustomEvent<Record<PropertyKey, never>>;
3568
3738
 
3739
+ export declare type DdsSelectionChangeEvent = CustomEvent<RowSelectionState>;
3740
+
3741
+ export declare type DdsSortingChangeEvent = CustomEvent<SortingState[]>;
3742
+
3569
3743
  export declare type DdsTabSelectEvent = CustomEvent<{
3570
3744
  tabId: string;
3571
3745
  }>;
@@ -3885,6 +4059,7 @@ declare class ModalBaseElement extends DdsElement {
3885
4059
  private canceled;
3886
4060
  static styles: CSSResult;
3887
4061
  protected updated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
4062
+ scrollLock: (open: boolean) => void;
3888
4063
  protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
3889
4064
  show(): void;
3890
4065
  hide(): void;
@@ -3936,6 +4111,10 @@ export declare type PopupPlacement = 'top' | 'top-start' | 'top-end' | 'right' |
3936
4111
 
3937
4112
  export declare type PopupTrigger = 'click' | 'hover' | 'focus' | 'manual' | 'hover focus';
3938
4113
 
4114
+ export { RowData }
4115
+
4116
+ export { RowSelectionState }
4117
+
3939
4118
  export declare type Size = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
3940
4119
 
3941
4120
  declare interface SizedElementInterface {
@@ -3952,6 +4131,8 @@ export declare type SnackbarMessage = {
3952
4131
 
3953
4132
  export declare type SnackbarPosition = 'bottom-left' | 'bottom-right' | 'bottom-center' | 'top-right' | 'top-center';
3954
4133
 
4134
+ export { SortingState }
4135
+
3955
4136
  export declare type Spacing = 0 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 1000 | 1200 | 1400 | 1600 | 1800 | 2000 | 2400 | 3000 | 4000 | 5000 | 6000;
3956
4137
 
3957
4138
  declare type Spacing_2 = 'top' | 'bottom' | 'both' | 'none';
@@ -4954,6 +5135,10 @@ export declare class SystemSubtractLine2 extends DdsElement {
4954
5135
  render(): TemplateResult_2;
4955
5136
  }
4956
5137
 
5138
+ export { Table }
5139
+
5140
+ export { TableController }
5141
+
4957
5142
  export declare type TooltipMode = 'tooltip' | 'toggle';
4958
5143
 
4959
5144
  declare type TooltipMode_2 = 'tooltip' | 'toggle';
@@ -5149,6 +5334,20 @@ declare global {
5149
5334
  }
5150
5335
 
5151
5336
 
5337
+ declare global {
5338
+ interface GlobalEventHandlersEventMap {
5339
+ 'dds-pagination-change': DdsPaginationChangeEvent;
5340
+ }
5341
+ }
5342
+
5343
+
5344
+ declare global {
5345
+ interface GlobalEventHandlersEventMap {
5346
+ 'dds-row-click': DdsRowClickEvent;
5347
+ }
5348
+ }
5349
+
5350
+
5152
5351
  declare global {
5153
5352
  interface GlobalEventHandlersEventMap {
5154
5353
  'dds-search': DdsSearchEvent;
@@ -5163,6 +5362,20 @@ declare global {
5163
5362
  }
5164
5363
 
5165
5364
 
5365
+ declare global {
5366
+ interface GlobalEventHandlersEventMap {
5367
+ 'dds-selection-change': DdsSelectionChangeEvent;
5368
+ }
5369
+ }
5370
+
5371
+
5372
+ declare global {
5373
+ interface GlobalEventHandlersEventMap {
5374
+ 'dds-sorting-change': DdsSortingChangeEvent;
5375
+ }
5376
+ }
5377
+
5378
+
5166
5379
  declare global {
5167
5380
  interface GlobalEventHandlersEventMap {
5168
5381
  'dds-tab-select': DdsTabSelectEvent;
@@ -5336,6 +5549,13 @@ declare global {
5336
5549
  }
5337
5550
 
5338
5551
 
5552
+ declare global {
5553
+ interface HTMLElementTagNameMap {
5554
+ 'dap-ds-datatable': DapDSDataTable<unknown>;
5555
+ }
5556
+ }
5557
+
5558
+
5339
5559
  declare global {
5340
5560
  interface HTMLElementTagNameMap {
5341
5561
  'dap-ds-datepicker': DapDSDatePicker;
@@ -5798,6 +6018,13 @@ declare global {
5798
6018
  }
5799
6019
 
5800
6020
 
6021
+ declare global {
6022
+ interface HTMLElementTagNameMap {
6023
+ 'dap-ds-notification-badge': DapDSNotificationBadge;
6024
+ }
6025
+ }
6026
+
6027
+
5801
6028
  declare global {
5802
6029
  interface HTMLElementTagNameMap {
5803
6030
  'dap-ds-number-input': DapDSNumberInput;
@@ -5826,6 +6053,13 @@ declare global {
5826
6053
  }
5827
6054
 
5828
6055
 
6056
+ declare global {
6057
+ interface HTMLElementTagNameMap {
6058
+ 'dap-ds-pager': DapDSPager;
6059
+ }
6060
+ }
6061
+
6062
+
5829
6063
  declare global {
5830
6064
  interface HTMLElementTagNameMap {
5831
6065
  'dap-ds-password-input': DapDSPasswordInput;