@nysds/nys-table 1.19.0 → 1.19.2

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.
@@ -0,0 +1,53 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * `<nys-table>` is a responsive table component that can display native HTML tables,
4
+ * supports striped and bordered styling, sortable columns, and CSV download.
5
+ *
6
+ * @slot - Accepts a `<table>` element. Only the first table is rendered.
7
+ *
8
+ * @fires nys-click - Fired when the download button or sortable headers are clicked.
9
+ * @fires nys-column-sort - Fired when a sortable column header is clicked. Can be prevented by calling `event.preventDefault()` to override default sort behavior.
10
+ * Detail: { columnIndex: number, columnLabel: string, sortDirection: "asc" | "desc" | "none" }
11
+ *
12
+ * @method downloadFile - Triggers download of the CSV file if `download` is set.
13
+ */
14
+ export declare class NysTable extends LitElement {
15
+ static styles: import("lit").CSSResult;
16
+ id: string;
17
+ name: string;
18
+ striped: boolean;
19
+ sortable: boolean;
20
+ bordered: boolean;
21
+ download: string;
22
+ private _sortColumn;
23
+ private _sortDirection;
24
+ private _captionText;
25
+ private _observer;
26
+ /**************** Lifecycle Methods ****************/
27
+ constructor();
28
+ connectedCallback(): void;
29
+ firstUpdated(): void;
30
+ disconnectedCallback(): void;
31
+ willUpdate(): void;
32
+ /******************** Functions ********************/
33
+ private _handleSlotChange;
34
+ private _setupMutationObserver;
35
+ private _normalizeTableDOM;
36
+ private _addSortIcons;
37
+ private _updateSortIcons;
38
+ private _onSortClick;
39
+ private _sortTable;
40
+ private _updateSortedColumnStyles;
41
+ downloadFile(): void;
42
+ /****************** Event Handlers ******************/
43
+ /**
44
+ * Dispatches the `nys-column-sort` custom event.
45
+ *
46
+ * @param columnIndex - Zero-based index of the sorted column.
47
+ * @param columnLabel - The text label of the sorted column header.
48
+ * @param sortDirection - The new sort direction: "asc", "desc", or "none".
49
+ */
50
+ private _emitColumnSortEvent;
51
+ /****************** Render ******************/
52
+ render(): import("lit-html").TemplateResult<1>;
53
+ }
package/dist/nys-table.js CHANGED
@@ -5,7 +5,7 @@ import { property as u, state as h } from "lit/decorators.js";
5
5
  * █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
6
6
  * █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
7
7
  *
8
- * Table Component v1.19.0
8
+ * Table Component v1.19.2
9
9
  * Part of the New York State Design System
10
10
  * Repository: https://github.com/its-hcd/nysds
11
11
  * License: MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/nys-table",
3
- "version": "1.19.0",
3
+ "version": "1.19.2",
4
4
  "description": "The Table component from the NYS Design System.",
5
5
  "module": "dist/nys-table.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,11 +20,11 @@
20
20
  "test": "vite build && wtr",
21
21
  "build:watch": "tsc --emitDeclarationOnly && vite build --watch",
22
22
  "test:watch": "vite build && wtr --watch",
23
- "lit-analyze": "lit-analyzer '*.ts'"
23
+ "lit-analyze": "lit-analyzer 'src/**/*.ts'"
24
24
  },
25
25
  "dependencies": {
26
- "@nysds/nys-icon": "^1.19.0",
27
- "@nysds/nys-button": "^1.19.0"
26
+ "@nysds/nys-icon": "^1.19.2",
27
+ "@nysds/nys-button": "^1.19.2"
28
28
  },
29
29
  "devDependencies": {
30
30
  "lit": "^3.3.1",
@@ -41,5 +41,6 @@
41
41
  "forms"
42
42
  ],
43
43
  "author": "New York State Design System Team",
44
- "license": "MIT"
44
+ "license": "MIT",
45
+ "sideEffects": true
45
46
  }