@fluid-topics/ft-filterable-table 0.1.5 → 0.1.8

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.
@@ -1,5 +1,8 @@
1
1
  import { PropertyValues, TemplateResult } from "lit";
2
- import { ElementDefinitionsMap, FtCssVariable, FtLitElement } from "@fluid-topics/ft-wc-utils";
2
+ import { FtCssVariable, FtLitElement } from "@fluid-topics/ft-wc-utils";
3
+ import "@fluid-topics/ft-select";
4
+ import "@fluid-topics/ft-text-field";
5
+ import "@fluid-topics/ft-button";
3
6
  export declare type Getter<T> = (o: T) => any;
4
7
  export interface ColumnConfiguration<T> {
5
8
  title: string | TemplateResult;
@@ -37,7 +40,6 @@ export declare const FtFilterableTableCssVariables: {
37
40
  contentFont: FtCssVariable;
38
41
  };
39
42
  export declare class FtFilterableTable<T extends Record<string, any>> extends FtLitElement implements FtFilterableTableProperties<T> {
40
- static elementDefinitions: ElementDefinitionsMap;
41
43
  data: Array<T>;
42
44
  columns: Array<ColumnConfiguration<T>>;
43
45
  sort?: Sort;
@@ -9,9 +9,10 @@ import { property, state } from "lit/decorators.js";
9
9
  import { repeat } from "lit/directives/repeat.js";
10
10
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
11
11
  import { customElement, designSystemVariables, FtCssVariable, FtLitElement, setVariable } from "@fluid-topics/ft-wc-utils";
12
- import { FtSelect, FtSelectOption } from "@fluid-topics/ft-select";
13
- import { FtTextField } from "@fluid-topics/ft-text-field";
14
- import { FtButton, FtButtonCssVariables } from "@fluid-topics/ft-button";
12
+ import "@fluid-topics/ft-select";
13
+ import "@fluid-topics/ft-text-field";
14
+ import "@fluid-topics/ft-button";
15
+ import { FtButtonCssVariables } from "@fluid-topics/ft-button";
15
16
  export class RowClickEvent extends CustomEvent {
16
17
  constructor(data) {
17
18
  super("row-click", { detail: data });
@@ -31,6 +32,8 @@ const DEFAULT_COMPARATOR = (a, b) => a - b;
31
32
  const DEFAULT_STRINGIFY = (v) => "" + v;
32
33
  let FtFilterableTable = class FtFilterableTable extends FtLitElement {
33
34
  constructor() {
35
+ // Don't scope components here or web components cannot be used in columns render method
36
+ // static elementDefinitions: ElementDefinitionsMap = {}
34
37
  super(...arguments);
35
38
  this.data = [];
36
39
  this.columns = [];
@@ -312,12 +315,6 @@ let FtFilterableTable = class FtFilterableTable extends FtLitElement {
312
315
  return typeof column.stringify === "function" ? column.stringify(value, index) : DEFAULT_STRINGIFY(value);
313
316
  }
314
317
  };
315
- FtFilterableTable.elementDefinitions = {
316
- "ft-button": FtButton,
317
- "ft-select": FtSelect,
318
- "ft-select-option": FtSelectOption,
319
- "ft-text-field": FtTextField,
320
- };
321
318
  __decorate([
322
319
  property({ attribute: false })
323
320
  ], FtFilterableTable.prototype, "data", void 0);