@fluid-topics/ft-filter 1.0.36 → 1.0.38

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.
@@ -52,48 +52,52 @@ class FtFilterLevel extends FtLitElement {
52
52
  return html `
53
53
  <div class="ft-filter-level--container ${this.disabled ? "ft-filter--disabled" : ""}">
54
54
  ${this.parent == null ? null : html `
55
- <div tabindex="0"
56
- part="controls go-back"
57
- class="ft-filter-level--go-back"
58
- ?disabled=${this.disabled}
59
- @keyup=${this.goBackOnKeyPress}
60
- @click=${this.goBackOnClick}>
61
- <ft-ripple></ft-ripple>
62
- <ft-icon>thin_arrow_left</ft-icon>
63
- <ft-typography variant="body2">${this.parent.label}</ft-typography>
64
- </div>
65
- `}
55
+ <div tabindex="0"
56
+ part="controls go-back"
57
+ class="ft-filter-level--go-back"
58
+ ?disabled=${this.disabled}
59
+ @keyup=${this.goBackOnKeyPress}
60
+ @click=${this.goBackOnClick}>
61
+ <ft-ripple></ft-ripple>
62
+ <ft-icon>thin_arrow_left</ft-icon>
63
+ <ft-typography variant="body2">${this.parent.label}</ft-typography>
64
+ </div>
65
+ `}
66
66
  ${this.options.length === 0 && this.noValuesLabel ? html `
67
- <ft-typography class="ft-filter-level--no-values" element="span" variant="body2">
68
- ${this.noValuesLabel}
69
- </ft-typography>
70
- ` : nothing}
67
+ <ft-typography class="ft-filter-level--no-values" element="span" variant="body2">
68
+ ${this.noValuesLabel}
69
+ </ft-typography>
70
+ ` : nothing}
71
71
  ${repeat(limitedOptions, option => option.value, option => {
72
72
  var _a;
73
73
  return html `
74
- <div class="ft-filter-level--option" part="options">
75
- ${this.multivalued ? this.buildMultiValuedOption(option) : this.buildMonoValuedOption(option)}
76
- ${this.preventNavigation || option.selected || ((_a = option.subOptions) !== null && _a !== void 0 ? _a : []).length === 0 ? nothing : html `
77
- <ft-button icon="thin_arrow_right"
78
- part="controls navigate-hierarchy"
79
- label="${option.label}"
80
- ?disabled=${this.disabled}
81
- tooltipPosition="left"
82
- @click=${() => this.displayLevel(option)}></ft-button>
83
- `}
84
- </div>
85
- `;
74
+ <div class="ft-filter-level--option" part="options">
75
+ ${this.multivalued
76
+ ? this.buildMultiValuedOption(option)
77
+ : this.buildMonoValuedOption(option)}
78
+ ${this.preventNavigation || option.selected || ((_a = option.subOptions) !== null && _a !== void 0 ? _a : []).length === 0
79
+ ? nothing
80
+ : html `
81
+ <ft-button icon="thin_arrow_right"
82
+ part="controls navigate-hierarchy"
83
+ label="${option.label}"
84
+ ?disabled=${this.disabled}
85
+ tooltipPosition="left"
86
+ @click=${() => this.displayLevel(option)}></ft-button>
87
+ `}
88
+ </div>
89
+ `;
86
90
  })}
87
91
  ${limitedOptions.length < options.length ? html `
88
- <ft-button
89
- class="ft-filter-level--display-more"
90
- icon="thin_arrow"
91
- dense trailingIcon
92
- part="controls display-more"
93
- @click=${this.displayMore}>
94
- ${this.moreValuesButtonLabel}
95
- </ft-button>
96
- ` : nothing}
92
+ <ft-button
93
+ class="ft-filter-level--display-more"
94
+ icon="thin_arrow"
95
+ dense trailingIcon
96
+ part="controls display-more"
97
+ @click=${this.displayMore}>
98
+ ${this.moreValuesButtonLabel}
99
+ </ft-button>
100
+ ` : nothing}
97
101
  </div>
98
102
  `;
99
103
  }
@@ -126,22 +126,24 @@ class FtFilter extends FtLitElement {
126
126
  renderLevels() {
127
127
  const allOptions = this.flatOptions;
128
128
  const selectedOptions = allOptions.filter(o => o.selected);
129
- const currentLevelIndex = (this.slideIn || this.slideOut) ? this.displayedLevels.length - 2 : this.displayedLevels.length - 1;
129
+ const currentLevelIndex = (this.slideIn || this.slideOut)
130
+ ? this.displayedLevels.length - 2
131
+ : this.displayedLevels.length - 1;
130
132
  const rootOptionsClass = currentLevelIndex < 0 ? "ft-filter--level-center" : "ft-filter--level-left";
131
133
  return html `
132
134
  ${this.raiseSelectedOptions && selectedOptions.length > 0 ? html `
133
- <ft-filter-level
134
- filterId="${this.id}"
135
- ?multivalued=${this.multivalued}
136
- ?disabled=${this.disabled}
137
- preventNavigation
138
- .options=${selectedOptions}
139
- @change=${this.onChange}
140
- part="values selected-values"
141
- .exportpartsPrefixes=${["values", "selected-values"]}
142
- ></ft-filter-level>
143
- <div class="ft-filter--separator">
144
- ` : null}
135
+ <ft-filter-level
136
+ filterId="${this.id}"
137
+ ?multivalued=${this.multivalued}
138
+ ?disabled=${this.disabled}
139
+ preventNavigation
140
+ .options=${selectedOptions}
141
+ @change=${this.onChange}
142
+ part="values selected-values"
143
+ .exportpartsPrefixes=${["values", "selected-values"]}
144
+ ></ft-filter-level>
145
+ <div class="ft-filter--separator">
146
+ ` : null}
145
147
  <ft-snap-scroll horizontal hideScrollbar
146
148
  class="ft-filter--levels"
147
149
  @current-element-change=${(e) => this.levelsScrollDebouncer.run(() => {