@internetarchive/collection-browser 0.2.4-alpha.3 → 0.2.4
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/dist/src/sort-filter-bar/sort-filter-bar.js +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.d.ts +0 -1
- package/dist/src/tiles/grid/account-tile.js +68 -31
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/icons/account.d.ts +1 -0
- package/dist/src/tiles/grid/icons/account.js +12 -0
- package/dist/src/tiles/grid/icons/account.js.map +1 -0
- package/dist/src/{assets/img → tiles/grid}/icons/favorite-filled.d.ts +0 -0
- package/dist/src/{assets/img → tiles/grid}/icons/favorite-filled.js +0 -0
- package/dist/src/{assets/img → tiles/grid}/icons/favorite-filled.js.map +1 -1
- package/dist/src/{assets/img → tiles/grid}/icons/reviews.d.ts +0 -0
- package/dist/src/{assets/img → tiles/grid}/icons/reviews.js +0 -0
- package/dist/src/{assets/img → tiles/grid}/icons/reviews.js.map +1 -1
- package/dist/src/{assets/img → tiles/grid}/icons/upload.d.ts +0 -0
- package/dist/src/{assets/img → tiles/grid}/icons/upload.js +0 -0
- package/dist/src/{assets/img → tiles/grid}/icons/upload.js.map +1 -1
- package/dist/src/tiles/grid/icons/views.d.ts +2 -0
- package/dist/src/{assets/img → tiles/grid}/icons/views.js +1 -1
- package/dist/src/tiles/grid/icons/views.js.map +1 -0
- package/dist/src/tiles/grid/item-tile.d.ts +0 -1
- package/dist/src/tiles/grid/item-tile.js +91 -43
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/mediatype-icon.js +0 -4
- package/dist/src/tiles/mediatype-icon.js.map +1 -1
- package/package.json +1 -1
- package/src/sort-filter-bar/sort-filter-bar.ts +1 -1
- package/src/tiles/grid/account-tile.ts +67 -30
- package/src/tiles/grid/icons/account.ts +12 -0
- package/src/{assets/img → tiles/grid}/icons/favorite-filled.ts +0 -0
- package/src/{assets/img → tiles/grid}/icons/reviews.ts +0 -0
- package/src/{assets/img → tiles/grid}/icons/upload.ts +0 -0
- package/src/{assets/img → tiles/grid}/icons/views.ts +1 -1
- package/src/tiles/grid/item-tile.ts +94 -46
- package/src/tiles/mediatype-icon.ts +0 -4
- package/dist/src/assets/img/icons/views.d.ts +0 -1
- package/dist/src/assets/img/icons/views.js.map +0 -1
- package/dist/src/tiles/grid/tile-stats.d.ts +0 -10
- package/dist/src/tiles/grid/tile-stats.js +0 -106
- package/dist/src/tiles/grid/tile-stats.js.map +0 -1
- package/src/tiles/grid/tile-stats.ts +0 -104
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
/* eslint-disable import/no-duplicates */
|
|
2
2
|
import { css, CSSResultGroup, html, LitElement, nothing } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
4
|
|
|
6
5
|
import { TileModel } from '../../models';
|
|
6
|
+
import { formatCount } from '../../utils/format-count';
|
|
7
|
+
|
|
8
|
+
import { favoriteFilledIcon } from './icons/favorite-filled';
|
|
9
|
+
import { reviewsIcon } from './icons/reviews';
|
|
10
|
+
import viewsIcon from './icons/views';
|
|
7
11
|
|
|
8
12
|
import '../mediatype-icon';
|
|
9
13
|
import '../item-image';
|
|
10
|
-
import './tile-stats';
|
|
11
14
|
|
|
12
15
|
@customElement('item-tile')
|
|
13
16
|
export class ItemTile extends LitElement {
|
|
@@ -16,74 +19,84 @@ export class ItemTile extends LitElement {
|
|
|
16
19
|
@property({ type: String }) baseImageUrl?: string;
|
|
17
20
|
|
|
18
21
|
render() {
|
|
19
|
-
const itemTitle = this.model?.title;
|
|
22
|
+
const itemTitle = this.model?.title || nothing;
|
|
20
23
|
const itemCreator = this.model?.creator;
|
|
21
24
|
return html`
|
|
22
25
|
<div id="container">
|
|
23
|
-
<div id="
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
+
<div id="title-image-container">
|
|
27
|
+
<h1 id="item-title" title=${itemTitle}>${itemTitle}</h1>
|
|
28
|
+
<div id="item-image-container">
|
|
29
|
+
<item-image .model=${this.model} .baseImageUrl=${this.baseImageUrl}>
|
|
30
|
+
</item-image>
|
|
26
31
|
</div>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
.baseImageUrl=${this.baseImageUrl}>
|
|
33
|
-
</item-image>
|
|
34
|
-
</div>
|
|
35
|
-
<div class="item-creator">
|
|
36
|
-
<div class="truncated">
|
|
37
|
-
${
|
|
38
|
-
itemCreator
|
|
39
|
-
? html`<span>by ${itemCreator}</span>`
|
|
40
|
-
: nothing
|
|
41
|
-
}
|
|
42
|
-
</div>
|
|
32
|
+
<div class="item-creator">
|
|
33
|
+
<div class="truncated">
|
|
34
|
+
${itemCreator
|
|
35
|
+
? html`<span>by ${itemCreator}</span>`
|
|
36
|
+
: nothing}
|
|
43
37
|
</div>
|
|
44
38
|
</div>
|
|
45
39
|
</div>
|
|
46
40
|
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
<div class="hr"></div>
|
|
42
|
+
|
|
43
|
+
<div id="item-stats-container">
|
|
44
|
+
<div id="stats-holder">
|
|
45
|
+
<div class="col">
|
|
46
|
+
<mediatype-icon
|
|
47
|
+
.mediatype=${this.model?.mediatype}
|
|
48
|
+
.collection=${this.model?.collections}
|
|
49
|
+
style="--iconHeight:25px; --iconWidth:25px;"
|
|
50
|
+
>
|
|
51
|
+
</mediatype-icon>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="col">
|
|
54
|
+
${viewsIcon}
|
|
55
|
+
<p class="status-text">
|
|
56
|
+
${formatCount(this.model?.viewCount, 'short', 'short')}
|
|
57
|
+
</p>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="col">
|
|
60
|
+
${favoriteFilledIcon}
|
|
61
|
+
<p class="status-text">
|
|
62
|
+
${formatCount(this.model?.itemCount, 'short', 'short')}
|
|
63
|
+
</p>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="col">
|
|
66
|
+
${reviewsIcon}
|
|
67
|
+
<p class="status-text">
|
|
68
|
+
${formatCount(this.model?.favCount, 'short', 'short')}
|
|
69
|
+
</p>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
53
72
|
</div>
|
|
54
73
|
</div>
|
|
55
74
|
`;
|
|
56
75
|
}
|
|
57
76
|
|
|
58
77
|
static get styles(): CSSResultGroup {
|
|
78
|
+
const cornerRadiusCss = css`var(--collectionTileCornerRadius, 4px)`;
|
|
79
|
+
|
|
59
80
|
return css`
|
|
60
81
|
#container {
|
|
61
82
|
background-color: #ffffff;
|
|
62
|
-
border-radius:
|
|
83
|
+
border-radius: ${cornerRadiusCss};
|
|
63
84
|
box-shadow: 1px 1px 2px 0px;
|
|
64
85
|
display: flex;
|
|
65
86
|
flex-direction: column;
|
|
66
87
|
height: 100%;
|
|
88
|
+
position: relative;
|
|
67
89
|
}
|
|
68
90
|
|
|
69
|
-
#
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
.title-wrapper {
|
|
76
|
-
flex-shrink: 0;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.image-wrapper {
|
|
80
|
-
flex-grow: 1;
|
|
91
|
+
#title-image-container {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex: 1;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
padding: 0.5rem 0.5rem 0 0.5rem;
|
|
81
96
|
}
|
|
82
97
|
|
|
83
98
|
#item-title {
|
|
84
|
-
flex: 1;
|
|
85
99
|
color: #2c2c2c;
|
|
86
|
-
min-width: 0; /* Important for long words! */
|
|
87
100
|
font-size: 1.6rem;
|
|
88
101
|
text-align: center;
|
|
89
102
|
margin-top: 0rem;
|
|
@@ -91,7 +104,6 @@ export class ItemTile extends LitElement {
|
|
|
91
104
|
overflow: hidden;
|
|
92
105
|
text-overflow: ellipsis;
|
|
93
106
|
display: -webkit-box;
|
|
94
|
-
word-wrap: break-word;
|
|
95
107
|
-webkit-line-clamp: 2;
|
|
96
108
|
-webkit-box-orient: vertical;
|
|
97
109
|
line-height: 2rem;
|
|
@@ -102,7 +114,6 @@ export class ItemTile extends LitElement {
|
|
|
102
114
|
display: flex;
|
|
103
115
|
justify-content: center;
|
|
104
116
|
flex: 1;
|
|
105
|
-
height: 16rem;
|
|
106
117
|
}
|
|
107
118
|
|
|
108
119
|
.hidden {
|
|
@@ -128,7 +139,6 @@ export class ItemTile extends LitElement {
|
|
|
128
139
|
align-items: flex-end; /* Important to start text from bottom */
|
|
129
140
|
height: 3rem;
|
|
130
141
|
padding-top: 1rem;
|
|
131
|
-
margin-top: 5px;
|
|
132
142
|
}
|
|
133
143
|
|
|
134
144
|
.truncated {
|
|
@@ -148,6 +158,44 @@ export class ItemTile extends LitElement {
|
|
|
148
158
|
line-height: 2rem;
|
|
149
159
|
text-align: center;
|
|
150
160
|
}
|
|
161
|
+
|
|
162
|
+
.hr {
|
|
163
|
+
border: 0.5px solid #ccc;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
#item-stats-container {
|
|
167
|
+
align-items: center;
|
|
168
|
+
display: flex;
|
|
169
|
+
height: 5.5rem;
|
|
170
|
+
padding-left: 1rem;
|
|
171
|
+
padding-right: 0.5rem;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
#stats-holder {
|
|
175
|
+
align-items: center;
|
|
176
|
+
display: flex;
|
|
177
|
+
flex: 1;
|
|
178
|
+
justify-content: space-evenly;
|
|
179
|
+
text-align: center;
|
|
180
|
+
width: 100%;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
svg {
|
|
184
|
+
height: 10px;
|
|
185
|
+
width: 10px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.status-text {
|
|
189
|
+
font-size: 14px;
|
|
190
|
+
color: #2c2c2c;
|
|
191
|
+
margin: auto;
|
|
192
|
+
display: block;
|
|
193
|
+
text-align: center;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.col {
|
|
197
|
+
width: 25%;
|
|
198
|
+
}
|
|
151
199
|
`;
|
|
152
200
|
}
|
|
153
201
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const viewsIcon: import("lit-html").TemplateResult<2>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"views.js","sourceRoot":"","sources":["../../../../../src/assets/img/icons/views.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAA;;;;;;;;CAQ3B,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport const viewsIcon = svg`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m98 50.5704143c-.2830293-.471515-.671154-1.1088947-1.1643742-1.9121392s-1.6003642-2.3617474-3.3214321-4.6755089c-1.7210678-2.3137614-3.522258-4.5325939-5.4035703-6.6564975-1.8813124-2.1239037-4.2828993-4.473133-7.2047606-7.0476881-2.9218612-2.5745551-5.8895067-4.7933876-8.9029363-6.6564976-3.0134295-1.86311-6.4628491-3.4330878-10.3482587-4.7099336-3.8854095-1.2768458-7.7822651-1.9142256-11.6905667-1.9121443-3.9083017.0020914-7.8051573.6154781-11.6905668 1.8401652-3.8854096 1.2246871-7.3702078 2.8301329-10.4543947 4.8163375-3.0841869 1.9862045-6.0278997 4.1695691-8.8311384 6.5500937s-5.2048256 4.7652219-7.2047605 7.1540919c-1.99993501 2.38887-3.75430043 4.5722346-5.26309632 6.5500938s-2.63883199 3.583305-3.39010829 4.8163374l-1.13003609 1.8401602c.2830293.4715149.67115403 1.1088946 1.16437421 1.9121391.49322017.8032445 1.5878776 2.3617475 3.28397229 4.6755089s3.47439274 4.521119 5.3348942 6.6220728c1.8605014 2.1009538 4.2506422 4.4387083 7.1704224 7.0132633 2.9197801 2.5745551 5.8874256 4.7819127 8.9029363 6.6220729 3.0155106 1.8401601 6.4774168 3.398663 10.3857184 4.6755088 3.9083017 1.2768458 7.8176438 1.9142256 11.7280266 1.9121443 3.9103827-.0020914 7.7957922-.6154781 11.6562286-1.8401652s7.3337886-2.818658 10.4200566-4.7819127 6.0299808-4.1351444 8.8311384-6.515669 5.2152311-4.7652219 7.2422203-7.1540919 3.8052873-4.5607597 5.3348942-6.515669c1.5296068-1.9549093 2.6721295-3.5488802 3.427568-4.7819127zm-24.5142913 0c0 6.467683-2.3079374 12.0152859-6.9238123 16.6428087s-10.1495139 6.9412843-16.600917 6.9412843c-6.4992683 0-12.0453939-2.3137615-16.6383767-6.9412843s-6.8894742-10.1751257-6.8894742-16.6428087 2.2964914-12.003811 6.8894742-16.608384 10.1391084-6.9068595 16.6383767-6.9068595c6.4534842 0 11.9871232 2.3022865 16.600917 6.9068595s6.9217312 10.140701 6.9238123 16.608384zm-23.5247293-10.552755c2.8261308 0 5.2870289 1.0619518 7.3826944 3.1858555 2.0956655 2.1239036 3.1434982 4.5795368 3.1434982 7.3668995 0 2.8332624-1.0478327 5.2888956-3.1434982 7.3668995-2.0956655 2.078004-4.5565636 3.1170059-7.3826944 3.1170059-2.873996 0-5.3348941-1.0264838-7.3826944-3.0794516-2.0478002-2.0529677-3.0717003-4.5200758-3.0717003-7.4013243 0-2.8332624 1.0239001-5.3003705 3.0717003-7.4013243 2.0478003-2.1009538 4.5086984-3.1514307 7.3826944-3.1514307z\"\n fill=\"#333\"\n />\n <title>Eye icon</title>\n </svg>\n`;\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CSSResultGroup, LitElement } from 'lit';
|
|
2
|
-
export declare class TileStats extends LitElement {
|
|
3
|
-
mediatype?: string;
|
|
4
|
-
itemCount?: number;
|
|
5
|
-
viewCount?: number;
|
|
6
|
-
favCount?: number;
|
|
7
|
-
commentCount?: number;
|
|
8
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
9
|
-
static get styles(): CSSResultGroup;
|
|
10
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { css, html, LitElement } from 'lit';
|
|
3
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import { favoriteFilledIcon } from '../../assets/img/icons/favorite-filled';
|
|
5
|
-
import { reviewsIcon } from '../../assets/img/icons/reviews';
|
|
6
|
-
import { uploadIcon } from '../../assets/img/icons/upload';
|
|
7
|
-
import { viewsIcon } from '../../assets/img/icons/views';
|
|
8
|
-
import { formatCount } from '../../utils/format-count';
|
|
9
|
-
let TileStats = class TileStats extends LitElement {
|
|
10
|
-
render() {
|
|
11
|
-
console.log('tile-stats here');
|
|
12
|
-
return html `
|
|
13
|
-
<div class="stats-wrapper">
|
|
14
|
-
<div id="stats-holder">
|
|
15
|
-
<div class="col">
|
|
16
|
-
<mediatype-icon
|
|
17
|
-
.mediatype=${this.mediatype}
|
|
18
|
-
style="--iconHeight:25px; --iconWidth:25px;"
|
|
19
|
-
>
|
|
20
|
-
</mediatype-icon>
|
|
21
|
-
</div>
|
|
22
|
-
<div class="col">
|
|
23
|
-
${this.mediatype === 'account' ? uploadIcon : viewsIcon}
|
|
24
|
-
<p class="status-text">
|
|
25
|
-
${formatCount(this.mediatype === 'account' ? this.itemCount : this.viewCount, 'short', 'short')}
|
|
26
|
-
</p>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="col">
|
|
29
|
-
${favoriteFilledIcon}
|
|
30
|
-
<p class="status-text">
|
|
31
|
-
${formatCount(this.favCount, 'short', 'short')}
|
|
32
|
-
</p>
|
|
33
|
-
</div>
|
|
34
|
-
<div class="col">
|
|
35
|
-
${reviewsIcon}
|
|
36
|
-
<p class="status-text">
|
|
37
|
-
${formatCount(this.commentCount, 'short', 'short')}
|
|
38
|
-
</p>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
`;
|
|
43
|
-
}
|
|
44
|
-
static get styles() {
|
|
45
|
-
return css `
|
|
46
|
-
.stats-wrapper {
|
|
47
|
-
height: 35px;
|
|
48
|
-
flex-shrink: 0;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
#stats-holder {
|
|
52
|
-
border-top: 1px solid #bbb;
|
|
53
|
-
align-items: center;
|
|
54
|
-
display: flex;
|
|
55
|
-
flex: 1;
|
|
56
|
-
justify-content: space-evenly;
|
|
57
|
-
text-align: center;
|
|
58
|
-
width: 100%;
|
|
59
|
-
padding-top: 5px;
|
|
60
|
-
padding-bottom: 5px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.col {
|
|
64
|
-
width: 25%;
|
|
65
|
-
height: 25px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
svg {
|
|
69
|
-
height: 10px;
|
|
70
|
-
width: 10px;
|
|
71
|
-
display: block;
|
|
72
|
-
margin: auto;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.status-text {
|
|
76
|
-
font-size: 14px;
|
|
77
|
-
height: 15px;
|
|
78
|
-
color: #2c2c2c;
|
|
79
|
-
line-height: 20px;
|
|
80
|
-
margin: auto;
|
|
81
|
-
display: block;
|
|
82
|
-
text-align: center;
|
|
83
|
-
}
|
|
84
|
-
`;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
__decorate([
|
|
88
|
-
property({ type: String })
|
|
89
|
-
], TileStats.prototype, "mediatype", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
property({ type: Number })
|
|
92
|
-
], TileStats.prototype, "itemCount", void 0);
|
|
93
|
-
__decorate([
|
|
94
|
-
property({ type: Number })
|
|
95
|
-
], TileStats.prototype, "viewCount", void 0);
|
|
96
|
-
__decorate([
|
|
97
|
-
property({ type: Number })
|
|
98
|
-
], TileStats.prototype, "favCount", void 0);
|
|
99
|
-
__decorate([
|
|
100
|
-
property({ type: Number })
|
|
101
|
-
], TileStats.prototype, "commentCount", void 0);
|
|
102
|
-
TileStats = __decorate([
|
|
103
|
-
customElement('tile-stats')
|
|
104
|
-
], TileStats);
|
|
105
|
-
export { TileStats };
|
|
106
|
-
//# sourceMappingURL=tile-stats.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tile-stats.js","sourceRoot":"","sources":["../../../../src/tiles/grid/tile-stats.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAkB,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,IAAa,SAAS,GAAtB,MAAa,SAAU,SAAQ,UAAU;IAWvC,MAAM;QACJ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;QAC9B,OAAO,IAAI,CAAA;;;;;2BAKY,IAAI,CAAC,SAAS;;;;;;cAM3B,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;;gBAEnD,WAAW,CACX,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAC9D,OAAO,EACP,OAAO,CACR;;;;cAID,kBAAkB;;gBAEhB,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC;;;;cAI9C,WAAW;;gBAET,WAAW,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC;;;;;KAK3D,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuCT,CAAC;IACJ,CAAC;CACF,CAAA;AA3F6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAoB;AAEnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAoB;AAEnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAoB;AAEnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAmB;AAElB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAuB;AATvC,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CA4FrB;SA5FY,SAAS","sourcesContent":["import { css, CSSResultGroup, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { favoriteFilledIcon } from '../../assets/img/icons/favorite-filled';\nimport { reviewsIcon } from '../../assets/img/icons/reviews';\nimport { uploadIcon } from '../../assets/img/icons/upload';\nimport { viewsIcon } from '../../assets/img/icons/views';\n\nimport { formatCount } from '../../utils/format-count';\n\n@customElement('tile-stats')\nexport class TileStats extends LitElement {\n @property({ type: String }) mediatype?: string;\n\n @property({ type: Number }) itemCount?: number;\n\n @property({ type: Number }) viewCount?: number;\n\n @property({ type: Number }) favCount?: number;\n\n @property({ type: Number }) commentCount?: number;\n\n render() {\n console.log('tile-stats here')\n return html`\n <div class=\"stats-wrapper\">\n <div id=\"stats-holder\">\n <div class=\"col\">\n <mediatype-icon\n .mediatype=${this.mediatype}\n style=\"--iconHeight:25px; --iconWidth:25px;\"\n >\n </mediatype-icon>\n </div>\n <div class=\"col\">\n ${this.mediatype === 'account' ? uploadIcon : viewsIcon}\n <p class=\"status-text\">\n ${formatCount(\n this.mediatype === 'account' ? this.itemCount : this.viewCount,\n 'short',\n 'short'\n )}\n </p>\n </div>\n <div class=\"col\">\n ${favoriteFilledIcon}\n <p class=\"status-text\">\n ${formatCount(this.favCount, 'short', 'short')}\n </p>\n </div>\n <div class=\"col\">\n ${reviewsIcon}\n <p class=\"status-text\">\n ${formatCount(this.commentCount, 'short', 'short')}\n </p>\n </div>\n </div>\n </div>\n `;\n }\n\n static get styles(): CSSResultGroup {\n return css`\n .stats-wrapper {\n height: 35px;\n flex-shrink: 0;\n }\n\n #stats-holder {\n border-top: 1px solid #bbb;\n align-items: center;\n display: flex;\n flex: 1;\n justify-content: space-evenly;\n text-align: center;\n width: 100%;\n padding-top: 5px;\n padding-bottom: 5px;\n }\n\n .col {\n width: 25%;\n height: 25px;\n }\n\n svg {\n height: 10px;\n width: 10px;\n display: block;\n margin: auto;\n }\n\n .status-text {\n font-size: 14px;\n height: 15px;\n color: #2c2c2c;\n line-height: 20px;\n margin: auto;\n display: block;\n text-align: center;\n }\n `;\n }\n}\n"]}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { css, CSSResultGroup, html, LitElement } from 'lit';
|
|
2
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
-
|
|
4
|
-
import { favoriteFilledIcon } from '../../assets/img/icons/favorite-filled';
|
|
5
|
-
import { reviewsIcon } from '../../assets/img/icons/reviews';
|
|
6
|
-
import { uploadIcon } from '../../assets/img/icons/upload';
|
|
7
|
-
import { viewsIcon } from '../../assets/img/icons/views';
|
|
8
|
-
|
|
9
|
-
import { formatCount } from '../../utils/format-count';
|
|
10
|
-
|
|
11
|
-
@customElement('tile-stats')
|
|
12
|
-
export class TileStats extends LitElement {
|
|
13
|
-
@property({ type: String }) mediatype?: string;
|
|
14
|
-
|
|
15
|
-
@property({ type: Number }) itemCount?: number;
|
|
16
|
-
|
|
17
|
-
@property({ type: Number }) viewCount?: number;
|
|
18
|
-
|
|
19
|
-
@property({ type: Number }) favCount?: number;
|
|
20
|
-
|
|
21
|
-
@property({ type: Number }) commentCount?: number;
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
console.log('tile-stats here')
|
|
25
|
-
return html`
|
|
26
|
-
<div class="stats-wrapper">
|
|
27
|
-
<div id="stats-holder">
|
|
28
|
-
<div class="col">
|
|
29
|
-
<mediatype-icon
|
|
30
|
-
.mediatype=${this.mediatype}
|
|
31
|
-
style="--iconHeight:25px; --iconWidth:25px;"
|
|
32
|
-
>
|
|
33
|
-
</mediatype-icon>
|
|
34
|
-
</div>
|
|
35
|
-
<div class="col">
|
|
36
|
-
${this.mediatype === 'account' ? uploadIcon : viewsIcon}
|
|
37
|
-
<p class="status-text">
|
|
38
|
-
${formatCount(
|
|
39
|
-
this.mediatype === 'account' ? this.itemCount : this.viewCount,
|
|
40
|
-
'short',
|
|
41
|
-
'short'
|
|
42
|
-
)}
|
|
43
|
-
</p>
|
|
44
|
-
</div>
|
|
45
|
-
<div class="col">
|
|
46
|
-
${favoriteFilledIcon}
|
|
47
|
-
<p class="status-text">
|
|
48
|
-
${formatCount(this.favCount, 'short', 'short')}
|
|
49
|
-
</p>
|
|
50
|
-
</div>
|
|
51
|
-
<div class="col">
|
|
52
|
-
${reviewsIcon}
|
|
53
|
-
<p class="status-text">
|
|
54
|
-
${formatCount(this.commentCount, 'short', 'short')}
|
|
55
|
-
</p>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
`;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
static get styles(): CSSResultGroup {
|
|
63
|
-
return css`
|
|
64
|
-
.stats-wrapper {
|
|
65
|
-
height: 35px;
|
|
66
|
-
flex-shrink: 0;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
#stats-holder {
|
|
70
|
-
border-top: 1px solid #bbb;
|
|
71
|
-
align-items: center;
|
|
72
|
-
display: flex;
|
|
73
|
-
flex: 1;
|
|
74
|
-
justify-content: space-evenly;
|
|
75
|
-
text-align: center;
|
|
76
|
-
width: 100%;
|
|
77
|
-
padding-top: 5px;
|
|
78
|
-
padding-bottom: 5px;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.col {
|
|
82
|
-
width: 25%;
|
|
83
|
-
height: 25px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
svg {
|
|
87
|
-
height: 10px;
|
|
88
|
-
width: 10px;
|
|
89
|
-
display: block;
|
|
90
|
-
margin: auto;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.status-text {
|
|
94
|
-
font-size: 14px;
|
|
95
|
-
height: 15px;
|
|
96
|
-
color: #2c2c2c;
|
|
97
|
-
line-height: 20px;
|
|
98
|
-
margin: auto;
|
|
99
|
-
display: block;
|
|
100
|
-
text-align: center;
|
|
101
|
-
}
|
|
102
|
-
`;
|
|
103
|
-
}
|
|
104
|
-
}
|