@fluid-topics/ft-filter 0.2.14 → 0.2.17

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.
@@ -27,6 +27,7 @@ export declare class FtFilterLevel extends FtLitElement {
27
27
  preventNavigation: boolean;
28
28
  private filter;
29
29
  private moreValuesButtonLabel;
30
+ private noValuesLabel?;
30
31
  displayedValuesLimit: number;
31
32
  private container?;
32
33
  private displayedPages;
@@ -68,6 +68,7 @@ export class FtFilterLevel extends FtLitElement {
68
68
  <div class="ft-filter-level--container ${this.disabled ? "ft-filter--disabled" : ""}">
69
69
  ${this.parent == null ? null : html `
70
70
  <div tabindex="0"
71
+ part="controls go-back"
71
72
  class="ft-filter-level--go-back"
72
73
  ?disabled=${this.disabled}
73
74
  @keyup=${this.goBackOnKeyPress}
@@ -77,6 +78,11 @@ export class FtFilterLevel extends FtLitElement {
77
78
  <ft-typography variant="body2">${this.parent.label}</ft-typography>
78
79
  </div>
79
80
  `}
81
+ ${this.options.length === 0 && this.noValuesLabel ? html `
82
+ <ft-typography class="ft-filter-level--no-values" element="span" variant="body2">
83
+ ${this.noValuesLabel}
84
+ </ft-typography>
85
+ ` : nothing}
80
86
  ${repeat(limitedOptions, option => option.value, option => {
81
87
  var _a;
82
88
  return html `
@@ -84,6 +90,7 @@ export class FtFilterLevel extends FtLitElement {
84
90
  ${this.multivalued ? this.buildMultiValuedOption(option) : this.buildMonoValuedOption(option)}
85
91
  ${this.preventNavigation || option.selected || ((_a = option.subOptions) !== null && _a !== void 0 ? _a : []).length === 0 ? nothing : html `
86
92
  <ft-button icon="chevron_right"
93
+ part="controls navigate-hierarchy"
87
94
  label="${option.label}"
88
95
  ?disabled=${this.disabled}
89
96
  tooltipPosition="left"
@@ -97,6 +104,7 @@ export class FtFilterLevel extends FtLitElement {
97
104
  class="ft-filter-level--display-more"
98
105
  icon="expand_more"
99
106
  dense trailingIcon
107
+ part="controls display-more"
100
108
  @click=${this.displayMore}>
101
109
  ${this.moreValuesButtonLabel}
102
110
  </ft-button>
@@ -121,6 +129,7 @@ export class FtFilterLevel extends FtLitElement {
121
129
  var _a;
122
130
  return html `
123
131
  <ft-checkbox name="${this.id}"
132
+ part="multivalued-option"
124
133
  .checked=${option.selected}
125
134
  .disabled=${this.disabled}
126
135
  .indeterminate=${flatDeep((_a = option.subOptions) !== null && _a !== void 0 ? _a : [], o => { var _a; return (_a = o.subOptions) !== null && _a !== void 0 ? _a : []; }).some(o => o.selected)}
@@ -132,6 +141,7 @@ export class FtFilterLevel extends FtLitElement {
132
141
  buildMonoValuedOption(option) {
133
142
  return html `
134
143
  <ft-radio name="${this.id + Math.round(Math.random() * 1000000)}"
144
+ part="monovalued-option"
135
145
  .checked=${option.selected}
136
146
  ?disabled=${this.disabled}
137
147
  @click=${(e) => this.optionsChanged(e, option)}
@@ -226,6 +236,11 @@ FtFilterLevel.styles = [
226
236
  margin-left: -10px;
227
237
  word-break: break-word;
228
238
  }
239
+
240
+ .ft-filter-level--no-values {
241
+ margin: 10px 0;
242
+ color: ${FtFilterLevelCssVariables.colorOnSurfaceMedium};
243
+ }
229
244
  `
230
245
  ];
231
246
  __decorate([
@@ -255,6 +270,9 @@ __decorate([
255
270
  __decorate([
256
271
  property({ type: String })
257
272
  ], FtFilterLevel.prototype, "moreValuesButtonLabel", void 0);
273
+ __decorate([
274
+ property({ type: String })
275
+ ], FtFilterLevel.prototype, "noValuesLabel", void 0);
258
276
  __decorate([
259
277
  property({ type: Number })
260
278
  ], FtFilterLevel.prototype, "displayedValuesLimit", void 0);
@@ -7,6 +7,7 @@ export interface FtFilterProperties {
7
7
  filterPlaceHolder?: string;
8
8
  clearButtonLabel?: string;
9
9
  moreValuesButtonLabel?: string;
10
+ noValuesLabel?: string;
10
11
  options: Array<FtFilterOptionProperties>;
11
12
  multivalued?: boolean;
12
13
  disabled?: boolean;
@@ -33,6 +34,7 @@ export declare class FtFilter extends FtLitElement implements FtFilterProperties
33
34
  filterPlaceHolder: string;
34
35
  clearButtonLabel: string;
35
36
  moreValuesButtonLabel: string;
37
+ noValuesLabel: string;
36
38
  options: Array<FtFilterOptionProperties>;
37
39
  multivalued: boolean;
38
40
  disabled: boolean;