@fluid-topics/ft-tree-list 1.3.21 → 1.3.22

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.
@@ -47,6 +47,8 @@ export declare class FtdsTreeList extends FtLitElement implements FtdsTreeListPr
47
47
  "with-children": boolean;
48
48
  }): TemplateResult<1>;
49
49
  protected renderEmptyState(): TemplateResult<1>;
50
+ protected renderEmptyStateTitle(): TemplateResult | symbol;
51
+ protected renderEmptyStateDescription(): TemplateResult | symbol;
50
52
  protected willUpdate(props: PropertyValues): void;
51
53
  protected updated(props: PropertyValues): void;
52
54
  protected onKeydown(event: KeyboardEvent, currentNode: FtTreeNode, isLoadMore: boolean, parentNode?: FtTreeNode): void;
@@ -191,16 +191,49 @@ class FtdsTreeList extends FtLitElement {
191
191
  `;
192
192
  }
193
193
  renderEmptyState() {
194
- var _a, _b;
194
+ var _a;
195
195
  return html `
196
196
  <div class="empty-state">
197
197
  ${((_a = this.emptyState) === null || _a === void 0 ? void 0 : _a.noImage) ? nothing : cactusSvg}
198
- <ft-typography variant="${FtTypographyVariants.body2medium}">
199
- ${(_b = this.emptyState) === null || _b === void 0 ? void 0 : _b.content}
200
- </ft-typography>
198
+ ${this.renderEmptyStateTitle()}
199
+ ${this.renderEmptyStateDescription()}
201
200
  </div>
202
201
  `;
203
202
  }
203
+ renderEmptyStateTitle() {
204
+ if (!this.emptyState) {
205
+ return nothing;
206
+ }
207
+ if (typeof this.emptyState.title === "string") {
208
+ return html `
209
+ <ft-typography class="empty-state--title" variant="${FtTypographyVariants.body1medium}">
210
+ ${this.emptyState.title}
211
+ </ft-typography>`;
212
+ }
213
+ else {
214
+ return this.emptyState.title;
215
+ }
216
+ }
217
+ renderEmptyStateDescription() {
218
+ var _a;
219
+ if (!((_a = this.emptyState) === null || _a === void 0 ? void 0 : _a.description)) {
220
+ return nothing;
221
+ }
222
+ if (typeof this.emptyState.description === "string") {
223
+ this.emptyState.description = [this.emptyState.description];
224
+ }
225
+ if (this.emptyState.description instanceof Array) {
226
+ const labels = this.emptyState.description.map(label => html `
227
+ <ft-typography variant="${FtTypographyVariants.body1medium}">
228
+ ${label}
229
+ </ft-typography>`);
230
+ return html `
231
+ <div class="empty-state--description">${labels}</div>`;
232
+ }
233
+ else {
234
+ return this.emptyState.description;
235
+ }
236
+ }
204
237
  willUpdate(props) {
205
238
  var _a, _b;
206
239
  super.willUpdate(props);
@@ -481,7 +514,7 @@ __decorate([
481
514
  property()
482
515
  ], FtdsTreeList.prototype, "collapseAllLabel", void 0);
483
516
  __decorate([
484
- jsonProperty([])
517
+ jsonProperty(undefined)
485
518
  ], FtdsTreeList.prototype, "emptyState", void 0);
486
519
  __decorate([
487
520
  state()
@@ -14,5 +14,6 @@ export interface FtdsTreeListProperties {
14
14
  }
15
15
  export interface EmptyStateConfiguration {
16
16
  noImage: boolean;
17
- content: string | TemplateResult;
17
+ title: string | TemplateResult;
18
+ description?: string | string[] | TemplateResult;
18
19
  }
@@ -1,5 +1,5 @@
1
1
  import { css } from "lit";
2
- import { setVariable } from "@fluid-topics/ft-wc-utils";
2
+ import { foundation, setVariable } from "@fluid-topics/ft-wc-utils";
3
3
  import { FtTypographyCssVariables, FtTypographyVariants } from "@fluid-topics/ft-typography";
4
4
  import { treeList } from "@fluid-topics/design-system-variables";
5
5
  import { FtIconCssVariables } from "@fluid-topics/ft-icon";
@@ -214,5 +214,26 @@ export const styles = css `
214
214
  display: flex;
215
215
  flex-direction: column;
216
216
  align-items: center;
217
+ padding-top: ${treeList.emptyStateContainerPaddingTop};
218
+ padding-bottom: ${treeList.emptyStateContainerPaddingBottom};
219
+ }
220
+
221
+ .empty-state--title {
222
+ margin-bottom: ${treeList.emptyStateTitleMarginBottom};
223
+ color: ${treeList.emptyStateTitleLabelColor};
224
+ }
225
+
226
+ .empty-state--description {
227
+ display: flex;
228
+ flex-direction: column;
229
+ align-items: center;
230
+ gap: ${foundation.spacing2};
231
+ color: ${treeList.emptyStateDescriptionLabelColor};
232
+ }
233
+
234
+ .empty-state svg {
235
+ height: ${treeList.emptyStateIllustrationHeight};
236
+ width: ${treeList.emptyStateIllustrationWidth};
237
+ margin-bottom: ${treeList.emptyStateIllustrationMarginBottom};
217
238
  }
218
239
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-tree-list",
3
- "version": "1.3.21",
3
+ "version": "1.3.22",
4
4
  "description": "A tree list component",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,13 +19,13 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/design-system-variables": "2.52.1",
23
- "@fluid-topics/ft-assets": "1.3.21",
24
- "@fluid-topics/ft-wc-utils": "1.3.21",
22
+ "@fluid-topics/design-system-variables": "2.53.0",
23
+ "@fluid-topics/ft-assets": "1.3.22",
24
+ "@fluid-topics/ft-wc-utils": "1.3.22",
25
25
  "lit": "3.1.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@fluid-topics/ft-wc-test-utils": "1.3.21"
28
+ "@fluid-topics/ft-wc-test-utils": "1.3.22"
29
29
  },
30
- "gitHead": "fd30595cd89395cbcac48ca8146aecef2e9b8673"
30
+ "gitHead": "f8ee485234740327c93ce01f6149dc1605d080b9"
31
31
  }