@fluid-topics/ft-table 2.0.25 → 2.0.27
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/build/ft-table.light.js +58 -54
- package/build/ft-table.min.js +72 -68
- package/build/ftds-table.d.ts +2 -1
- package/build/ftds-table.js +15 -11
- package/package.json +6 -6
package/build/ftds-table.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { nothing, PropertyValues, TemplateResult } from "lit";
|
|
2
2
|
import "@fluid-topics/ft-button";
|
|
3
3
|
import "@fluid-topics/ft-typography";
|
|
4
|
+
import { FtdsTypographyVariants } from "@fluid-topics/ft-typography";
|
|
4
5
|
import { ColumnConfiguration, EmptyStateConfiguration, FtdsTableProperties, Sort } from "./ftds-table.properties";
|
|
5
6
|
import { FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
6
7
|
export declare class FtdsTable<T extends Record<string, any>> extends FtLitElement implements FtdsTableProperties<T> {
|
|
@@ -21,7 +22,7 @@ export declare class FtdsTable<T extends Record<string, any>> extends FtLitEleme
|
|
|
21
22
|
static DEFAULT_COMPARATOR: (a: any, b: any) => number;
|
|
22
23
|
focusRow(rowIndex: number): void;
|
|
23
24
|
protected render(): TemplateResult<1>;
|
|
24
|
-
protected optWrapWithFtTypography(toRender: TemplateResult | string): TemplateResult;
|
|
25
|
+
protected optWrapWithFtTypography(toRender: TemplateResult | string, variant: FtdsTypographyVariants): TemplateResult;
|
|
25
26
|
protected renderHeader(column: ColumnConfiguration<T>, index: number): TemplateResult<1>;
|
|
26
27
|
protected renderHeaderRow(): TemplateResult<1>;
|
|
27
28
|
protected renderRow(row: T, rowIndex: number): TemplateResult<1>;
|
package/build/ftds-table.js
CHANGED
|
@@ -4,19 +4,19 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { html, nothing } from "lit";
|
|
7
|
+
import { html, nothing, } from "lit";
|
|
8
8
|
import { repeat } from "lit/directives/repeat.js";
|
|
9
9
|
import "@fluid-topics/ft-button";
|
|
10
10
|
import "@fluid-topics/ft-typography";
|
|
11
11
|
import { FtdsTypographyVariants } from "@fluid-topics/ft-typography";
|
|
12
|
-
import { FtdsTableChangeEvent, RowClickEvent } from "./ftds-table.properties";
|
|
13
|
-
import { property, queryAll, state } from "lit/decorators.js";
|
|
12
|
+
import { FtdsTableChangeEvent, RowClickEvent, } from "./ftds-table.properties";
|
|
13
|
+
import { property, queryAll, state, } from "lit/decorators.js";
|
|
14
14
|
import { DesignSystemFamily } from "@fluid-topics/design-system-variables";
|
|
15
15
|
import { designSystemStyles } from "./ftds-table.styles";
|
|
16
16
|
import { classMap } from "lit/directives/class-map.js";
|
|
17
17
|
import { styleMap } from "lit/directives/style-map.js";
|
|
18
18
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
19
|
-
import { FtLitElement, jsonProperty } from "@fluid-topics/ft-wc-utils";
|
|
19
|
+
import { FtLitElement, jsonProperty, numberProperty, } from "@fluid-topics/ft-wc-utils";
|
|
20
20
|
import { cactusSvg } from "@fluid-topics/ft-assets";
|
|
21
21
|
export class FtdsTable extends FtLitElement {
|
|
22
22
|
constructor() {
|
|
@@ -51,10 +51,10 @@ export class FtdsTable extends FtLitElement {
|
|
|
51
51
|
</table>
|
|
52
52
|
`;
|
|
53
53
|
}
|
|
54
|
-
optWrapWithFtTypography(toRender) {
|
|
54
|
+
optWrapWithFtTypography(toRender, variant) {
|
|
55
55
|
if (typeof toRender === "string") {
|
|
56
56
|
return html `
|
|
57
|
-
<ftds-typography variant="${
|
|
57
|
+
<ftds-typography variant="${variant}">
|
|
58
58
|
${toRender}
|
|
59
59
|
</ftds-typography>
|
|
60
60
|
`;
|
|
@@ -88,7 +88,7 @@ export class FtdsTable extends FtLitElement {
|
|
|
88
88
|
part="${this.columnPart("title-container", index)}">
|
|
89
89
|
<span class="column-title"
|
|
90
90
|
part="${this.columnPart("title", index)}">
|
|
91
|
-
${this.optWrapWithFtTypography(column.title)}
|
|
91
|
+
${this.optWrapWithFtTypography(column.title, FtdsTypographyVariants.caption1semibold)}
|
|
92
92
|
</span>
|
|
93
93
|
${this.renderColumnSort(column, index)}
|
|
94
94
|
</div>
|
|
@@ -153,7 +153,7 @@ export class FtdsTable extends FtLitElement {
|
|
|
153
153
|
return html `
|
|
154
154
|
<td class="${classMap(classes)}" role="cell"
|
|
155
155
|
part="${this.columnPart("cell", columnIndex)} cell-row-${rowIndex} cell-column-${columnIndex}-row-${rowIndex}">
|
|
156
|
-
|
|
156
|
+
${render(this.getValue(column, row))}
|
|
157
157
|
</td>
|
|
158
158
|
`;
|
|
159
159
|
}
|
|
@@ -245,7 +245,11 @@ export class FtdsTable extends FtLitElement {
|
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
FtdsTable.styles = designSystemStyles;
|
|
248
|
-
FtdsTable.DEFAULT_RENDER = (v) => html
|
|
248
|
+
FtdsTable.DEFAULT_RENDER = (v) => html `
|
|
249
|
+
<ftds-typography variant="${FtdsTypographyVariants.caption1medium}">
|
|
250
|
+
${v}
|
|
251
|
+
</ftds-typography>
|
|
252
|
+
`;
|
|
249
253
|
FtdsTable.DEFAULT_COMPARATOR = (a, b) => a - b;
|
|
250
254
|
__decorate([
|
|
251
255
|
jsonProperty([])
|
|
@@ -275,10 +279,10 @@ __decorate([
|
|
|
275
279
|
property({ type: Boolean })
|
|
276
280
|
], FtdsTable.prototype, "clickableRows", void 0);
|
|
277
281
|
__decorate([
|
|
278
|
-
|
|
282
|
+
numberProperty()
|
|
279
283
|
], FtdsTable.prototype, "highlightedRowIndex", void 0);
|
|
280
284
|
__decorate([
|
|
281
|
-
|
|
285
|
+
numberProperty()
|
|
282
286
|
], FtdsTable.prototype, "activeRowIndex", void 0);
|
|
283
287
|
__decorate([
|
|
284
288
|
queryAll("tbody .row")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-table",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.27",
|
|
4
4
|
"description": "A dynamic table",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@fluid-topics/design-system-variables": "3.2.8",
|
|
26
|
-
"@fluid-topics/ft-assets": "2.0.
|
|
27
|
-
"@fluid-topics/ft-button": "2.0.
|
|
28
|
-
"@fluid-topics/ft-typography": "2.0.
|
|
29
|
-
"@fluid-topics/ft-wc-utils": "2.0.
|
|
26
|
+
"@fluid-topics/ft-assets": "2.0.27",
|
|
27
|
+
"@fluid-topics/ft-button": "2.0.27",
|
|
28
|
+
"@fluid-topics/ft-typography": "2.0.27",
|
|
29
|
+
"@fluid-topics/ft-wc-utils": "2.0.27",
|
|
30
30
|
"lit": "3.1.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "b4f188d0ab565bdf8a3fab98c358d0b533e8f611"
|
|
33
33
|
}
|