@fluid-topics/ft-filter 0.1.17 → 0.1.18
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-filter-level.d.ts +2 -2
- package/build/ft-filter-level.js +92 -98
- package/build/ft-filter-option.d.ts +1 -1
- package/build/ft-filter-option.js +4 -8
- package/build/ft-filter.d.ts +2 -3
- package/build/ft-filter.inline-styles.js +1421 -0
- package/build/ft-filter.js +114 -121
- package/build/ft-filter.light.js +512 -444
- package/build/ft-filter.min.js +547 -464
- package/build/index.d.ts +3 -0
- package/build/index.js +10 -0
- package/build/inline-styles.d.ts +2 -0
- package/build/inline-styles.js +6 -0
- package/package.json +9 -9
|
@@ -17,7 +17,7 @@ export declare const FtFilterLevelCssVariables: {
|
|
|
17
17
|
};
|
|
18
18
|
export declare class FtFilterLevel extends FtLitElement {
|
|
19
19
|
static elementDefinitions: ElementDefinitionsMap;
|
|
20
|
-
|
|
20
|
+
static styles: import("lit").CSSResult[];
|
|
21
21
|
id: string;
|
|
22
22
|
parent?: FtFilterOptionProperties;
|
|
23
23
|
options: Array<FtFilterOptionProperties>;
|
|
@@ -33,7 +33,7 @@ export declare class FtFilterLevel extends FtLitElement {
|
|
|
33
33
|
get hasHiddenValues(): boolean;
|
|
34
34
|
private get limit();
|
|
35
35
|
get height(): number;
|
|
36
|
-
protected
|
|
36
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
37
37
|
private goBackOnKeyPress;
|
|
38
38
|
private goBackOnClick;
|
|
39
39
|
private displayMore;
|
package/build/ft-filter-level.js
CHANGED
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { css, html, nothing } from "lit";
|
|
8
8
|
import { property, query, state } from "lit/decorators.js";
|
|
9
9
|
import { repeat } from "lit/directives/repeat.js";
|
|
10
|
-
import {
|
|
10
|
+
import { designSystemVariables, FtCssVariable, FtLitElement, setVariable } from "@fluid-topics/ft-wc-utils";
|
|
11
11
|
import { Checkbox } from "@material/mwc-checkbox";
|
|
12
12
|
import { flatDeep } from "./utils";
|
|
13
13
|
import { FtButton, FtButtonCssVariables } from "@fluid-topics/ft-button";
|
|
@@ -31,7 +31,7 @@ export const FtFilterLevelCssVariables = {
|
|
|
31
31
|
lineHeight: FtCssVariable.external(FtTypographyBody2CssVariables.lineHeight, "Body2 typography"),
|
|
32
32
|
textTransform: FtCssVariable.external(FtTypographyBody2CssVariables.textTransform, "Body2 typography"),
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
export class FtFilterLevel extends FtLitElement {
|
|
35
35
|
constructor() {
|
|
36
36
|
super(...arguments);
|
|
37
37
|
this.id = "";
|
|
@@ -45,96 +45,6 @@ let FtFilterLevel = class FtFilterLevel extends FtLitElement {
|
|
|
45
45
|
this.displayedValuesLimit = 0;
|
|
46
46
|
this.displayedPages = 1;
|
|
47
47
|
}
|
|
48
|
-
// language=CSS
|
|
49
|
-
getStyles() {
|
|
50
|
-
return [
|
|
51
|
-
css `
|
|
52
|
-
.ft-filter-level--container {
|
|
53
|
-
display: flex;
|
|
54
|
-
flex-direction: column;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.ft-filter-level--container > * {
|
|
58
|
-
padding: 0 10px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.ft-filter-level--go-back {
|
|
62
|
-
flex-shrink: 0;
|
|
63
|
-
text-decoration: none;
|
|
64
|
-
position: relative;
|
|
65
|
-
border-radius: ${FtFilterLevelCssVariables.borderRadiusM};
|
|
66
|
-
overflow: hidden;
|
|
67
|
-
display: flex;
|
|
68
|
-
align-items: center;
|
|
69
|
-
padding: 4px 4px;
|
|
70
|
-
gap: 4px;
|
|
71
|
-
cursor: pointer;
|
|
72
|
-
color: ${FtFilterLevelCssVariables.colorOnSurface};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.ft-filter-level--go-back:focus {
|
|
76
|
-
outline: none;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.ft-filter-level--go-back mwc-icon {
|
|
80
|
-
flex-shrink: 0;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.ft-filter-level--go-back ft-typography {
|
|
84
|
-
display: block;
|
|
85
|
-
flex-grow: 1;
|
|
86
|
-
flex-shrink: 0;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.ft-filter-level--option {
|
|
90
|
-
display: flex;
|
|
91
|
-
align-items: center;
|
|
92
|
-
max-width: 100%;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.ft-filter-level--option ft-button {
|
|
96
|
-
margin-right: -10px;
|
|
97
|
-
flex-shrink: 0;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
ft-button {
|
|
101
|
-
${setVariable(FtButtonCssVariables.color, FtFilterLevelCssVariables.colorOnSurface)};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
mwc-formfield {
|
|
105
|
-
flex-shrink: 1;
|
|
106
|
-
flex-grow: 1;
|
|
107
|
-
display: block;
|
|
108
|
-
max-width: calc(100% + 10px);
|
|
109
|
-
margin-left: -10px;
|
|
110
|
-
word-break: break-word;
|
|
111
|
-
|
|
112
|
-
--mdc-theme-secondary: ${FtFilterLevelCssVariables.colorPrimary};
|
|
113
|
-
|
|
114
|
-
--mdc-radio-unchecked-color: ${FtFilterLevelCssVariables.colorOnSurfaceMedium};
|
|
115
|
-
--mdc-checkbox-unchecked-color: ${FtFilterLevelCssVariables.colorOnSurfaceMedium};
|
|
116
|
-
--mdc-checkbox-ink-color: ${FtFilterLevelCssVariables.colorOnPrimary};
|
|
117
|
-
|
|
118
|
-
--mdc-radio-disabled-color: ${FtFilterLevelCssVariables.colorOnSurfaceDisabled};
|
|
119
|
-
--mdc-checkbox-disabled-color: ${FtFilterLevelCssVariables.colorOnSurfaceDisabled};
|
|
120
|
-
|
|
121
|
-
--mdc-theme-on-surface: ${FtFilterLevelCssVariables.colorPrimary};
|
|
122
|
-
|
|
123
|
-
--mdc-typography-body2-font-family: ${FtFilterLevelCssVariables.fontFamily};
|
|
124
|
-
--mdc-typography-body2-font-size: ${FtFilterLevelCssVariables.fontSize};
|
|
125
|
-
--mdc-typography-body2-font-weight: ${FtFilterLevelCssVariables.fontWeight};
|
|
126
|
-
--mdc-typography-body2-letter-spacing: ${FtFilterLevelCssVariables.letterSpacing};
|
|
127
|
-
--mdc-typography-body2-line-height: ${FtFilterLevelCssVariables.lineHeight};
|
|
128
|
-
--mdc-typography-body2-text-transform: ${FtFilterLevelCssVariables.textTransform};
|
|
129
|
-
--mdc-theme-text-primary-on-background: ${FtFilterLevelCssVariables.colorOnSurface};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.ft-filter--disabled {
|
|
133
|
-
--mdc-theme-text-primary-on-background: ${FtFilterLevelCssVariables.colorOnSurfaceDisabled};
|
|
134
|
-
}
|
|
135
|
-
`
|
|
136
|
-
];
|
|
137
|
-
}
|
|
138
48
|
get hasHiddenValues() {
|
|
139
49
|
let limit = this.limit;
|
|
140
50
|
return limit != null && limit < this.options.length;
|
|
@@ -146,7 +56,7 @@ let FtFilterLevel = class FtFilterLevel extends FtLitElement {
|
|
|
146
56
|
var _a, _b;
|
|
147
57
|
return (_b = (_a = this.container) === null || _a === void 0 ? void 0 : _a.scrollHeight) !== null && _b !== void 0 ? _b : 0;
|
|
148
58
|
}
|
|
149
|
-
|
|
59
|
+
render() {
|
|
150
60
|
let options = this.options;
|
|
151
61
|
if (this.hideSelectedOptions) {
|
|
152
62
|
options = options.filter(o => !o.selected);
|
|
@@ -242,7 +152,7 @@ let FtFilterLevel = class FtFilterLevel extends FtLitElement {
|
|
|
242
152
|
displayLevel(option) {
|
|
243
153
|
this.dispatchEvent(new CustomEvent("display-level", { detail: option }));
|
|
244
154
|
}
|
|
245
|
-
}
|
|
155
|
+
}
|
|
246
156
|
FtFilterLevel.elementDefinitions = {
|
|
247
157
|
"ft-button": FtButton,
|
|
248
158
|
"ft-ripple": FtRipple,
|
|
@@ -252,6 +162,94 @@ FtFilterLevel.elementDefinitions = {
|
|
|
252
162
|
"mwc-icon": Icon,
|
|
253
163
|
"mwc-radio": Radio,
|
|
254
164
|
};
|
|
165
|
+
// language=CSS
|
|
166
|
+
FtFilterLevel.styles = [
|
|
167
|
+
css `
|
|
168
|
+
.ft-filter-level--container {
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.ft-filter-level--container > * {
|
|
174
|
+
padding: 0 10px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.ft-filter-level--go-back {
|
|
178
|
+
flex-shrink: 0;
|
|
179
|
+
text-decoration: none;
|
|
180
|
+
position: relative;
|
|
181
|
+
border-radius: ${FtFilterLevelCssVariables.borderRadiusM};
|
|
182
|
+
overflow: hidden;
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
padding: 4px 4px;
|
|
186
|
+
gap: 4px;
|
|
187
|
+
cursor: pointer;
|
|
188
|
+
color: ${FtFilterLevelCssVariables.colorOnSurface};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.ft-filter-level--go-back:focus {
|
|
192
|
+
outline: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.ft-filter-level--go-back mwc-icon {
|
|
196
|
+
flex-shrink: 0;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.ft-filter-level--go-back ft-typography {
|
|
200
|
+
display: block;
|
|
201
|
+
flex-grow: 1;
|
|
202
|
+
flex-shrink: 0;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.ft-filter-level--option {
|
|
206
|
+
display: flex;
|
|
207
|
+
align-items: center;
|
|
208
|
+
max-width: 100%;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.ft-filter-level--option ft-button {
|
|
212
|
+
margin-right: -10px;
|
|
213
|
+
flex-shrink: 0;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
ft-button {
|
|
217
|
+
${setVariable(FtButtonCssVariables.color, FtFilterLevelCssVariables.colorOnSurface)};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
mwc-formfield {
|
|
221
|
+
flex-shrink: 1;
|
|
222
|
+
flex-grow: 1;
|
|
223
|
+
display: block;
|
|
224
|
+
max-width: calc(100% + 10px);
|
|
225
|
+
margin-left: -10px;
|
|
226
|
+
word-break: break-word;
|
|
227
|
+
|
|
228
|
+
--mdc-theme-secondary: ${FtFilterLevelCssVariables.colorPrimary};
|
|
229
|
+
|
|
230
|
+
--mdc-radio-unchecked-color: ${FtFilterLevelCssVariables.colorOnSurfaceMedium};
|
|
231
|
+
--mdc-checkbox-unchecked-color: ${FtFilterLevelCssVariables.colorOnSurfaceMedium};
|
|
232
|
+
--mdc-checkbox-ink-color: ${FtFilterLevelCssVariables.colorOnPrimary};
|
|
233
|
+
|
|
234
|
+
--mdc-radio-disabled-color: ${FtFilterLevelCssVariables.colorOnSurfaceDisabled};
|
|
235
|
+
--mdc-checkbox-disabled-color: ${FtFilterLevelCssVariables.colorOnSurfaceDisabled};
|
|
236
|
+
|
|
237
|
+
--mdc-theme-on-surface: ${FtFilterLevelCssVariables.colorPrimary};
|
|
238
|
+
|
|
239
|
+
--mdc-typography-body2-font-family: ${FtFilterLevelCssVariables.fontFamily};
|
|
240
|
+
--mdc-typography-body2-font-size: ${FtFilterLevelCssVariables.fontSize};
|
|
241
|
+
--mdc-typography-body2-font-weight: ${FtFilterLevelCssVariables.fontWeight};
|
|
242
|
+
--mdc-typography-body2-letter-spacing: ${FtFilterLevelCssVariables.letterSpacing};
|
|
243
|
+
--mdc-typography-body2-line-height: ${FtFilterLevelCssVariables.lineHeight};
|
|
244
|
+
--mdc-typography-body2-text-transform: ${FtFilterLevelCssVariables.textTransform};
|
|
245
|
+
--mdc-theme-text-primary-on-background: ${FtFilterLevelCssVariables.colorOnSurface};
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.ft-filter--disabled {
|
|
249
|
+
--mdc-theme-text-primary-on-background: ${FtFilterLevelCssVariables.colorOnSurfaceDisabled};
|
|
250
|
+
}
|
|
251
|
+
`
|
|
252
|
+
];
|
|
255
253
|
__decorate([
|
|
256
254
|
property({ type: String })
|
|
257
255
|
], FtFilterLevel.prototype, "id", void 0);
|
|
@@ -288,8 +286,4 @@ __decorate([
|
|
|
288
286
|
__decorate([
|
|
289
287
|
state()
|
|
290
288
|
], FtFilterLevel.prototype, "displayedPages", void 0);
|
|
291
|
-
FtFilterLevel = __decorate([
|
|
292
|
-
customElement("ft-filter-level")
|
|
293
|
-
], FtFilterLevel);
|
|
294
|
-
export { FtFilterLevel };
|
|
295
289
|
//# sourceMappingURL=ft-filter-level.js.map
|
|
@@ -13,7 +13,7 @@ export declare class FtFilterOption extends FtLitElement implements FtFilterOpti
|
|
|
13
13
|
selected: boolean;
|
|
14
14
|
subOptions: Array<FtFilterOptionProperties>;
|
|
15
15
|
private slotElement;
|
|
16
|
-
protected
|
|
16
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
17
17
|
private updateSubOptionsFromSlot;
|
|
18
18
|
protected updated(changedProperties: PropertyValues): void;
|
|
19
19
|
}
|
|
@@ -4,10 +4,10 @@ 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 {
|
|
7
|
+
import { FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
8
8
|
import { property, query } from "lit/decorators.js";
|
|
9
9
|
import { html } from "lit";
|
|
10
|
-
|
|
10
|
+
export class FtFilterOption extends FtLitElement {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
13
|
this.label = "";
|
|
@@ -15,7 +15,7 @@ let FtFilterOption = class FtFilterOption extends FtLitElement {
|
|
|
15
15
|
this.selected = false;
|
|
16
16
|
this.subOptions = [];
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
render() {
|
|
19
19
|
return html `
|
|
20
20
|
<slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
|
|
21
21
|
`;
|
|
@@ -28,7 +28,7 @@ let FtFilterOption = class FtFilterOption extends FtLitElement {
|
|
|
28
28
|
super.updated(changedProperties);
|
|
29
29
|
this.dispatchEvent(new CustomEvent("option-change", { detail: this, bubbles: true }));
|
|
30
30
|
}
|
|
31
|
-
}
|
|
31
|
+
}
|
|
32
32
|
FtFilterOption.elementDefinitions = {};
|
|
33
33
|
__decorate([
|
|
34
34
|
property({ type: String })
|
|
@@ -48,8 +48,4 @@ __decorate([
|
|
|
48
48
|
__decorate([
|
|
49
49
|
query(".ft-filter-option--slot")
|
|
50
50
|
], FtFilterOption.prototype, "slotElement", void 0);
|
|
51
|
-
FtFilterOption = __decorate([
|
|
52
|
-
customElement("ft-filter-option")
|
|
53
|
-
], FtFilterOption);
|
|
54
|
-
export { FtFilterOption };
|
|
55
51
|
//# sourceMappingURL=ft-filter-option.js.map
|
package/build/ft-filter.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PropertyValues } from "lit";
|
|
2
2
|
import { ElementDefinitionsMap, FtCssVariable, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
3
3
|
import { FtFilterOptionProperties } from "./ft-filter-option";
|
|
4
|
-
export * from "./ft-filter-option";
|
|
5
4
|
export interface FtFilterProperties {
|
|
6
5
|
id: string;
|
|
7
6
|
label: string;
|
|
@@ -28,7 +27,7 @@ export declare class FtFilterChangeEvent extends CustomEvent<Array<any>> {
|
|
|
28
27
|
}
|
|
29
28
|
export declare class FtFilter extends FtLitElement implements FtFilterProperties {
|
|
30
29
|
static elementDefinitions: ElementDefinitionsMap;
|
|
31
|
-
|
|
30
|
+
static styles: import("lit").CSSResult[];
|
|
32
31
|
id: string;
|
|
33
32
|
label: string;
|
|
34
33
|
filterPlaceHolder: string;
|
|
@@ -52,7 +51,7 @@ export declare class FtFilter extends FtLitElement implements FtFilterProperties
|
|
|
52
51
|
private slideOut?;
|
|
53
52
|
private scrollResizeObserver;
|
|
54
53
|
private get flatOptions();
|
|
55
|
-
protected
|
|
54
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
56
55
|
protected update(props: PropertyValues): void;
|
|
57
56
|
protected contentAvailableCallback(props: PropertyValues): void;
|
|
58
57
|
private levelsScrollDebouncer;
|