@fluid-topics/ft-filterable-table 1.1.45 → 1.1.46

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.
@@ -6,8 +6,9 @@ export interface ColumnConfiguration<T> {
6
6
  render?: (value: any, index: number) => string | TemplateResult;
7
7
  sortable?: boolean;
8
8
  comparator?: (a: any, b: any) => number;
9
- filter?: "text" | "select" | "date" | "none";
9
+ filter?: "text" | "select" | "none";
10
10
  stringify?: (value: any, index: number) => string;
11
+ options?: Array<any>;
11
12
  gridTemplateColumn?: string;
12
13
  }
13
14
  export interface Sort {
@@ -16,15 +17,25 @@ export interface Sort {
16
17
  }
17
18
  export interface Filter {
18
19
  value?: string;
19
- rangeStart?: Date;
20
- rangeEnd?: Date;
20
+ }
21
+ export interface ColumnFilter {
22
+ column: number;
23
+ value: string;
21
24
  }
22
25
  export declare class RowClickEvent<T> extends CustomEvent<T> {
23
26
  constructor(data: T);
24
27
  }
28
+ export interface FtFilterableTableChangeEventDetail {
29
+ filters: ColumnFilter[];
30
+ sort?: Sort;
31
+ }
32
+ export declare class FtFilterableTableChangeEvent extends CustomEvent<FtFilterableTableChangeEventDetail> {
33
+ constructor(detail: FtFilterableTableChangeEventDetail);
34
+ }
25
35
  export interface FtFilterableTableProperties<T extends Record<string, any>> {
26
36
  data: Array<T>;
27
37
  columns: Array<ColumnConfiguration<T>>;
28
38
  sort?: Sort;
29
39
  stickyHeaders: boolean;
40
+ disableDataManipulation: boolean;
30
41
  }
@@ -3,3 +3,8 @@ export class RowClickEvent extends CustomEvent {
3
3
  super("row-click", { detail: data });
4
4
  }
5
5
  }
6
+ export class FtFilterableTableChangeEvent extends CustomEvent {
7
+ constructor(detail) {
8
+ super("change", { detail: detail });
9
+ }
10
+ }
@@ -5,6 +5,7 @@ export declare const FtFilterableTableCssVariables: {
5
5
  rowHoverBackground: import("@fluid-topics/ft-wc-utils").FtCssVariable;
6
6
  stickyHeaderZIndex: import("@fluid-topics/ft-wc-utils").FtCssVariable;
7
7
  cellVerticalBorderWidth: import("@fluid-topics/ft-wc-utils").FtCssVariable;
8
+ columnTitleWhiteSpace: import("@fluid-topics/ft-wc-utils").FtCssVariable;
8
9
  colorOnSurfaceHigh: import("@fluid-topics/ft-wc-utils").FtCssVariable;
9
10
  titleFont: import("@fluid-topics/ft-wc-utils").FtCssVariable;
10
11
  contentFont: import("@fluid-topics/ft-wc-utils").FtCssVariable;
@@ -1,6 +1,7 @@
1
1
  import { css } from "lit";
2
2
  import { designSystemVariables, FtCssVariableFactory, setVariable } from "@fluid-topics/ft-wc-utils";
3
3
  import { FtButtonCssVariables } from "@fluid-topics/ft-button/build/ft-button.styles";
4
+ import { FtSelectCssVariables } from "@fluid-topics/ft-select/build/ft-select.styles";
4
5
  export const FtFilterableTableCssVariables = {
5
6
  headerBackground: FtCssVariableFactory.create("--ft-filterable-table-header-background", "", "COLOR", "whitesmoke"),
6
7
  oddRowBackground: FtCssVariableFactory.create("--ft-filterable-table-odd-row-background", "", "COLOR", "#FFFFFF"),
@@ -8,6 +9,7 @@ export const FtFilterableTableCssVariables = {
8
9
  rowHoverBackground: FtCssVariableFactory.create("--ft-filterable-table-row-hover-background", "", "COLOR", "#fafafa"),
9
10
  stickyHeaderZIndex: FtCssVariableFactory.create("--ft-filterable-table-sticky-header-zindex", "", "NUMBER", "10"),
10
11
  cellVerticalBorderWidth: FtCssVariableFactory.create("--ft-filterable-table-cell-vertical-border-width", "", "SIZE", "1px"),
12
+ columnTitleWhiteSpace: FtCssVariableFactory.create("--ft-filterable-table-column-title-white-space", "", "UNKNOWN", "nowrap"),
11
13
  colorOnSurfaceHigh: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceHigh, "Design system"),
12
14
  titleFont: FtCssVariableFactory.external(designSystemVariables.titleFont, "Design system"),
13
15
  contentFont: FtCssVariableFactory.external(designSystemVariables.contentFont, "Design system"),
@@ -60,7 +62,7 @@ export const styles = css `
60
62
  }
61
63
 
62
64
  .column-title {
63
- white-space: nowrap;
65
+ white-space: ${FtFilterableTableCssVariables.columnTitleWhiteSpace};
64
66
  text-transform: uppercase;
65
67
  margin-right: .5rem;
66
68
  font-weight: normal;
@@ -71,6 +73,7 @@ export const styles = css `
71
73
  .column-filter {
72
74
  flex-grow: 1;
73
75
  flex-shrink: 0;
76
+ ${setVariable(FtSelectCssVariables.optionsHeight, "300px")};
74
77
  }
75
78
 
76
79
  .column-filter:not(:empty) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-filterable-table",
3
- "version": "1.1.45",
3
+ "version": "1.1.46",
4
4
  "description": "A dynamic table with filters",
5
5
  "keywords": [
6
6
  "Lit"
@@ -22,11 +22,11 @@
22
22
  "test": "echo \"Error: run tests from root\" && exit 1"
23
23
  },
24
24
  "dependencies": {
25
- "@fluid-topics/ft-button": "1.1.45",
26
- "@fluid-topics/ft-select": "1.1.45",
27
- "@fluid-topics/ft-text-field": "1.1.45",
28
- "@fluid-topics/ft-wc-utils": "1.1.45",
25
+ "@fluid-topics/ft-button": "1.1.46",
26
+ "@fluid-topics/ft-select": "1.1.46",
27
+ "@fluid-topics/ft-text-field": "1.1.46",
28
+ "@fluid-topics/ft-wc-utils": "1.1.46",
29
29
  "lit": "3.1.0"
30
30
  },
31
- "gitHead": "6f166986bd8187f17e3d5a70f366596807be03c1"
31
+ "gitHead": "023f346e70fcbd9980c41b0c7ede0c199ca699bc"
32
32
  }